Within the recreation engine that I’m modifying, it’s purported to mix solely two animations (by means of one thing like frame-by-frame linear interpolation of the place of the bones throughout 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, in case you 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 can look as if the left motion was “clear” and never combined with one other animation. I’ve a number of choices for fixing the issue, however I want to know the way different folks resolve comparable points.
In favor of higher 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 appearing 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 you’ll want to first mixing the primary W and A animations within the ordinary method, after which mix the lead to the same method with the ultimate W animation. If we had even 8 animations that will be combined in a loop based on 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 complete course of of blending many animations ought to match into the final mix time, after which it stops. If all mix occasions have been the identical, then there could be no issues, in any other case totally different artifacts may are available in. My resolution thus far is that this: within the loop, all mix occasions (together with the elapsed time counters) must be scaled based on 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 occasions 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 don’t 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.