My game is too fast with Chrome, why?

Discussion and feedback on Construct 2

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

Post » Wed Jan 09, 2013 7:35 pm

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

Post » Wed Jan 09, 2013 11:52 pm

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?

[QUOTE=Lowren] 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. :/[/QUOTE]
B
18
S
4
G
3
Posts: 436
Reputation: 4,801

Post » Thu Jan 10, 2013 12:11 am

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

Post » Thu Jan 10, 2013 2:26 am

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

Just make sure you've applied dt in every equation where speed matters.
B
134
S
65
G
16
Posts: 1,766
Reputation: 19,190

Post » Thu Jan 10, 2013 11:17 am

[QUOTE=alspal]Just make sure you've applied dt in every equation where speed matters.[/QUOTE]
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...Lowren2013-01-10 11:17:44
B
20
S
5
G
3
Posts: 58
Reputation: 4,136

Post » Thu Jan 10, 2013 1:58 pm

[QUOTE=Lowren]I have a 120hz monitor.[/quote]

There you go, that's why. C2 doesn't cap the framerate at all, it's just most browsers render at V-sync rate. While that's very commonly 60 FPS, it's not guaranteed to be 60. This is why it's mandatory to make a framerate independent game (and also so if it slows to 30 FPS it doesn't go in slo-mo).
Scirra Founder
B
359
S
214
G
72
Posts: 22,949
Reputation: 178,544

Previous

Return to Construct 2 General

Who is online

Users browsing this forum: R0J0hound and 9 guests