Author Topic: New savedgame format  (Read 698 times)

Crimson Wizard

  • Local Moderator
  • AGS Project Tracker Admins
    • Best Innovation Award Winner 2013, for spearheading the AGS 3.3.0 project
    • Lifetime Achievement Award Winner
    • Crimson Wizard worked on a game that was nominated for an AGS Award!
      Crimson Wizard worked on a game that won an AGS Award!
New savedgame format
« on: 06 May 2013, 22:44 »
While redesigning the engine (slowly) I got to the point when it would be highly beneficial to change savedgame format. While my primary concern is the amount and order of data, stored there (a lot of problems arise simply because some things could not be initialized before others were read), new format could be useful to improve extensibility and error detection... at least a little.

Does anyone have any ideas and suggestions on what it may look like?

I remember Nefasto once mentioned having savegame as (an encoded) XML, but I have certain doubts about this, because XML tends to increase size of data pretty much. Also it probably will load slower. Of course there's a strong temptation to have a data that you may both easily read from program and edit by hand. Plus it is... well, most extensible.

If that does not fit, I had an idea about simple binary format built of blocks in a (imaginary) form of a tree, with a table of contents placed at the beginning of the file. Well, actually, coded it last day. But still unsure what to choose.

UPD: What I mean is a file (or dedicated part of file) that has following information about its parts in the header:
- id (numeric or string)
- version/format tag (in case reader needs to know it)
- offset (related to header)
- length
- list of subparts (recursive)

Since there's a table of contents, the reader may search only for blocks it needs or knows how to read. This will ease random extraction of wanted data. Also, this will help backward compatibility, and provide minimal forward compatibility (meaning older versions of engine could still try to read data, skipping parts they don't know).
« Last Edit: 07 May 2013, 09:16 by Crimson Wizard »