1
\$\begingroup\$

In the game engine I'm modifying, it is designed to blend only two animations at a time using frame-by-frame linear interpolation of bone positions during a specified blend time. However, after introducing numerous animations for the new movement system, I noticed an issue: there isn't sufficient "blending from blend."

For instance, if you quickly press W-A-W (before the blend time expires), the character exhibits a jerky motion. This happens because, during the transition between left and forward movements (A to W), the engine treats the left movement as "clean"—not already mixed with the prior animation. This creates noticeable artifacts. I have several potential solutions in mind but would like to understand how others handle similar challenges.

To prioritize smoother and more anatomically accurate transitions, animations are blended frame-by-frame rather than snapping from the fixed bone positions at the time of the animation change. While this approach aligns with my current logic, I’m unsure if it’s strictly necessary, as I’m not an animation expert.

Returning to the W-A-W example: I believe the solution lies in first blending the initial W and A animations as usual, then blending the result with the final W animation. With even eight animations blended in this way, linear interpolation ensures that the "further" an animation is from the current one, the less influence it has on bone positions. After the blend time elapses, only the current animation dictates the bones' positions.

The challenge arises when organizing this blending cycle. The entire process must fit within the final blend time, after which blending stops. If all blend times are identical, this works seamlessly. However, with varying blend times, artifacts may emerge. My current solution involves scaling all blend times (and their elapsed time counters) within the loop to match the smallest subsequent blend time—subsequent referring to animations added later in the queue. This guarantees all animations complete blending before the newer ones expire.

An alternative approach would forego scaling and simply remove previous animations from the queue as soon as the newer blend times expire.

At this point, I’m uncertain which option is better—or if I’m misguided in insisting on frame-by-frame blending rather than blending from fixed bone positions. I’d appreciate any insights or advice on this matter.

\$\endgroup\$
2
  • \$\begingroup\$ According to this brief review, it seems my option is similar to weight distribution by layers \$\endgroup\$ Commented Dec 10, 2024 at 10:08
  • \$\begingroup\$ If you're drawing inspiration from Unity, have you looked at the 2D Blend Tree modes? This is how games will often handle blending between 2D directional movements. \$\endgroup\$ Commented Dec 10, 2024 at 12:36

0

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.