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& )
You could use the TMX map format used by the Tiled editor (as well as several other map editors).
Even if you don't use Tiled yourself, the TMX format supports all the functionality you mentioned and it has several existing loaders/parsers for a variety of languages. It's also very easy to understand the format and extend it for your own game.
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 ...
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 ...
Wavefront OBJ supports materials, which color groups of meshes the same color.
Material statements look like this:
Kd 1.00 0.00 0.00
Ks 0.50 0.50 0.50
So, Kd is the diffuse component, Ks specular.
These would be specified inside a .mtl file that accompanies the .obj file. Inside the .obj file are statements like
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 ...
Endianness matters when it comes to game consoles. The Wii, the PS3, and the XBox 360 all run big-endian, while all major desktop computers (as of the date I'm writing this answer) run little-endian. If there's a chance you'll want to compile your code for one of those game consoles someday, or if someone releases another popular big-endian desktop machine ...
Personally, I'm more of a fan of binary formats with sections (like Windows PE, just much simpler). They are also easier to parse (but that's just my opinion.... I did work with XML enough to give me headaches, checking whether getElementByName has returned a single value or a list of values... ugh). So, if I were you, I'd make it something like this:
Good guess, XML is not by default the simplest method of storing plain text data. It depends on a lot of things, mostly what existing tools you are planning to use. Some questions to ask yourself before choosing XML:
Do you feel XML editors make you (or your team) more productive? (If
you are a programmer, used to a text editor, the answer is probably no.)
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 ...
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 ...
Actually, the intermittant 5 bytes are part of the zlib compression.
As detailed on http://drj11.wordpress.com/2007/11/20/a-use-for-uncompressed-pngs/,
the little endian bit string 1 00 00000. 1 indicating the final
block, 00 indicating a non-compressed block, and 00000 are 5 bits of
padding to align the start of a block to on octet (which is ...
I've also seen many games that are pretty much just static images and web forms for the UI and the server simply constructs different static HTML pages in ...
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
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 ...
Planning on making these map files by hand? You have 409,599 more lines to write if you want to fill a 640x640 tiled map.
You should store the map in a binary format. An easy way to do that is to serialize the data structure you're storing the map with in RAM.
It would be far easier to write a simple visual editor that allowed you to place tiles and ...
If you are using Ogre3D, a logical choice would be to use Blender for creating the map, and Blender2Ogre to export the map into a .scene file.
Then, in the code, you can use the DotSceneLoader class to import the .scene file into the game world. This will automatically attach each object to a scene node and you can access them as needed.
Here's a link to the autodesk docs about importing .obj files in 3ds Max. The .3ds file format isn't something open and it's really tied to the internal workings of 3ds Max, so you can't really count on an external exporter or something like that.
Source: I worked on 3ds Max.