thiloplanz / glulx-typescript

Glulx VM in TypeScript with Channel IO
14 stars 10 forks source link

Engine state snapshotting #16

Open thiloplanz opened 8 years ago

thiloplanz commented 8 years ago

While we support the "save" (and "restore") family of opcodes, these have to be triggered from within the game image itself (usually by typing "save" into the command prompt, but the game may implement this differently or not at all).

It would be nice to be able to take snapshots of the whole engine state directly through an API (whenever the game is in a wait-state, i.e. the engine not actively running).

ChicagoDave commented 8 years ago

If you look at the C# version, I used the Undo feature to grab the last "save state" and expose it as a property which I passed through to the EngineWrapper.

thiloplanz commented 8 years ago

We now have a case where the current "save" mechanism that EngineWrapper uses does not work, because the game changes the prompt to ask for something other than a command ("What do you want to name the world?"), and as a result does not execute a "save" operation.

The workaround with using the Undo feature instead might work here: While it also depends on the game to generate undo information, it does not require interacting with the command prompt. I'll check if sufficient undo information is generated in the "Name the World" scenario.