What heuristics do programmers use in A* pathfinding for NavMeshes?
NavMesh = Navigation Mesh, its a type of pathfinding that uses meshes instead of waypoints.
What heuristics do programmers use in A* pathfinding for NavMeshes?
NavMesh = Navigation Mesh, its a type of pathfinding that uses meshes instead of waypoints.
Take your pick:
http://theory.stanford.edu/~amitp/GameProgramming/Heuristics.html
There's a load of heuristics described in that link, either for speed or accuracy. There's always a trade-off, so I would assume that developers would use the most accurate heuristic that would cause minimal impact to their game's performance.
A very, very rough (but very speedy) heuristic to use is: (Manhattan distance)
vec1 = start vector
vec2 = end vector
heuristic = abs(vec2.x - vec1.x) + abs(vec2.y - vec1.y))
This avoids any square rooting, which could be costly (Pythagorean distance).