Setting the update_frequency in game.project to a value below 15 seems to get ignored and the engine reverts to 60fps. Documentation states values of 12, 10, 6, 5, 4, 3, 2 and 1 are valid.
I’d like to set a low rate of 1 or 2 for testing some stuff.
Hmm, this works for me on OSX. Setting update frequency to 2 and printing dt in update() shows 0.5. I don’t have a Windows machine at hand so I can’t test if this is a problem on Windows only. @sven or @Mathias_Westerdahl , are you able to test this?
Thanks @britzl for trying that out for me. The dt value is correct on Windows as well - I’m talking about the actual frame rate though.
Stepping down to 30 and 15 works as expected - the motion starts moving in steps. Below 15 though, it goes back to the nice and smooth motion as you’d expect at 60fps.
Perhaps I’m misunderstanding the purpose of the update_frequency value - wouldn’t be the first time!
I did a go.animate() and it animated in the expected 0.5 second steps. What kind of motion is it you’re testing? go.animate(), gui.animate(), update(), spine?
I’m using gui.animate, among other things. Works as expected for 30 and 15 fps but below that it starts to speed up as the actual frame rate has reverted to 60fps.
Setting update_frequency to 2 means a 0.5sec gui animation happens instantly.
I tried the same with gui.animate() and I’m unable to reproduce this problem (still on oSX though). Hopefully @sven or @Mathias_Westerdahl has some idea about what could be wrong.
It could be something related to the Windows version of the engine, since I remember people having problems with the Vsync on Windows machines… I don’t have access to a PC until 2nd of January.
Set update_frequency to 1. Printed dt on update, and it printed 1 second each update.
Set update_frequency to 2. Printed dt on update, and it printed 0.5 second each update.
Just to confirm.
Tested go.animate with 1 and 2 and it appears to update at the right rate.
function init(self)
local values = { 0, 1 }
local vec = vmath.vector(values)
go.animate(".", "position.y", go.PLAYBACK_LOOP_PINGPONG, 100, vec, 2.0)
end
With update_frequency to 1 pings back and forth at the 1 second frame.
Works with GUI for me too.
function init(self)
local values = { 0, 1 }
local vec = vmath.vector(values)
local node = gui.get_node("logo")
gui.animate(node, "position.y", 100, vec, 2.0, 0, nil, gui.PLAYBACK_LOOP_PINGPONG)
end