Smooth

It’s been a while since I’ve been programming simple games. I liked how smooth things could move. Today I tested a game, and there’s a lot of lag. I tested some Phaser 3 examples and they have the same problem. I usually use Opera, tested Chrome, same problem, and then luckily Firefox is relatively smooth. Is this a common problem with never versions of browsers and Phaser ? That they’re more demanding. My PC should be capable.

The games and examples run almost twice as slow compared to Firefox. Using older versions of Phaser 3 helps a bit.

I can have Opera, Chrome and Firefox running the
https://phaser.io/examples/v3/view/actions/place-on-circle
side by side. All updated. Firefox is super smooth. Opera and Chrome is lagging awfully.

On the other hand. Firefox doesn’t show the source. Just stops at “Please wait, loading source from GitHub …”.

https://phaser.io/examples/v3/view/physics/arcade/fps-test
ETA: 2000, Opera: 2163, Chrome: 2193 and Firefox: 2011
Again these numbers has Opera and Chrome running like at half speed.

Tried to play around with
this.physics.world.setFPS();
Is the threshold like trying to get below 2000 in the example. If so it doesn’t look good.

All of my games have some objects moving at a fixed number of pixels per frame, so this is like a dealbreaker.

Check https://codepen.io/samme/full/KbdXad (click on the game canvas) or https://codepen.io/samme/debug/KbdXad (temporary link).

Physics FPS is a different thing, you don’t need to change that.

1 Like

Excellent. That restores a bit of faith. With the debug Opera, Chrome and Firefox has the logo jumping around smoothly. ActualFps and delta at 98-101%. Now what happened ? Shouldn’t the Phaser 3 Examples be tweeked accordingly - if possible. I need to investigate.
Thanks. :slight_smile:

Okay, I guess I need to go from Phaser.AUTO (which auto-detect WEBGL) to CANVAS. Funny thing is that it used to be all fine. I’ll look into my graphics driver. And of course I have to test on a few other computers.

Been running different WebGL reports and tests in Chrome and Firefox, and got different results (on both top and lower levels). I guess that was what to be expected.
https://browserleaks.com/webgl
Chrome says ANGLE: True, Direct3D 9. Major Performance Caveat: True.
Firefox, ANGLE: True, Direct3D 11. Major Performance Caveat: False.

Okay. Solution for me (developing). In Opera and Chrome I enable this flag:
image
Changed from “default”.

Link in previous post now reports the same for Opera, Chrome and Firefox.
Phaser 3 is now super smooth. Yes !

For my low demanding games I think I can use CANVAS (leaving AUTO). Some people will experience smooth games at 60 fps and not something lagging at an erratic 30 something fps, but it may also be the other way around.

CANVAS seems to use GPU anyway. The tricker was to go from Direct3D 9 to 11.
https://en.wikipedia.org/wiki/ANGLE_(software)
Chromium (Opera and Chrome) uses ANGLE not only for WebGL, but also for its implementation of the 2D HTML5 canvas and for the graphics layer of the Google Native Client.
Firefox uses ANGLE as the default WebGL backend on Windows.

Beware. Setting the flag may cause problems elsewhere. I haven’t seen any.

:smiley:

1 Like