Timer and fps

Just started using Construct 2? Post your questions here

Post » Thu Feb 09, 2017 4:33 pm

I'm going mad with this.
I made a simple counter that increases every 1.0 seconds.
If I run it at ~60 fps it updates every 1 second. If I slow down the pc the counter is slower.

Here's the capx: https://www.dropbox.com/s/ntukwq2wqro56 ... .capx?dl=0
Here's a video (slowing down from 2 to 30 secs): https://www.youtube.com/watch?v=ouaFrR0Iy8Y

Shouldn't 1 second be always 1 second (not depending on the framerate)?
B
12
S
5
Posts: 42
Reputation: 990


Post » Thu Feb 09, 2017 4:56 pm

@Ciao121

There is a system action 'Set minimum framerate'. Manual says about that action ....
Set the maximum delta-time (dt) value based on a framerate. The default minimum framerate is 30 FPS, meaning the maximum dt is 1 / 30 (= 33ms). If the framerate drops below 30 FPS, dt will still not exceed 1/30. This has the effect of the game going in to slow motion as it drops below the minimum framerate, rather than objects stepping further every frame to keep up the same real-world speed. This helps avoid skipped collisions due to stepping a very large distance every frame.

Additional info: All of Construct 2's behaviors use dt in their internal movement calculations. (exept physics i think).

Linking one to the other: Timer behavior is using dt. That makes a timer frame independent till the minimum framerate is reached. Lowering the minimum framerate with the system action will make collision defection on very low frames rates virtual impossible.

Whatever you do with it, just dont allow your game to drop fps below 30 fps.
B
33
S
18
G
28
Posts: 2,493
Reputation: 20,950

Post » Thu Feb 09, 2017 5:13 pm

@Burvey
Thanks for the link. But IMHO 1 second should always be 1 second. Using or not using dt.

@99Instances2Go
That's was the problem (again!!!). I added set minimum framerate to 5 and the problem is no more here. I knew about the default minimum framerate. I had the problem also at 40 fps. Maybe the showed fps does not reflect the real fps... don't know...
B
12
S
5
Posts: 42
Reputation: 990


Return to Beginner's Questions

Who is online

Users browsing this forum: No registered users and 5 guests