If all you truly needed was the PNG file, chances are they just simply added the information into the file. This is actually a practice of Steganography. A lot of the times, this is used to hide payloads or secret messages in things that are seemingly public facing. However, it is likely in this case that this method is what was used. Typical Stegongraphy ...
The developer of Monaco actually made an excellent article on how both they and Spore accomplished this.
The basic summary of what they do is fairly simple:
Convert your data into binary
Convert your target image into a raw bitmap
Walk along the pixels of the image in some predictable pattern (they simply do left-to-right from the top-left corner).
Every thing you mention is something that can be specified in data. Why are you loading aspecificmap ? Because the game configuration says that is first level when a player starts a new game, or because that's the name of the current save point in the player's save file they just loaded, etc.
How do you find aspecificmap ? Because it's ...
There does exist a flavour of Wavefront's *.obj that facilitates Vertex Coloring..
I know of two applications that can export these namely "MeshLab" (free) and "MeshMixer"
(also free from Autodesk)..
The vertex colours is actually found just after each vertex definition as shown below..
(Piece of *.obj)
# OBJ File Generated by Meshlab
The same way you avoid hardcoding in general functions.
You pass parameters and you keep your information in configuration files.
In that situation, there is absolutely no difference in software engineering between writing an engine and writing a class.
errorCode loadAssetFromDisk( filePath )
errorCode getMap( mapName, map& )
Disclosure: I'm the author of Scelight and Sc2gears.
Blizzard released an official, open-source SC2Replay file parser library called s2protocol written in python:
That is the most complete, up-to-date, official replay parser. It is considered the reference implementation. It is quite low-level though.
There is ...
I downloaded and examined a few Spore creatures from Sporepedia. From those I learned that:
The images contain no information in addition to the standard image data.
The stenographic data have been stored with no consideration for the image, one could imagine that the transparent parts were used exclusively, but they are not.
The storage use depend on the ...
Use the organization of the data to your benefit. You can always be expect the data in the same order, so you know what the next bytes belong to. For example (not specific to your data), when reading in the data, always expect two bytes for tile type, two bytes for lighting information and then two bytes for extra info. So it knows that after 6 bytes, it's ...
Loading up DirectX (via SharpDX or XNA) to do the conversion is probably overkill.
Why not simply decode the format on the CPU? It's simple enough. There is a DXT decoder in MonoGame you might be able to borrow. (In case the file changes, the latest revision at time of writing is here.)
BC3_UNORM is equivalent to DXT5, which that will happily decode.
Naughty Dog seems to use scheme for describing both the data and how it should be read. However, my knowledge of scheme is non-existent so I have no clue how that would work. This would however, solve my problem, as the data would describe itself see reference.
Not something I would recommend if you are a solo developer or a small group of developers. This ...
As with so many things, the answer is "Depends"
Do you need to load a couple of hundred megs of data quickly? Are you streaming data in as the player traverses the level? Are you reading from optical media?
If the answer is "yes", then pre-packed resource streaming is for you.
If you're just making pong. It's not really a big issue, loading flat ...
What Byte56 says makes sense.
I'm not sure why you need 2 separate coordinates (chunk coords and xy coords). But since a map is always square, the most basic representation is a 2D array of ascii chars
So there is the specification of a 4x10 map in 40 bytes. A 10,000 x 10,000 map would take 95MB, which isn't ...
So the tags [float_array id="Suzanne-mesh-positions-array"
count="1521"] and [/float_array] contain the huge list of vertex
And the tags [p] and [/p] inside [polylist count = "968"] and
[/polylist] should contain vertex indices in triangular order right?
But that doesn't make sense, cause then the first triangle is going to
To quote directly from the link you provided:
For instance, OpenCTM does not handle multiple meshes,
transformation matrices, materials, light sources, physical properties, etc.
So, the answer is it does not have built in material support. However, it also says 'Supports storage of per-vertex normals, UV coordinates and custom vertex attributes.' This ...
I would suggest using fbx. It is much more widely supported by other tools and that generally means that even in Unity, more effort will have been spent on making sure that fbx works properly. If you need to import your models to other tools besides Unity for processing etc, you will probably need fbx anyhow. Also, if you decide to use some other modelling ...
I like the other answers so I'm going to be a little bit contrary. ;)
You can't avoid coding knowledge about your data into your engine. Wherever the information comes from, the engine must know to look for it. However, you can avoid encoding the actual information itself into your engine.
A "pure" data driven approach would have you start the executable ...
If storage size is your main concern, using vector<bool> is probably actually your best bet. This is because vector<bool> is optimized to use one bit per bool instead of one byte (see reference here). From there for file read/write just make sure to write the capacity of the vector<bool> to file then use the same one bit per bool/spell (...
I played with parsing the SC2 replay files a while back. You can view what I've done and what I've been able to reverse engineer (as well as bunch of links to helpful sites at the bottom):
There's no reason to use a script if you're just storing time-based data.
There's many different ways you can design a file format for your data. As long as you can load it into the game, whether you used XML, binary, plain-text, etc, is not very relevant.
As long as your format allows you to add new information without breaking the previous format (during ...
Vector of vectors (a.k.a. array of arrays)
Using this data structure allows you to consider vertices and edges (specially useful when dealing with one-way streets or roads) and it also let's you consider more efficient maps, leaving out obstacles.
In this case you would use at least two vector of vectors; one for storing the vertices and ...
Though the idea of what to do with your data is vague, reading image data and operating on it is straightforward. See the ImageBuffer.getRGBA docs.
public byte getRGBA()
Retrieve the raw data stored within the image buffer
The raw data in RGBA packed format from within the image buffer
You have other options as well, such as ...
This isn't explicitly a problem of Unity. This is something an installer could do for your programm.
Summed up: it is a registry setting
Hope this link helps:
where-in-the-registry-does-windows-store-with-which-program-to-open-certain-files @ superuser
Code samples on microsoft social network
The rotation comes from the calculation of the index in load_from_file(), it should be:
chunk[i][j] = std::stoi(tokens[i * Constants::BIOMESIZE + j]);
That said, it would be much better if you could save the file in such a way that you can load it back the same way. Instead of using "," as a separator, use a space (" "). Then you can ...
It looks like what you would essentially like to do is create a game engine (like RPG Maker) or a game with some modding tools with the ability to create custom semi-defined object (like Skyrim).
Game Engine Approach
Typically when people make their own engine, their own program will include a compiler that reads another scripting language (typically LUA ...
That is right idea for reading/writing images but you'll want to get your "ImageLoader" class from a library, which will then give you a regular bitmap in memory to work with. The layout of that bitmap class is going to depend on the library you use.
To see why, or what you need to handle if you want to write your own, see the W3C PNG Specification.