RichAI getting stuck on stairs

First, let me just say that the A* Pathfinding project is awesome!

I’m having issues where the RichAI component is not working well for compact staircase situations. The actual path A* finds is valid, but the approximation that the RichAI component does to find the sensible/ smooth path is not working well and causes the characters to get stuck, or fall down the stairs.

Thanks for any help or advice. I’m thinking of modifying the RichAi to take less of an averaged smoothed path when the change in y for a path section is greater than the change in x and z.

I’ve recorded a small video demonstrating this behavior:

RichAI Issue

what type of graph are you using? are you running any modifiers on the path?

the first thing i’d do to troubleshoot is to remove any type of path smoothing to see if the enemy successfully draws a path up all the stairs. if that still catastrophically fails, perhaps exploring the use of a point graph would be ideal.

1 Like

Do you think you could post a screenshot of your graph?

It’s a recast graph, and there are no modifiers. Yes, the path, which can be seen in the video as the green debug lines is successful. The smoothed path, blue line that RichAI creates, is not. Just lerping between the points works.

Hi

Sorry, I was unclear. I meant a screenshot of the graph in the scene view. In particular around the problematic area.

Gotcha. Here are some screenshots. Also, the video at this time, shows the graph in the scene: https://youtu.be/jTWYMbTscmc?t=131

Hmmm… That’s odd.
Would it be possible to share a small example scene with me that allows me to reproduce the issue?

Yes, let me prepare a small project for this and send it you over email.

I’ve sent you a reproduction project via gmail. Oddly enough, it looks like the issue could be related to custom Recast Graph bounds. I only was able to reproduce the issue when I set a custom bounds, rather than using the snap bounds feature.

Hi

I checked the scene. It looks like this is caused by a navmesh with too small margins.
When the stair turns there are two triangles that line up exactly when seen from above, but they differ in y coordinate. However since they line up on one vertex the system cannot really decide if they should be connected or not. In this case it does decide they should be connected and thus we get this odd behaviour.

The inspector does show a warning that your settings are not optimal.

and indeed if I change the radius to 0.5 the problem disappears (and I think it cannot possibly happen with those settings).

1 Like

Thank you Aron for root causing the issue.