- sueastside
- futuredib
- Xordan
- iceeey
- Welcome
- jwir3
- Jorrit
- BlackPanther
- Krajcevski
- OllieBrown
- res
- SamD
- KlausM
- Mohit
- Leonardo RD
- baribal
- Christian
- RlyDontKnow
- Antony
- Naman22

01:55:38 am, Categories: **Hierarchical Pathfinding**

The basics of hierarchical pathfinding were already discussed in the post about the API (link). In this post, I'm going to talk a little about the implementation of HPF.

First of all, in order to build the high level graph that connects all portals, we needed a way to find a point that represents a portal. In the current implementation, the central point of the portal polygon was chosen. While this heuristic will give good results most of the time, it won't result in optimal paths. The difference in length to the shortest path possible will be more noticeable in a map that has very large portals. One alternative to reduce the effects of this problem is to create a number of points per portal proportional to it's size, relative to the agent size. However, while using more points per portal will result in more accurate paths, it will also cause a decrease in performance, so the number of points has to be chosen with care.

To find a path in the high level graph, we first need to add both the source and destination points to it, and then connect them to other nodes that share their sectors. We then calculate the path using A*. After the path is calculated, we remove the source and destination nodes from the graph, as well as any edges connected to them.

With the high level path calculated, it's time to refine it. For each two consecutive nodes in the high level path, we calculate a low level path segment using the Detour pathfinding. This step is done on demand: each time a user asks for the next node, either a new low level path segment is calculated or the next position of the current low level path is returned (if there is one).

In case the destination point is not reachable, the path to it's closest point in the navigation structure will be calculated.

No Comments/Trackbacks/Pingbacks for this post yet...

This post has 5 feedbacks awaiting moderation...

*Comments are not allowed from anonymous visitors.*

**
**

Sun | Mon | Tue | Wed | Thu | Fri | Sat |
---|---|---|---|---|---|---|

<< < | > >> | |||||

1 | ||||||

2 | 3 | 4 | 5 | 6 | 7 | 8 |

9 | 10 | 11 | 12 | 13 | 14 | 15 |

16 | 17 | 18 | 19 | 20 | 21 | 22 |

23 | 24 | 25 | 26 | 27 | 28 | 29 |

30 | 31 |

- All
- General (6)
- Graph (1)
- Hierarchical Pathfinding (4)
- Navigation Meshes (7)

- August 2010 (6)
- July 2010 (5)
- June 2010 (4)
- More...