Framerate Independant scrolling?

0 favourites
  • 10 posts
From the Asset Store
All popular touch mechanics - scrolling, zooming, swiping
  • Hi,

    I'm in the process of making an Android game. It's very simple and basic but I'm already hitting performance issues.

    I've implemented deltaTime object movement, but my current problem is making FPS independent scrolling.

    My camera follows the character. Every Tick it Scrolls to Character.X

    As soon as FPS drops below 60 FPS the camera scrolling becomes jittery. How would I implement this?

  • post .capx

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Scroll to Character.X every dt instead of every tick?

  • Oh my god Pseudotropheus, that actually worked!

    And that was so obvious!

    I tried some variations of that like, seconds * dt , and other various twists, but never just dt!

    Now it's suddenly the character that suddenly became jittery at times, but I'll look into that myself : ) Thank you very much!

  • Heres a falldown game I made. You could probably use it in what you're doing. capx

  • I have the same problem as Xionor.

    Sometimes i just go to 58 and my camera jitters.

    I tried every dt but it's changing nothing at my end (i tried with "scroll to" behaviour, tried to program the movement every 0.01, etc, but i still have that visual pb.

    EncryptedCow, i would be interesting in your link but it doesn't work anymore.

  • Do not use dt in 'Every X seconds'. It is simply incorrect to do so. Every 0.01 seconds will also be the same as 'Every tick'. You should simply scroll every tick!

  • thanks for your answer Ashley.

    I never mix dt and every seconds.

    My pb is that :

    I scroll to my heros.x, or put a scroll behaviour on it, whatever, and my hero moves with dt (+600*dt) to the right, for example.

    As long as my fps is 60, no pb, but if it goes down, even just a few fps, my camera "jumps".

    So i tried to scroll using dt, using everyseconds, etc..., to have my camera moving independently from the fps.

    I don't know if it's normal, but i thought that having everything moving with dt, even the scrolling, would erase the fact that every framerate drop is visible, but maybe it's just impossible to hide this kind of things, I don't know.

    That's why too, and i know you're not agree, maybe it would be nice to have an option to chose to render the games at 30 or 60 fps.

    I mean, i would prefer to have my game running (at the same speed using dt) with a perfect 30 fps and no framerate drops who make the camera jump, than being between 60 and 55 and having this camera jumps, which are very annoying me.

    It would be very usefull for old mobile devices : still having my character moving at 600*dt, but on a stable 30 fps. Not sure if i'm clear, but in my case, to make my game working perfectly on an ipod4, it would be great. i succeded on that device to have a nice game and to stay between 55-60 fps, but i just try to get ride of the jump of the camera :), if it's possible.

    Now, maybe i understand nothing in how framerate work, but for what i understand, it would nice, again, for old devices, to give a kind of "security" part concerning the framerate.

  • Do not use dt in 'Every X seconds'. It is simply incorrect to do so. Every 0.01 seconds will also be the same as 'Every tick'. You should simply scroll every tick!

    So it's wrong to use something like "Every 20 * dt Seconds" ??

    Ashley care to explain??

    That's why too, and i know you're not agree, maybe it would be nice to have an option to chose to render the games at 30 or 60 fps.

    I mean, i would prefer to have my game running (at the same speed using dt) with a perfect 30 fps and no framerate drops who make the camera jump, than being between 60 and 55 and having this camera jumps, which are very annoying me.

    It would be very usefull for old mobile devices : still having my character moving at 600*dt, but on a stable 30 fps. Not sure if i'm clear, but in my case, to make my game working perfectly on an ipod4, it would be great. i succeded on that device to have a nice game and to stay between 55-60 fps, but i just try to get ride of the jump of the camera :), if it's possible.

    Now, maybe i understand nothing in how framerate work, but for what i understand, it would nice, again, for old devices, to give a kind of "security" part concerning the framerate.

    Excellent idea man, tv and movies are what, 29.9fps? And one hardly notices.

    I assume that would also have the benefit of lower CPU usage too, right? that'd be excellent for portable devices, tablets, etc.

  • Ashley

    pokayoke suggestion: disable entering "dt" in Every X seconds

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