Where in source does A* Pro handle stairs and slopes in generating Recast graph?

Where in source does A* Pro handle stairs and slopes in generating Recast graph? Thanks in advance.

That depends a bit on what you mean. Slopes are primarily handled in VoxelRasterization.cs line 239.

    _
  _|
_|
    _
  _/
_/
   _
  /
_/

I would like to customize the generated NavMesh position in Recast graph, for cases of above shapes.
I have not decided how it exactly looks like until I have performed a simple research.

Hi

I think that would be pretty tricky to do. The recast graph rasterizes everything to a single voxel representation (think minecraft, but with much smaller blocks) and then generates a navmesh from that. I think an easier way if you want smooth stairs would be to give the recast graph a collider which is just a slope instead of a stair mesh.

I know it. Since all is in voxels, I wonder if there is a way to adjust maybe several or more voxels so that it would tailor to my needs.

Here is the difference for slopes between A* and native NavMesh with same Recast parameters.
I would like to at least make them the same and maybe make customized smooth for stairs.

Hi

It’s hard to say what the exact difference is between Unity’s system here and my system.
One thing that they might have done is to modify recast to take the y coordinate into account when simplifying the mesh border. This is done in VoxelContour.cs in the SimplifyContour method. The middle loop uses the Douglas–Peucker algorithm to simplify it, however it only uses the x and z coordinates. I am not sure why this is the case, I have been thinking of making the same modification. It might cause some issues at tile borders perhaps…
You can also reduce the ‘max segment length’ in the recast graph settings.

Usually you want to avoid using the navmesh for height information though and instead use the physics engine for that.