hierarchical pathfinding algorithm
hierarchical pathfinding algorithm
Hierarchical PathFinding
Plans a route in much the same way as a person would.
Human plan an overview route first and then refine it as needed.
Ex: The high-level overview route might be
Connection Cost
The cost of a connection between two groups should reflect the difficulty of traveling
between them.
This can be specified manually, or it can be calculated from the cost of the low-level
connections between those groups.
THE HIERARCHICAL PATHFINDING
GRAPH
complex calculation,(cost of moving
from group C to group D)
Cost = 5 (if entered from A
Cost = 2(if entered from B)
In general, the grouping should be
chosen to minimize this problem, but
it cannot be resolved easily.
A tile-based representation of
a level with groups marked
There are three heuristics that are commonly used to calculate the connection cost
between groups Min. Distance, Maximin. Distance, Avg. Minimum Distance
Heuristics are the strategies derived from previous
experiences with similar problems.
Heuristics
• Minimum Distance
This heuristic says that the cost of moving between two groups is the
cost of the cheapest link between any nodes in those groups.
Pathfinder will try to find the shortest route between two locations.
Ex: Cost of moving from C to D would be 1. Note that if you entered C
from either A or B, it would take more than one move to get to D.
The value of 1 is almost certainly too low, but this may be an
important property depending on how accurate you want your final
path to be.
The A* & dijkstra
Heuristics
• Maximin Distance
To calculate the cost of moving from C to D, two costs are
calculated:
the minimum cost from C1 to C5 (4) and the minimum cost from C6 to
C7 (1). The largest of these (C1 to C5) is then added to the cost of
moving from C5 to D1 (1). This leaves a final cost from C to D of 5.