Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
Tags

What is rollback and rewind?

A topic by Garry Francis created Feb 19, 2020 Views: 110 Replies: 8
Viewing posts 1 to 4
Submitted

TWO includes the following:

game_settings {
   rewind_enabled = true
   rollback_enabled = true
}
What's the difference between rewind and rollback and what do they do? I suspect it has something to do with undoing the last move, but I can't work out the command to make it happen. I've tried rewind, rollback and undo.
Host (2 edits)

Rewind I think is the ability to step backwards and forwards through the game state. Rollback is the ability to step back (usually one move) to safety (after a lose_game or end_game).

To rewind, I think the keybinding is CONTROL + SHIFT + CURSOR KEYS.

It's a bit experimental, I plan a UI for it eventually.

Submitted

I think REWIND works. It's just that it's not obvious that anything has happened if there's no change to the upper part of the display. However, it looks like it deletes the previous command and response.

Is there a system command for this? I'm going to try adding UNDO as a synonym for REWIND, as that's what I'm used to.

Host

I think REWIND and UNDO already work. No custom command yet.

Submitted

Okay, I'll remove the synonym and try it. I previously had UNDO as a synonym for something else. That's why it wasn't working.

Submitted

Yep, UNDO works without having to define it as a synonym. Nice one, Chris.

Submitted

Yep, UNDO works as a synonym for REWIND. Makes life easier for testing!

So ROLLBACK only comes into play when the game is over, correct? I'm presuming it asks you a question or something.

Host (1 edit)

Yes, enabling rollback only affects the lose_game or end_game commands, and allows the player to undo their last command after they have consumed the death (or end game) routine. It allows death to be used as a wisdom acquiring mechanic without being grossly unfair.

I do plan on adding explicit autosave commands in future too, so you can tailor auto-save points if your game (a reserved slot in the save game list).

There is a hidden (soon to be unhidden) system message called:

system_messages{
   restore_from_autosave = Rollback?
}
Submitted

Rollback works! Hooray. Should have added more death scenarios.