Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Emscripten: FPS counter broke, showing more than 60 fps #2444

Open
fdelapena opened this issue Jan 23, 2021 · 4 comments
Open

Emscripten: FPS counter broke, showing more than 60 fps #2444

fdelapena opened this issue Jan 23, 2021 · 4 comments
Labels
Emscripten WebAssembly/JavaScript port for web browsers Regression
Milestone

Comments

@fdelapena
Copy link
Contributor

The web player FPS counter which appears whith the F2 key regressed likely since major changes allowing frameskip and fast forward since WebAssembly landed.
Ideally, should get a count similar to JavaScript's requestAnimationFrame, which is based on system refresh rate.

@fdelapena fdelapena added Emscripten WebAssembly/JavaScript port for web browsers Regression labels Jan 23, 2021
@fdelapena fdelapena added this to the 0.6.3 milestone Jan 23, 2021
@Ghabry
Copy link
Member

Ghabry commented May 6, 2021

Here for comparison:
As you know we use Asynchify right now because the normal animation frame API had problems with frameskip.
With the Clock refactor this was mostly solved (But I still get a browser freeze when 0 FPS are reached)

With Asyncify:
https://easyrpg.org/play/test/gabriel/easyrpg-player.html
https://easyrpg.org/play/test/gabriel/easyrpg-player.html?game=frozen_triggers

Without (correct frame counter):
https://easyrpg.org/play/test/gabriel2/easyrpg-player.html
https://easyrpg.org/play/test/gabriel2/easyrpg-player.html?game=frozen_triggers

Please also check, besides looking at the frame counter, what feels "smoother" for you.

Also added a fix for our easteregg (#1899)

Imo the version with Asyncify feels less choppy. The one without sometimes hangs for short moments.

@fdelapena
Copy link
Contributor Author

fdelapena commented May 7, 2021

Frozen Triggers desktop test, I feel the scroll while displacing between the snowy weather and the cavern smoother in the "Without" version. It jumps slightly more with the Asyncify version here. (Firefox on Ryzen 5 2400G on Fedora 34 GNOME 40)

Frozen Triggers mobile test, with Asynficy: bad performance as expected, maybe 4 fps. But without Asyncify it gets even worse: not even loading the snow or audio, slow asset loading, even slower FPS. (Firefox on a low end quad core mediatek Android Go potatophone 1 gb ram)

Testgame scrolling works smoother to me on both desktop and mobile without asyncify, so it seems the frozen triggers issue on mobile is related to the 0fps somehow.

@Ghabry
Copy link
Member

Ghabry commented May 7, 2021

Also pinging the others:
@carstene1ns @rueter37 @fmatthew5876

Could you please compare the Async vs. No async version on both your Computer and your Smartphone and tell me which feels "smoother". This is highly subjective so we must find consense first.

@ghost
Copy link

ghost commented May 7, 2021

The Asyncify version is way smoother for me than the no async version. Tested the desktop versions, because due to not possessing a smartphone I could not test the mobile versions.

Desktop PC specs:
Browser: Firefox 88.0
OS: Lubuntu 20.04
CPU: Intel Core i5-4670K
RAM: 16 GB

@Ghabry Ghabry modified the milestones: 0.7.0, 0.7.1 Jul 12, 2021
@Ghabry Ghabry modified the milestones: 0.7.1, 0.7.2 Jul 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Emscripten WebAssembly/JavaScript port for web browsers Regression
Development

No branches or pull requests

2 participants