[Scummvm-devel] Thoughts on new save/load system

Marcus Comstedt marcus at mc.pp.se
Sun Sep 22 09:31:03 CEST 2002


Max Horn <max at quendi.de> writes:

>[...]
> void mySaveGame()
> {
>    Archiver *archiver = new Archiver("path/to/my/file");
>    archiver.open();
>    archiver.writeInt(1, "version");
>    archiver.writeObject(g_scumm, "Scumm");
>    archiver.close();
> }

This is the only part I'd like to change.  The Archiver class should
be abstract, and implement everything except the actual reading and
writing of the streamed octets.  This will be implemented by a
port-specific implementation (of course, a default implementation
using FILE* can be provided in common/), thus allowing for saves to
memory cards etc.  This way the NONSTANDARD_SAVE hack can be removed
(which was made that way because virtual method calls weren't used at
that time, a restriction we have now lifted).

The point being of course that

    Archiver *archiver = new Archiver("path/to/my/file");

should instead be

    Archiver *archiver = osystem->newArchiver("path/to/my/file");

to make this possible.


> OK, so now there was some concern about save game sizes. Currently we
> are at 35-100KB per save game. This new approach definitly will
> increase the size, depending on how long we choose the names it could
> easily double or triple our size. However, that would still be OK
> IMHO. And it would be trivial to use zlib (which is open source, very
> small, easy to use and available on nearly every system) to compress
> our data - given the strucutre of the data it should compres well and
> might in the end be small than what we have currently.

The Dreamcast port already uses zlib (since a memory card is only 128K
big), the typical file size with the old save scheme becomes around
16K.


  // Marcus






More information about the Scummvm-devel mailing list