Recast graph PathPending taking multiple seconds

I’m still trying to narrow this problem down, but I have some AI that seem to get stuck with PathPending for a few seconds, then it clears up on their own. It seems to happen to all the AI at the same time, sort of like all the AI are stuck trying to calculate a path at the same time.

It’s all happening inside Opsive behaviour tree/tasks.

And it doesn’t happen all the time so it’s a bit tricky to narrow down.

Note that I do dynamic graph updates which may be related. For example, my AI are clearing vegetation from the map, when they clear something there is a graph update. The problem seems to be happening only when AI are clearing vegetation.
I’m currently running with 4 graphs for different size agents.

I also do graph updates when I place buildings, but that doesn’t seem to be causing any issues.

Any suggestions on what to look for?

After more testing the main problem seems to be when adding navmesh back after having removed an object that previously caused a cut, but when adding objects and updating the graph to make new cuts that is fast.

Will keep looking.

1 Like