Page 3 of 5

Re: Capped frame limit for no reason *sigh*

Posted: Mon Oct 20, 2014 4:47 pm
by zorg
just a fyi; love.timer.sleep() is imprecise at best so that could be a reason if you are calculating the sleep times like that; but this is just a guess.

Re: Capped frame limit for no reason *sigh*

Posted: Mon Oct 20, 2014 5:01 pm
by pacman
It worked like a charm for weeks and it works on other OS and for other people :?
Also after commenting these lines I get same fps cap with random it_works_too_fast spikes.

Re: Capped frame limit for no reason *sigh*

Posted: Mon Oct 20, 2014 9:03 pm
by arampl
Well, I copied standard function love.run() from Wiki page and commented out line "if love.timer then love.timer.sleep(0.001) end" at the end.
And now it shows 125 FPS (Windows 7 64-bit and Xubuntu 13.10 64-bit)

Though I don't understand what is the purpose of this line...

Re: Capped frame limit for no reason *sigh*

Posted: Tue Oct 21, 2014 12:35 am
by caldur
arampl wrote:Well, I copied standard function love.run() from Wiki page and commented out line "if love.timer then love.timer.sleep(0.001) end" at the end.
And now it shows 125 FPS (Windows 7 64-bit and Xubuntu 13.10 64-bit)

Though I don't understand what is the purpose of this line...
Tried and didn't work on my box... and I actually would be surprised if it did :?

And seriously, I can understand the need for a higher update rate (in cases like fighting games, more frequent input polling makes sense), but the fps beyond 60 is not that useful; in terms of eliminating temporal aliasing or screen shuttering, using interpolation would be a better approach (and more efficient if taking things like power consumption into consideration)

Re: Capped frame limit for no reason *sigh*

Posted: Tue Oct 21, 2014 3:30 am
by zorg
arampl wrote:Well, I copied standard function love.run() from Wiki page and commented out line "if love.timer then love.timer.sleep(0.001) end" at the end. (...) Though I don't understand what is the purpose of this line...
Run your project, then open the equivalent of a task manager on your OS; you will probably see one of your CPU cores being consumed 100%... that is unless vsync is enabled, i think.
caldur wrote: And seriously, I can understand the need for a higher update rate (in cases like fighting games, more frequent input polling makes sense), but the fps beyond 60 is not that useful; in terms of eliminating temporal aliasing or screen shuttering, using interpolation would be a better approach (and more efficient if taking things like power consumption into consideration)
I actually solved this problem for myself with a custom game loop / love.run function, but i needed to bork some things in the process; namely love.timer.getDelta and getAverageDelta. (or i could have just borked getFPS though; but either one or the other)
*In the pastebin'd file, i commented out love.timer.sleep for experimental purposes; it works both ways though, and there are some vars that are pulled in from other files as well, so this isn't an out-of-the-box working snippet :3

Re: Capped frame limit for no reason *sigh*

Posted: Tue Oct 21, 2014 4:05 am
by caldur
zorg wrote: I actually solved this problem for myself with a custom game loop / love.run function, but i needed to bork some things in the process; namely love.timer.getDelta and getAverageDelta. (or i could have just borked getFPS though; but either one or the other)
*In the pastebin'd file, i commented out love.timer.sleep for experimental purposes; it works both ways though, and there are some vars that are pulled in from other files as well, so this isn't an out-of-the-box working snippet :3
Yep, that's basically what I do in my projects, too. The thing about timestep is, there is the constant issue of decoupling it from rendering vs. making things look smooth, and also maintaining fixed timestep vs. catering to low perf machines... and above all better keep it simple and straightforward.

That sleep for 1ms is just to prevent rendering from going crazy without limits I assume...

Re: Capped frame limit for no reason *sigh*

Posted: Tue Oct 21, 2014 4:40 am
by zorg
It's more like for the process to not hog your processor as i've said; and if i remember correctly, if you do have vsync on in your conf.lua, then you shouldn't sleep it; otherwise you should, but then it gets a bit wonky.

Re: Capped frame limit for no reason *sigh*

Posted: Tue Oct 21, 2014 5:19 am
by arampl
caldur, zorg may be you right guys, but why it behaves differently on different platforms? On Windows it gives no more than 100 FPS, on Linux - 125 FPS.

Re: Capped frame limit for no reason *sigh*

Posted: Tue Oct 21, 2014 5:32 am
by Zilarrezko
Don't know if it was mentioned before. But when I had windows 7, I had pretty good frames. I then upgraded to windows 8.1 and now I notice all my frames for every game ever is lower (I thought windows 8 was suppose to optimize my 8 cores for performance D';). But yeah, I get 64 frames as well. Something weird with windows 8.

Re: Capped frame limit for no reason *sigh*

Posted: Tue Oct 21, 2014 5:35 am
by pacman
Zilarrezko wrote:Something weird with windows 8.
There's nothing weird about windows being weird :roll: