Let the world act during a night's sleep, and wake the player if it must
When the player rests until morning, a market opens, rain starts and a burglar climbs through the window, and skipping the hours must not skip these. Here is how to run the skipped time event by event, in order, with sleep that can be broken off.
Why this works
Skipped time is still time. If the world only jumps the clock, cause and effect break, so the hours pass in order, each thing happens when it is due, and anything that should wake the player really does.
When not to use it
Skip it when the world is meant to stand still while the player rests, as in a cosy farm game where nothing bad happens at night. There a plain jump of the clock is honest and cheaper; just say so in the game's rules.
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
- 26 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 "Let the world act during a night's sleep, and wake the player if it must" (read_entry sleeping-through-scheduled-events) 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