Hey thar. So I’ve been learning both FlashPunk and AS3 at the same time (great idea I know) and I’ve run into the first problem that I haven’t been able to solve simply by praying to Google.
Here it is:
No matter what I do, the framerate seems to “stutter” for random periods of time. It feels “silky smooth” at 60fps for several seconds, and then suddenly it looks like it’s 30fps for some time, and this goes back and forth randomly, with no apparent rhyme or reason. Even stranger, FP.framerate always shows ~60 even when it feels like 30.
Tracing “FP.elapsed” each frame:
0.016, 0.016, 0.03, 0.004, 0.016, 0.016 (etc)
or another example:
0.016, 0.016, 0.034, 0.006, 0.01, 0.018, 0.028, 0.006, 0.024, 0.008, 0.024, 0.01, 0.016, 0.016
Normally I would assume that it’s the fault of my computer, but this is super simple, and I have a decent computer (3.07GHz / 12GB ram), and it looks the same on an old computer (2GHz / 2GB ram) and if anything it looks better on a terrible old laptop (1.7GHz / 504mb ram). The laptop has crazy screen tearing but not much visible stuttering.
Also I’m testing this in a browser, exported in “release” mode, with the FlashPunk console disabled. The game uses a variable timestep. My movement code is basically x += speed * FP.elapsed
I’m completely at a loss as to what the issue could be. I can’t imagine that this is “just how Flash works”, because this stuttering looks almost “broken” to me. In a different thread, someone posted an extremely simple test, and to me it stutters almost as much: http://www.dreamspike.com/red/testplane.swf
Here’s my own simple test file (WASD to move the object - don’t press Z or the screen gets cluttered) http://50.16.187.43/fl/VARIABLE-60.swf
So… what the heck? Do you see similar intermittent stuttering? Do I just ignore this and try to work around it? Or is this some known issue? (In the game I’m actually working on, I’m trying to quickly scroll a large map by moving FP.camera while adjusting for FP.elapsed, and it looks terrible.)