-
Notifications
You must be signed in to change notification settings - Fork 58
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support for 3D grids #21
Comments
Hey Adam, I'm not planning on adding 3D pathing since it adds a lot of computation complexity really fast. For example a 10x10 grid has 100 cells to check (worst case) while a 10x10x10 grid already has a 1000 cells to check (worst case again). But if you really need A* path finding in 3D, the algorithm is exactly the same. All you have to do is expand the grid into 3d, add a third dimensions to the movement patterns and expand the heuristic here AStar/Roy-T.AStar/PathFinder.cs Line 159 in 8a3c6ac
So I think its easier to fork this library than trying to fake it. However in some scenarios faking it would also be a good idea. For example if your 3D map is a map of a house. Where each floor is 2D grid and there are only a few place where you can go up or down (at the stair cases). In that case you could use this library to path from the current position to a stair case. |
Thanks for the quick reply (and great work on the library). I'll certainly look into making the modification myself. |
I think you could make that work with 7 2D grids and a few staircases :) |
Closed, No more actions needed |
I noticed in your previous versions of this library that it supported 3D pathing.
Is that something you are considering for this version?
If not, I'm wondering if it's something I could 'fake' by connecting 2D grids in layers and adding sensible costings between them. But not sure how best to achieve that?
The text was updated successfully, but these errors were encountered: