Sign in to follow this  
NukeCorr

RTS with lots of units

Recommended Posts

NukeCorr    159
Hey. I'm making a RTS. It has currently working gameplay, etc. Tested on dualcore processor, it can run about 100 active units with smooth fps. Tested on quadcore, it can run about 300 active units with smooth fps. But with lots of, like +400 units, the fps starts to drop critically. How could I improve the code so that the fps would not drop so much. Should I do some priority for units that compute some specific units at different times or compute like half of the current active units instead of all of them at the same time? I hope you get what I mean...

Share this post


Link to post
Share on other sites
haegarr    7372
You gave too less details to allow judging what can be done at best. What does "compute a unit" mean? Is there a full run of AI done for every unit and every rendered frame? Or is rendering the units itself the bottleneck? Or...

Share this post


Link to post
Share on other sites
nullsquared    126
It depends on what part of the units is causing the slowdown. Use a profiler to find out what part exactly is causing the slowdown when you add more units.

Share this post


Link to post
Share on other sites
EnochDagor    180
Make sure it is not your game logic stuff (movement, ai, collision, etc...). To check, disable your game logic stuff in your main loop and see what happens (make a command for spawning units and such).

If it is not your game logic then your next bet is likely your draw routines (the way you are rendering the models). However, it could simply be your PC config.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this