Framerate Independant scrolling?

Get help using Construct 2

Post » Sat Jun 01, 2013 5:57 pm

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?

Xionor2013-06-01 18:03:08
B
10
S
3
Posts: 233
Reputation: 1,537

Post » Sat Jun 01, 2013 6:26 pm

post .capx
B
10
S
3
Posts: 102
Reputation: 1,888

Post » Sat Jun 01, 2013 10:07 pm

Scroll to Character.X every dt instead of every tick?
B
16
S
3
Posts: 24
Reputation: 859

Post » Sat Jun 01, 2013 10:45 pm

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!
B
10
S
3
Posts: 233
Reputation: 1,537

Post » Sat Jun 01, 2013 11:26 pm

Heres a falldown game I made. You could probably use it in what you're doing. capx
B
46
S
14
G
7
Posts: 603
Reputation: 8,096

Post » Tue Sep 10, 2013 12:45 pm

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.
B
12
S
6
G
2
Posts: 105
Reputation: 3,969

Post » Tue Sep 10, 2013 2:59 pm

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!
Scirra Founder
B
384
S
227
G
86
Posts: 24,139
Reputation: 190,761

Post » Wed Sep 11, 2013 2:18 pm

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.goldentreee2013-09-11 14:54:50
B
12
S
6
G
2
Posts: 105
Reputation: 3,969

Post » Wed Sep 11, 2013 5:14 pm

[QUOTE=Ashley] 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![/QUOTE]
So it's wrong to use something like "Every 20 * dt Seconds" ??
@Ashley care to explain??

[QUOTE=goldentreee] 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.[/QUOTE]
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.
B
12
S
3
G
1
Posts: 347
Reputation: 2,866

Post » Wed Sep 11, 2013 11:03 pm

@Ashley
pokayoke suggestion: disable entering "dt" in Every X seconds
B
12
S
3
G
1
Posts: 347
Reputation: 2,866

Next

Return to How do I....?

Who is online

Users browsing this forum: NN81, Sumyjkl, Yahoo [Bot] and 2 guests