On 2/6/07, Giel van Schijndel <[EMAIL PROTECTED]> wrote:
On Tue, 6 Feb 2007 10:49:03 -0500, Ari Johnson wrote:
> ...
>
> Now would also be a good time to consider changing to an XML file
> format for all our data. That would make life easier. But
> regardless, if anyone changes any file format, make certain to
> endianize when you save and when you load. It's so much easier to
> take care of the endianness issues when you are writing new code than
> to have someone else do it months later. :)
As far as save games are considered you basically have a big pro and big
con for XML.
Firstly XML would obviously be the easiest to read/write and operate on
(i.e. with an appropriate parser).
Secondly however, XML wouldn't be near as fast as any binary format
would be (just grab data from a file and dump it somewhere in memory),
XML might have O(n) here where n=number of objects (buildings/droids/etc).
I'm not sure about my quantification of the performance hit though
(because O(n) seems a lot in an RTS game).
It was my belief that the game reads things into memory once, when you
load a game or start a new level of a game, and thereafter only
accesses the data from memory. If that is incorrect, then you are
right - XML is a bad idea for efficiency reasons. However, if I am
correct, then the extra fraction of a second it takes to parse an XML
data file versus that for a raw memory dump will likely not even be
noticed.
Mostly, I am just frustrated with evntsave.c and the related code in
scriptobj.c. It is extremely difficult to figure out what needs to be
endianized in those files because they are so haphazard compared to,
for instance, the map loading.
_______________________________________________
Warzone-dev mailing list
[email protected]
https://mail.gna.org/listinfo/warzone-dev