Page 5 of 5
Re: Capped frame limit for no reason *sigh*
Posted: Thu Oct 23, 2014 7:12 pm
by pacman
What did you do?
Are you Jesus?
At first my pc had problem with getting 372FPS. Really unstable and messy.
But it went great after all.
"Let's try run mah game" - works at nice 75FPS
Go back to 125 cap.
BAM it works
PRAISE THE SUN!
I will save this .love and run it everytime something goes wrong.
Re: Capped frame limit for no reason *sigh*
Posted: Fri Oct 24, 2014 8:38 am
by zorg
Evine wrote:Check if this program works on your computer. It uses a "while" loop to delay the frame rate.
Yep, it kills one of my CPU cores
Evine wrote:The "love.timer.sleep" function is cursed I tell ya.
It's just imprecise.
Re: Capped frame limit for no reason *sigh*
Posted: Fri Oct 24, 2014 10:44 pm
by Evine
pacman wrote:What did you do?
Are you Jesus?
At first my pc had problem with getting 372FPS. Really unstable and messy.
But it went great after all.
"Let's try run mah game" - works at nice 75FPS
Go back to 125 cap.
BAM it works
PRAISE THE SUN!
I will save this .love and run it everytime something goes wrong.
The program doesn't actually do anything with your pc. Your love.timer.sleep() function just decided to be accurate again, for some bizarrely strange reason.
Now i made a more precise timer function you can implement into your game. And it doesn't kill a CPU core either. (unless you put the tolerance_constantFPS to 0)
Code: Select all
--Add this line to the start of love.update(dt)
constantFPS(125,0.5) -- FPS , Sleep % from 0(Diabled, max CPU usage) to 1(CPU Sleep 100% of a frame)
--Copy this function to wherever.
function constantFPS(fps_constantFPS,tolerance_constantFPS)
do
local fps , tolerance , loopTime , loopDelay = fps_constantFPS , tolerance_constantFPS , loopTime_constantFPS , loopDelay
if loopTime == nil then loopTime = 0 end
love.timer.sleep((1/fps)*tolerance)
local loopTime = loopTime - love.timer.getTime()
local loopDelay = love.timer.getTime() + loopTime
while love.timer.getTime() - loopDelay < (1/fps) do end
end
loopTime_constantFPS = love.timer.getTime()
end
zorg wrote:Evine wrote:The "love.timer.sleep" function is cursed I tell ya.
It's just imprecise.
No it's inconsistently imprecise. In layman terms: Cursed
Re: Capped frame limit for no reason *sigh*
Posted: Sat Oct 25, 2014 7:20 am
by bartbes
Evine wrote:
No it's inconsistently imprecise. In layman terms: Cursed
If it were "consistently imprecise" it wouldn't be imprecise.
Re: Capped frame limit for no reason *sigh*
Posted: Sat Oct 25, 2014 7:31 am
by pacman
There's definitely something going on with this one.
Yesterday I had 100FPS problem once again but today it seems fine ; )
I will try your "antidote" to this curse, Evine. Thank you very much