Closed deezaster closed 1 year ago
cc @smix8
You need to sync the cell_size
and cell_height
of your navigation mesh with the cell_size
and cell_height
set on the navigation map that uses the navigation mesh.
Since you changed the cell_height
of the navigation mesh from the default 0.25 to 0.1 you also need to set the same value on the navigation map.
The second error is not new, just reworded. Since you did not add a MRP I can only guess but all points that you already had merge errors on your navigation map in Godot v4.1.beta2 and the newly added validations only make it more explicit.
If you do not sync navigation mesh and navigation map the navigation map can not rasterize your navigation mesh vertices and edges correctly if you have more of them in close proximity and you get edge merge conflicts (second error msg).
Set your cell_size
with ProjectSettings navigation/3d/default_cell_size
for the default 3D navigation map.
You can use NavigationServer3D.map_set_cell_size()
at runtime to set it for a specific map.
Set your cell_height
with ProjectSettings navigation/3d/default_cell_height
for the default 3D navigation map.
You can use NavigationServer3D.map_set_cell_height()
at runtime to set it for a specific map.
Message 1 has now disappeared with the recommendations. Thank you.
But Message 2 remains:
E 0:00:19:0007 sync: Navigation map synchronization error. Attempted to merge a navigation mesh polygon edge with another already-merged edge. This is usually caused by crossing edges, overlapping polygons, or a mismatch of the NavigationMesh / NavigationPolygon baked 'cell_size' and navigation map 'cell_size'.
<C++ Source> modules/navigation/nav_map.cpp:770 @ sync()
This error tells you that you have somewhere around your navigation map a lot of vertices in very close proximity, too close to be rasterized into the navigation map cells at the current cell size/height. The navigation map tried and failed to place the two vertices of an edge into cells because the cells where already occupied by two other edges.
As the error msgs tells this is usually caused by crossing edges or overlapping polygons or a mismatch of the cell size/height the navigation mesh was baked with and the navigation map cell size/height.
Ok. But what I don't understand is that when I 'bake' in the editor, it works fine. Obviously it is only a problem if I add a StaticNode at runtime (as a child of the NavigationRegion3D Node) and then bake it.
And why did it work in beta2?
I don't understand is that when I 'bake' in the editor, it works fine.
Those navigation meshes loaded in the scene might not cause conflict on their own, the NavigationServer also does not always process in the Editor compared to runtime where it processes every physics frame. The missing part might be only added at runtime that causes it e.g. polygon overlap or crossed edges what went wrong.
And why did it work in beta2?
This second error has not changed and the error msg existed since Godot 4.0 and before. Only the error wording has changed with Godot 4.1 beta3.
Without a MRP I can not tell you more what might be causing it.
I uploaded a MRP.
Here the demo: https://github.com/godotengine/godot/assets/1539838/3c91b410-d181-48c4-ac3e-71e88822217f
There was actually a bug, just in a very unexpected direction. Goes to show why adding a MRP is so important.
For now you can solve this by using NavigationMesh.clear_polygons() before the bake until the fix is merged.
Godot version
4.1.beta3
System information
Godot v4.1.beta3 - macOS 13.2.1 - Vulkan (Forward+) - dedicated AMD Radeon Pro 580 - Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz (8 Threads)
Issue description
When baking the mesh in GDScript after placing a Node3D (StaticBody3D with CollisionShape3D) these error message are displayed:
In Godot v4.1.beta2 it worked, i.e. no error message
Steps to reproduce
GDScript:
Properties NavigationRegion3D:
Minimal reproduction project
RTS 3D BakeIssue.zip