Top
Best
New

Posted by bobbiechen 7/28/2026

Improving Heuristics for A* Pathfinding(www.redblobgames.com)
204 points | 22 commentspage 2
lokar 7 hours ago|
It uses df as an example, but it (unlike the others) has the problem that the set of valid paths between any two points can be constantly changing.
amitp 5 hours ago||
The landmark data can be calculated in a background thread. For DF I imagine you'd have a background thread running all the time, updating one landmark every so often. But what happens if you look for a path before the landmark data is updated? I haven't tested this yet but I believe this is how it'd work:

1. If the cost of a tile decreases, the precalculated heuristic will be too high, so A* might find a non-shortest but ok path. In game, you can think of the dorf as following the path they already know about, because they don't yet know that there's a shorter way.

2. If the cost of a tile increases, the precalculated heuristic will be too low, so A* will find the optimal path but it will take a little bit longer (still not as long as if we weren't using this heuristic). In game, you can think of the dorf as following the path they already know about, but running into a wall, so then they find a path around it.

bombcar 6 hours ago||
One of the big questions for an algorithm is - when do you recalculate the path? A real "human" doesn't recalculate until they receive information that the chosen bath is blocked/changed (they see the road closed sign, etc).

But many games recalculate distance to target (one ping only) over and over again each step, so moving a single block half a map away causes an entire army to repath immediately.

bellowsgulch 8 hours ago||
In the event this helps a random developer with some fun experimentation: I had once accidentally independently reinvented drunken pathfinding by adding random additional weights to the node costs, which has the side effect of making an object seeking a path end wander "drunkenly."
azhenley 8 hours ago||
I love this blog. 10/10
lucb1e 7 hours ago|
One might even say it's an A+ resource
eru 1 hour ago||
You mean an A* resource?
taneq 5 hours ago|
From the title I was expecting something about jump point search but this is even more interesting. Bravo!