Giter Site home page Giter Site logo

morbitz / 3d-a-star-pathfinding Goto Github PK

View Code? Open in Web Editor NEW

This project forked from olokobayusuf/3d-a-star-pathfinding

0.0 0.0 0.0 13 KB

This is a small repo I made while working on a game that needed node grid generation in 3 dimensions (multi level planes).

C# 100.00%

3d-a-star-pathfinding's Introduction

3D-A-Star-Pathfinding

This is a small repo I made while working on a game that needed node grid generation in 3 dimensions (multi level planes). It was built in Unity but the principles stay the same across several languages. It is based off Sebastian Lague's tutorials on A* in Unity, see https://www.youtube.com/watch?v=mZfyt03LDH4. Grid generation is the first and most important step--it is also the slowest. In my project, I had to generate grids with little node diameter which yielded a grid that was generated in over 9 million iterations and 10 minutes in Unity Editor. It crashed my iPhone (duhh). As a result, I worked on, and almost completed, an optimization method:

Subdivision Testing: This would generate the grid in two passes. First it would generate a subdivision grid with a node size that was much larger than the final size. This would give a general idea of where nodes are concentrated (and as such where to generate nodes from). Then for each subdivision node, a grid node was generated. This is best suited for environments that are filled with open spaces. In my best tests, I was able to achieve less than 80,000 iterations.

Depth Aware Subdivision Testing: This promises to reduce the grid generation operation from an O(n^3) operation to an O(n^2) operation by performing tests only on the XZ axis (looking at the environment top-down) and using raycasts to analyze all hits down the Y axis. This is currently incomplete but in my tests, I managed to reduce the iteration count to nearly 9,000.

3d-a-star-pathfinding's People

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.