Jump to content
  • Advertisement
Sign in to follow this  
wizardpc

Help, I've optimized too much!

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

So my game was running around 50 FPS, but then I reworked my terrain by implimenting GeoMipMapping, and sending my entity draw calls to a frustrum check instead of just rendering all entities.

 

I'm now pushing 170 fps, and my laptops fan ramps up and gets loud.  I'm assuming this will cook the GPU after a while.

 

Is there a way to figure out how much to sleep given the FPS? I want to get it back down to 60ish fps (or some lower value).

Share this post


Link to post
Share on other sites
Advertisement

Probably just waiting on VSync would do it.

 

If you are using DirectX lookup the present parameters and something like D3DPRESENT_INTERVAL_ONE.

 

So if your monitors refresh rate is 60hz.  Then your FPS will be 60 at most.

 
That would be a pretty straight forward way to limit your FPS.
 
For lower values there is D3DPRESENT_INTERVAL_TWO and THREE i think.
 
For sleep times you could just track your frame and sleep until 1/60th of second as passed; That sounds kinda weird to me though.
 
 
 
 
 
Edited by HAM

Share this post


Link to post
Share on other sites

Well the concept is the same.  Just wait on vsync.  I'm sure there is a way to do it in openGL.

 

A quick google search shows wglSwapIntervalEXT as an extension.  Unsure if that is what you should use.  But I'm sure you can figure it out.

Share this post


Link to post
Share on other sites
So my game was running around 50 FPS, but then I reworked my terrain by implimenting GeoMipMapping, and sending my entity draw calls to a frustrum check instead of just rendering all entities.

 

I'm now pushing 170 fps, and my laptops fan ramps up and gets loud.  I'm assuming this will cook the GPU after a while.

 

Is there a way to figure out how much to sleep given the FPS? I want to get it back down to 60ish fps (or some lower value).

Really? they didn't buzz before. I mean before rework... The CPU usage would be the same with or without optimization with your description so strange...

Share this post


Link to post
Share on other sites
So my game was running around 50 FPS, but then I reworked my terrain by implimenting GeoMipMapping, and sending my entity draw calls to a frustrum check instead of just rendering all entities.

 

I'm now pushing 170 fps, and my laptops fan ramps up and gets loud.  I'm assuming this will cook the GPU after a while.

 

Is there a way to figure out how much to sleep given the FPS? I want to get it back down to 60ish fps (or some lower value).

Really? they didn't buzz before. I mean before rework... The CPU usage would be the same with or without optimization with your description so strange...

I'm not sure why you would assume his CPU load would be the same when he runs at 50 FPS vs 170 FPS, but it is not relevant.  He asked how to limit his FPS.  

Share this post


Link to post
Share on other sites
So my game was running around 50 FPS, but then I reworked my terrain by implimenting GeoMipMapping, and sending my entity draw calls to a frustrum check instead of just rendering all entities.

 

I'm now pushing 170 fps, and my laptops fan ramps up and gets loud.  I'm assuming this will cook the GPU after a while.

 

Is there a way to figure out how much to sleep given the FPS? I want to get it back down to 60ish fps (or some lower value).

Really? they didn't buzz before. I mean before rework... The CPU usage would be the same with or without optimization with your description so strange...

I'm not sure why you would assume his CPU load would be the same when he runs at 50 FPS vs 170 FPS, but it is not relevant.  He asked how to limit his FPS.  

 

Thanks HAM, i'll take a look at what you said earlier.  Yea, I'm not multithreaded, so my update and render functions are right after eachother.  Now that I'm pushing 200 FPS, the fan gets really really loud, so I just read up on it, and basically you gave me some good keywords to google search.  I'm wasting cycles drawing the scene that aren't going to matter anways since I'm limited by the refresh rate. 

 

So If I limit my frames to 60 per second, should I only be limiting my Render function (that renders the scene) or both update and render functions.  Update functions handles all game updates, moving objects, AI, etc......  I'm also single threaded.  This is a small game really.  I'm just kinda asking what the best advice is when limiting FPS.

Share this post


Link to post
Share on other sites
So If I limit my frames to 60 per second, should I only be limiting my Render function (that renders the scene) or both update and render functions.  Update functions handles all game updates, moving objects, AI, etc......  I'm also single threaded.  This is a small game really.  I'm just kinda asking what the best advice is when limiting FPS.

 

Well since you can run at 200 FPS that means you are not CPU bound.  And for simplicity sake why not just keep it like you have it.  

 

Lock to vsync.   This will lock you state updates, input, and rendering.  If you start wanting to run at lower than 60 that is when it might become a concern for your input timings.    But you'll create more input woes if you want to start threading anyway, so why not keep it as simple as possible until you need something more.

Share this post


Link to post
Share on other sites
So If I limit my frames to 60 per second, should I only be limiting my Render function (that renders the scene) or both update and render functions.  Update functions handles all game updates, moving objects, AI, etc......  I'm also single threaded.  This is a small game really.  I'm just kinda asking what the best advice is when limiting FPS.

 

Well since you can run at 200 FPS that means you are not CPU bound.  And for simplicity sake why not just keep it like you have it.  

 

Lock to vsync.   This will lock you state updates, input, and rendering.  If you start wanting to run at lower than 60 that is when it might become a concern for your input timings.    But you'll create more input woes if you want to start threading anyway, so why not keep it as simple as possible until you need something more.

Yes thanks, I've learned a bit with this thread.  I'll keep things the way it is, and try to reduce the fps to 60.  I'm at work at the moment, so I'll have to give it a go tonight.

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!