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

Fix NavigationRegion2D transform update #85258

Merged
merged 1 commit into from
Dec 4, 2023

Conversation

smix8
Copy link
Contributor

@smix8 smix8 commented Nov 23, 2023

Fixes NavigationRegion2D transform update.

Fixes #85242

That line slipped on a refactor.

Fixes NavigationRegion2D transform update.
@smix8 smix8 added bug topic:navigation cherrypick:4.2 Considered for cherry-picking into a future 4.2.x release labels Nov 23, 2023
@smix8 smix8 added this to the 4.3 milestone Nov 23, 2023
@smix8 smix8 requested a review from a team as a code owner November 23, 2023 06:28
@@ -165,6 +165,7 @@ void NavigationRegion2D::_notification(int p_what) {

case NOTIFICATION_INTERNAL_PHYSICS_PROCESS: {
set_physics_process_internal(false);
_region_update_transform();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The way internal physics process is used here as a one shot seems like a convoluted way to do a deferred call. I assume call deferred wouldn't be enough for this method in NOTOFICATION_TRANSFORM_CHANGED?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If I remember correctly the reason this was added as a physics process one shot is because the server does the sync on the physics tick directly after this.

If it is added to the msg queue it would need a bool to stop the transform notification from spamming the msg queue like crazy which was one of the original problems. E.g. animationplayers that moved regions would trigger 1000+ transform update calls at high frame rate for every navigation server sync due to the lower physics tick rate.

@akien-mga akien-mga modified the milestones: 4.3, 4.2 Nov 23, 2023
@akien-mga akien-mga added cherrypick:4.2 Considered for cherry-picking into a future 4.2.x release and removed cherrypick:4.2 Considered for cherry-picking into a future 4.2.x release labels Nov 23, 2023
@akien-mga akien-mga modified the milestones: 4.2, 4.3 Nov 23, 2023
@sandygk
Copy link
Contributor

sandygk commented Nov 23, 2023

I tested the fix locally, and I can confirm it Fixes #85242

GIF 11-23-2023 7-12-06 AM

@akien-mga akien-mga merged commit 0e4aead into godotengine:master Dec 4, 2023
15 checks passed
@akien-mga
Copy link
Member

Thanks!

@YuriSizov
Copy link
Contributor

Cherry-picked for 4.2.1.

@YuriSizov YuriSizov removed the cherrypick:4.2 Considered for cherry-picking into a future 4.2.x release label Dec 5, 2023
@smix8 smix8 deleted the navregion2d_transform branch December 5, 2023 15:26
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.

NavRegion2d merge indicators are only generated when the scene is loaded
4 participants