How do I limit the game frame rate?

Get help using Construct 2

Post » Mon Oct 15, 2012 2:23 pm

I would like my game to run at a constant 30fps. Is there an easy way?

Thanks
B
20
S
3
G
4
Posts: 77
Reputation: 3,346

Post » Mon Oct 15, 2012 3:19 pm

This is not supported. I'm not aware of any good reason to do this - if the game can run at 60 FPS, why not let it?
Scirra Founder
B
359
S
214
G
72
Posts: 22,952
Reputation: 178,580

Post » Mon Oct 15, 2012 3:45 pm

I cant find a way to do a variable jump on a platform game that's not affected by the CPU. The less powerful the computer, the smaller the jump is regardless of delta time. This makes my game unplayable on the 3gs and iphone 4 (using CocoonJS) as you can't make the jumps on these systems (on 4s and 5 it is fine).

If you have any solution to this problem I would be very grateful.
B
20
S
3
G
4
Posts: 77
Reputation: 3,346

Post » Mon Oct 15, 2012 10:48 pm

Does C2 user timer based movement? Will my game play the same if it's running at 30 or 60fps?
B
41
S
11
G
4
Posts: 428
Reputation: 7,356

Post » Mon Oct 15, 2012 11:49 pm

@bjadams - yes, Construct 2 movements work the same regardless of the framerate. See delta time and framerate independence for more information.

@slw666 - unfortunately a delta-time based movement like Construct 2 uses can result in slight random variations in the movement. Reducing the framerate won't necessarily solve this problem either. The best thing to do is design your game so pixel-perfect movement is not necessary. I'd increase the jump height a little so it works reliably everywhere.
Scirra Founder
B
359
S
214
G
72
Posts: 22,952
Reputation: 178,580

Post » Tue Oct 16, 2012 2:37 pm

Thank you for your reply Ashley.

I really wouldn't mind if it was a case of a slight fluctuation in height but if I make the height acceptable on the 3gs (i.e. so he can make the jump), the iPhone 4s is literally jumping out of the screen, probably double the height. I'm not sure if I'd go as far as to say this was a bug, but it does make platform games near unplayable at the moment on mobile platforms.

Are there any work arounds or is this possible to fix?

(P.S. I really appreciate you taking the time to respond to us)
B
20
S
3
G
4
Posts: 77
Reputation: 3,346

Post » Tue Oct 16, 2012 2:51 pm

@slw666 - it definitely shouldn't be as much as double, are you using the built in platform behavior? Can you share a .capx showing the results?

Also, are you having extremely low framerates on the 3GS? If the framerate is under 10, it could be highly unstable.
Scirra Founder
B
359
S
214
G
72
Posts: 22,952
Reputation: 178,580

Post » Tue Oct 16, 2012 3:22 pm

Hi Ashley,

The 3GS is mid 20's according to CocoonJS. I have spoken to the guy doing the art and he doesn't mind me emailing you directly the .capx file if that is possible.

I am currently using the default platform behaviour with an extra variable to increase the -y vector when the player keeps a hold of the jump button.

B
20
S
3
G
4
Posts: 77
Reputation: 3,346

Post » Mon Oct 22, 2012 2:08 pm

Any advice yet or possible fix?
B
20
S
3
G
4
Posts: 77
Reputation: 3,346

Post » Mon Oct 22, 2012 5:16 pm

@slw666 - can you make a repro from a new empty project demonstrating the issue and post it here? It could be a mistake in your events, and this step would eliminate that possibility.
Scirra Founder
B
359
S
214
G
72
Posts: 22,952
Reputation: 178,580

Next

Return to How do I....?

Who is online

Users browsing this forum: gregorysforster, jeffige, Matthew de, onzephyr and 0 guests