This is a follow up to AStar - RecastGraph, RichAI - Performance?
I’m seeing some very erractic behaviour from agents. Agents find and take the correct path, but at some point along the path they circle back for a bit before continuing on their path. This can happen 0-4 (give or take) times in the same spot before they continue on their path.
I currently have it set so that SearchPath() is called 1x when the agent starts. WallForce/Dist are set to 0 (but the problem also happens with those set to default). But the same behavior is visible when the agents are set to “Dynamic, at least every 10s, Sensitivity 10”. I’ve taken a video with this setting:
According to the gizmos, there’s nothing visibly wrong in this spot:
This isn’t tied to the fact that the agents are very close to their destination (in terms of line of sight) at that point. Neither is it tied to the complexity of the path. I can replicate it (less reliably) when their path is a very very long straight line as well, where they issue happens when the agents are still about 20 units away from the destination.
Since it also isn’t a matter of the agents re-calculating their path (again, it also happens when they calculate a path only 1x, when they start out), or an issue with local avoidance (as you can see, the first agent exhibits this behavior alone) I am at a loss.
The issue goes away if I set the agents to recalculate their path every 2 seconds.
If I set it to every 4 seconds, then the issue appears, in a “milder” form. The agents either stop in that spot for half a second, or they turn around and go back half the distance that they would at 10 seconds.