Giter VIP home page Giter VIP logo

Comments (4)

roy-t avatar roy-t commented on July 28, 2024

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

private static float ManhattanDistance(Position p0, Position p1)
to also account for the 3rd dimension.

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.

from astar.

AdamJamesNaylor avatar AdamJamesNaylor commented on July 28, 2024

Thanks for the quick reply (and great work on the library).

I'll certainly look into making the modification myself.
As for the faking option, the grids will need to support layouts as complex as this: https://www.reddit.com/r/starcitizen/comments/9wqv0r/lorville_map/
I certainly think there is a way to logically simplify the grid so that it works. Perhaps by scaling sections and modifying the costings so that it works?

from astar.

roy-t avatar roy-t commented on July 28, 2024

I think you could make that work with 7 2D grids and a few staircases :)

from astar.

roy-t avatar roy-t commented on July 28, 2024

Closed, No more actions needed

from astar.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.