0 Favourites

problem with FPS, easy question, maybe some math?

  • I have a easy question...

    this is the capx: https://www.umbriadesign.it/test_fps.capx

    result:

    I made an easy example, we have a blue square that is moving at angle 0 by 600*dt pixel every tick...(so, if you change the timescale, will be fine) with a countdown.

    in 60 fps, for example, the square reach 490px, but a 34 fps, will be 859.... I read somewhere how to fix this problem by some formula...but I don't remember...

    I would like to have the same result(o very close, like 20 different px it's fine) with different fps...

    thank you very much <img src="{SMILIES_PATH}/icon_e_biggrin.gif" alt=":D" title="Very Happy">

  • Look at event 3 -- you're subtracting timescale from countdown. Since timescale doesn't change with the framerate, it will always take the same number of frames for it to reach zero, even if it takes more time. Thus, at lower framerates countdown will take longer to reach zero and the sprite will move farther.

    Try subtracting (60 * dt) instead -- this should give you the same result regardless of framerate.

  • Construct 3

    Buy Construct 3

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

    Buy Now Construct 3 users don't see these ads
  • Look at event 3 -- you're subtracting timescale from countdown. Since timescale doesn't change with the framerate, it will always take the same number of frames for it to reach zero, even if it takes more time. Thus, at lower framerates countdown will take longer to reach zero and the sprite will move farther.

    Try subtracting (60 * dt) instead -- this should give you the same result regardless of framerate.

    that is, 60*dt, thank you very much, I was trying 60/dt

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)
Similar Topics Posts Views Last Post
Unread hot topic
353 32,079
yojona's avatar
yojona
Unread sticky
192 1,337,408
Kyatric's avatar
Kyatric Construct Team Support
Unread hot topic
96 6,220
Zebbi's avatar
Zebbi