Animation and Frame Rate

Hello, I’m posting about this problem, if it is a problem, I don’t know that it is, because I’ve been searching for an answer to this question and I can’t find anything on the internet so I’m just going to ask.

For the current game project that I’m working on, I want to make it so that the animations I’m playing will look the same independent of the frame rate. For example, animations that are playing in a game running at 30 fps will look the same as if it’s running at 60 fps or 144 fps or 24 fps or 12 fps or any other frame rate.

Like I said, I don’t know that this is a problem but, if it is, I would like to know a solution as quickly as possible.

Thanks for whatever input I get, any help is appreciated.

Every animation has a play rate.

Tick time is different for each frame rate. For example tick time for 40 fps is 25 ms. I think it is possible to do some calculation and mix the play rate with tick time.

The engine already does that. Animations are saved as keyframes that represent the state of the animation at a given time. If your game renders a frame in between 2 keyframes the engine will simply interpolate between thes keyframes, so that it looks as if there was a keyframe there too. So you don’t need to worry about any of that, a animation looks the same, no matter what your framerate is, it will not suddenly play faster or slower.

1 Like

You’re close but not exact. What I want is for any given animation to look the same visually even if the frame-rate fluctuates. Changing the frame-rate cap from 30 to 60 and having them look the same is a relatively simple example but one that I think would be more common is if players uncap the frame-rate and the fluctuation from a given range will cause the animations to speed up or slow down or cause any other problem that may be in some way tied to that. That is the problem I’m trying to solve.

Okay, so then it’s not really a problem at all? Good, thank you.

Glad I could! If your problem is solved please accept the answer.

I see. That’s generally why the engine is time based and not frame based, to avoid such problems. The only problem that produces is one where if it’s really important to you that you see ONLY the keyframes the animators made in the 3D package, you have to get rid of interpolation, and then you sacrifice timing slightly anyway.

If that’s what you’re after, I would suggest checking into the approach of using stepped curves in your animations. Make your Maya (or equivalent) clips using stepped animations, and in the clip’s page on UE4, switch from Linear to Stepped. That will make it so animations frames “snap” from one to the next, meaning the same animation will always show up - and since the system is time based it will drop frames when framerate severely drops, but will never show you more than the X number of keyframes you originally made, since the animation isn’t interpolating anymore.

It’s important to remember that this way, your animations will never exceed the original framerate from a visual standpoint. Meaning, if you used a 30FPS timeline in Maya, your animation will “update” 30 times a second, not matter how many frames you actually render in the game. That’s why it’s recommended to use a timeline in your 3D animation software that’s similar to your target framerate for the end product.