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

Handle translation deltas that exceed consecutive path points #84

Closed
zlxt2714 opened this issue Sep 6, 2021 · 3 comments
Closed

Handle translation deltas that exceed consecutive path points #84

zlxt2714 opened this issue Sep 6, 2021 · 3 comments
Labels
bug Something isn't working discussion Talk about stuff nav Related to the nav package

Comments

@zlxt2714
Copy link

zlxt2714 commented Sep 6, 2021

Bug description:

When the speed of the agents in the scene exceeds 30 (Translationspeed = 50F), some agents will get stuck in place, and some will shake violently when they reach the target point. If navflocking is turned on, the agent will circle around the target point. So how to solve this problem?

@zlxt2714 zlxt2714 added the triage Maintainer needs to verify nature of issue and determine future steps. label Sep 6, 2021
@reeseschultz reeseschultz changed the title [BUG]agent shake and stuck when Translationspeed is bigger than 30 Handle translation deltas that exceed consecutive path points Sep 6, 2021
@reeseschultz reeseschultz added bug Something isn't working discussion Talk about stuff nav Related to the nav package and removed triage Maintainer needs to verify nature of issue and determine future steps. labels Sep 6, 2021
@reeseschultz
Copy link
Owner

Thanks for submitting this issue. It gives me an opportunity to explain how the navigation works at a glance, and why this happens.


You have to supply reasonable parameters for navigation to work, in the same way that you do for physics, shaders, etc., although I understand the need for input validation where possible.

The navigation package generates a buffer of navigable points. If the translation delta of an agent exceeds the distance between a set of consecutive points, the agent will, as you put it, shake violently, because it's unable to "reach" said points—and it will keep trying indefinitely. Keep in mind that whether a point is "reached" is approximate, since positions are stored as floating-point numbers.

Input validation for this is challenging. For example, points could be removed to account for the translation delta; however, those points exist for a reason: the avoidance of obstacles. In this way, if we remove a hypothetical Point B between A and C, then we have no assurance that the vector between A and C is navigable/walkable.

Another way to go about this would be to temporarily slow the agent. Thus, the TranslationSpeed would effectively become a MaxTranslationSpeed. Maybe a name change would be in order.

All in all, I'll consider slowing agents conditionally with a distance check. I'm also curious if anyone has input on that, or agrees with that approach. Let me know if you do. Also, maybe MaxTranslationDelta would be more appropriate than MaxTranslationSpeed, because it's best thought of as change in units (meters by default) over time.

In the meantime, just lower the translation speed. Or, hey, I literally added an option for the agents to teleport. Use that if you want them to go really "fast."

@reeseschultz
Copy link
Owner

Closing, see #99.

@zlxt2714
Copy link
Author

zlxt2714 commented Aug 11, 2023 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working discussion Talk about stuff nav Related to the nav package
Projects
None yet
Development

No branches or pull requests

2 participants