What are some methods for pathfinding in a 3d world?
Object X needs to move from Point A to Point B but it might have to avoid things like asteroids, planets or gas pockets that makes the object slower.
The program uses an octtree and is not “tile” or “grid” based.
E.g.:
What kind of pathfinding system does games like Homeworld 2, Sins of a solar empire and similar use?
There would be a lot of objects flying around in this 3d space, each having it’s starting point A and destination point B but each would have to periodically update it’s path in order to avoid the other objects.
I have implemented the A* algorithm before by myself. The best I can think of is using a flow field but I perceived it to be very ineffective in large scale.
Since flow fields need to be calculated on a large area, doing so for hundreds or even thousands of objects can become a slow process. Supreme Commander 2 uses flow fields for pathfinding and it’s possible to have hundreds of units. Under the hood, the pathfinding is very simple, though. It only works for finding paths that are simple because finding the way out of a very simple labyrinth is a problem and would cause units to phase through the walls/buildings.
Using a flow field for the purpose sounds, to me at least, as a good decision. Alas, I’m unsure if it’s a wise choice when the flow fields need to be updated often so that other objects can be avoided. Or is there maybe a technique for calculating everything from start to finish before moving the objects? If there is, I don’t know what it’s called or how to find information about it.
5
What are some methods for pathfinding in a 3d world?
The same as a 2D world.
Most pathfinding algorithms work on graphs, and will happily work with an arbitrary number of paths from a node. You might have some challenges building that graph from your existing data structures; and you might need to change your distance/heuristic for how “good” a path is, but the methods for pathfinding itself does not change.
2