I found this in the docs:
"You can also use setFps(-60) or setFps(-30) to maintain an apparent frame rate of 60 or 30 fps by skipping frames if the system notices it is running slow. So for example, it updates the game logic 60 times per second but redraws the screen 30 times. The game is playable but will not be so smooth on slow devices. (currently available on WinRT)"
http://docs.giderosmobile.com/reference/gideros/Application/setFps#Application:setFpsHow involved would it be to add this to iOS and Android?
Comments
So if fps drop, enter frame gets called more rarely.
There was an idea to introduce second parallel game loop, like tick, which would run provided FPS times per second, no matter if real FPS drops down due to performance.
But actually when thinking about this, it is probably does not make sense to have both game loops, does it?
It would probably be better to have a setting to switch behavior of enter frame to one or another. Right?
Likes: totebo, antix
You can also get a delta when the event starts - so you multiply changes by 2 if the frame was skipped:
https://deluxepixel.com
https://github.com/gideros/gideros/blob/master/winrt/gideros/gideros.Shared/giderosapi.cpp#L1001
There is an inner loop which runs as long as the computer thinks it is not keeping up. The inner loop runs extra ENTER_FRAME events while the outer loop redraws the scene. So provided the ENTER_FRAME is quicker than the screen draw this will work, but it will be a disaster if it's the other way round and the code doesn't check. Having said that, in my experience the screen redraw is always the bottleneck in practice.
I got the idea from this website which also discusses other ways to do the game loop:
http://www.koonsolo.com/news/dewitters-gameloop/
I'm using the one he calls "Constant Game Speed with Maximum FPS"
So yes, its definitely possible to implement on Android and iOS. But I didn't write those so need to dig down to see how they operate! I think it would be good to have this. But don't expect too much: it makes the game playable on an old device but it will be jerky.
Likes: antix
https://github.com/gideros/gideros
https://www.youtube.com/c/JohnBlackburn1975
https://deluxepixel.com