Mixing a number of animations – Recreation Growth Stack Trade


Within the recreation engine that I’m modifying, it’s alleged to mix solely two animations (via one thing like frame-by-frame linear interpolation of the place of the bones in the course of the specified mix time). Nonetheless, after including quite a lot of animations for the brand new motion system, I got here throughout the truth that there may be not sufficient “mixing from mix”. By default, if you happen to press, for instance, W-A-W quick sufficient (earlier than the mix time has expired) the character will jerk, since for mixing left and ahead actions (A-W) it is going to look as if the left motion was “clear” and never blended with one other animation. I’ve a number of choices for fixing the issue, however I wish to know the way different individuals remedy related points.

In favor of better smoothness and anatomicity, animations are blended frame-by-frame, and never from the mounted place of the bones, which was on the time of the animation change, so I’m nonetheless performing on this logic, though I have no idea if there’s a nice want for this, since I’m not an knowledgeable in animation.

Returning to the instance with W-A-W motion, it appears to me that it’s essential to first mixing the primary W and A animations within the traditional means, after which mix the end in an identical means with the ultimate W animation. If we had even 8 animations that will be blended in a loop in line with this logic, linear interpolation ensures that the “additional” the animation is from the precise one, the much less its contribution to the place of the bones can be, and after mix time, the bones can be decided solely by the present animation.

And in the mean time of the group of this cycle, the pitfalls come up. This entire course of of blending many animations ought to match into the final mix time, after which it stops. If all mix instances have been the identical, then there could be no issues, in any other case completely different artifacts may are available in. My resolution to this point is that this: within the loop, all mix instances (together with the elapsed time counters) needs to be scaled in line with the smallest subsequent mix time (subsequent – that’s, from these animations that have been added to the queue of animation gamers later), which ensures their expiration earlier than the following mix instances expire. There may be additionally an possibility not scaling mix time, however merely throw all earlier animations out of the participant queue as quickly because the mix time of the newer ones expires.

To date, I do not know which of those two choices is healthier, and whether or not I am speaking nonsense making an attempt to maintain frame-by-frame mixing as a substitute of a mix from a set bones place.

Related Articles

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Latest Articles