libgdx / gdx-ai

Artificial Intelligence framework for games based on libGDX or not. Features: Steering Behaviors, Formation Motion, Pathfinding, Behavior Trees and Finite State Machines
Apache License 2.0
1.21k stars 244 forks source link

Hierarchical pathfinding question #46

Closed madmenyo closed 9 years ago

madmenyo commented 9 years ago

I have seen your implementation of the hierarchical pathfinding and mine is slightly different. I just have a tilemap and each tile has a node with connections. Now I want to divide my map in "sectors" and build nodes on the edges where there is a entrance.

If so, I would like to know :)

If not:

I see you store all the nodes in a single array and use an offset for higher levels. However I want to make a dynamic map. And once a node changes it will update it surrounding nodes and if level 2 changes as well it does the same. But that means I need something more flexible then a ArrayList or (like I do on the 1st level) create all possible nodes and alter there connections. I would appreciate some pointers in the right direction.

Thanks in advance,

davebaol commented 9 years ago

What you're trying to do is known as "graph partitioning" in pathfinding literature. There are many techniques, each with pros and cons, but none of them are currently supported.