You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
At the moment I'm using specs and rlua to write a simple RTS for research-level AI. I won't go into the details, but for various reasons (including tree search, game replays, speculative simulation, and so on) I really need to serialize the entire game state from any frame so that it's arbitrarily rewindable and deterministic on rewind.
At the moment, the lack of serialization is constraining. I basically have to assume the Lua stores no data, and likewise the Rust side must immediately convert any returned Lua data into native Rust types and write it elsewhere. This limits my scripting potential heavily without mucking with the core engine, because I need to essentially implement piecemeal triggers in Rust and use Lua as a simple configuration language (basically just return a table of prebaked entities, triggers and parameters which Rust then executes).
Currently, my strategy is just to serialize the file path of the script, and on startup load it (on rewind I just assume the file is constant).
I'm not asking for full Serde here since I doubt it's even possible (esp. once references get involved), but it would be nice if there was some way to serialize certain data and (pipe dream) Function types, and reattach them to a new context, even if there end up being some constraints. I understand this is likely a Hard Problem™ but I figured I'd file an issue just to see if any partial version of this is even possible.
The text was updated successfully, but these errors were encountered:
At the moment I'm using
specs
andrlua
to write a simple RTS for research-level AI. I won't go into the details, but for various reasons (including tree search, game replays, speculative simulation, and so on) I really need to serialize the entire game state from any frame so that it's arbitrarily rewindable and deterministic on rewind.At the moment, the lack of serialization is constraining. I basically have to assume the Lua stores no data, and likewise the Rust side must immediately convert any returned Lua data into native Rust types and write it elsewhere. This limits my scripting potential heavily without mucking with the core engine, because I need to essentially implement piecemeal triggers in Rust and use Lua as a simple configuration language (basically just return a table of prebaked entities, triggers and parameters which Rust then executes).
Currently, my strategy is just to serialize the file path of the script, and on startup load it (on rewind I just assume the file is constant).
I'm not asking for full
Serde
here since I doubt it's even possible (esp. once references get involved), but it would be nice if there was some way to serialize certain data and (pipe dream) Function types, and reattach them to a new context, even if there end up being some constraints. I understand this is likely a Hard Problem™ but I figured I'd file an issue just to see if any partial version of this is even possible.The text was updated successfully, but these errors were encountered: