Hi,
Is there a way to set FPS for a game, like I want to set FPS (60) for a game? Would appreciate any feedback.....Thanks and God Bless....
Sincerely,
Sunday
Set FPS ().......?
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
Re: Set FPS ().......?
No. There is no way to guarantee that "love.update" will always be executed in under 1/60 of a second. It may take longer depending on the machine and your Lua code. That's why we have "dt".
Re: Set FPS ().......?
There's this:
https://love2d.org/wiki/love.timer.sleep
https://love2d.org/wiki/love.timer.sleep
https://github.com/Sulunia
Re: Set FPS ().......?
Hi Ivan and Sulina,
Thanks for the information, really appreciated it....So I can use:
function love.update(dt)
if dt < 1/30 then
love.timer.sleep(1/30 - dt)
end
end
and set it to if dt < 1/60 then
love.timer.sleep(1/60 - dt) and this will set my FPS to 60 for the game?
The reason I'm asking is that I'm very interested in using Lua2 for mobile games ( IOS / Android ) and also Desktop, but would really love the ability to set p my FPS to 60, even though, I still need to optimized code......Thanks again for your help.....God Bless....
Sincerely,
Sunday
Thanks for the information, really appreciated it....So I can use:
function love.update(dt)
if dt < 1/30 then
love.timer.sleep(1/30 - dt)
end
end
and set it to if dt < 1/60 then
love.timer.sleep(1/60 - dt) and this will set my FPS to 60 for the game?
The reason I'm asking is that I'm very interested in using Lua2 for mobile games ( IOS / Android ) and also Desktop, but would really love the ability to set p my FPS to 60, even though, I still need to optimized code......Thanks again for your help.....God Bless....
Sincerely,
Sunday
Re: Set FPS ().......?
You also need to disable vsync in [wiki]conf.lua[/wiki] or with [wiki]love.window.setMode[/wiki].
Re: Set FPS ().......?
Sunday, if you want to have a "fixed time step" in your game,
it's usually done using "accumulators":
http://gafferongames.com/game-physics/f ... -timestep/
PS. Note: accumulators do not guarantee that your game runs at 60 FPS.
Accumulators simply ensure that the math works out nicely,
so you can avoid imprecise floating-point math due to varying "dt".
it's usually done using "accumulators":
http://gafferongames.com/game-physics/f ... -timestep/
PS. Note: accumulators do not guarantee that your game runs at 60 FPS.
Accumulators simply ensure that the math works out nicely,
so you can avoid imprecise floating-point math due to varying "dt".
Re: Set FPS ().......?
Hi,
Thanks for all the help guys / gals, much appreciated it......By any chance, do you know if Love2d supports, Game Circle, Game Center or IAP integration? Or this is something in the near future that will be supported.....? Thanks for the help and God Bless....
Sincerely,
Sunday
Thanks for all the help guys / gals, much appreciated it......By any chance, do you know if Love2d supports, Game Circle, Game Center or IAP integration? Or this is something in the near future that will be supported.....? Thanks for the help and God Bless....
Sincerely,
Sunday
Re: Set FPS ().......?
If you want your game to run at 60 FPS, just turn on vsync.
And there was a guy messing with mobile ads in love2d. I'll find the link later and edit this post here for you.
And there was a guy messing with mobile ads in love2d. I'll find the link later and edit this post here for you.
https://github.com/Sulunia
Re: Set FPS ().......?
Here's a crude way to set the approximate FPS. This method requires modifying love.run.
Use "q" to decrease the desired FPS by 5 fps and "e" to increase by 5.
Use "q" to decrease the desired FPS by 5 fps and "e" to increase by 5.
- Attachments
-
- FPS.love
- (798 Bytes) Downloaded 441 times
PM me on here or elsewhere if you'd like to discuss porting your game to Nintendo Switch via mazette!
personal page and a raycaster
personal page and a raycaster
Re: Set FPS ().......?
Hi Davidobot,
Thanks for the quick love script, much appreciated it.....Also, thanks everyone for their help.... I just downloaded the .love framework, I have a Mac OS X 64 Bit, but I have a question though, I see that the .love file is 11.6 MB, so when I finish the game, and I packaged it to a platform, will this be included as well, I mean the 11.6 MB with the final export, so if I have a games that's like 20 MB, it would be then 30+ MB at the end?
Thanks and God Bless...
Sincerely,
Sunday
Thanks for the quick love script, much appreciated it.....Also, thanks everyone for their help.... I just downloaded the .love framework, I have a Mac OS X 64 Bit, but I have a question though, I see that the .love file is 11.6 MB, so when I finish the game, and I packaged it to a platform, will this be included as well, I mean the 11.6 MB with the final export, so if I have a games that's like 20 MB, it would be then 30+ MB at the end?
Thanks and God Bless...
Sincerely,
Sunday
Who is online
Users browsing this forum: Google [Bot] and 5 guests