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

Adding/Moving navigation links needs to be optimized #96944

Closed
0x0ACB opened this issue Sep 13, 2024 · 1 comment
Closed

Adding/Moving navigation links needs to be optimized #96944

0x0ACB opened this issue Sep 13, 2024 · 1 comment

Comments

@0x0ACB
Copy link
Contributor

0x0ACB commented Sep 13, 2024

Tested versions

4.3-stable

System information

Windows 11

Issue description

Related to: #96483
Navigation links also suffer from having no form of BVH available during sync. All faces of all polygons have to be scanned not once but twice, because for some reason it first scans all polygons for the start position, and then for the end position. Merging these two loops into one already saves half the time spent here without any additional effort.

This also causes issues in editor when moving navigation links around making it way more painful than it needs to be. Especially because the NavigationLink3D will recompute its connections each physics tick while moving around. Again there is an easy optimization to just defer updating the position in the NavigationServer3D until the drag operation has completed.

Steps to reproduce

Create a big navmesh with a lot of navigation links.

Minimal reproduction project (MRP)

@0x0ACB 0x0ACB changed the title Adding navigation links needs to be optimized Adding/Moving navigation links needs to be optimized Sep 13, 2024
@smix8
Copy link
Contributor

smix8 commented Dec 18, 2024

PR #100497 pushes the sync that causes the stutter to a background thread.

It also adds a region bounds check first for links before they go into the more detailed polygon search. Although how much this affects performance will be very much depend on how balanced the region layout is.

While there are other optimizations to be made in the future this should solve the immediate issues with the editor responsiveness.

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

No branches or pull requests

3 participants