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

Better heuristic for the shortest path algorithm for navigation2D #22047

Merged
merged 1 commit into from
Sep 20, 2018
Merged

Better heuristic for the shortest path algorithm for navigation2D #22047

merged 1 commit into from
Sep 20, 2018

Conversation

Piet-G
Copy link
Contributor

@Piet-G Piet-G commented Sep 13, 2018

Better heuristic for the shortest path algorithm for navigation2D.
It now will use the shortest distance to the polygon as cost instead of the distance to the center of the polygon.

This fixes #15919 and fixes #6310.

@Zireael07
Copy link
Contributor

Can we get same fix for navmesh 3d?

@Piet-G
Copy link
Contributor Author

Piet-G commented Sep 13, 2018

@Zireael07 Does navmesh3D return incorrect paths as well? TBH I've never used the 3D features of godot, but if someone gave me an example project where navigation gives the wrong path in 3D I could probably easily apply the same fix.

@fire
Copy link
Member

fire commented Sep 13, 2018

@akien-mga akien-mga added this to the 3.1 milestone Sep 13, 2018
@Piet-G Piet-G mentioned this pull request Sep 14, 2018
@reduz
Copy link
Member

reduz commented Sep 20, 2018

this is really good, but please implement in 3D before merging, you have the same functions there

… navigation.

Better heuristic for the shortest path algorithm for navigation2D and navigation.
It now will use the shortest distance to the polygon as cost instead of the distance to the center.
@Piet-G
Copy link
Contributor Author

Piet-G commented Sep 20, 2018

Added the improvements to 3D as well.

@akien-mga akien-mga merged commit 34f8441 into godotengine:master Sep 20, 2018
@akien-mga
Copy link
Member

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Strange pathfinding with NavigationPolygon Navigation2D bug
5 participants