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 function to get navigation map iteration id from NavigationServer #84275

Merged
merged 1 commit into from
Feb 22, 2024

Conversation

smix8
Copy link
Contributor

@smix8 smix8 commented Nov 1, 2023

Adds NavigationServer map_get_iteration_id() function to get current navigation map iteration id.

This is useful to give users an option to check if a navigation map has synchronized before doing queries.

Doing queries on never synchronized navigation maps triggers certain warnings / errors.
The NavigationServer map_changed signal alone is too unreliable to track this.

Also increases the wrap range of the map iteration id to UINT32_MAX so long-running games and servers do not have to encounter and deal with wraps in a normal lifetime.

@smix8 smix8 added this to the 4.3 milestone Nov 1, 2023
@smix8 smix8 requested review from a team as code owners November 1, 2023 02:14
@smix8 smix8 force-pushed the navmap_iteration_id branch 2 times, most recently from 7bd9f1f to b5b3d35 Compare November 1, 2023 02:21
@smix8 smix8 added the cherrypick:4.2 Considered for cherry-picking into a future 4.2.x release label Nov 1, 2023
@smix8 smix8 force-pushed the navmap_iteration_id branch 2 times, most recently from 52ff43d to 3cf3956 Compare February 20, 2024 09:14
Copy link
Contributor

@Scony Scony left a comment

Choose a reason for hiding this comment

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

This PR is very easy to test - just saying :)

modules/navigation/nav_map.h Outdated Show resolved Hide resolved
doc/classes/NavigationServer2D.xml Outdated Show resolved Hide resolved
doc/classes/NavigationServer3D.xml Outdated Show resolved Hide resolved
Adds function to get navigation map iteration id from NavigationServer.
@smix8
Copy link
Contributor Author

smix8 commented Feb 22, 2024

Removed the old get_map_update_id() and updated the internal uses in NavMap, NavAgent and NavObstacle to use get_iteration_id() instead.

@akien-mga akien-mga merged commit 0e704ff into godotengine:master Feb 22, 2024
16 checks passed
@akien-mga
Copy link
Member

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cherrypick:4.2 Considered for cherry-picking into a future 4.2.x release enhancement topic:navigation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants