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

Navigation get_simple_path doesn't optimize straight lines in 3D. #19011

Closed
Gyrth opened this issue May 18, 2018 · 7 comments · Fixed by #90434
Closed

Navigation get_simple_path doesn't optimize straight lines in 3D. #19011

Gyrth opened this issue May 18, 2018 · 7 comments · Fixed by #90434

Comments

@Gyrth
Copy link

Gyrth commented May 18, 2018

Godot version:
3.0.2
OS
Ubuntu Linux 18.08

I've been using the Godot Navigation system and noticed that my character sometimes does a little dance around nav target when they are very close to each other. I've made the nav targets visible by spawning a cube in the locations and I noticed that the ones in a straight line don't get optimized out. Is this by design?

I use this to generate the nav path.
var path = navigation.get_simple_path(starting_point, end_point)

image

image

@Einlander
Copy link

A habit that I have picked up from other engines is to have a threshold for each waypoint. If they are within a specific distance from a point go to the next one. This avoids the circle dance that sometimes happens, and adds some variation so it does not look exactly the same every run.

@Calinou
Copy link
Member

Calinou commented Aug 26, 2020

This may have been resolved by #34776 in the master branch.

@timcode77
Copy link

I do think that my test project (#48361) presents an interesting case that exemplifies how pathfinding with Navigation2D get_simple_path() is broken. Please have a look at it if you're interested in understanding the bug. I would say this is high priority given getting shortest paths easily is an expected basic process in game engines. Sorry if this comment isn't appropriate for here; I'm new!

@Calinou
Copy link
Member

Calinou commented May 1, 2021

I would say this is high priority given getting shortest paths easily is an expected basic process in game engines.

The current navigation system is known to be broken in 3.x. Hopefully, the new NavigationServer in 4.0 should do a better job at it.

There is some chance that the NavigationServer is backported to 3.x, but it may take a while to happen.

@timcode77
Copy link

The current navigation system is known to be broken in 3.x. Hopefully, the new NavigationServer in 4.0 should do a better job at it.

That's good to know. How can I help update the 3.x documentation to warn users so they don't waste their time?

@Calinou
Copy link
Member

Calinou commented May 1, 2021

That's good to know. How can I help update the 3.x documentation to warn users so they don't waste
their time?

Done here: #48367

@smix8
Copy link
Contributor

smix8 commented May 19, 2022

This is the same issue for 3D paths as #60277 for 2D.

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

Successfully merging a pull request may close this issue.

7 participants