Jump to content
  • Advertisement
Sign in to follow this  
NukeCorr

RTS with lots of units

This topic is 3028 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
Advertisement
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
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
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
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!