🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

Fixed timestep and skeletal animations

Started by
1 comment, last by CDRZiltoid 4 years, 1 month ago

I’ve implemented a fixed timestep loop and am currently interpolating translation/rotation/scale of objects as they transform via user input. However, I’m currently wondering about the best way to go about interpolating skeletal animations?

I require the animation data to be updated at the fixed timestep rate in order to sync hitboxes and do collision response (and have it be consistent across all clients), but simply updating the animations in my fixed logic loop (obviously) results in blurred motion as they are not synced to the render fps.

I know one solution to this would be to save the previous and current transforms for all of the bones in an armature and interpolate them based on an alpha time value the same way I have done for object movement, however…it seems quite inefficient to loop through so many bones twice (once in the fixed timestep and then again to interpolate for render).

Is there a better way to handle this situation that I am not aware of?

Advertisement

@whitwhoa Think I may have realized what needs to be done. Instead of looping twice, once in the logic loop and once in the render loop, just loop once for every display tick, update and save a renderMatrix and a logicalMatrix, only updating the logicalMatrix at the fixed timestep rate. Going to give that a shot and report back.

EDIT

Although this does work, the armature bones would only ever be updated as fast as the machine could render. Therefore if the logic tick rate were 120 and the render rate was 30, the logic loop would only ever see the bones at the positions it calculates for 30fps, whereas if another user was at 60fps, then it would see for 60fps, making the logic inconsistent across clients. Back to the drawing board.

This topic is closed to new replies.

Advertisement