Post news RSS Small note about the Map XML

XML of Map. first version of the XML counterpart of the map format. i left only a couple of entries as a reference on how it looks like. i will most probably add a textureStyle block to avoid repeating the texture-block in every terrain patch. additional map elements will be done using blocks. like

Posted by on

XML of Map. first version of the XML counterpart of the map format. i left only a couple of entries as a reference on how it looks like. i will most probably add a textureStyle block to avoid repeating the texture-block in every terrain patch. additional map elements will be done using blocks. like mentioned this will be brushes and perhaps math-geometry elements. this is not fully planed yet.

now someone might ask what such a bloaty XML file compared to a binary one is usefull for. well there is a nifty little surprise handling with XMLs. let's have a small calculation to see an interesting result.

here a file listing of a map file in binary and XML:

> dir -l ch1s1*
-rw-r--r--  1 roland users  46787 Oct  1 00:04 ch1s1.map
-rw-r--r--  1 roland users 171301 Oct  1 17:10 ch1s1.map.xml

XML file is a lot bigger. this we expected. but now lets compress those two files and have a look again.

> tar -cvjf test1.tar.bz2 ch1s1.map 
ch1s1.map
> tar -cvjf test2.tar.bz2 ch1s1.map.xml
ch1s1.map.xml
> dir -l test?.tar.bz2
-rw-r--r--  1 roland users 9937 Oct  1 17:15 test1.tar.bz2
-rw-r--r--  1 roland users 6590 Oct  1 17:15 test2.tar.bz2

the XML is only 66% of the binary format. now that is a surprise, and especially not a single case. hence the reason for using binary formats (smaller size) is totally outmuscled by the XML format in compressed shape. now having a format easy to edit with any text editor and smaller noticable than a non-editable binary file is something i would consider a noticable advantage.

have a nice day.

Comments
ShortCutMan
ShortCutMan - - 806 comments

:O

Ownage.

Reply Good karma Bad karma+1 vote
Dragonlord Author
Dragonlord - - 1,934 comments

to be fair i should add that BZIP2 (which i used t compress) is very strong compressing ASCII, which explains this result. with a little trick my engine can directly read .bz2 files without the modules having to change one single bit.

this one will for sure turn out interesting, especially for modders and tool-developers.

Reply Good karma+1 vote
Post a comment
Sign in or join with:

Only registered members can share their thoughts. So come on! Join the community today (totally free - or sign in with your social account on the right) and join in the conversation.