- Home /
Is there any full 3D-Pathfinding asset/solution?
Please don't misunderstand my question: Obviously there are tons of good pathfinding solutions which can cope with a three-dimensional world(The most popular probably being Aron Granberg's A* implementation).
However, I am looking for a solution which is able to path-finding in a full three dimensional space, like for example space itself(and able to e.g. avoid asteroids in its path).
Is there any asset available that provides such features out-of-the-box, or would I have to implement this myself? If the latter, how should I go about it? Grids aren't really an option since they would blow up memory, and I haven't implemented any non-grid based path-finding algorithms myself so far.
Thank you for your time.
Unity : https://docs.unity3d.com/$$anonymous$$anual/nav-BuildingNav$$anonymous$$esh.html
RAIN indie : http://legacy.rivaltheory.com/rain/features/
.disclaimer: I havn't used either :D
Thank you for your reply,
Unfortunately I already used both, and both use the same concept: Nav$$anonymous$$eshes. Nav$$anonymous$$eshes in general only support semi-3d path finding by the way they are designed. They - as the name implies - build a mesh the agents can follow along. This creates a flat mesh with some bumps in it where for example hills are.
Quick example image: See here for larger version: http://imgur.com/a/dLZUl
Red: (Incomplete) Example Nav$$anonymous$$esh // Purple: What it's lacking for my problem
So, a Nav$$anonymous$$esh allows me to move "on the ground" in a 3d-environment, but does not allow me to move "up and down" (speak: into the air) which would be essential for games featuring airplanes or spaceships.
I also cannot simply use Raycasts to check if I can move to a position since this strategy is not viable for AI path-finding, only for player characters/controllers.
I hope I further explained my current problem.
Answer by kddressel · Oct 27, 2016 at 05:30 PM
I'm not aware of any pre-made assets that do exactly what you want, but you could at least avoid writing your own pathfinding algorithm by using PointGraph in Aron Granberg's A* implementation.
You provide a list of node positions and the algorithm automatically creates edges between nodes that are close together. It allows nodes to be at any position rather than bound to the ground as long all axes of the "limits" parameter are set to 0 (infinity).
Granted, I've only played with that library's navmesh and grid based approaches myself so there could be a catch.
You're still stuck with having to generate the points yourself, but you could get a very simple first pass at that quickly. Generate a bunch of nodes in 3D space at some standard distance from each other. Exclude points that are overlapping with obstacles.
This is like a 3D grid, which as you said it might have memory issues. You could try using a k-d tree or Octree to prune out points in open spaces while keeping a larger density of points in more intricate areas with obstacles.
Would love to hear how other space themed games do this, but that's where I would start.
Sorry for the late reply, I didn't have access to my home computer the last two days. That's too bad, but your idea sounds very reasonable. I still see the potential for possible memory issues, but a decent distance between the nodes could make up for that. Also nodes don't need to store as much information as "normal" nodes as the cost from one node to another neighboring another is always the same in space(no affecting terrain or gravity).
I'll mark your answer as accepted, but I'd also love to hear how other space games did this.
Answer by NikitossFly · Oct 10, 2017 at 01:50 PM
https://forum.unity.com/threads/pathfinder-3d-pathfinding-in-three-dimensional-space.499144/#post-3246308 - the only solution to your problem
Answer by FirstTimeCreator · Jun 11, 2018 at 05:59 AM
I am working on one, it's nearly done: https://forum.unity.com/threads/swarmai-3d-pathfinding-system-should-i-sell-asset.535090/#post-3527697
Your answer
Follow this Question
Related Questions
Pathfinding in a 3d Space 1 Answer
How to find % along path between N points 2 Answers
Manipulating cursor direction in 3D space 0 Answers
Pathfinding on Instantiated AI Vehicles 0 Answers
How to minimize directional changes of A* autopathing movement? 0 Answers