By adjusting my monitor’s refresh rate, I have confirmed: Time-based tweens run more slowly on monitors with a faster refresh rate. This is a reproducible Phaser bug, and you can see it for yourself by adjusting your monitor’s refresh rate.
This is the exact opposite behavior of what you might intuitively imagine the problem to be. With frame-based tweens, a faster frame rate would result in faster tweens (because the update loop is running faster). So this is something different. This appears to be a bug in Phaser’s time-based tweens, that causes the tweens to run more slowly when the monitor is faster. The docs claim that the whole point of time-based tweens is to ensure they run independent of frame rate. So, if you say the tween should take 800ms, it should always take 800ms, regardless of the frame rate.
As far as I can tell, this isn’t affecting anything other than tweens, which makes sense because Phaser’s frame rate is limited by default to 60 fps, even when the monitor’s refresh rate is faster. So it seems to be a bug in tweens specifically, where some line of code incorrectly uses the monitor’s refresh rate rather than the game’s limited frame rate to do its calculation.
Reading through some of these related older issues, it sounds like some people resolved it by switching over to frame-based tweens. But this seems like it would just reverse the problem, making the tween speed directly dependent on the speed of the computer. Frame-rate based tweens might not be a problem on fast computers, which are being rate limited by Phaser to 60fps, but it seems like it would slow the tweens way down on slow processors (such as mobile devices) that run slower than 60 fps, which is certainly not desirable.
One user said he believed the culprit was this line in Phaser: phaser/TweenData.js at v2.4.6 · photonstorm/phaser · GitHub
Anyone know if this was fixed in a later community edition release? In general, how compatible are later community releases with the 2.6.2, which was the last officially supported release of Phaser 2?
Once I’ve solved this problem, my next agenda is to tackle the new audio issues that Milton noted in my legacy Phaser game running on new browsers, saying “Another thing that changed in the last couple of years is the media autoplay policy…”
Any ideas how to address Phaser 2.6.2’s inability to play audio until “after a user gesture on the page”?