An open API service indexing awesome lists of open source software.

https://github.com/denv3rr/routenodehandler

Handling (creation, pathfinding within, etc) of grid nodes for created entities in a 3D environment of a specified size. Written in C++. (Research)
https://github.com/denv3rr/routenodehandler

3d cplusplus grid-system navigation nodes npc pathfinding simulation

Last synced: 5 months ago
JSON representation

Handling (creation, pathfinding within, etc) of grid nodes for created entities in a 3D environment of a specified size. Written in C++. (Research)

Awesome Lists containing this project

README

          


















seperet.com spinning logo gif






![GitHub top language](https://img.shields.io/github/languages/top/denv3rr/RouteNodeHandler)
![GitHub Created At](https://img.shields.io/github/created-at/denv3rr/RouteNodeHandler)
![GitHub last commit (branch)](https://img.shields.io/github/last-commit/denv3rr/RouteNodeHandler/main)
![GitHub License](https://img.shields.io/github/license/denv3rr/RouteNodeHandler)
![GitHub branch status](https://img.shields.io/github/checks-status/denv3rr/RouteNodeHandler/main)







##

- Keep track of entity data (3D coordinates, neighbors, etc.) while they search for a location.
- Currently supporting entities such as:
- NPCs
- Vehicles
- and more - feel free to add your own.

- Current pathfinding algorithms in use:
- A*
- Dijkstra



- ***Example*** of the A* algorithm in use in a Python program.
-







## Compiling

1. Clone the repo.
- `git clone https://github.com/denv3rr/RouteNodeHandler.git`

2. Navigate to the `src` folder.
- `cd RouteNodeHandler/src`

3. Compile. The current build can be compiled with 2 options:
1. Named:
- `g++ -I ../include *.cpp -o ''`
2. Default:
- `g++ -I ../include *.cpp` - for an **unnamed** out file.

- These 2 compile options use the "Include" (`-I`) tag to add 2 things:
1. The `include` folder found one directory back: `../include`
2. All (`*`) other files ending in `.cpp` (located in the `src` folder).

- Depending on what you specify at compilation, the compiled out/exe file will then be added to the same folder you are in (should be `src`).

4. Run the `.exe` file.









## Issues

🚧 If you have any problems with anything, submit an issue to let me know.










## Contributing

Contributions are welcome. Please fork this repository and create a pull request with your added changes.








## Links

- seperet.com || [Seperet](https://seperet.com)
- Dijkstra, A*, and Topological Sort || [CS106B Lecture 27. Dijkstra, A*, and Topological Sort](https://web.stanford.edu/class/archive/cs/cs106b/cs106b.1242/lectures/27-graph-algorithms/)






## Notes

1. Entity Identification: Each entity (NPC or Vehicle) is identified by its type and ID, like "Entity: NPC 1" or "Entity: Vehicle 3". This clarifies which entity is being processed.

2. Start and Goal Nodes: For each entity, the start node and goal node are printed (e.g., "Start Node: 0", "Goal Node: 99"). If the start or goal node is blocked, subnodes are generated and tried.

3. Subnode Attempts: If the start or goal node is blocked, the log shows "Start node blocked, trying subnodes..." and attempts to find subnodes. The subnode IDs are also shown (e.g., "Start Node: 2899 at (0, 0, 3)").

4. Pathfinding: After attempting subnodes, the pathfinding algorithm is initiated ("Initiating pathfinding algorithm..."). If no path is found, the log prints "No path found."

5. Multithreading-like Output: The logs may seem to jump between entities because multiple entities are processed sequentially in each simulation step. This can give the appearance of multithreading but is a result of each entity attempting pathfinding one after the other. This will be added eventually.

6. Goal Reached: At the end, if a path is successfully found, it reconstructs and prints the path ("Goal node reached").






## License
MIT License

Copyright (c) 2024 Denver Clark

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.






##




seperet.com