Nav Mesh Agent Predictability

We have 5 different cars and we set their nav mesh agent input parameters at the start. They cross the finish line and the output can be defined by:

  1. Ranking
  2. Relative distance to each other.
  3. Relative time to each other

We are looking for the exact same, predictable output every time i.e. if we set the same parameter values again as input, they should follow the exact same paths and have the same output values over the entire race. That doesn’t seem to happen now. Any pointers?

That’s intended behaviour. You’re not going to get predictable behaviour because it’s physics.
Part of the beauty of the system is that it can feel realistic.

There’s only a couple of ways you could achieve what you’re after.

  • Give advantage to agents falling behind so they catch up eg. Greater acceleration & top speed.
  • Do the opposite for agents getting too close, reduce their acceleration and top speed.

The alternative is to hard code your car movement so the cars follow a bezier like animation instead of using the agent.

NavMeshAgents will never be predictable on their own.