problem with FPS, easy question, maybe some math?

0 favourites
  • 3 posts
From the Asset Store
Create a game inspired by great arcade classics as Operation Wolf
  • 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.

  • Try Construct 3

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

    Try 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)