Open razcore-rad opened 6 months ago
Seems like something similar is happening with NavigationMesh.cell_height
.
If the map would react to every region with a navigation mesh that has a mismatch configuration that would be a cacophony of unexpected overrides.
So I see this was marked as a discussion topic.
From a gamedev user of Godot perspective, is there ever a point of having out of sync navigation server maps properties (cell_size
, cell_height
, etc.) & navigation polygon properties? I don't see any scenario where we might want that possibility.
So doesn't it make sense to update the navigation server maps with the properties we define as users in the inspector? Instead of being forced to update/track everything manually and sync in code.
From a gamedev user of Godot perspective, is there ever a point of having out of sync navigation server maps properties
No not really. There is no point in having them out of sync for a single navigation map as it only invites problems with merging edges.
The thing is that you can not enforce it outside the navigation server internals. The reality we live in is that a lot of users do not have their navigation meshes baked in sync with the same properties for the same map. Some love to have different properties for every single mesh to "make it look good" or fix certain surface areas instead of fixing the actual geometry that causes the bake problem.
Users can throw whatever NaviationPolygon or NavigationMesh they want at the server, there is not way to verify any of this upfront before it is used by an actual navigation map.
That is also why it does not verify on the region or mesh but on the internal navigation server map. Since it is the navigation map that needs to merge that polygon soup that users create it is also what dicates the conditions and settings and not the other way around.
Tested versions
v4.2.2.rc1.official [c7fb0645a]
System information
Ubuntu 23.04, Vulkan, NVIDIA GeForce RTX™ 2060 / NVIDIA GeForce RTX™ 2060, NVIDIA Driver Version: 525.105.17, NVML Version: 12.525.105.17
Issue description
This seems something similar to https://github.com/godotengine/godot/issues/83570, but for
NavigationRegion3D
/NavigationMesh
.The error occurs when when:
NavigationMesh
with a differentcell_size
and then using Bake NavigationMesh. On subsequent recreations ofNavigationMesh
in the same Godot session the error doesn't occur.NavigationMesh.cell_size
is different from the project properties default value.NavigationMesh.cell_size
is different from the project properties default value.The workaround is to call
NavigationServer3D.map_set_cell_size(get_navigation_map(), navigation_mesh.cell_size)
somewhere in the code.Steps to reproduce
Open the Minimal Reproduction Project and see the error first occur since I have assigned a
NavigationMesh
toNavigationRegion3D.navigation_mesh
with acell_size
of0.1
which is different from the default project properties of0.25
.When you run the project you'll also get the error.
I've attached a workaround script to
NavigationRegion3D
which callsNavigationServer3D.map_set_cell_size(get_navigation_map(), navigation_mesh.cell_size)
and fixes the error at runtime. This code is commented out for the purpose of demonstration.Minimal reproduction project (MRP)
godot-dbg.zip