Navigation Cell Border Size always rounded up, instead of being set to 0?

Godot Version

4.3.rc3
Windows 10,
Ryzen 5600 & Radeon 7800XT.

Question

Hey all,

is it possible that the NavMesh Parameter “Cells: Border Size” is always rounded up to the (in my case: 0,25) nearest value, instead of being 0 ?

Please see my Settings for the NavMesh #1 itself:


NavMesh #2:

NavMesh #3:

NavMesh #4:

y is always -25 to hit the floor.

This is what it looks in the Editor:

When I set the Node3D of the NavMeshes manually to these values NavMesh#1: x -1,01, NavMesh#3: x: 1, z: and NavMesh#4 to z: 1.

I was able to archive the NavMeshes to connect:

BTW: It looks like there is no connection between 3 and 4, but the NavAgent does not care for that and walks on all 4 NavMeshes, I guess this is due to them already seen as connected by the NavServer because of the NavMeshes 1 & 2.

From the docs:
"In conjunction with the filter_baking_aabb and a edge_max_error value at 1.0 or below the border size can be used to bake tile aligned navigation meshes without the tile edges being shrunk by agent_radius.

Note: While baking and not zero, this value will be rounded up to the nearest multiple of cell_size."

Because I set this to 0 I would think that the NavMeshes connect, also I set Edges: Max Error to 0,1, but there is still a big gap as you can see.

Is this intented or do I miss something obvious ?

Big Thanks in advance! :slight_smile:

The magenta/pink debug is for the edge connection margin. A sign that your edges could not connect the “normal” way by edge key. If your edges connected normally you will not see a special debug and the pathfinding will just do its job.

When I look at your debug visuals for the AABB the gap is because the baking AABB is too small and it adds agent radius offset.

You need to extend the AABB over the size of your intended chunk size, then add the border size. The border size is an inward margin from your baking AABB.

Hey again :slight_smile:

The magenta/pink debug is for the edge connection margin. A sign that your edges could not connect the “normal” way by edge key. If your edges connected normally you will not see a special debug and the pathfinding will just do its job.

Okay, the Pink Debug Line shows that here the Edges could not connect, and falled back to the edge connection margin.
Thats the thing that I should not use. :slight_smile:
Thus is not being Terrain3D, it is just a plane mesh.

When I look at your debug visuals for the AABB the gap is because the baking AABB is too small and it adds agent radius offset.

This. My PlaneMesh (400x400) and NavMeshes are pretty big (100, as shown in the first Screenshots)
I am wondering why the NavMesh gets build with the agent radius offset, because with Cell_Border_Size = 0 & Max_Edge_Error < 1 & Baking_AABB = True this is should not happen, or I am misunderstanding the node.


With the AABB Offset it works, but only into one direction, so I need to Offset all the Navmeshes that I would want to connect into the same axis, since the AABB grow to all axis is only possible by code I guess. This is no Problem.

But I think my Border size is (should be) 0 anyways and so I would not need the AABB Offset.

The Meshes fit pretty perfectly I thought, since their all 100x100 into one direction from 0,-25,0.

If you just use the baking AABB the navmesh will be offset by agent radius. You need a border size to make this work with agent radius. The border size needs to be at least as large as the agent radius because it is an inward margin from the AABB edges.

When you add a chunk size 100 and an AABB size 100 on top, you need to grow that AABB by 100 (which grows it on all sides by 100) and set the border size to 100.

See documentation image here Using navigation meshes — Godot Engine (latest) documentation in English and also the official navmesh chunks demo godot-demo-projects/3d/navigation_mesh_chunks at master · godotengine/godot-demo-projects · GitHub.

Ahh okay, that is the Trick.
This is clearly stated in the Docs:

“With only the baking bound set another problem still exists. The resulting navigation mesh will inevitably be affected by necessary offsets like the agent_radius which makes the edges not align properly.
This is where the border_size property for navigation mesh comes in. The border size is an inward margin from the baking bound. The important characteristic of the border size is that it is unaffected by most offsets and postprocessing like the agent_radius.”

But, at least for me, the explanation from the property “Border Size” in the NavMesh-Node implies that it can be 0, when I have set the Cell_Border_Size to 0 , have a Max_Edge_Error below 1 and use an Baking_AABB. That is a bit confusing.
So imHo the Border Size chould be set to 0,5 or 0,25 by default when creating a new NavMesh, to stop the confusion :slight_smile:

“In conjunction with the filter_baking_aabb and a edge_max_error value at 1.0 or below the border size can be used to bake tile aligned navigation meshes without the tile edges being shrunk by agent_radius.
Note: While baking and not zero, this value will be rounded up to the nearest multiple of cell_size.”

I did not find a way to grow the AABB without attaching a Script and growing it like in the Chunks-Demo, because I only see the AABB Offset in the Editor, I guess there is not yet a way to do this Editor-only ?

The border size can’t be set to a default because there is no default baking AABB. The default “AABB” is whatever bounds over the entire parsed geometry. So you would cut off things for users totally unexpeceted. It only works when users set a baking AABB that makes sense for their projects.

No there is no way to call AABB.grow() from the inspector. Precise AABB placement in the editor with the inspector alone is finicky. The reason the aabb offset property was added so you can just set the AABB to whatever size it needs to be and do the actual placement with the offset without constantly changing both position and size of the aabb.

Yes, okay. :slight_smile:
I still find it a bit confusing, like I already said.

Is it possible that there will be a way in the future to grow the AABB from within the inspector ?

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.