Add means for fixing navmap synchronization errors #87959
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #85548
This PR is based on my observation that for some valid input geometries, recast produces valid navigation meshes and yet the transformation that is done as part vertex hashing:
godot/modules/navigation/nav_map.cpp
Lines 106 to 108 in b4e2a24
This PR proposes a map-level option to change the scale of internal rasterizer which allows the engine to perform the align-to-recast-grid transformation using greater precision. With that, in projects where navigation baking leads to synchronization problems, the precision of internal rasterizer can be increased to avoid errors (although potentially sacrificing the ability to connect separate regions).
I've prepared a straightforward demo (godot-navigation-demos.zip -
ComplexNavmeshPaths.tscn
) application that showcases the problem - all it does is query the server for paths from random point A to random point B each and render them to show potential holes in navigation.The demo outcome when using current Godot implementation:
The demo outcome when the Godot from this PR is used and
merge_rasterizer_cell_scale
is set to0.001
: