We recently jumped up from 3326 to 3462/63 and the frame rate seems crazy fast. We have fps = 30 in config.lua but it looks like 60 fps. Switch back to 3326 and it’s fine - forward to 3462 and it’s super fast.
We rely on the timer a lot for animation in our game and this is a real problem. Why is this happening?
Timers should not be affected by the frame rate. And we are unaware of anything that would mess with this.
Can you put together a demo project with your config.lua and build.settings that demos that changing the frame rate affects the animation? It would be great if we could simply change the FPS in config.lua and see this misbehavior. Put that in a .zip file and upload it to a data sharing site like Dropbox or Google Drive and share it with us, please.
Here you go - your HelloWorld app with a count of called to my timer function and also a count of “seconds” (increments every 30 calls based on an fps of 30).
OK. I took a deeper look. Unfortunately timer is not reloading like that, but issue is with that change. That change alters the behaviour that timer is invoked only once per frame. FPS are actually stay same, just timer gets fired up quite a bit. I’m looking if there’s a fix for such behaviour.
BTW, here’s code for FPS counter:
local frames = display.newText( "FPS: 00.0", world.x, world.y-160, native.systemFont, 32 ) frames:setFillColor( 0.2, 0.6, 0.8 ) local i = 0 local startTime = 0 function OnFrame( e ) i = i+1 if i == 100 then frames.text = string.format("FPS: %.1f", 1000\*i/(e.time - startTime)) i=0 startTime = e.time end end Runtime:addEventListener("enterFrame", OnFrame)
Timers should not be affected by the frame rate. And we are unaware of anything that would mess with this.
Can you put together a demo project with your config.lua and build.settings that demos that changing the frame rate affects the animation? It would be great if we could simply change the FPS in config.lua and see this misbehavior. Put that in a .zip file and upload it to a data sharing site like Dropbox or Google Drive and share it with us, please.
Here you go - your HelloWorld app with a count of called to my timer function and also a count of “seconds” (increments every 30 calls based on an fps of 30).