My game is too fast with Chrome, why?

0 favourites
From the Asset Store
Full game Construct 2 and Construct 3 to post on Google Play
  • Hi,

    I'm making a basic endless runner with Construct2, and it's almost finished now.

    The last problem is, when I test my game with Chrome, the game is too fast. On Firefox and Internet Explorer it works fine.

    I displayed the framerate on the game screen, and on Chrome the game runs with 120 fps. On other browsers it runs with 60 fps.

    This problem occurs only on few computers (for example on my laptop I got the problem, on my another computer it works fine).

    I use every tick in my game, I read somewhere it was problematic for framerate related problems...

    Any idea? It's the last big problem on my game, so it's a bit frustrating.

    Thanks a lot!

  • Here you go: Framerate independent games

  • I tried to use dt but it didn't work.

    Every tick I add 1 to the platformX var (for example) to create the "run" feeling.

    I tried to put "Every tick, set X to platformX + 60 * dt" instead of "Every tick, set X to platformX + 1" but the result was, on Chrome it now works fine but in other browsers the game is too slow. The problem is reversed. :(

  • You need to read and apply framerate independence.

    It's strange that chrome displays more FPS than 60, have you changed something in the flags ?

    Browsers and C2 are supposed to be caped at 60 FPS.

    Anyway make sure to use dt everywhere it is possible (built in plugins/behaviors already use it), and your game should execute the same on every computers/devices.

    EDIT: People DTed me Oo

    Anyway, post your capx at worst, but it's a very strange behavior you're reporting that sounds more like an issue with your local Chrome browser.

  • Very good to know...

  • My chrome runs at 75fps too, but its not a problem in my case because my game uses a lot of physics.

  • Couldn't you set the time scale in construct 2 from 1.0 to 0.8 to slow down the game?

  • Here's a capx for example.

    Demo

    Capx

    With Firefox and IE it runs 60 fps, and with Chrome it's 120.

    I think it's my local Chrome browser too, but I don't understand because I didn't change anything in the flags. I ask friends to test the game, some of them had 120 fps (so the game was fast / too difficult), some of them had 60 fps. :/

  • Runs at 60 FPS in Chrome here. Are you sure you didn't change any of the flags in chrome://flags such as disabling v-sync?

    It still shouldn't matter if it runs at 120 FPS - as the framerate independence article says, if your game properly uses dt it should be totally independent of the framerate.

  • There seems to be a misconception about every tick. Using it is not a problem. Ever. This is because every single event essentially has an every tick condition in it, as can be shown by an event with no conditions at all behaving the same way as an event with the every tick condition. It's what you do with the other conditions and actions that's important.

    As for the framerate problem, I think I recall reading something about c2 capping the framerate at 60. If that's the case, I'm guessing c2 might also be clamping the dt value? I know it does on the low end, to make sure if the framerate goes too low sprites don't start teleporting through walls. If it's clamped to not go above 60 fps, then going above 60 fps anyway would cause the behavior you describe.

    Ashley - is that the problem? Does c2 try to cap the framerate at 60? If so, why not let computers run at higher frame rates than 60 if they can/are doing so? I tried 120 hz on one of my cc games once and it was awesome. There are gamers out there who get 120 hz monitors specifically for that silky smooth gaming experience. Also, wouldn't capping the framerate to 60 cause jittery frame rates on any refresh rate that's not a multiple of 60?

    If c2 doesn't try to cap the framerate, though, never mind. ^^

  • retrodude I tried that, but it can't work. In Firefox the game becomes to slow, and in Chrome the game is still to fast, so it's even worse.

    Ashley I verified the flags section one by one, and I changed nothing. If I deactivate v-sync, the game runs at 240 fps... very weird.

    I read the framerate independence article several times, and I think I applied it correctly (every tick, add 60 * dt instead of 1 to make the elements move, like in my capx). I really don't understand why it's still too fast.

    I have a 120hz monitor. Maybe it's part of the problem?

  • That's a bit odd since it runs at 60 fps for me on google chrome and 57-66 fps on firefox. Are you using the same version of google chrome as them? The ones who were getting 120 fps, were they using a different version of chrome compared to ones who were getting 60 fps? Because you mentioned that some of them were getting 120 fps, so I am assume its only a couple who are having this problem?

    Here's a capx for example.

    http://dl.dropbox.com/u/27924504/test/index.html

    With Firefox and IE it runs 60 fps, and with Chrome it's 120.

    I think it's my local Chrome browser too, but I don't understand because I didn't change anything in the flags. I ask friends to test the game, some of them had 120 fps (so the game was fast / too difficult), some of them had 60 fps. :/

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • The ones who had the 120 fps problem were a minority compared to the others, but we all had the last Chrome release.

    Anyway I think I definitly found the origin of the problem: I just tried to change my monitor's hz to 100 (instead of 120) then launch the game on Chrome. The game works with 100 fps now. So, I guess this problem occurs with people who own a 120 hz monitor...

  • That's not a problem, that's a good thing.

    Just make sure you've applied dt in every equation where speed matters.

  • Just make sure you've applied dt in every equation where speed matters.

    Really, I did it. Even in my capx example I posted few posts before... But it still occurs.

    I think I'll publish my game with this problem, 120 hz monitors are a minority anyway. And this occurs only with Chrome, so...

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)