I need a map file structure for my game but does anyone know a good way to map it out? I was thinking something like this:
name=MyMap
add[floor[stone]][solid][20, 640]
add[playerspawn][20, 620]
|
I need a map file structure for my game but does anyone know a good way to map it out? I was thinking something like this:
|
|||
|
|
|
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 write a binary file, than to write out so many lines by hand. |
|||
|
|
|
Depending on what you are going to do for a game, this is diffrent. In other words, An fps, might store additional stuff on the map like, monsters, spawn points of monsters, pickups, and more. While a RTS might only store, the diffuculty to move there, the tile, and what kind of protection this tile gives. But you structure there looks wery promising. seems like it will be easy to just add up stuff. and easy to remove stuff. And flexibility is allways a good choise. |
|||
|
|
|
I'd recommend you the XML format and, specifically for the tiles, you can try to put just the tile number, something like this:
|
|||
|
|
|
This depends on various points. Since you didn't really go in-depth with your current setting (game-type, platform, etc.), all I can do here is do assumptions.
|
|||
|
|