Prevent unnecessary navigation map synchronizations #75678
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.