Page 1 of 1

getFPS

Posted: Thu Apr 24, 2014 4:13 am
by pielago
i have used

Code: Select all

love.graphics.print("Current FPS: "..tostring(love.timer.getFPS( )), 0, 30)
the question is what is this code???
Can someone explain what this does in love2d? whats the main purpose? i don't have it clear yet..
and was hoping someone here can explain it to me i know its good when its FPS 60 but still not sure why 60?
is it like DT??? delta time or no???
p.s hope to get a simple answer for me to understand it :)

Re: getFPS

Posted: Thu Apr 24, 2014 6:16 am
by HugoBDesigner
FPS means "Frames Per Second"; it measures how many frames from your game your computer is drawing in a single second. The minimum good value for it is around 30 (at this point our eyes can still see smooth movements).

It is highly affected by computer processing's capability and memory usage, so the more images/calculations you game have to make, the smaller your FPS and the image quality of your game will be.

For technical purposes, it is just demonstrative. It doesn't change your game environment in any way, but it can help you a lot to analyze whether or not your game is running smoothly ;)

Re: getFPS

Posted: Thu Apr 24, 2014 6:31 am
by Zilarrezko
FPS is technically how many times the love.draw function is called. When the fps gets low like about 10 frames or even 15 or higher you can see a noticeable lag time between the frames.

dt eliminates the diverse processing power of different computers to update everything at a constant among all computers to help in times when your FPS drops(if your FPS drops, then not only is the frequency at which love.draw is called drops but so does love.update, causing things like movement to slow)

if your FPS is below 20 and your game is relatively simple, then either your processor needs an upgrade or most likely you have a problem in your code such as too much unneeded calculations in your love.update.

Hope I helped, Good luck in the future, and have fun! :awesome:

Re: getFPS

Posted: Thu Apr 24, 2014 4:55 pm
by pielago
thank you soooooooo.. much for the answers...
No wonder it was slow and had alot of code and it was simple and saw it laggy!! fps ( 10 to 70 ) all time never 60 :o
this great info for me or anyone with similar problems...
also wonder if to many images helped to slow it down???
well will have to use less images hope that can work ...