I have done it! I have managed to get 1000 units moving around the screen at one time at a solid 60fps on my pc. For some reason though its only in HWA mode, I have no real idea why this is faster as it was mainly the pathfinding that made it lag so much, I guess just redrawing the 1000 units made it faster? *shrugs*
I can actually get nearly 1200 units, but that doesnt really matter.
I have got my basic pathfinding code down to about 6 lines at the moment, however this will likely increase once I start implementing additional features.
It also still lags for a second or two if lots of units try to find a new path at the same time. This will happen if I have say 300 units selected and click for a new destination. I am trying to reduce this so its not noticable. I think I can do this by splitting the units into smaller groups and finding a path for each group at one time, allowing me to split the pathfinding over several game frames. If this and nothing else works then I guess I will just limit the number of units that can be selected at one time (not what I want to do).
|
|