[Scummvm-devel] Sword25 save system

Eugene Sandulenko sev at scummvm.org
Wed Aug 24 13:48:29 CEST 2011


Hi Team,

The only thing which prevents me from announcing Sword25 as supported
is its save system.

Basically the whole engine is built as Lua interpreter with extensions
which is a smart thing. But the side effect is that the saves are
actually snapshots of Lua machine state. Current Lua persistence code
(pluto) has at least two problems with the save interchangeability:

  - Storing IEEE floating point numbers (could be addressed quite easily)
  - Storing pointers.

The pointers are used heavily within the engine, and are used by
linked lists and complex structures. I was trying to look into it, but
it seems it requires digging deeper into Lua internals in order to
understand how it handles it.

So, the question is. Should we rewrite whole save system for Sword25,
or claim that the saves are not interchangeable between platform with
different pointer size (32bit vs 64bit) and probably with different
endianness too.

Another possible alternative which could potentially help with the
rewrite is to drop Lua state altogether and restore its state with
another Lua script which we will inject into the engine.

Please comment.


Eugene




More information about the Scummvm-devel mailing list