lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


I encountered the same problem, and though it wasn't actually solved there
are some ideas on how it could be made.

First I'd state that yes, it would be very convinient for everyone if such
system existed. In our game (worth about 40Mb in C++ code) we use full
serialization to save game state during the mission, and I think similar
approach can be used for Lua.

Main problems:
1. how to limit serialized part of the state to exclude libraries and other
'static' parts.
2. how to serialize C-functions (some kind of wrapper will be needed
probably)
3. how to serialize userdata (it's simplier - just use callback
serialize_udata(void *data, unsigned size) )

with exclusion of these, Lua state can be serialized by generic
serialization techniques (we use factories and object enumeration)
all constructive ideas are welcome :)

with respect,
Grisha