Sign in to follow this  

RTS with lots of units

This topic is 2810 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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
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
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

This topic is 2810 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

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