VSync affecting physics?

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.
User avatar
Tesselode
Party member
Posts: 555
Joined: Fri Jul 23, 2010 7:55 pm

VSync affecting physics?

Post by Tesselode »

Open this .love file, and try setting vsync to true and false in conf.lua. Observe the differences.

Why?
Attachments
tilt test.love
(1.01 MiB) Downloaded 54 times
Last edited by Tesselode on Sat Oct 30, 2010 4:19 am, edited 1 time in total.
User avatar
Motig
Prole
Posts: 28
Joined: Fri Oct 15, 2010 3:43 am

Re: VSync affecting physics?

Post by Motig »

Tesselode wrote:Open this .love file, and try setting vsync to true and false in conf.lua. Observe the differences.

Why?
The .love file is a lie!

(You forgot to post it)
User avatar
Tesselode
Party member
Posts: 555
Joined: Fri Jul 23, 2010 7:55 pm

Re: VSync affecting physics?

Post by Tesselode »

Motig wrote:
Tesselode wrote:Open this .love file, and try setting vsync to true and false in conf.lua. Observe the differences.

Why?
The .love file is a lie!

(You forgot to post it)
Facepalm. :P Fixed.
User avatar
TechnoCat
Inner party member
Posts: 1611
Joined: Thu Jul 30, 2009 12:31 am
Location: Denver, CO
Contact:

Re: VSync affecting physics?

Post by TechnoCat »

Not much better.
trace.PNG
trace.PNG (83.92 KiB) Viewed 1691 times
User avatar
ninwa
Party member
Posts: 118
Joined: Tue Oct 12, 2010 1:21 am
Location: Metro Detroit
Contact:

Re: VSync affecting physics?

Post by ninwa »

I got it running and observed the difference you are talking about. My initial expectation was that you were including game logic somewhere within love.graphics.draw (which would typically be limited to 60fps by v-sync) but the code exhibits pretty good structure and separation of game-logic from rendering. That said, no fucking idea. Good luck.

(Edit: This may be related to some sort of bug in LOVE where Box2D / Particle Engine calls are limited internally by v-sync, but you would have to ask a LOVE developer about that.)
User avatar
Robin
The Omniscient
Posts: 6506
Joined: Fri Feb 20, 2009 4:29 pm
Location: The Netherlands
Contact:

Re: VSync affecting physics?

Post by Robin »

ninwa wrote:(Edit: This may be related to some sort of bug in LOVE where Box2D / Particle Engine calls are limited internally by v-sync, but you would have to ask a LOVE developer about that.)
That makes sense, because there is a single game loop: love.run() (it's even implemented in Lua and everything).
Help us help you: attach a .love.
User avatar
bartbes
Sex machine
Posts: 4946
Joined: Fri Aug 29, 2008 10:35 am
Location: The Netherlands
Contact:

Re: VSync affecting physics?

Post by bartbes »

Note that I didn't actually do it, but if your code is affected by how many times love.update is called (especially when it still is 60 Hz!) you must be doing something wrong.
User avatar
Robin
The Omniscient
Posts: 6506
Joined: Fri Feb 20, 2009 4:29 pm
Location: The Netherlands
Contact:

Re: VSync affecting physics?

Post by Robin »

I've read the thing, and he doesn't use dt *ever* (as in, no argument to love.update), but he does use getDelta when calling world:update().
Help us help you: attach a .love.
User avatar
Tesselode
Party member
Posts: 555
Joined: Fri Jul 23, 2010 7:55 pm

Re: VSync affecting physics?

Post by Tesselode »

Will it help if I use dt? I tried using it before. I could get it to work in the love.update loop, but when I tried to pass it to other functions, it didn't work. Is there a difference between dt and love.timer.getDelta?

Some people have been reporting performance problems with the game and I'm thinking this VSync issue might have something to do with it.
User avatar
bartbes
Sex machine
Posts: 4946
Joined: Fri Aug 29, 2008 10:35 am
Location: The Netherlands
Contact:

Re: VSync affecting physics?

Post by bartbes »

dt is obtained from love.timer.getDelta(), so that shouldn't change anything, you might want to limit the timesteps. (i.e. use a fixed timestep, and use that enough times to 'fill' dt)
Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot], Bing [Bot], Google [Bot], slime and 210 guests