My game is too fast with Chrome, why?

Discussion and feedback on Construct 2

Post » Wed Jan 09, 2013 12:39 pm

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!Lowren2013-01-09 12:41:46
B
20
S
5
G
3
Posts: 58
Reputation: 4,136

Post » Wed Jan 09, 2013 1:05 pm

B
24
S
8
G
7
Posts: 756
Reputation: 7,192

Post » Wed Jan 09, 2013 1:11 pm

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. :(Lowren2013-01-09 13:14:08
B
20
S
5
G
3
Posts: 58
Reputation: 4,136

Post » Wed Jan 09, 2013 1:14 pm

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.Kyatric2013-01-09 13:17:54
New to Construct ? Where to start

Image Image
Image Image

Please attach a capx to any help request or bug report !
Moderator
B
247
S
85
G
40
Posts: 6,998
Reputation: 57,791

Post » Wed Jan 09, 2013 5:35 pm

Very good to know...
B
13
S
4
G
3
Posts: 75
Reputation: 3,425

Post » Wed Jan 09, 2013 6:26 pm

My chrome runs at 75fps too, but its not a problem in my case because my game uses a lot of physics.ByR2013-01-09 18:28:27
B
31
S
7
G
2
Posts: 157
Reputation: 3,735

Post » Wed Jan 09, 2013 6:31 pm

Couldn't you set the time scale in construct 2 from 1.0 to 0.8 to slow down the game?
B
18
S
4
G
3
Posts: 436
Reputation: 4,801

Post » Wed Jan 09, 2013 6:44 pm

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. :/
B
20
S
5
G
3
Posts: 58
Reputation: 4,136

Post » Wed Jan 09, 2013 7:02 pm

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.
Scirra Founder
B
359
S
214
G
72
Posts: 22,946
Reputation: 178,478

Post » Wed Jan 09, 2013 7:10 pm

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. ^^Arima2013-01-09 19:13:28
Moderator
B
87
S
32
G
33
Posts: 3,005
Reputation: 27,397

Next

Return to Construct 2 General

Who is online

Users browsing this forum: No registered users and 8 guests