delta-time and framerate

0 favourites
  • 4 posts
From the Asset Store
An educational game for Times Table. An easy to use template for developers to build larger games
  • 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'

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • 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.

  • That's exactly what I was looking for, in order to make my game playable on every computer... <img src="smileys/smiley20.gif" border="0" align="middle" />

    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?

  • 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.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)