framerate below 60

Get help using Construct 2

Post » Wed Jul 17, 2013 8:40 pm

How do i set the frame rate below 60? like 30, for example.
thx
B
20
S
4
Posts: 385
Reputation: 2,270

Post » Wed Jul 17, 2013 9:45 pm

Put in your program big bad loops that slows the runtime ?

On a more serious note, why would you do so ? It will lag on the screen.
B
17
S
8
G
4
Posts: 461
Reputation: 6,087

Post » Wed Jul 17, 2013 9:49 pm

Some people will not be able to run my game at 60fps. Then, to avoid slowdowns, I want to set the fps at 30 by default.
is this possible?
B
20
S
4
Posts: 385
Reputation: 2,270

Post » Wed Jul 17, 2013 9:53 pm

If you program your game to where all time dependent actions - movement, timers, etc. - use delta time, you shouldn't have any issues. That will ensure that your game runs at the same speed regardless of frame rate.

If that's not acceptable, I don't believe there's a way to lock the framerate.linkman20042013-07-17 22:57:34
Moderator
B
111
S
41
G
20
Posts: 1,586
Reputation: 19,046

Post » Wed Jul 17, 2013 9:56 pm

The best practice in this field is to make your game framerate independant, as you cannot manage every type of computer. This tutorial can show you how to do it.
This way, people with low config won't suffer from it playing your game, and people with higher will enjoy it too.

If you still want to slow down the rendering, I'm not sure there is a way. It would be in the project properties I think, and I can't see anything like this.

Edit : ninja'd ^^Guizmus2013-07-17 21:57:04
B
17
S
8
G
4
Posts: 461
Reputation: 6,087

Post » Wed Jul 17, 2013 11:07 pm

hehe thnks every1 ^^
I have to learn much more about dt... so, let's read :)
B
20
S
4
Posts: 385
Reputation: 2,270

Post » Wed Dec 18, 2013 5:49 am

Bumping this. Is there really NO way to lower the framerate, and cap it?

I need this for aesthetic and design reasons. If you try to emulate a system you need to frameskip and emulate choppiness too.

This is quite important to me =\
B
33
S
9
G
1
Posts: 156
Reputation: 3,024

Post » Wed Dec 18, 2013 5:55 am

@notnsane The feature was added to a beta version of construct a few releases ago, and then removed because it wasn't really helping like people thought it would. I'm sure if you really need it someone on here still has a copy of the beta and would probably send it to you.
B
57
S
19
G
56
Posts: 1,064
Reputation: 35,733

Post » Wed Dec 18, 2013 6:12 am

impossible to slow the FPS processing. Ashley can't/won't apply an advanced FPS controller. Ashley has a strong opinion that there should never be a reason to slow the renderer, but there may be limitations within the browser environment itself.

The best you can do is swap the your own logic of thinking to do this. Instead of running your game logic update nativly you can in stead update your game logic using X seconds.

so if you know that 60fps is apx every 0.16 seconds. Then

On Every 0.32 seconds(every 30fps)
-- do logic

however this will require you to do a lot of custom logic and redifine the numerous behaviours move X persecond values.

so then you could do something along the lines
var fps_slow = 0.32
Every fps_slow + (numberofsprites on scree / 40)

that way you can try to mimic the slower aspects of having more objects on the screen.

The other option as some one mentioned. Use a loop to lock the. personally though I don't like that and it feels sloppy.

@Burvey
It wasn't working the way expected because it was a quick hacky version. Ashley mentioned that he feels it's not worth writing a more complicated FPS controller.
B
88
S
18
G
9
Posts: 2,455
Reputation: 14,928

Post » Wed Dec 18, 2013 6:58 am

There's actually a simpler method to fake reducing the framerate. Set the 'clear background' property to no, then add to a variable 1 each tick. When the variable is above the desired threshold (5 for example to make the effect obvious), make all the layers visible for one tick.

Every tick
- add 1 to variable
If variable = 5
- make all layers visible
- set variable to 0
Else
- make all layers invisible

Using this method, you don't have to recode anything, but this will only work on platforms that don't automatically clear the screen regardless of c2's setting, though (I seem to recall there is a platform that ignores it), and needs the background to be completely obscured otherwise you'll get smearing effects.

Also, @jayderyu - don't use a condition checking if a variable equals a float/decimal - use integers instead. Because of rounding errors, floats cannot be relied on to be exact, they are very often off by a tiny amount and so the condition won't run.Arima2013-12-18 07:18:41
Moderator
B
91
S
32
G
33
Posts: 3,005
Reputation: 27,552

Next

Return to How do I....?

Who is online

Users browsing this forum: bazmat1963, bikachu, LaurenceBedford, lucstanislash and 13 guests