Support Forum

RichAI agents periodically start and stop

Hello hello!

Camp Canyonwood is our second game that plans to ship using this A* package. We love it. I am having some weird behaviours though.

Because our game map is pretty large, we don’t populate it with nearly anything at the start of the application (trees, rocks, flowers, etc.). We’ve chosen to populate all of those objects around the player about every 2 seconds in a roughly 200x200 square. Because A* does an initial scan on awake of our empty map, we choose to almost exclusively use graph updates rather than scans to keep up the A* graph around our “treadmilling” populated terrain.

The trouble I’m running into is that A* agents told to follow the player will do so in stops and starts, seemingly at intervals, but not quite the same interval as the graph updates. I played with the repath rate (now called autopath interval) on these agents following the player - I turned it up and down and even let it go dynamic. This seemed to have no impact on the behavior.

Is there a suggested way to have relatively frequent recast graph updates without causing this start-and-stop behavior? Are the two even related? This didn’t happen when our map had fixed trees/rocks/flowers. The agents navigated A-okay, and we even did occasional graph updates when the player placed a structure in the map. Any ideas on why this happens?

Update: I can reduce the frequency with which the agents pause, and the length of that pause, by increasing the number of pathfinding threads from 1 to 2. I’d say this would be the result of waiting for new paths, but the problem doesn’t get better or worse if I specifically change the autopath rate on these agents. How are both of these true simultaneously?