Jump to content
  • Advertisement

This topic is 477 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

I'm a college game design major, but I have also picked up on some basic programming.  I've done some stuff in Javascript, AS3, Visual Basic, Stencyl, and I'm now moving into using C# in Unity.  Just as a general programming question, what are some tricks/techniques that any programmer can do, regardless of coding language, to make sure that their game runs as smoothly as it possibly can, in terms of frame rate?

Share this post


Link to post
Share on other sites
Advertisement

Profile your code regularly. Budget out your frametime -- e.g. if you want to run at 60Hz, that's 16.67ms per frame, so divide that up between different game systems and then make sure you stay within your budgets. Run / test / measure on your minimum spec hardware. Optimize for the worst case, don't worry about the average or best case. The average case behavior of an algorithm doesn't matter if the worst case will blow your performance budgets. In managed languages (e.g. C#), do not generate garbage for the GC to pick up. GC time is highly variable, so the only way to keep it in line is to not produce any garbage during gameplay - don't create/destroy temporary objects, cache them and reuse them again and again.

Share this post


Link to post
Share on other sites

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