Make sure dusk, dawn and midnight events fire even when time jumps ahead
A check like "is it dusk right now" works until the player sleeps through the evening, and then the lights never switch on and the night monsters never come. This entry gives the AI a way to ask which moments were passed between two times.
Why this works
A moment in time cannot be caught by asking whether it is that time now, because the clock may jump over it. Asking instead which moments lie between the last look and this one finds every event, however big the jump, and in the right order.
When not to use it
Playing every missed event is wrong when a long skip would flood the player, such as a week of sleep with a monster raid each night. Then keep only the latest effect of repeating events, or tell the player what happened in one summary.
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
- 27 lines of example code with 5 checks that pass
- How your AI shows you that it works
Say this to your AI
Use the Spielerando entry "Make sure dusk, dawn and midnight events fire even when time jumps ahead" (read_entry dusk-never-comes-when-time-skips) 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