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

Prevent unnecessary navigation map synchronizations #75678

Merged
merged 1 commit into from
May 11, 2023

Conversation

smix8
Copy link
Contributor

@smix8 smix8 commented Apr 5, 2023

Prevents unnecessary navigation map synchronizations triggered by redundant calls to setters of e.g. region, link or map properties.

The properly biggest, common found issue and performance offender was any transform change to regions or links. Users would often have them or their parents animated with an AnimationPlayer. They would have an animation track for the position / rotation / scale of a region, link or one of the parents. E.g. for an elevator or other moving platforms.

The problem with animation tracks is that they trigger updates every single frame regardless if it is the same keyframe value. As long as the animation was playing as a loop those animation track updates would trigger every single frame. This in turn would trigger synchronization updates for the entire navigation map every single frame (and flood the NavigationServer queue with multiple update commands). This would make every single navigation agent on that map update the navigation path every single frame. This obviously would tank the frame rate.

Prevents unnecessary navigation map synchronizations triggered by redundant calls to setters of e.g. region, link or map properties.
@smix8 smix8 force-pushed the navregion_update_guards_4.x branch from 9a9aa59 to 7e1a261 Compare May 11, 2023 05:38
@akien-mga akien-mga modified the milestones: 4.x, 4.1 May 11, 2023
@akien-mga akien-mga merged commit f78c2dd into godotengine:master May 11, 2023
@akien-mga
Copy link
Member

Thanks!

@smix8 smix8 deleted the navregion_update_guards_4.x branch May 11, 2023 12:40
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.

3 participants