stutter while scrolling

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.
Post Reply
monolifed
Party member
Posts: 188
Joined: Sat Feb 06, 2016 9:42 pm

stutter while scrolling

Post by monolifed »

If I keep going right non stop I see small stutters. Attached file rather simple. My assumption is it is the video card/driver.
I am just curious that whether anyone else sees the stutter. Use left/right arrow keys to go left/right respectively
User avatar
Tabaqui
Prole
Posts: 34
Joined: Tue Mar 24, 2020 2:47 pm
Location: Italy

Re: stutter while scrolling

Post by Tabaqui »

I had the exact "problem" with an old project and i had it because i've turned off vsync. Try enabling it in conf.lua like this:

Code: Select all

function love.conf(c)
	c.window.vsync = true
end
This will cause your game to run at lower FPS (in my case 60, but depends on the monitor you are using), but the draw function will be called in sync to your monitor's refresh rate. If you are using "dt" correctly in your game logic this won't affect the game experience.
User avatar
pgimeno
Party member
Posts: 3550
Joined: Sun Oct 18, 2015 2:58 pm

Re: stutter while scrolling

Post by pgimeno »

It depends on what you call micro-stutters. I see a little bit of tearing. If I enable vsync like Tabaqui suggests, the tearing is gone but the scroll is still not 100% smooth. But that's expected because the speed isn't a constant amount of pixels per frame like it used to be in old games; that's a logical consequence of having to adapt the program to any possible frame rate. If I set the scroll speed to 240 instead of 200, with vsync active, it is pretty smooth in a 60 Hz mode, but it loses a bit of smoothness when I switch to a 75 Hz mode.

Nevertheless, it's possible that the problem is the print() statement in your system. Sometimes these are slow.
monolifed
Party member
Posts: 188
Joined: Sat Feb 06, 2016 9:42 pm

Re: stutter while scrolling

Post by monolifed »

So it is smooth with speed=240 and vsync on? But it is still the same for me with or without the print()
The print() was there to warn when dt is more than 1/60, And I noticed that it prints even without scrolling

OK this one has speed=240, vsync=1 and no print
User avatar
pgimeno
Party member
Posts: 3550
Joined: Sun Oct 18, 2015 2:58 pm

Re: stutter while scrolling

Post by pgimeno »

That one is smooth for me.

For me the print was triggering a lot of the time, perhaps because the tolerance was small. When I changed it to 1/56, it barely triggered.

Note my system is Linux, not sure if that makes a difference.
monolifed
Party member
Posts: 188
Joined: Sat Feb 06, 2016 9:42 pm

Re: stutter while scrolling

Post by monolifed »

Thanks.
I assume that if it can run smoothly on some system with proper settings, code is not the problem.
I tested it on linux too, so I guess it makes no difference
Post Reply

Who is online

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