Additive Animations | Adv. Anim Application [UE4]

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hello and welcome to my new series advanced animation application the show where we apply [Music] advanced animation techniques today we're going to be taking a look at additive animations and how you can use them to sort of add more nuance to your your characters and kind of make them a little bit more believable with very little effort so let's jump straight into it i'm gonna jump into my scene uh you can see i've got my my fella right here you can see as i start running he leans forward and then as he stops accelerating he goes to you know a normal sort of leaning forward pose and then as i stop he leans back and then recovers and same thing goes if i start running in circles you'll see that he leans over sideways it's just really basic stuff like that that can really add a lot more weight to your animations and stuff so if i was to go ahead and remove that part you can see he stays sort of upright and looks a bit stiff and it kind of just looks like he isn't creating the momentum like it's like he's being pushed along by something whereas now if we take another look you know it looks like he's generating force and then stopping force so that's the first example that we're gonna have a little look at today now the second example that we'll have a look at is landing so you can see when my character jumps and lands he sort of compresses down a little bit now if it's just a small jump it'll be kind of slight but if he was to jump off something a bit taller you can see he compresses a lot further and then the last thing that we're going to have a look at is adding a sort of breathing animation that gets overlaid the top of our animations no matter what animation is playing we're going to implement that one together [Music] so step one setting up an additive animation so if we look at our acceleration leaning poses so i'm just using some of the animation poses from the als advanced locomotion system which is available for free on the marketplace i highly recommend checking that out so this is our bass pose and then there are poses that are sort of variations of that and there is also a pose that leans left one that leans forward one that leans backwards you get it and then something else that you'll need to do is make a duplicate of the bass pose and so it will just be sitting here like this so this first technique is about using additive poses to overlay over the top of your animations and stuff so if we go into our bass pose or a master pose you don't need to actually change anything on that but when we go to our additive poses like the leaning right additive pose you'll need to scroll down here and you'll need to go additive animtype and we're going to do this in local space as opposed to mesh space but then in the base pose type you're going to go selected animation and you're going to select your bass pose and so what this is telling your animation or your skeleton is my bass pose looks like this and the the additive pose looks like this and so this has a specific transformation that's required to get from this position to this position so if we were to then use this transformation to transform something like this where you know your little stick figure man has his arms up it would then transform to this presumably because we're applying the same transforms here to the pose down here so all of the poses should be set to additive in local space select animation the animation selected is the bass pose then what we'll do is create a blend space uh a two-dimensional blend space we're gonna do it to our unreal engine mannequin i'm just gonna call it new blend space and then what we'll do is we'll look for our poses so we're going to put our backwards one here a forward one up here our left one over here and our right one over here and now you can see we can blend between all of our leaning poses and you know have combinations of them and all that good stuff and so in our axis values we're going to set this from negative one to one and then also negative one to one in the vertical axis so then if the acceleration is zero then you'll just be standing up straight you know we don't want him to be doing this when you're standing still now another cool thing when you're working with additive animations is you can here we go preview bass pose so we can put any animation here so i can go to my run animation and we can grab this run animation and then we can preview what these poses look like when played over the top of the animation and so this is a really good way to check if your additives are actually working in the way that you intended them to work and i almost forgot to mention we're going to name the horizontal axis left right lane and we're going to name the vertical axis forward back lean and another thing that you might want to do is to set an interpolation time so this will if i was to snap from here to here it will take some time to get from one to the other so now all that's left to do is to apply this to our animation somehow i've created a state machine just for acceleration leaning the only reason i do that honestly is just to make it look a bit tidier you can access a blend space out in the open and put that in there and you know put our parameters into here for the sake of this video we're going to do it out in the open in the anim graph rather than obscuring it so we've got our blend space we plug it into an apply additive node the base is wherever you want to apply this animation so maybe maybe you might want to apply this animation at the very end of your chain so that it plays on top of your attack montages or something or maybe you want to apply this before your foot and and spine inverse kinematic solvers and stuff like that so it's really up to you where you apply this you'll have to use your own discretion for that it's all set up and ready to go now all that's left to do is to get these values so how do we actually calculate when a character is accelerating not just moving but accelerating in a direction so i'm going to use the calculation from the als session just because it's very robust and it does exactly you know what i need it to do you know don't don't fix what ain't broke so essentially what it's doing is at the end of each sort of calculation it sets the current velocity as the previous velocity and then does another cycle and on the next frame it will calculate the acceleration using the current frame's velocity and the variable that we set here and then it divides it by delta world seconds and that's how we calculate acceleration and then after that's done you know it will set this as that and so it just sort of creates this perpetuating cycle of current frame minus previous frame you know it gives us acceleration per frame and then so that acceleration gets used here it gets dotted against the current character's velocity and that determines whether or not you know he's accelerating or decelerating i'll leave this up on screen you know if you want to do this yourself and basically what this does if i was to print this value so if i was to only move upwards then you'll see this x value goes up to one and then as i stop accelerating goes back down to zero and then when i stop that'll go to negative one and then to zero again and that corresponds to these leaning poses that we've set up and so with this lean x y value that we get at the end what we do is we get lean x y i'm going to break this into these ones and then the x goes into the forward back lean and the y goes into the left right lane and now if we have a look we get these forward leaning and backwards leaning and also sideways leaning super super awesome so that's the first example out of the way now we're going to move on to the landing animations and making them more compressive when the the landing velocity is greater so the way that i have my landing animation set up is that i have an event in my nmbp so a cool thing about state machines in unreal engine is that you can specify an event for a certain transition so when we go from falling to walk slash run what we do here is we trigger an event down here called start transition event custom blueprint event and it's called additive landing now this can be called whatever you want but you will have to remember the name because in your event graph you're going to recall that by going additive landing bam and then when this event is called we play a montage now this montage looks like this it kind of looks a bit stupid i mean it looks very stupid but again it's an additive animation so the bass pose or master pose that i use for this additive is just the unreal engine standard a pose and so what i did was i exported this into blender and then in blender i animated this little landing loop so then i right click that i went create and in montage and we get left with this and in here you know i can set additive settings preview bass pose and you know we can uh get walking and so this is going to play over the top of the walking animation now it looks a bit it looks a bit choppy because the walking animation is longer than this animation but you can see this is kind of what it will be doing and an important thing to note about this montage that i've got set up is that it plays in a different slot to the default it's called additive landing slot so to set up a new slot you go down here to anim slot manager you can add a slot new slot name additive landing or something and so what that slot is gonna do is anytime we call this animation montage it will only play from this slot so to get a slot you just go slot slot default slot and then over here on the side you can change the slot name to whatever one you made before so i've got my slot additive landing uh you'll need to put a reference pose into that and so then the way we sort of get the variation between a small jump and a large or a small landing and a big landing or a heavy landing is we get the falling impact velocity which is a value that i set on my character blueprint with the unlanded event and it basically just gets the character's velocity and it takes the z value of that and sets that as a variable whenever landing occurs and then the reason i divide that by negative 800 is because when the impact velocity is 800 that's when i want this to be one and when the impact velocity is zero so like a very tiny minuscule jump this won't even be noticeable if it was 400 then this would be 0.5 and so on the reason this is negative here is because the velocity is actually negative when they hit the ground because they're traveling downwards not upwards that was something that i got stumped on for a long time i couldn't figure it out so now if we jump back in excuse the pun if i jump off this ledge we get like a really heavy compression whereas if i just jump like this we get a really small one a very slight one and you know if i jump up this slope there'll barely be one at all because my velocity is positive at that point so let's set this alpha to zero so that there is no additive animation whatsoever and if i jump and then hit the ground it just looks super stiff it looks like his legs were like locked and it just doesn't look believable you know it looks like he's made of helium balloons or something even if i was to jump off this slope it still just doesn't do anything you know it just doesn't look believable it doesn't look like he has any weight or anything but then with it enabled you know it looks like he has weight it looks like he's made of meat and you can make this you know more pronounced when they're wearing heavy armor or something or if they're like a a bigger character so that's how i use additives to make my landings more believable and sort of give your character more weight and stuff like that now the last one we're going to look at is adding sort of heavy breathing as your character's stamina runs out so this one's very similar to the leaning one that we looked at first so what this is it's a blend space that goes from no additive animation through to some you know light breathing then in the middle it's like sort of deep breathing but a bit bit harder a bit more pronounced and then at the very end when there's no stamina it looks very labored and so the oxide just go from 0 to 100 and it's called stamina percentage and so if we were to change this to a walking animation unarmed walk forward so now you can see he's walking forward just strutting along but then if i make him run out of stamina he's breathing but over the top of the walking animation which is really cool so the way we're going to implement this is we're just going to get the breathing blend space uh rather than you know using a state machine like i do to keep it tidy and wherever we want this in our animation chain that goes into the base and so the alpha of this is always set at one because we've programmed into it the the neutral state the zero state which is here so we don't actually have to worry about the alpha it's always going to be at one same with the leaning animations so now all we have to do is calculate our stamina percentage so these will be variables that you retrieve from your character blueprint so you know you might have a stamina and a max stamina and you just do it you know divide one by the other and you get the percentage you know this is up to you to figure out okay so now if we jump back into the game and i just keep pressing f which is my my self-harm debug button um as my chest gets more damaged his maximum stamina will decrease and so you know he'll become more puffed i guess so i'm just going to spam this for a little while there we go and so now you can see he's he's super puffed out you know he's not having a good time and if i was to keep running you can kind of see it a little bit it would be more obvious if i was walking but even if he's in his combat pose he's still puffed you can see his head moving up and down and so it can be really subtle but it's those things that players will notice you know 10 hours into your game and they'll be like oh that's cool like i didn't realize that you know i can tell if an enemy is running out of stamina by you know them huffing and puffing so that about wraps it up for today i didn't want to go like too in depth to all the technicalities and stuff i just sort of wanted to give you guys a bit of an idea of what is possible with additive animations and you know some creative ways that you can implement them in your games without boring you to death with like super specific things and you know this is how you set a variable in your character blueprint because if you're already at this stage of making your project you probably already know how to set a variable in your character blueprint i will be doing some videos about passing variables from your character blueprint to your animation blueprint because you know it is important to have a good sort of chain of command and also differentiating between you know what variables should be calculated on the nmbp and what ones should be calculated in your character bp anyway i hope you learned something at least i hope this gave you some cool ideas if you've got some unique ideas about what additive animations could possibly be used for please feel free to mention it in the comments below so we can build up a sort of repertoire of cool little tricks that we can use to make our animations feel alive and feel like they have weight make them a bit more interactive if you liked what you saw in this episode today don't forget to hit the like button hit the subscribe button uh ring the bell so you can stay up to date with you know all future videos and whatnot and if this channel holds a very special place in your heart please consider checking out our patreon below so with that i say goodbye goodbye [Music] you
Info
Channel: PrismaticaDev
Views: 61,300
Rating: undefined out of 5
Keywords: ue4 breathing animation, ue4 additive breathing, ue4 additive leaning, ue4 acceleration leaning, ue4 acceleration animation, ue4 leaning animation, ue4 tutorial, ue4 animation tutorial, ue4 blendspace, ue4 additive animation, ue4 additive, ue4 landing animation, ue4 landing, ue4 fall damage, ue4 fall animation, ue4 character breathing, ue4 run animation, ue4 walk animation, ue4 locomotion, ue4 locomotion animation, ue4 beginner, ue4 beginner animation
Id: flHL3qJB3_I
Channel Id: undefined
Length: 18min 11sec (1091 seconds)
Published: Tue Apr 27 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.