LÖVE framerate stutters?
Posted: Fri Aug 01, 2014 10:16 pm
I've almost always noticed stutters in the framerate when working with LÖVE. Today I decided to simply ask the forum. hi.
I'll give a description of what I mean with these "stutters". Sometimes it's like one of the usual (60) frames just decides to not show up today, causing the frame before it to appear twice as long before skipping to the one afterwards. Instead of the frames going 1-2-3, they go 1-1-3, if not worse. Of course, this is more noticeable at lower framerates. With Vsync off and a framerate of ~1000 fps, it's practically not noticeable. However, when Vsync is enabled or when the framerate is lowered in another way, these stutters can be very annoying.
It has happened on every computer I have used LÖVE on, as well as every project or on all code. I believe this has been happening for several version now as well (since around 0.8.0?). The computer I am using currently has windows 7 64 bit (I am also using a 64-bit installation of LÖVE), an i5-4590, an AMD HD 6850 and 8GB of DDR3 RAM. I can't imagine that my computer is not powerful enough to handle a simple LÖVE project. It's been bothering me and I want to know if this happens to others as well, or if it can possibly be helped.
Of course, I have attached a simple .love as a 'test'. It's just a white circle circling around inside the window at a decent speed, making eventual stutters easy to see.
Here's the code in main.lua:
conf.lua doesn't really have anything interesting to note, other than vsync being enabled.
I also have a link to a .webm where one of these stutters occurs, for those who are into that .webm stuff: http://puu.sh/azUxg/bc8c3443f7.webm (the stutter happens about at the top of the path)
I wouldn't say this is a big issue, but it's something I want to look into nevertheless.
I'll give a description of what I mean with these "stutters". Sometimes it's like one of the usual (60) frames just decides to not show up today, causing the frame before it to appear twice as long before skipping to the one afterwards. Instead of the frames going 1-2-3, they go 1-1-3, if not worse. Of course, this is more noticeable at lower framerates. With Vsync off and a framerate of ~1000 fps, it's practically not noticeable. However, when Vsync is enabled or when the framerate is lowered in another way, these stutters can be very annoying.
It has happened on every computer I have used LÖVE on, as well as every project or on all code. I believe this has been happening for several version now as well (since around 0.8.0?). The computer I am using currently has windows 7 64 bit (I am also using a 64-bit installation of LÖVE), an i5-4590, an AMD HD 6850 and 8GB of DDR3 RAM. I can't imagine that my computer is not powerful enough to handle a simple LÖVE project. It's been bothering me and I want to know if this happens to others as well, or if it can possibly be helped.
Of course, I have attached a simple .love as a 'test'. It's just a white circle circling around inside the window at a decent speed, making eventual stutters easy to see.
Here's the code in main.lua:
Code: Select all
function love.load()
timer = 0
screen = {
width = love.graphics.getWidth(),
height = love.graphics.getHeight(),
update = function(self, new_width, new_height)
self.width = new_width
self.height = new_height
end
}
circle = {
x = 0,
y = 0,
radius = 50,
update = function(self, dt)
self.x = screen.width/2 + (screen.width/2-self.radius) * math.cos(timer * math.pi)
self.y = screen.height/2 + (screen.height/2-self.radius) * math.sin(timer * math.pi)
end,
draw = function(self)
love.graphics.circle("fill",self.x,self.y,self.radius,_)
end
}
end
function love.update(dt)
timer = timer + dt
circle:update(dt)
end
function love.draw()
circle:draw()
love.graphics.print("FPS: "..love.timer.getFPS(),0,0)
end
function love.resize(width, height)
screen:update(width, height)
end
I also have a link to a .webm where one of these stutters occurs, for those who are into that .webm stuff: http://puu.sh/azUxg/bc8c3443f7.webm (the stutter happens about at the top of the path)
I wouldn't say this is a big issue, but it's something I want to look into nevertheless.