Hi, I’m working on a top-down RTS game, my problem is if I have overlapping navigation I get an error
I want different heights in my game
E 0:00:01:0521 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'. If you're certain none of above is the case, change 'navigation/3d/merge_rasterizer_cell_scale' to 0.001.
<C++ Source> modules/navigation/nav_map.cpp:990 @ sync()
I tried different navigation layers but still have the same issues
Navigation meshes can not overlap on the same navigation map, it is a logical error if they do.
So if you need 2D “height” you either use 3D navigation or you create different “2D” navigation maps for each height and juggle agents between them.
Or you can switch to simple point navigation with AStar2D. Because this kind of navigation has no surfaces, just points, it does not care about overlap too much as long as the point connections make sense.
so I need just collect tilemap navigation data, remove them, create a new navigation region, and call set_navigation_map?
wait, an agent just can have 1 active navigation map? mean for each floor change I need to call set_navigation_map for agents?
No need to remove things, you can just call TileMapLayer.set_navigation_map().
Yes, you need to switch agents for a “floor” change.
2D throws all the navigation mesh polygons over each other when on the same map because there is no real verticality axis like in 3D. If all the polygons just randomly overlap and intersect how should pathfinding still function, all that surface logic no longer makes any sense at that point.