Peformance Problem when using 4000 agents

Hello,
I am trying to make an RTS game with huge number of objects moving and doing stuff around. For Map Navigation, i have used unity’s inhouse navigation system but it does not perform well. I have been trying the free version of A* project, and it really can calculate 4000 paths very fast, even in a single thread. But moving the agents proved to be a bottleneck, it took 11 ms on average to move them everyframe. For free version, the problem was the movement is done in Update() cycle, and inefficient. I read somewhere in beta versions, the A* project is getting updated to use more job and burst features. I was wondering does it include the movement of the agents? If not, is there any way that i can easily get access the movement logic, so i can implement it myself in job system.
Thanks a lot in advance, and really nice done tool, i love it <3

Hi

The beta version does not do anything about the performance of movement scripts. They are still implemented using MonoBehaviors. 4000 agents is a lot, and handling that using MonoBehaviors is going to be very tough.
If you want to write a custom movement script, there are ways of doing that. See https://arongranberg.com/astar/docs/custom_movement_script.html for a tutorial on how to write a (very simple) movement script. There some other users who have written movement scripts for their games using DOTS.

1 Like

Thanks a lot for the fast response! I already got that part of documentation opened while i was writing my question, guess i was too tired to realize :sweat_smile:. Awesome tool and thanks a lot!