RichAI.UpdateTarget() / RichFunnel.Update() performence

Hi Aron.

I’m profiling our game, and i’m my agents spend a lot of time when running UpdateTarget() (this happens every frame), with the majority of time spent in RichFunnel.Update().

Can you shed some light on the proper usage of these functions? What exactly is being done there, and if this really needs to happen every frame.

I’m not using RichAi specifically, but a modified version of it.




The Update method will calculate the next corner the agent should move to in the path. It also makes sure that the agent stays on the navmesh.
It is usually pretty fast (somewhere between 2 and 100 microseconds on my machine, can’t remember exactly), but it will slow down a lot if you the agents are being pushed outside the navmesh because then it has to do a lot of processing to figure out where the closest point on navmesh is. Is this the case in your game?

Thanks for the reply.

I think it ended up being something else, but the profiler was just lying to me.

The character aren’t supposed to leave the nav mesh, and I haven’t seen them do so at all,
we have RVO implemented along with RVONavMesh script, so there isn’t really a reason for that to happen.

Again, in any case, this is no longer an issue, but I’m happy to know what these functions do.

1 Like

Ah ok. Great that it is working now.