Skip to content
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

[SUGGESTION]: Offload the pathfinding logic to NavigationServer #6

Open
dukemagus opened this issue Sep 29, 2022 · 3 comments
Open
Labels
enhancement New feature or request

Comments

@dukemagus
Copy link
Contributor

dukemagus commented Sep 29, 2022

While a relatively recent feature, it should be theoretically possible to define a 3d grid as a navmesh, let it pull any move cost or obstacle modifier from the object in that space and then return the route.

It isn't as performant as a hand crafted A* implementation, but it's also a core component of the engine rather than running interpeted gdscript files. It should scale better if for any reason someone wants to do a map with many units or complex movement rules.

https://docs.godotengine.org/en/stable/classes/class_navigationserver.html

@ramaureirac
Copy link
Owner

I remember that I started this project using navmesh + grids but soon after I ran into problems related to the movement radius of each character, also if (I'm not mistaken) at that time it was not possible to generate a navmesh between two different objects and made more difficult the idea that I had for creating maps.

I guess looking for navigation server should be a good starting point if you start from zero (specially now with godot 4), however change such core logic its too time consuming and complex for me right know. However i'm still open to accept any pull request related to pathfinding :)

@dukemagus
Copy link
Contributor Author

dukemagus commented Dec 29, 2022

https://youtu.be/QRr_P_uqz8w

Was the class (AStarGrid2D) available when the project started? It seems to be able to make things easier. It only needs some parameters for height and movement coat to be dialed in, but it needs less code than the previous astar class and nodes

@ramaureirac
Copy link
Owner

according to the documentation it is a new feature for 2d nodes. for 3d a better choice should be AStar3D https://docs.godotengine.org/en/latest/classes/class_astar3d.html which is also included in Godot 4.

however, you still have to attach each point and check all routing conditionals manually. so, in a way, you will end up saving around 20-30 lines of pathfinding code, but creating new ones just for creating a communication between meshes, vector3s and characters.

for now I think it's better to wait until it supports custom nodes as input

@ramaureirac ramaureirac added the enhancement New feature or request label Jan 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants