Trouble understanding navmesh parameters

Here is what my scene and navmesh look like:

and here are my parameters:

const parameters = {
    cs: 0.2,
    ch: 0.1,
    walkableSlopeAngle: 0,
    walkableHeight: 0,
    walkableClimb: 0,
    walkableRadius: 0.5,
    maxEdgeLen: 12,
    maxSimplificationError: 1.3,
    minRegionArea: 1,
    mergeRegionArea: 1,
    maxVertsPerPoly: 6,
    detailSampleDist: 6,
    detailSampleMaxError: 1,
  };

Basically, I’m trying to make it so that agents can’t walk through the tables. I assume the red areas are valid walkable areas, and the clear areas are blocked off.

I don’t understand:

  • Why there is a clear section connecting one of the table legs to the statue
  • Why all the table legs are not blocked off
  • How I could make the ground below the surface of the table blocked off

Thanks!

I usually create appropriately sized boxes at the location of obstacles such as tables, merge them with the ground mesh, and then create a navigation mesh.

Unfortunately I don’t think I can go this route in this case, but will keep that in mind, thank you!

Ok I’ve figured out “why all the table legs are not blocked off”: reducing the maxSimplificationError to 0.1 blocks them all off, so they are just too small.

Now I just need to figure out 1) if there’s a way to block off the area below the table and 2) why there’s a line connecting one of the tables to the statue.

EDIT: Figured out the answer to #1, I need to set a walkableHeight > height of table.

Not totally sure which adjustment got rid of the line between a table and the statue, but these parameters seem to give me the result I was wanting:

const parameters = {
    cs: 0.5,
    ch: 0.5,
    walkableSlopeAngle: 0,
    walkableHeight: 4,
    walkableClimb: 0,
    walkableRadius: 0.5,
    maxEdgeLen: 12,
    maxSimplificationError: 0.5,
    minRegionArea: 3,
    mergeRegionArea: 5,
    maxVertsPerPoly: 6,
    detailSampleDist: 6,
    detailSampleMaxError: 1,
  };

1 Like

Hi!
I’m glad you solved the issue. Here is a tip to see how various parameters affects the navmesh. You can create a debug navmesh which is the calculated mesh actually used to navigate (not your source navmesh). I used to put it slighlty above my source navmesh and make it transparent.

    const navmeshdebug = navigationPlugin.createDebugNavMesh(this.scene)
    navmeshdebug.position = new Vector3(0, 0.1, 0)
    const matdebug = new StandardMaterial('navdebug', this.scene)
    matdebug.emissiveColor = new Color3(0, 0, 1)
    matdebug.diffuseColor = new Color3(0, 0, 1)
    matdebug.alpha = 0.6
    navmeshdebug.material = matdebug

:vulcan_salute:

2 Likes

Thank you, yes, that’s what the red is in the photos

1 Like

See also: Digesting Duck: Recast Settings Uncovered

3 Likes

Very cool! Thanks!