Walking along a route looks like a staircase instead of a straight line
A route found on a grid turns at every cell, so characters wobble along it like they are on rails made of steps. Here is how to remove the needless turns without ever cutting through a wall.
Why this works
A route made of grid cells is shaped by the grid, not by the world. Keeping only the turns where the view is truly blocked gives the walk a person would choose: straight wherever they can see ahead.
When not to use it
Skip it when units must move cell by cell, as on a board with turns, or when the route follows roads that really exist. Straight shortcuts there would break the rules.
In the full entry
- What to build, step by step
- Starting values and the reason for each
- 3 common mistakes and the fix
- 50 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 "Walking along a route looks like a staircase instead of a straight line" (read_entry straighten-grid-path-string-pulling) 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