Units think about their route every moment and keep changing their mind
Searching again every moment wastes time and makes characters shuffle back and forth when something moves in their way. Here is a calm rule for when to keep walking, when to wait, and when a new search is really worth it.
Why this works
Most blockages are short, because the thing in the way is also moving. Waiting a little before asking for a new route, and limiting how often to ask, keeps units calm and stops one traffic jam from using up all the effort.
When not to use it
Skip the waiting when the world changes for good, such as a wall that was just built or a bridge that fell. Then plan again at once, because waiting will never clear the way.
In the full entry
- What to build, step by step
- Starting values and the reason for each
- 2 common mistakes and the fix
- 27 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 "Units think about their route every moment and keep changing their mind" (read_entry repath-only-when-blocked) 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