Page 2 of 3

Re: Gravity and lag

Posted: Thu Jul 19, 2012 11:39 am
by Kivutar
Yes I remember that few days ago the bug was not there. I should investigate the git diffs.

Re: Gravity and lag

Posted: Thu Jul 19, 2012 11:52 am
by Santos
I think the not-opening-on-certain-computers thing is due to t.screen.fullscreen = true in conf.lua.

The game also doesn't start for me when t.screen.fullscreen is true, however when using love.graphics.setMode(1280, 800, true) or love.graphics.toggleFullscreen() in love.load, it works fine in fullscreen. EDIT: Fullscreen without scaling, that is.

I have no idea why. :D

This game looks wonderful by the way! ^^

Re: Gravity and lag

Posted: Thu Jul 19, 2012 12:03 pm
by coffee
Kivutar wrote:Yes I remember that few days ago the bug was not there. I should investigate the git diffs.
A quick check on trash and was still there! I retested and player "lands" well in this version for me.
File is Kivutar-twinsisters-9134783.zip
Don't know much about GIT's but I hope this help check faster the wanted version.

Re: Gravity and lag

Posted: Thu Jul 19, 2012 3:10 pm
by Kivutar
This game looks wonderful by the way!
Thanks a lot! I'm happy that you liked the graphics.
File is Kivutar-twinsisters-9134783.zip
Thank you coffee, I found the commit #9134783 on my github, it was only 2 days ago. Now I can browse my commits to understand the bug.

Re: Gravity and lag

Posted: Thu Jul 19, 2012 4:16 pm
by Puzzlem00n
Sorry, you miss a lot in a few hours around here!

It still doesn't seem to open, strangely. I'm going to try Santos' suggestion, hold on...

Well, now we're partly getting somewhere. Turning off fullscreen at least allows the program to give me an error message:

Image

Re: Gravity and lag

Posted: Fri Jul 20, 2012 2:20 pm
by rvj
I don't have much to contribute but just a heads up that in versions before 0.8.0 the first update's "dt" included the load time of the program, so on the first update, dt would be big, which means objects would potentially travel abnormally far (ie. past what your collision detection might expect). It was corrected in 0.8.0.

I don't know how relevant that is to you but it tripped me up for days before I found out what the problem was.

Re: Gravity and lag

Posted: Fri Jul 20, 2012 4:24 pm
by Puzzlem00n
That is a good thing to point out, rvj, we sort of covered that in the forum link I posted. I find it to be an interesting glitch, you would never think about it when you're coding it together, but it turns out to be such a game-breaker in some genres. Good thing it's fixed so no one has to hack around it.

Re: Gravity and lag

Posted: Sat Jul 21, 2012 10:38 am
by bartbes
Normally you want to call your collision detection in even timesteps, you could do something along these lines:

Code: Select all

function love.update(dt)
    local physics_dt = dt
    while physics_dt > 0 do
        physics_update(math.min(0.1, physics_dt))
        physics_dt = physics_dt - 0.1
    end
end
Note that this is very basic code, and you might want to improve on this concept to get the best expeirence.

Re: Gravity and lag

Posted: Sat Jul 21, 2012 8:41 pm
by Kivutar
Wow I never thought about that before. Thanks, I'm going to give it a try.

Re: Gravity and lag

Posted: Sun Jul 29, 2012 2:57 am
by Puzzlem00n
bartbes wrote:Normally you want to call your collision detection in even timesteps, you could do something along these lines:

Code: Select all

function love.update(dt)
    local physics_dt = dt
    while physics_dt > 0 do
        physics_update(math.min(0.1, physics_dt))
        physics_dt = physics_dt - 0.1
    end
end
Wow... I know it's been a while since this thread was relevant (I've gotta stop taking such elongated breaks from this place) but I'm actually at a loss as to what that does. Anyone care to explain just to quench my curiosity?