XML Level Format?
If we used XML for the level format, it would be better organized, more readable, and far, far more extendable. I'm sure there are plenty of XML parsers out there.
It is more verbose, though, and will take up more room, but if that really is an issue the XML could be compressed.
Example:
- Code:
- <level>
<levelInfo>
<name>Test Level</name>
<description>This is an XML example</description>
<author>Unknown</author>
</levelInfo>
<game>
<type>CTF</type>
<time>5m</time>
<endscore>3</endscore>
<gridsize>255</gridsize>
<bots>auto</bots>
<allowEngineer>true</allowEngineer>
</game>
<teams>
<team name="Blue" color="0000FF"/>
<team name="Red" color="FF0000"/>
</teams>
<objects>
<wall>
<width>50</width>
<points>
<point x="0" y="0"/>
<point x="4" y="0"/>
<point x="4" y="4"/>
<point x="0" y="4"/>
<point x="0" y="0"/>
</points>
</wall>
<spawn>
<teamID>1</teamID>
<point x="1" y="1"/>
</spawn>
<spawn>
<teamID>2</teamID>
<point x="3" y="3"/>
</spawn>
<teleporter>
<in x="2" y="2"/>
<out x="6" y="2"/>
</teleporter>
</objects>
</level>