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

Move navigation mesh baking to NavigationServer #79643

Merged
merged 1 commit into from
Aug 7, 2023

Conversation

smix8
Copy link
Contributor

@smix8 smix8 commented Jul 18, 2023

Moves navigation mesh baking to NavigationServer.

  • Moves the 3D NavigationMesh parsing and baking from NavigationMeshGenerator to NavigationServer3D.
  • Deprecates the NavigationMeshGenerator singleton.
  • Splits the monolithic geometry parsing code into node specific functions.

Fixes #79843.

Requires #79157 to be merged first as a substitute for NavigationMeshGenerator.clear().

The other public functions from the NavigationMeshGenerator can already be found on the NavigationServer3D since Godot 4.1 and #77412.

Updating the NavigationMeshGenerator for further developments is not feasible as the NavigationServer needs to be in full control of the navigation mesh baking process going forward. E.g. for internal threading support or the change to a navmesh instance system as part of the server, or better agent sizes support. The old NavigationMeshGenerator also had nothing but problems from init chain to extendibility and required workarounds and extra functions like #79137.

@smix8
Copy link
Contributor Author

smix8 commented Jul 19, 2023

EDIT
Removed the parsers, nothing but problems with both init and certain platform builds with them, not worth the trouble.

@smix8 smix8 force-pushed the navgenerator_4.x branch 5 times, most recently from d83dd69 to c8ed3be Compare July 20, 2023 10:44
@smix8 smix8 force-pushed the navgenerator_4.x branch 2 times, most recently from ebecc01 to 17f4528 Compare July 22, 2023 22:16
@smix8
Copy link
Contributor Author

smix8 commented Jul 22, 2023

Made the node parsers more readable by splitting them into their own functions.

Now the Editor NavigationMeshEditor (should be renamed NavigationRegion3DEditor because that is what it is) uses the same function as the NavigationRegion3D for consistent bake behavior. Changed that the NavigationRegion3D did entire NavigationMesh resource duplicates for each bake. This not only drained performance on large meshes but also made the bake behavior different in the Editor as compared to baking at runtime. For the future duplicating the resource all the time would also make the resource RID change / invalid all the time as soon as instances get added so it needs to change anyway at some point.

@smix8 smix8 force-pushed the navgenerator_4.x branch 2 times, most recently from ed05ae7 to 83fc909 Compare July 24, 2023 08:26
@smix8 smix8 added the bug label Jul 24, 2023
@smix8
Copy link
Contributor Author

smix8 commented Jul 24, 2023

Added a fix for the CSGShape3D collision and changed some functions due to changes in a subsequent pr.

Moves navigation mesh baking to NavigationServer.
@akien-mga akien-mga merged commit 7eb047a into godotengine:master Aug 7, 2023
14 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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

NavMesh source geometry parsing ignores CSGShape3D set to use_collision
2 participants