Structuring Your Map Format
Posted: Tue Apr 27, 2010 4:55 am
Hello I have a question for everyone who has implemented a map format before. How have you gone about structuring it? For example I use XML which I parse through tinyXML ( a great lightweight xml parsing libraryfor C++ ) I have heard that other people use JSON and a lot of indie game developers just develop their own customized formats. So anyway post how you structure your file formats cheers. ( Note this is not a problem it is a discussion ).
This is a test map we are using in the Kickle Cubicle Remake ( it still needs some refinement but it is shaping up to work quite well, note this has already been implemented and is a working system ):
This is a test map we are using in the Kickle Cubicle Remake ( it still needs some refinement but it is shaping up to work quite well, note this has already been implemented and is a working system ):
Code: Select all
<?xml version="1.0"?>
<map>
<tile_sheet>
Content/Core/Sheets/levelSheet.png
</tile_sheet>
<tile_anims>
Content/Core/Animations/TileSheet_48x48.xml
</tile_anims>
<tile_layout>
12 12 12 12 12 12 12 12 12 12 12 12 12 12 12
12 12 12 12 12 12 12 4 12 12 12 12 12 12 12
12 12 12 12 12 12 6 7 8 12 12 12 12 12 12
12 12 12 12 12 12 16 17 18 12 12 12 12 12 12
12 12 3 4 4 4 4 4 4 4 4 4 5 12 12
12 6 7 7 7 7 7 7 7 7 7 7 7 8 12
12 16 17 17 17 17 17 17 17 17 17 17 17 18 12
12 6 1 1 1 1 1 1 1 1 1 1 1 8 12
12 16 6 1 1 1 1 1 1 1 1 1 8 18 12
12 13 16 6 1 2 1 1 1 2 1 8 18 15 12
12 12 13 16 6 1 1 1 1 1 8 18 15 12 12
12 12 12 13 16 6 1 1 1 8 18 15 12 12 12
12 12 12 12 13 16 6 1 8 18 15 12 12 12 12
12 12 12 12 12 13 16 7 18 15 12 12 12 12 12
12 12 12 12 12 12 13 17 15 12 12 12 12 12 12
</tile_layout>
<collision_layout>
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
1 1 1 1 1 1 1 0 1 1 1 1 1 1 1
1 1 1 1 1 1 0 0 0 1 1 1 1 1 1
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
1 1 0 0 0 0 0 0 0 0 0 0 0 1 1
1 0 0 0 0 0 0 0 0 0 0 0 0 0 1
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
1 0 0 0 0 0 0 0 0 0 0 0 0 0 1
1 1 0 0 0 0 0 0 0 0 0 0 0 1 1
1 1 1 0 0 1 0 0 0 1 0 0 1 1 1
1 1 1 1 0 0 0 0 0 0 0 1 1 1 1
1 1 1 1 1 0 0 0 0 0 1 1 1 1 1
1 1 1 1 1 1 0 0 0 1 1 1 1 1 1
1 1 1 1 1 1 1 0 1 1 1 1 1 1 1
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
</collision_layout>
<game_objects>
<entity data="Content\\Core\\Objects\\Slime.xml">
<instance x="3" y="8" />
<instance x="11" y="8" />
</entity>
<entity data="Content\\Core\\Objects\\DreamBag.xml">
<instance x="6" y="2" />
<instance x="7" y="2" />
<instance x="8" y="2" />
</entity>
<entity data="Content\\Core\\Objects\\Kickle.xml">
<instance x="7" y="12" />
</entity>
<entity data="Content\\Core\\Objects\\SpawnPoint.xml">
<instance x="3" y="9" />
<instance x="11" y="9" />
</entity>
</game_objects>
<music_playlist>
<song data="Content\\Core\\Sound\\stage_1.ogg"/>
<song data="Content\\Core\\Sound\\stage_2.ogg"/>
</music_playlist>
</map>