Playing Normal Animation Speed inside Game Loop

Blitz3D Forums/Blitz3D Programming/Playing Normal Animation Speed inside Game Loop

RustyKristi(Posted 2015) [#1]
Hey guys,

I got a bit of a problem with my animation speeds. It seems that when I play a sequence, the speed is faster when the fps is higher even though I set it like this:

Animate robot,1,1 ;<-- default animation speed


How can I play it with normal speed as what is stored in the animation model/file which is normally 30fps?


RemiD(Posted 2015) [#2]
Depending on the number of frames calculated and displayed per second, (maximum 60 with flip(1)), the speed of the turns, moves, animations will be different...

A way to prevent this : http://www.blitzbasic.com/codearcs/codearcs.php?code=2916


RustyKristi(Posted 2015) [#3]
Thanks RemiD, I will look into that source.


Flanker(Posted 2015) [#4]
UpdateWorld can take a parameter to adjust animation speed. Based on deltatime like in the example posted by RemiD it works very well.


Yasha(Posted 2015) [#5]
This is the solution I always used for this:



Translated from a classic game development article: http://gafferongames.com/game-physics/fix-your-timestep/


RustyKristi(Posted 2015) [#6]
Thanks Yasha. I will check this out asap and hopefully it solves my timing problem.


RustyKristi(Posted 2015) [#7]
@Flanker

Yes, looks like UpdateWorld is also one option that will work. Thanks.