getFPS

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
pielago
Party member
Posts: 142
Joined: Fri Jun 14, 2013 10:41 am

getFPS

Post 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 :)
User avatar
HugoBDesigner
Party member
Posts: 403
Joined: Mon Feb 24, 2014 6:54 pm
Location: Above the Pocket Dimension
Contact:

Re: getFPS

Post 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 ;)
@HugoBDesigner - Twitter
HugoBDesigner - Blog
User avatar
Zilarrezko
Party member
Posts: 345
Joined: Mon Dec 10, 2012 5:50 am
Location: Oregon

Re: getFPS

Post 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:
pielago
Party member
Posts: 142
Joined: Fri Jun 14, 2013 10:41 am

Re: getFPS

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

Who is online

Users browsing this forum: Ahrefs [Bot] and 4 guests