delta-time and framerate

Get help using Construct 2

Post » Sat Mar 03, 2012 8:09 am

Hi!

By chance, I've heard about "delta-time and framerate". That's something totally new for me. 2-3 weeks ago, I posted a topic about performance and no one mentioned that.

I suppose I should have to apply it manually on all my project. But before to do so, I'd like to know :

Thanks to that, can I "force" a game to be fast on a slow computer (that makes the game run at 30fps), and will it look like if it was really running at 60fps??

It would be too nice to be true, but I might have misunderstood... What are the disadvantages? Why isn't it a default feature?

Rag'
B
17
S
4
G
4
Posts: 137
Reputation: 3,767

Post » Sat Mar 03, 2012 8:19 am

you can't force a game to be fast unfortunately (:
using dt just unsure that if you want an object to move 100px per seconds, it moves exactly at this speed.
If your fps is at 60, the sprite will move 100px/60 = 1.67 px per tick
If your fps is at 30, the sprite will move 100px/30 = 3.33 px per tick
If your fps is at 2, the sprite will move 100px/2 = 50 px per tick

So the higher the fps, the smoother the movement.Yann2012-03-03 08:19:37
B
60
S
22
G
14
Posts: 1,479
Reputation: 16,346

Post » Sat Mar 03, 2012 9:39 am

That's exactly what I was looking for, in order to make my game playable on every computer...

Even if it's less smooth on a slow computer, it remains playable! (I've quickly tested and it seems to work)

Does it impact the collisions accuracy?
B
17
S
4
G
4
Posts: 137
Reputation: 3,767

Post » Sat Mar 03, 2012 2:15 pm

Yes, as the article notes, lower framerates mean objects jump further every tick which can make some collisions less accurate. However a minimum FPS of 10 is used which helps prevent it getting too bad at really low framerates.
Scirra Founder
B
359
S
214
G
72
Posts: 22,946
Reputation: 178,498


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 9 guests