inkle / ink

inkle's open source scripting language for writing interactive narrative.
http://www.inklestudios.com/ink
MIT License
3.97k stars 482 forks source link

How to rewind? #376

Open kbigdelysh opened 6 years ago

kbigdelysh commented 6 years ago

I searched the tutorial page but could not find a specific feature in Ink language to rewind to previous stage of the game. I want the player be able to rewinds to his last selection every time he/she rewinds.

It seems I can probably do a workaround by saving each stage on disk and load when the player rewinds but this solution is not elegant. Another possible workaround probably to have an additional option that always rewinds to the previous selection but that still would not be elegant.

How did you guys add the rewind feature in the sorcery game series?

joningold commented 6 years ago

So, broadly, save / load is the way to go. The ink save state isn't enormously big so you don't actually have to save to disk; you can just shove save states into an array.

Note we limited rewind to each location, not every choice; and we didn't save/load the game state, only the ink state - game state was rewound "by hand" in code in whatever way was efficient.

I think by the later sorcery games the save was starting to get unwieldy, so we made a system that only saved the diff from one state to the next, but that's basically on top of the save/load of the ink; we just used it to reduce the save data down on collection, and build it back up again when it was needed.

On Sat, Oct 21, 2017 at 7:22 AM Kamran Bigdely-Shamloo < notifications@github.com> wrote:

I searched the tutorial page but could not find a specific feature in Ink language to rewind to previous stage of the game. I want the player be able to rewinds to his last selection every time he/she rewinds.

It seems I can probably do a workaround by saving each stage on disk and load when the player rewinds but this solution is not elegant. Another possible workaround probably to have an additional option that always rewinds to the previous selection but that still would not be elegant.

How did you guys add the rewind feature in the sorcery game series?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/inkle/ink/issues/376, or mute the thread https://github.com/notifications/unsubscribe-auth/AA40o9GPwPUUriJ6krPcdXFP1ilvEp_Hks5suY2mgaJpZM4QBc75 .