Page 1 of 1

maintaining desired framerate?

Posted: Fri Oct 02, 2009 5:40 am
by CR4SH3D
How do you maintain a constant framerate? im using the timers lib for a couple of simple timers but the framerate keep fluctuating visibly atleast, i tried adding timer.sleep(10) and it didnt really do much :(

Re: maintaining desired framerate?

Posted: Fri Oct 02, 2009 6:17 am
by Robin
There is not much you can do about that. Other processes use your CPU as well, and their use differs. You can't count on the framerate to be constant. If you want your game to be independent of framerate (which you most certainly will), you can use dt, as you probably know.

Re: maintaining desired framerate?

Posted: Sat Oct 03, 2009 3:49 am
by zugamifk
Really, just optimize your code as much as you can. You can never be too optimized.

Re: maintaining desired framerate?

Posted: Sat Oct 03, 2009 7:19 am
by Robin
zugamifk wrote:You can never be too optimized.
Mr Knuth does not agree. ;)

Re: maintaining desired framerate?

Posted: Sat Oct 03, 2009 11:15 pm
by rude
Adding love.timer.sleep(10) somewhere should help, though. Did you add it somewhere in the call chain of update()?

Re: maintaining desired framerate?

Posted: Mon Oct 05, 2009 5:26 am
by Jasoco
Robin wrote:
zugamifk wrote:You can never be too optimized.
Mr Knuth does not agree. ;)
I do though. I've sped up my game a bit by taking a step back and looking at what can be fixed up to make it squeeze out a few more FPS.