Pathfinding idle / performance - Using grid with AiPath

Hello Aron,

You may remember me by that post: Doubt-about-rvo-and-aipath
I am saying this because it can be related.

I am still using the old version 3.8.5 because of that problem described in the post above (I did not test new version to see if it can run). But I am having a few problems with the A* that, in the long run, it can be a bigger problem. My game is a village building, so I have around 30-50 units, always. All works good, I implemented everything you say/suggest to make each unit on the ground.

During my Load Game call (only here, after this all runs good because I handle how many calls each unit makes), after finishing it, all units will start to call the pathfinding for next actions. Having around 25 units, they just keep in place for a few seconds before really moving (I assume they are running the pathfinding system). A quick fix (not really the best one) is just having a way to check if they are stuck in your pathfinding system trying to find the best path. I saw this on the new version: AstarPath.active.ScanAsync - which I think it can solve it for me. But still, they will be idle for a few seconds (4-8) and I will just “mask” the problem with another loading screen for the player.

Is there any suggestion you can give to me to work around this? Do you recommend to me to change the version, even if I need to write again the ground check logic?
I am using RVO Controller, Seeker and AiPath for the units path logic, together with my own scripts for the AI, path calls and ground check (which is not my “bottleneck” for performance (graphics is), but anything it can help since the game becomes bigger).

Thank you.

Hi

The issue is that all the units are trying to calculate their paths at the same time, and that seems to take some time.
You can enable logging (A* Inspector -> Path Log Mode) to check how long each path request takes.
If you haven’t enabled multithreading (A* Inspector -> Threads) I suggest that you do that.

It seems to take a really long time for your units to calculate their paths though, if it takes say 4 seconds for 25 units to calculate their paths that would mean each path would take around 160 ms which is a very long path (or there is something else that is taking a very long time, check the log messages as indicated above).

Is the FPS of the game also low during this time?

That will not solve it. It is not being blocked by the graph generation taking a long time, it seems to be blocked by the pathfinding speed.

Hello Aron,

FPS is the same (no real impact), so it is odd. It only happens after I load the game and make them try to walk. After that, with the game running, all works good normally (no big delays). I tried to disable the AiPath and RVOController before I do any action, but no result. I am trying other things now, lets see. Thank you