A room's loot changes every time the player leaves and comes back
Generated rooms should look the same on a second visit, yet storing every room is heavy. The room can be rebuilt from the run's seed and its place, if the two are mixed carefully. A common shortcut lets different rooms share a seed without anyone noticing.
Why this works
A room does not need to be remembered if it can be rebuilt exactly. When the run and the room's place are the only ingredients, the result is the same on every visit, in any order, and the only thing worth saving is what the player changed.
When not to use it
Skip it when rooms should change on purpose, such as a haunted house that moves behind you or a level that gets harder each visit. Rebuilding gives the same room every time. Draw those rooms fresh, or mix the visit count into the ingredients.
In the full entry
- What to build, step by step
- Starting values and the reason for each
- 3 common mistakes and the fix
- 29 lines of example code with 4 checks that pass
- How your AI shows you that it works
Say this to your AI
Use the Spielerando entry "A room's loot changes every time the player leaves and comes back" (read_entry room-contents-stay-the-same-on-return-by-position-hash) 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