maintaining desired framerate?

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
Post Reply
User avatar
CR4SH3D
Citizen
Posts: 67
Joined: Mon Mar 02, 2009 6:00 pm
Location: England
Contact:

maintaining desired framerate?

Post 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 :(
User avatar
Robin
The Omniscient
Posts: 6506
Joined: Fri Feb 20, 2009 4:29 pm
Location: The Netherlands
Contact:

Re: maintaining desired framerate?

Post 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.
Help us help you: attach a .love.
User avatar
zugamifk
Prole
Posts: 28
Joined: Sun Jul 26, 2009 4:01 pm

Re: maintaining desired framerate?

Post by zugamifk »

Really, just optimize your code as much as you can. You can never be too optimized.
User avatar
Robin
The Omniscient
Posts: 6506
Joined: Fri Feb 20, 2009 4:29 pm
Location: The Netherlands
Contact:

Re: maintaining desired framerate?

Post by Robin »

zugamifk wrote:You can never be too optimized.
Mr Knuth does not agree. ;)
Help us help you: attach a .love.
User avatar
rude
Administrator
Posts: 1052
Joined: Mon Feb 04, 2008 3:58 pm
Location: Oslo, Norway

Re: maintaining desired framerate?

Post by rude »

Adding love.timer.sleep(10) somewhere should help, though. Did you add it somewhere in the call chain of update()?
User avatar
Jasoco
Inner party member
Posts: 3725
Joined: Mon Jun 22, 2009 9:35 am
Location: Pennsylvania, USA
Contact:

Re: maintaining desired framerate?

Post 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.
Post Reply

Who is online

Users browsing this forum: No registered users and 45 guests