Differences in Browser

Hello,
I am making a game similar to guitar hero. My game works great on safari but not on Chrome or Firefox. On Safari, my game runs super smooth at 60fps (which is required for the game because of how I made it in the beginning.) However, on Chrome and Firefox there are tons of interruptions and jitters. Chrome has less jitters than Firefox but both are unplayable. The game jam I’m in is due tonight and I’m not sure what to do.

I’m only having this problem because of many stupid decisions in the beginning that I made, such as using 1920x1080 resolution, however changing the resolution would take hours and hours to do, so I only want to do it if I have to.

Any help is greatly appreciated. Feel free to ask questions.

2 Likes

I’d suggest using Chrome’s profiler; for other games I’ve made it’s been invaluable for finding the slow parts of my code.

Thanks. I will check it out and put my findings here.

How did it go in the end @UltimateProGrammer?

I’m interested too. I still haven’t had time, I’m going to do it within the next hour :).

It’s kind of inconclusive. I see a lot of timer fired events, (10-20ms) which I think could be the source of the issue. I used setTimeout() and setInterval() quite a lot, so I think I will try to do a test later to see if that really is it.

Chrome actually has poorly timed setTimeout/setInterval as one of the common problems for performance, so maybe Apple decided to optimize it for some reason.

I think this is actually the reason that Phaser has timer so I will make an apples to apples example to see if that really is the issue.

@Phailser Okay, I made the example. You can try it here. Conclusive results:
NEVER USE setTimeout()!!!

https://natelev.in/games/other/Phaser/general/javascript-wait-vs-phaser-wait/index.html

1 Like

I gave it a try on Chrome for Android. setTimeout had a bit of jitter but not that much.

Desktop Chrome seems to behave the same as mobile Chrome. Firefox on desktop is the worst with very frequent jittering.

Safari has quite a bit of jitter. I don’t know why it didn’t affect it when I was developing my game though.