Calculating routes with other point graphs

Hi Aron,

We are running a multi-agent simulation of just over 50 agents in a 3D environment, where we’ve implemented them to have an updating knowledge based on where they travel.
Because of this, we are calculating routes with other point graphs besides the first one (with the use of the A* Pathfinding Project).
The problem we are currently having is a delay where the agents do not move simultaneously when the simulation begins…

The version we have been using is 3.8.6, would a updated project version help provide for smoother multiagent movement? Or are there other recommendations you’d suggest?

Normally path calculations are spread out over several frames to reduce the potential for frame rate drops. If you want you can force paths to be calculated immediately. You can do this by calling AstarPath.WaitForPath(path) with the path object.

var path = seeker.StartPath(...);
AstarPath.WaitForPath(path); // In 3.x
// in 4.x you should instead use path.BlockUntilCalculated();

If you haven’t already I’d also recommend enabling multithreading in A* Inspector -> Settings.

Thank you for your help, we’ve now been able to fix that problem.

But since we are simulating for 53 agents with each using graphMasks (of int32 bit).
As a result the A* pathfinding doesn’t seem to work when we are simulating for over 32 agents.
Is there a way we could work around this?
Thanks again.

Hi

Do you need over 32 graphs, is that what you are saying?
You are sure you don’t mean the tag mask?

Sorry, yes was referring to needing over 32 graphs.

May I ask, why do you need that many graphs?

(also, your issue can be solved by creating a custom class which inherits from PathNNConstraint, override the SuitableGraph method and do whatever logic you want in there, then you can assign the path.nnConstraint field to an instance of your custom constraint.).