Unreal Engine 5.4 - Motion Matching With One Animation (Overview)

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
all right guys so in this video I'm just going to go ahead and uh put this out there uh their license agreement it says that I can't share uh adapted material uh based off of their animation set which means that I can't share retargeted animations and also I have confirmed that this is for non-commercial purposes only so for non-commercial purposes only and you can't share the animations uh in any way after you can share them if they're in their original format and have not been altered uh that's basically it which means that since these come in bhv format I I can't I can't share the fbx ones that I retargeted so I apologize for that now I used character creator 4 to retarget those but whenever they came in uh this is the ground right here where that shadow is you may not be able to see it but I'll show you so you'll see he's hovering off the ground I had to come through all 77 of those animations and I had to offset the the hips so I'm not going to go through that in this video this is just a rundown but if anybody wants to know how I did that I'll do a video on it later and I'll probably do videos on iclone later anyway but it is a paid program uh you might be able to do this with a trial version of iclone in character creator you can try and see I can't guarantee you that you'll be able to but you can try so anyway moving back over here I'll have the link to this in the description it'll take you over here to their GitHub which is where I was at right there there inside of the license now you can't just download the zip here uh if you don't know how to uh clone a repo I'll show you an easy way to do it you can press this open with GitHub desktop and it'll take you to the download for some reason uh after you've downloaded it it's actually supposed to launch it inside of the application but for some reason on my computer it's not doing that so what you can do though is you can go to https right here and you can copy the URL and then open up the uh GitHub desktop and you can go to file and clone repository and URL and you can paste it there and then you have to choose a directory to place it and then press clone uh once you've done that you can go into the folder where you cloned it and you'll have something like this you won't have that folder there um and you'll have one fbx here not two I was experimenting there uh so this is an asky and it can't be opened in blender uh oddly enough but you can import it into unreal and then export it from unreal and then import that uh into blender and that will work um now if you try to download the zip version of this right here then these Zips inside of here will be empty that's why I say you have to clone it then you can extract them the lefon one is where the bvh files are these are the ones that have already been uh uh I guess set up for the uh for the character that it that uh is in the fbx folder this one right here the c3d ones are the raw mocap uh animations from my understanding so you probably won't want to try to use those I would uh recommend using these bvh ones and so you'll have to uh figure out a way to convert those if you don't want to uh uh or if you don't have character creator 4 uh then you'll have to uh find a way to do this in blender or somewhere else but I won't really be able to help you much there now I've seen somebody he did it in blender and for whatever reason it had no root motion on it I don't know why that is uh because I looked in here and I'm looking at the rotation z now I don't know if his did have rotation on the root or not but if it didn't then that would mean that these already had root motion and somehow he stripped them on accident uh because these curves on the root and the hips don't match and you can't get Mitch M uh mismatching uh curves between these uh if you're doing if you're transferring these by hand so uh but I will say that the position X and position y of the hips uh do seem to be on the root so there's no movement on the hips if there is movement it's probably very subtle as you can see it looks pretty straight to me uh but so what's important for root motion is X and Y and Z rotation X Y position and Z rotation so uh if you can figure out how to do that and blend then you should be able to get this set up so now that I've had uh I've gotten that out of the way you know how to clone the repository and download the animations and uh oh you know how I converted the animations like I said I had to offset the pelvis myself but anyway let me just go ahead and get in here and I'll show you now I did make a slight alteration to how I had this uh set up uh and it it it did reduce the bobbing effect that we have right there but it's not completely gone and that might have a lot to do with the way uh this animation was done perhaps that these stretches just aren't quite long enough uh to accommodate or to prevent that bobbing effect I don't know but I only have one of them set up so you'll see a few uh glitches here and there where it's it's missing data and so it has to jump from one point to another now the downside of having uh this set up the way I have it set up is uh you don't really have a whole lot of control so you C you can uh you can tell it where where you want it to go but um the root motion on the animation that are playing to match that uh desired direction is actually what's driving the motion so let me just go ahead and explain this to you I'll come over here to the anoms on subject one and so I I actually uh divided these into subject one two three four and five because there's five subjects in that set and each of them have their own animations uh just so you know and some of them have different animations that others don't have but it's just how it [Music] is now there's a few things that you need to actually get this working uh you don't actually need a normalization set a normalization set a post search normalization set is you is meant I believe to um it has something to do with having multiple uh post search databases like I said uh I've only actually spent a couple of hours even studying this so I don't know a whole lot about this yet but people were asking me to do a video on this so I wanted to cover it for you guys so if you go into plugins and go into animation uh you do need motion trajectory plugin enabled you need the post search plug get enabled now there's probably about five billion motion matching and unreal uh videos out there now so I don't really feel like I have to go over this uh manually but I'm going to go over like what I did change so I uh went to animation the motion matching I created a post search datab database and a post search schema so the post search schema this is my post search schema right here and uh this uh holds data based off of how you want the searches uh within the database to be uh done so I did create a mirror data table uh but I ended up not using it because it caused problems uh apparently whenever you mirror animations it'll mess up the feet so it was causing the feet to do funny stuff so if you see videos where people have their feet and their feet are sliding that's the reason why is because they're mirroring the animations to try to cover more area and that's actually causing problems for them and they don't realize it so you have a roll I I suppose you can have multiple skeletons within the schema and you can have different roles for each of them and these roles are uh being used by uh these channels so you'll see that there's two channels here there's a trajectory Channel and opposed channel so the trajectory Channel it basically Maps out from what I understand uh the types of uh things that you want to uh as far as the trajectory itself that you want to keep track of and so this is saying that for example the position XY uh it's going to look uh back uh4 seconds and then the velocity XY facing Direction XY that's current Uh current position in the timeline uh this is 35 positions ahead in the timeline and then uh this is7 seconds uh ahead in the timeline and then you'll see they have different weights on them uh which determine how uh much influence they hold over the decision of this trajectory the trajectory itself has a weight of seven and and that is separate from the uh the weights inside of here so that's seven this is three which means that the trajectory is going to be favored over the pose I did actually change uh that way on the pose so I think yeah I think by default it's actually uh one it might be two by default I don't remember maybe it was yeah it might be one I think it is one by default okay so I did change mine to three let's see what kind of effect that has on it okay so so it looks like uh increasing the pose weight actually does smooth it out just a little bit does have a slight effect on it but everything has a cost in here so if you increase uh the pose uh weight then I'm not really sure what problems it would cause to be honest with you I haven't gotten that far into it yet I'll tell you what I do know though is adding uh the neck uh and having attract the velocity and position of the neck or one of the upper bones I chose neck because the head it made the head move in a funny way but whatever you have set here you're also going to have to set on the pose history uh collected bones inside of here otherwise uh this won't do anything it won't be any good so so you I've introduced you to the to the setup I have inside of here like I said I did have a a weight of three but you know I'm not sure how relevant that is I was just experimenting I didn't uh change the continuing uh pose cost bias or any of that in here I did mess with the continuing pose cost bias but increasing it too much will cause serious problems uh and even increasing it slightly can cause problems so see I'm not pushing any buttons but you'll see he's moving and the reason why is because and I'm not pushing any buttons right now the reason why he's moving is because we've made it uh more favor favorable for it to continue playing animations uh and so because of that what can happen is it can cause cause it to be less responsive so if I press uh to go in One Direction uh it may be the case that that sometimes whenever you're in an animation it might favor to ignore your input and just continue playing the animation so that will be a uh decision that you'll have to make I'm not pressing any buttons right there you'll see he kept moving after I let go he kept moving and that's because we probably increased it too much so we be careful how much uh you increase that and I say increase that I know it's confusing I'm thinking of it as increasing uh the the possibility of it continuing but really uh the lower the weight of a pose the more likely it will be that pose will be chosen and so for the continuing pose cost bias if you lower it you're you're actually increasing the chance that it's going to continue playing uh those poses one after the other which means that he might press a key or he might let go of the key but he'll keep running basically uh but there's other ways to mitigate that and I'll probably get into that in a later video so you do have different post search uh modes down here I've experimented with the other to but didn't really get very good results the VB tree is meant to be an optimized search mode and this is probably what they're using in uh if I had to guess inside of uh their project uh I keep forgetting the name of that game fortnite yeah just to show how uh how much I play it but yeah so you can set a preview mes here I don't really feel that's necessary but if you want to you can and in order to get animations in here you can press this add button and press one of these the these are the different kinds of things you can add ANM comp composits ANM montages multi-sequence blend spaces and sequences so it supports all of that all you have to do is click and drag to get it in there and I'm just and you can also say okay well maybe I want to see if this is causing any problems this one right here I'll disable it and so it won't be evaluated while the game is running so uh this means that it that it's a looping animation uh and this means it's root motion enabled they should all be root motion enabled and I'll go over that right now so if you open it up if you open it up uh you'll see that I not only enabled root motion but I also Force root lock and that part is actually important and I'll show you what it does if you don't do that so let's see so I'm pressing in this direction but he's not moving and I'm pressing the key and he's not moving pressing forward he started to move but he's moving forward and left not forward uh but you you see it seems that if you don't do if you don't force root lock then and I'm pressing back right now you see it tends to do funny stuff so yeah you want that Force root lock and I'm not really sure yet why you have to force the root lock uh but you do inside of uh your animation blueprint you'll see the class defaults root motion from everything uh that's how I have it set up but by default it's set to root motion from Montage only and so it won't receive root motion from the animations and so right now it actually it actually is working and it's more responsive uh but because there may not be a matching pose to the Lo uh to the movement of the capsule in this case uh you may see some uh funky stuff and so you'll see it's a little bit more jittery uh now because I'm not uh having the and you'll see that my velocity over there is solid so it's more responsive this way but the animations uh May the animation may not look quite as good uh so but it depends too if if you're not using uh dance cards then if you're just using regular game animations game ready animations that are looping and stuff like that then they probably have a constant speed uh unlike the unlike these dance cards these dance cards he's moving at all kinds of different speeds and so trying to match my actual uh character movement uh motion uh to the data set so that the data set uh will uh so that the pose selection will be good uh is would be a logistical nightmare so trying basically I would need to create a movement system that mimics uh the way the guy was actually moving in that animation or uh you'll get stuff like this where it's just jittery and all kinds of weird weirdness uh so also the more animations you Fe into this the less likely it'll be that it'll Jitter because we'll have more animations to match that movement so it depends really so it doesn't look too bad and it is more responsive but I mean it's really jittery it's not something you would want to use in a game so that's why I'm using root motion from everything you you can do uh ignore uh root motion and it basically does the same thing so it it's still really jittery you see so yeah so that's how I got that working I use root motion from everything and I have Force root lock and enable root motion so that's the rundown on that so also over here you can uh choose to uh enable and disable it from here but that's the same thing as pressing this button you can disable reelection if you disable reelection then it can't loot back over and select different parts of the animation I believe that forces it to select a different one inside of here and if you only have one like me that would probably be a bad idea we can try it now though and see I might be wrong so let's see I mean it seems to be working the same as before so I guess maybe I'm wrong yeah I it's still working the same as before you see what happens though whenever you're using the root motion from everything uh and it seems like it's wor it's running a little bit worse than it was for some reason probably because I've been been coming in here messing with stuff see okay so disabling uh reselect uh might have actually been causing some problems because it seemed less responsive whenever I disabled that no it's still doing it so it might be my continuation bias I think I I messed with that oh no I set it back okay I don't know why it's doing that then but it's he's slowing down and that's because we're letting the animation drive it and so sometimes it'll get into a position to where it'll think it needs to slow down uh because it's trying to match the velocity and Direction but the velocity and direction to some degree is actually being controlled by the animation itself so like I said that's probably that may not be a good way to do it but I'm still learning so that's the rundown on that so the second thing you need to know is that if you come over to the see the blueprint me just open up I don't even know where that guy is for some reason there he is okay I just overlooked him earlier so if we open this up you have to have a character uh trajectory right here so that's uh needed and then on the animation blueprint on the event graph uh you need some kind of reference uh to the character uh don't try to uh store a reference directly to the trajectory the character trajectory don't do that I tried that and for some reason it doesn't work uh so don't do that just store a reference to the character itself and then on the enm graph the only thing you really need and I don't think I even have that hooked up no I don't um I was experimenting with that but um so yeah you need a motion matching and there's actually more than one in here so it's a little confusion confusing I don't know what's up with my ability to talk today so you see that motion match here that's not the one you need you need the one down here under pose uh search the one with this icon I don't know why their their names are so similar it's weird one of them is a function though uh the other one's a function so you need to grab that one and then you need to grab the posst history and there's only one of those I I believe but so the post history uh anything you feed it into the source will be taken into consideration for post selection for my understanding so you get the motion matching component uh you choose your database uh you have to set a trajectory so I'm just going to show you how I did it so I went to this and then I referenced the character TR trajectory from the character reference itself so that's how I did that so I actually uh increased the post count the maximum amount of poses that can be stored that will increase memory uh but I think it gives it uh more poses to cross reference that's on the Post history and you'll see that like I said before if on on your on your post search schema which stores all your uh settings for it whatever you added under your HST channel right here these bones they all need to be uh set up right here as well because these are the bones that this post history is going is going to collect information on from whatever you're feeding into it so with that being said you wouldn't want to get a foot placement node and put it between here because if you did that then it would have trouble trying to match uh trying to choose the next pose based off of this altered animation but if you place it afterwards it it won't affect it at all also over here on your motion matching you have a blend time you can set blend profiles uh and I'll show you what those are a lot of people still don't know what these are so if I just create a time wait and blend and then we come back over here you'll see that we have the time and the weight but the blend profiles those are only used for uh the uh other notes inside of here the like well it's for uh like the man my mind is going blank here I don't know what's what's up with me today anyway uh so the POS reselect history right this prevents reselection of poses within this uh time period so this is half a second right here uh so in this case I I'm telling it by default it's 3 seconds uh and I was just telling it uh don't select toose within 0.5 seconds that might actually not be a good idea now I did ask it not to jump back one second in time I was just experimenting with some of those settings but maybe uh 0 five is more appropriate and so that that will help make sure that it that uh the animation is being driven forward in time and that it won't suddenly snap back and so you'll see the the jerking has uh reduced uh significantly so you don't want to prevent it from going too far back in time because that'll cause serious problems so maybe try to stay under a second if you I do set that but actually setting it to.5 I think that kind of makes this irrelevant right here so right foot left foot and neck yeah that's pretty much it guys I mean uh I enabled use inertial uh [Music] blend and I increased the max active Blends from four to five not really sure how relevant that is like I said I've only had a few hours to even look at this over but a lot of people were asking me to cover this so I wanted to show you guys how I pulled that off I'm going to have to look into this uh further it might take me a couple of months before I come out with another video on this uh but you know there's a lot of other good videos out there you know just if you have time dive into them and uh check them out you know there's a lot of good information out there but also you know you'll see I hook to this leg ik up afterwards you'll see it's not causing any problems so with the post selection you'll see there's still a few hitches in places but it's not that bad now the problem with uh these dance cards is uh these things can actually they're not easy to do so I actually let me show you so if I come into this animation and I uncheck that let's see here let me just reopen this there we go refreshed it so this is around the area that they used so if we go into the top down you'll see that this is roughly 12 M by about 8 m that's a pretty big space so the move. a uh AI animation uh uh software that's starting to get real big uh I looked into that and if you have six iPhones you can cover an area of 6 by six meters which would be let me see so it would be this far which is half of uh that length so six and then six so you'll see you'd be really limited to the area of movement right here you wouldn't have a whole lot of space to move in and so trying to perform these dance cards like they're doing would be basically impossible to do within such a small tight space so I looked into it and just for the cameras the cameras alone uh to cover uh 9 by 99 uh which would be to cover this uh length but you'd also have one meter further in this direction unless you rearranged them some way to cover a longer area uh but that would cost you about uh $95,000 just for the cameras then you need the space uh you need to Anchor them like up on the ceyon or the walls or something uh and then the software also I think it cost about $5,000 for the software and then you have to pay M maintenance fee of about $25,000 after that uh and that's if you want all the important features of the software but they have a cheaper one that's like half the price like $2 and half thousand and then like I think $500 or $800 a year after that but yeah anyway that's basically the rundown on it guys uh sorry I couldn't provide those animations uh if somehow someway uh I'm given permission uh by Ubisoft to do that then I'll come back and I'll uh I'll just share the animations with you and I'll we'll walk I'll walk you through the entire setup but that's pretty much all I have I'll see you guys in the next video
Info
Channel: Unreal DevOP
Views: 3,051
Rating: undefined out of 5
Keywords:
Id: FJFV89YYu08
Channel Id: undefined
Length: 35min 8sec (2108 seconds)
Published: Sun May 05 2024
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.