Check a patrolling threat always leaves a window to slip past
A watcher that walks a loop is only fair if the player can see a gap and use it. This entry finds every start time that works for a crossing of a given length, including windows that wrap around the end of the loop, and adds room to react.
Why this works
A guard who repeats the same round can always be beaten by someone who watches. What matters is that a gap exists, long enough to cross, and since the round starts again, the gap may wrap from the end back to the start.
When not to use it
Wrong for guards who react to noise or chase the player, because their pattern is not fixed and no window can be promised. Use alert levels and hiding places instead, and test those with a different kind of check.
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
- 33 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 "Check a patrolling threat always leaves a window to slip past" (read_entry patrolling-threat-needs-a-safe-window) 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