Thanks a lot guys! I e-mailed Myopic about the broken link so hopefully that will get fixed, but for now, the link in the sidebar does work, even though the link in the article body is broken. So you can still get the source from there.
quote:
What does the testmap.dat look like or how do you view it or make it?
In tile.zip there's a file called Test Map.cpp. If you look in there, it's just very simple code that comes up with a random map. This is easy because there are so few tiles in the example, heh. You should be able to tell everything you need about the file structure by looking at the code which writes the file, or the code which reads the file for that matter. You can't really view the file in a user-friendly manner since it's binary and not text, but if you really want to, you can open it with a hex editor (just drag and drop it into Visual C++ if nothing else).
In your actual games, map files would be generated by using a map editor, which you'll probably have to write, unless you can find one out there that uses the same sort of file structure you'd like to implement. Map editors are not hard to write, because you can use a lot of the same code as is used for your tile engine to display maps as they're being created. At the bare minimum, what you need to add is some way to select a tile from your tileset, and then add copies of that tile to the map.
There are lots of extra things you can put in though. For instance, you will probably have objects that are made up of multiple tiles (unless you're simply using tiles of variable size), so a very convenient thing to add is either a tool that plots an entire object on the map at once, or a default program option that places the rest of an object's tiles when you place one of them.
Another thing to add is a method of linking scripts to the map. You might want to be able to select a scripting tool, then click on the map somewhere, and get a prompt asking you for a script ID number or name. When you type one in, that script is 'linked' to the map, and will be triggered whenever the character steps on that spot, or searches that spot, however you need to do it.
If you're going to have multiple layers, obviously you'll need some way to specify which layer you're plotting tiles on. A common way to do this is to implement a Photoshop-like layer system, where you can select which layers are visible and which one is active. Another way to go is to set each tile a default layer, so that when you drop it onto your map, the editor knows which layer to place it on. Or you can use a combination of different methods. My map editor for Terran, for example, has that last thing I mentioned, the default layer technique, for ease of use... but it also has separate windows for viewing each of the three layers individually, so I can place tiles outside of their default layers, or edit things manually if I need to.
These are just some ideas for map editors -- I'm sure you can come up with more. Obviously the features you will need are dependent on what data you'll be storing in the map file, but hopefully this gives you some ideas.
Thanks again for the comments!
-Ironblayde
Aeon Software
Down with Tiberia!! 
|