Spielerando

Keep a flashback from changing the present state of the game

When the player replays a memory, health lost, items used and doors opened in the past must not follow them back, but what the character remembered should. Here is a simple stack that restores the present on the way out and carries over only chosen things.

Why this works

A memory should leave behind only what the character remembers, not what happened in it. Saving a copy on the way in and restoring it on the way out guarantees the present is untouched, and only the things you name are allowed back.

When not to use it

Wrong when the past really does change the present, as in time travel, where the player's deeds in the past should show up now. Then the changes must carry over on purpose. Also check saving mid-memory, or loading breaks the story.

In the full entry

  • What to build, step by step
  • Starting values and the reason for each
  • 3 common mistakes and the fix
  • A diagram of every state
  • 25 lines of example code with 3 checks that pass
  • How your AI shows you that it works

Say this to your AI

Use the Spielerando entry "Keep a flashback from changing the present state of the game" (read_entry flashback-changes-must-not-leak-into-now) in my game. Build it step by step, and show me how you checked that it works.

Or skip this and connect the MCP: your AI then finds all of this by itself.Connect the MCP