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

Add NavigationServer map_force_update() function #62300

Merged
merged 1 commit into from
Jun 24, 2022

Conversation

smix8
Copy link
Contributor

@smix8 smix8 commented Jun 22, 2022

Adds map_force_update() function to NavigationServer. This function immediately flushes the Navigationserver command queue and recalculates all navigationmeshes and region connections for a single, specific map.

If used appropriately can be a very powerful tool to do crazy stuff with procedual navigation and path queries but can also cause a lot of misery for ppl that just want to use it because they do not like to wait for something without understanding the impact so I hope the warning is clear enough.

Can be used to make situations like in #57815 and #57022 or any situations where users want to do procedual levels more controllable. Sometimes it is very inconvenient to wait for a full physics frame to make (correct) path queries, e.g. if you use one map on the NavigationServer for AI queries and want to check this map under multiple different region constellations all in the same frame.

Actually the real bug potential of this function for now is very little. I just added some drama to get the warning across. It would create just more lag when a long command queue is updated by accident and some regions and avoidance agents would surprisingly be already placed on the new update map. Since everything would still process normally in the synchronisation phase nothing would break without recovering. With already disabled dirty flags on the updated objects it would also do no double processing if not required e.g. because other change commands were send later.

@smix8 smix8 requested review from a team as code owners June 22, 2022 08:38
@smix8 smix8 force-pushed the navigation_map_force_update_4.x branch from a9ba9fe to 03dc835 Compare June 22, 2022 08:48
@Calinou Calinou added this to the 4.0 milestone Jun 22, 2022
@Calinou Calinou added the cherrypick:3.x Considered for cherry-picking into a future 3.x release label Jun 22, 2022
@smix8 smix8 force-pushed the navigation_map_force_update_4.x branch from 03dc835 to 6212c35 Compare June 22, 2022 10:03
Adds map_force_update() function to NavigationServer. This function immediately flushes the Navigationserver command queue and recalculates all navigationmeshes and region connections for a specific map.
@smix8 smix8 force-pushed the navigation_map_force_update_4.x branch from 6212c35 to fdea269 Compare June 23, 2022 15:32
@akien-mga akien-mga merged commit faae246 into godotengine:master Jun 24, 2022
@akien-mga
Copy link
Member

Cherry-picked for 3.5.

@akien-mga akien-mga removed the cherrypick:3.x Considered for cherry-picking into a future 3.x release label Jun 24, 2022
@smix8 smix8 deleted the navigation_map_force_update_4.x branch June 24, 2022 08:22
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