|
Hey,
I am
at exactly the same juncture. To my knowledge there is no experience
on this list with saving Lua states. It is possible but a bit of a brute force
approach. Basically, the state is just a collection of C structures and, as
such, can be saved and restored. I have a hunch it would be hard to get it
right, making the code pretty high maintanance. Serializing game object
state tables is what I am considering/prototyping at the moment. We don't go
dumping raw process memory heaps when saving games written in C, do we? Instead
we rely on that the OS will load the executable and we only need to serialize
the application state variables. Same line of reasoning may be applied to Lua if
you think of Lua VM as a process. Restoring the instruction pointers? Well, same
thing, how would you go about this for an application written in C? There is a
difference between restoring the game state and the process
state.
Alex.
|