Gravity and lag

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.
Kivutar
Prole
Posts: 13
Joined: Wed Jul 18, 2012 2:49 pm

Re: Gravity and lag

Post by Kivutar »

Yes I remember that few days ago the bug was not there. I should investigate the git diffs.
Santos
Party member
Posts: 384
Joined: Sat Oct 22, 2011 7:37 am

Re: Gravity and lag

Post 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! ^^
Last edited by Santos on Sat Jul 21, 2012 10:45 am, edited 1 time in total.
coffee
Party member
Posts: 1206
Joined: Wed Nov 02, 2011 9:07 pm

Re: Gravity and lag

Post 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.
Kivutar
Prole
Posts: 13
Joined: Wed Jul 18, 2012 2:49 pm

Re: Gravity and lag

Post 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.
User avatar
Puzzlem00n
Party member
Posts: 171
Joined: Fri Apr 06, 2012 8:49 pm
Contact:

Re: Gravity and lag

Post 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
I LÖVE, therefore I am.
rvj
Prole
Posts: 15
Joined: Fri Feb 10, 2012 5:55 pm

Re: Gravity and lag

Post 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.
User avatar
Puzzlem00n
Party member
Posts: 171
Joined: Fri Apr 06, 2012 8:49 pm
Contact:

Re: Gravity and lag

Post 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.
I LÖVE, therefore I am.
User avatar
bartbes
Sex machine
Posts: 4946
Joined: Fri Aug 29, 2008 10:35 am
Location: The Netherlands
Contact:

Re: Gravity and lag

Post 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.
Kivutar
Prole
Posts: 13
Joined: Wed Jul 18, 2012 2:49 pm

Re: Gravity and lag

Post by Kivutar »

Wow I never thought about that before. Thanks, I'm going to give it a try.
User avatar
Puzzlem00n
Party member
Posts: 171
Joined: Fri Apr 06, 2012 8:49 pm
Contact:

Re: Gravity and lag

Post 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?
I LÖVE, therefore I am.
Post Reply

Who is online

Users browsing this forum: Bing [Bot], Google [Bot] and 225 guests