Savegame format changing ordeal

HI! Tried changing the Cine engine’s savegame format from plain data without any markers to a chunked format akin to IFF. Got lots of ideas, and some code together too, but eventually gave up as making it really work would’ve required some major objectifying of the engine and it’s still very C style in many places currently.

So I’m not going to make use of a finegrained totally new chunked format now, but I’ll make a compromise and use a new chunked format but dump most of the savegame data into a single chunk. The format can be improved later.

I looked into how the SCUMM engine has implemented its savegame handling and its approach looks to be quite an interesting one. Take a look at scumm/saveload.h and scumm/saveload.cpp.

P.S. My IRC attendance on #scummvm will suffer in the near future as the server on which I ran irssi in a screen moves town starting today. I’ll try to get back on IRC during Sunday or Monday the latest.

Advertisements

Tags: ,

3 Responses to “Savegame format changing ordeal”

  1. Max Horn Says:

    Indeed, check out the SCUMM savegame system. We were considering switching to a chunked system at some point, too, but then came up with this approach instead, which is very flexible, was easy to implement (little changes required compared to the original system), and also incurred almost now size overhead in the savegames.

    We replicate some of the code in the Tinsel engine now (in a revised/improved variant, but still without the cool versioning feature), and my plan is to make that code fully “versioning-enabled”, too. If you are interested, we could try to make the code flexible enough to be shared by Cine, Tinsel & SCUMM and put it into SCUMM.

  2. Buddha Says:

    Making the code flexible enough to be shared between engines (e.g. Cine, Tinsel & SCUMM) would be really great. As Operation Stealth is WIP I’ll probably just modify its savegame format along the way if I need to, but I’d really love to use a shared savegame format serializer/deserializer, I’m all for it!

  3. Buddha Says:

    Looked a bit more into the SCUMM engine’s savegame handling stuff. Combining the saving and loading into a same function is simple brilliance. Very nice.

    I’ll go drink myself happy now :-), going to do some coding on Sunday next.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s


%d bloggers like this: