-
-
Notifications
You must be signed in to change notification settings - Fork 21.5k
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
baked navigationmesh is incomplete #77695
Comments
Adjust the properties on the NavigationMesh to your terrain. Your terrain needs to go through a voxelization stage in the baking process where vertices get mapped to a voxel grid the size of your cell size and cell height. If the cells are too large the elevation differences between the voxel cells will be too much to count as traversable. In general, even if the baking would not fail on the slopes, your terrain mesh looks way to complex around them to gain any reasonable navigation pathfinding performance out of it. Consider excluding that entire part and / or the use of a more simplified representation of your level as the source geometry for baking navmesh. Prefer collision shapes over visual meshes as the source geometry for the baking as those are faster and already more simplified compared to visual meshes. |
so i should use a smaller cell_size/cell_height? godot will crash.😫 |
If the baking crashes because ReCast runs out of memory that is also a clear hint that the source geometry is too large and complex for a single navmesh. Under such conditions, even if the baking would not fail, the resulting navmesh would be unusable for pathfinding performance. Another possibility is that the terrain mesh is downscaled (e.g. FBX imports) so the real voxel grid ends up way larger than you think and runs against the cell or float limit. |
does cell_size corresponds to face size in blender? e.g. 1000x1000 plane subdivided to 10000 faces, then cell_size is 100. |
The voxel grid size is determined by the Godot world dimensions of your mesh at scale 1.0. |
|
is there any risk using |
Depends on your mesh. In case of your currently used mesh it lacks any consideration for agents so everything will clip and move where it is not supposed to be, it will properly cause a lot of navigation map synchronization issues due to a mismatch of cell layouts, and it is also poorly optimized e.g. look at the valley section, it is basically turned into a navigation grid with hundreds of grid cells what could be a single polygon. That will really tank the pathfinding performance. |
If there are no further questions I think we can close this issue. |
Godot version
4.0.3.stable
System information
Windows 11, CPU: 1th Gen Intel Core i7-11700F, Renderer: Forward+, GPU: NVIDIA GeForce RTX 3060
Issue description
using NavigationRegion3D, the baked navmesh for a 'mountain terrain' is incomplete,
the navmesh cannot cover all area, even if 'agent max slope' set to 90 degree.
otherwise, some area is wired, see blow picture.
Steps to reproduce
1.open project
2.open res://terrain/nav.tscn
3.bake navmesh using $Node3D/NavigationRegion3D
4.incompleted navigation area
Minimal reproduction project
minimal reproduction project
testnavmesh.zip
The text was updated successfully, but these errors were encountered: