Motion Matching & Animation Blueprints First Look | Unreal Engine Tutorial

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
all right everybody Welcome to motion matching First Look round two reason this is round two is we already did a round one first look and since then we have discovered and learned a bunch of new things that warranted pulling down the original video and redoing the whole thing from scratch so today we are going to be taking look at motion matching so right now motion matching is all of the rage everybody's very excited about what motion motion matching is it looks cool it seems like it's easy you just drop it in and your character just looks awesome so the way that works is there is a giant database of animations and in that basically what happens is all those animations gets Co coalesced and tagged and um kind of organized and then what you do is you give the system information about which way your character is moving turning velocities there's all kinds of different parameters you can use and then what happens is depending on which parameters you use and which joints Etc you're tracking your database will give you back the best pose for what it is that should be playing on your character at any given moment now what this means though is that the data sets in order for it to have a high fidelity get quite large now there is a sample project that is coming uh according to Epic in June June of 24 it's going to be awesome to be able to take a look at that and see what kind of best practices and everything we can learn from that right now motion matching is technically experimental but that doesn't mean there isn't a lot of cool stuff so a couple more things to touch on before we kick off one uh because motion matching generally speaking requires a bunch of data assets it is probably there there's there's a bit of a slippery slope here okay uh it's probably a lot of work to generate those assets so if without the ability to generate all those assets if everybody starts using this same motion matching tutorial everybody's games are going to start looking the same so don't do that make your games cool make them unique make them fun make them have style all right don't forget that do use motion matching as a tool to help get your prototypes going to help uh you know prove out new characters all those kinds of things and then obviously um as the databases grow and expand and we can find uh cool ways to vary them great but don't lose the art people please second thing is huge shout out to Andre uh we had an amazing multi-hour session where uh a bunch of our community was hanging out in Discord and Andre was kind enough to share a bunch of his insights and learnings and point out some of the mistakes that uh I had made or more efficient ways of doing things uh from the original first look motion matching video uh I'm trying to coales all that here today so with that let's get started on our motion matching First Look round two we are going to be doing this three different ways okay so I'm going to show you how to set up motion matching I'm going to we're going to do just a plain motion matching method then we're going to use a animation State machine method and then we're finally going to do the exact same thing again with a Chooser so that you can see all three different methods and then between the three figure out what works best for your project and move from there so with all that monster intro let's hop in and take a look at getting set up for motion matching all right so here we are in unreal there's a couple things that we do need to set up uh this is a default uh third person template file I'll just go ahead and increase the font size for you all to be able to read and we are using 5.41 but in general if you want to do motion matching with the new stuff you need at least version 5.4 now if you watch the previous first look at motion matching the there is one change we're actually adding a another plugin in this setup so make sure you get the Chooser plugin uh in order to basically be able to facilitate the Third Way way that we're going to be setting up the motion matching so with that let's get started first we need to load some plugins so let's go to our window and we will go to edit plugins and the three plugins that we want is we want our post search so we'll go ahead and check that then we also need our trajectory so we'll go ahead and check that and it's experimental we know we're excited about the experiments and then we we will go ahead and look for the Chooser this was the change since the last version one of the several changes and then now that we have all those going we can go ahead and choose restart now so that's going to restart and while that's restarting you'll notice that I have a Lyra project here in the background we do need some animations in order for us to work with motion matching and so rather than creating a whole bunch of animations and spending all that time we're actually going to migrate all those the Lyra assets over so to do that also as part of our project setup we're going to go to characters we'll choose Heroes mannequin and let's see here we have animations Locomotion and we're going to use the unarmed set and in here I'm just going to filter for animation sequence and we're just going to take them all so I'm going to select them all and I'm going to right click and I'm going to choose aset actions and migrate now there's a bunch of stuff that we don't need uh I don't need the modifiers for example I don't need the notifies I want to keep this fairly clean we'll keep all the animations I don't need any of the materials because we've already got materials we already have meshes we're going to be stealing or reusing the skeleton in our already existing project so I can basically uncheck all of these effects all of that and there we have it so that's everything that we need the way the migration works is you go ahead and click okay and then you have to find your project you'll notice that we are motion matching three we have done this so many times all right so here we go we go to motion matching 3 we'll choose content select the folder and that's going to go ahead and migrate all those packages over for us now once we have those migrated over I'm going to go ahead and close Lyra just to save some resources and these will show up in our folder over here in our project under motion unarmed now what I want to do is technically if I open any of these uh they're not going to play properly because this skeleton remember we did not bring over the skeleton so it does not know how to play itself so I'm going to just quickly update the skeleton by right clicking and choosing replace skeleton and in this case I am going to select the SK mannequin skeleton this one not not ue4 yeah that's correct okay so go ahead and click okay and once it does that it will go ahead and will update all of our stuff so it actually shows a proper Visual and then what I like to do is I like to at least open one of these and just make sure it's actually working so okay so at this point we've loaded our plugins we've got our animations to work with let me just go ahead and save all of our animations frequently and often we're using an experimental feature and let's get uh a couple of more things set up so in order for us to let's go ahead and into our tutorial folder and let's talk a little bit about what we're going to be building here so for there's three or 4ish major parts to motion matching all right basically the way that motion matching works is it is a database of animations and they basically all your animations get dumped into a database and they all get tracked on a per joint velocity rotation all kinds of different bases and then what we can do is we can use some kind of metric to choose the best animation pose based on that metric so what I mean by that is if you have a character that's running forward really fast and you're tracking the feet and the hips for example and you give that you say database give me the best pose for the character moving this fast and you know in this position and it will go through and say ah this is the best pose and give that to you that's kind of a a loose version of the way this works so one of the things that we need is a database however if we try to create if we come up here and we try to create our pose search database you'll notice these are our three options if I try to create a pose search database you'll notice there's no config so what we need to do is we need to define the rules or the schema that allow us to talk to the database so that's the first thing we're going to create so if we go ahead and type in here pose I'm going to create a post search schema and the post search schema needs to know which skeleton we're working with and I'm going to call this my PSS post search schema this is going to be Manny okay and when we open this up it's worth just a quick little walk through and what we've got here is as I've described this is the rule set of how we are going to select the right poses from our database so our skeletons pretty straightforward we have that here we have our channels if we shift click the channel it'll just open them all up for us now you can see what it's using to choose the pose here we have all kinds of measures we have position X position XY we have velocity and position etc etc and you can also see which sample the bones are being used currently right now we're using foot left and foot right so this is kind of the rule system that is used to look up information in the database uh according to the docs and in general uh these basic rules will work really well especially for the purposes of this demo in a lot of the cases but you can come in here and you can play with uh a bunch of these to figure out the best match for you so we now have our post search schema now we can create our posst search database so up here we'll go ahead and choose pose search and we'll choose database and when we do that it is going to ask us for a schema this is going to be our post search database I'm going to call this Manny all because this first method that we're going to be doing is the kitchen snc we're throwing it all in it's going to be all motion matching all the time and we're going to see how it looks that's the plan all right so what does this post search database look like well when we open this up this is the really cool stuff so over here on the left top left these are all of our database apps assets that have been put into this database over on the right is our viewer and then we have you know various settings and information that we can set for all these things now to add to add animations to this database we could just go ahead and click add and add them one at a time but that would take forever so what I am going to do is I am going to go ahead and use the content drawer I'm going to go down to our unarmed and what I'm going to do is I'm going to do a quick search in here I only want the mm underbar so let's take all of these and actually I want them I want all of them but not Crouch and so I'm using a exclamation point so I'm getting everything but Crouch so let's take all of these and drop these in okay and now we get to have a lot of fun so let's get rid of our content drawer one of the cool things about the way this works is when these um animations are set up in here you can take a look and you can just click for the ones you click you'll see it kind of just playing and what they look like like over here in our visualizer now the cool thing is this visualizer is kind of helping us see what the visual representation of the current schema looks like so you can see we have this trajectory and then we have these green vectors on each of our feet right remember we are tracking the bones left and right foot so this gives us a visual idea of what is going to be used for um the pose selection now couple other things that are important uh you'll notice over here on the left there's there's basically the looping whether or not it's looping and we also have a root motion enabled now generally speaking everything I've read everything I've tested you want root motion enabled on all these so we're going to do some property editing and one other thing that's worth mentioning is uh I've seen a lot of tutorials where they turn the looping on I've actually had great success not turning it it on but I would go ahead and try both ways but for today we're not going to turn on looping for any of the animations so first things first let's at least do uh a quick update to all of these we're going to use a property Matrix we're still kind of in setup at this point so if we right click on these we choose asset actions and we do a edit selection in property Matrix what I want to do over here in the details for root motion you'll notice that this is a dash that means some of them it's on some of them it's off so I'm going to turn them all off and then turn them all back on and then I'll go ahead and click save contrl s to save those and then when we come back to our post search database you'll notice that these have all now been set up to have um our enable root motion now there's a couple things that we're not going to use today we're not going to use our idle breaks we are going to use our idle Rees we'll keep all of our jogs we'll keep all of our walks we're not going to use our turns so I'm just going to select those and this is one of the cool things about using motion matching you can just add stuff in and take it out super quick so we're not going to use our turns so we have our walks our jogs our starts uh we do not need our jumps either so let's get rid of our jumps as well for the purpose of this demo okay so we basically have everything we need in our database and just for fun I just think it's so cool to see the characters doing that all at once Real Time stuff is fun and and we've got it now we basically got our database set up now Okay so we've got our database we've got our post search schema we do need to uh let's talk real briefly about this other item this post search normalization set so basically from what I've seen in the code and what I've seen in the the documentation I can find basically what this is used for is this is used to normalize the searches across different databases so that if you have two databases with very different types of movement like really fast runs and idle it is meant to be able to help normalize that so as you're looking between them you get reasonable um you get reasonable lookups that's from everything I've read so far we will get a more definitive uh definition in use cases as we go forward and maybe even do a separate video on that but the good thing to know is this is totally optional so we're not even going to be using that today now the last bit of setup that we need to do before we actually start connecting everything in and actually building our motion matching is we do need to make a change in our third person character so our third person character right now uh it's the standard third person character I do want to change this I'm going to change this to Manny and uh I'm going to briefly change this to the Manny animation blueprint I'm going to go ahead and search for that I'm going to duplicate this and I'm going to call this APB Manny motion match and that is the one that I want to plug in now to our animation blueprint so we have our animation motion match I'm going to compile and save all of this and press play just to make sure we're still there okay so we have Manny running around with the standard old school animation blueprint we have one more thing that we need to add to our character remember we have the post search database we have the post search schema so we know how to look things up but we need the trajectory we need where do we get the information from to even provide the information for the lookup and that's where that trajectory plugin comes in and we need to add a component called a trajectory component to our character so we add this to our character we just call it character trajectory that's fine and we have everything we need to go into our animation blueprint to start setting up motion matching method one which is the kitchen sink all motion matching all the time so that's what we're going to do let's get it and hop into our animation blueprint and start setting that stuff up but the setup is done we're ready let's go all right let's get into the fun stuff we are going to be taking a look at our animation blueprint now and what we're going to do is we're going to basically throw in the motion matching kitchen sink so let's go through this this is a standard third person uh animation blueprint what we're going to be working in primarily is in our uh anom graph and if we take a look at our anom graph uh what we're going to do is we're basically going to replace this Locomotion State machine with a motion matching post search so there's a couple things that we need to do in order for this to work it's probably easiest to just kind of like lay it out and let's start adding in the pieces we need we know we need a database so how do we do that let's go ahead and type in post search and here we're going to choose this motion matching now now when you pick motion matching you may accidentally get the larger version of this um which is just got all kinds of extra stuff in here we're not going to worry about that one we're we're working with the the simplest most Straight Ahead version of this motion matching stuff so we have a motion matching and you'll notice that we have a database so in here let's just go ahead and pick our database in this case we have Manny all so in order to plug this in there's a couple of things that we need so first we need if we just plug this in let's just go ahead and do it so you all can see if we plug this in and we go ahead and we play you'll notice that our character just kind of moves around but doesn't actually run and that's because we haven't actually given the system the information it needs in order to track the to basically be able to have the trajectory and the information so what we're going to do after this motion matching is we're going to add in a post history note and you'll notice under post search pose history the piece that is important about this POS history is we can actually plug in a trajectory but we don't actually have a trajectory yet so the other thing I want to call out is if you happen to watch the first version the motion matching first look we had these Post history nodes all over the place we do not need that we're just plugging in the one and that will take care of uh even the second and uh the method two and three that we're going to be doing in a minute so I just want to call that out as a big change since the first version so we basically have our pose history node we do need to plug in a trajectory how do we get it what we're going to do is in our event graph we're going to bring up um our event graph and on begin play we've tried this before and a lot of tutorials have tried this and it has not been totally successful so let me show you how and why we can do this now okay so first off what we're going to do is we're going to change our cast we're going to change this cast to be our third person character and the reason we're going to do this is so that we know that we can get our trajectory component now couple quick things on the cast first off I'm not worried about this cast the third person character has to be loaded it is our top level character so it's already loaded I'm not worried about performance for those of you that are per performance inclined also for the purposes of the demo all we're trying to do here is get this trajectory component there is um there's there there you may find for your own work that there's a better way to to get this you can push it from the um character all kinds of stuff but what I want to show you here is if we drag off to this we can get our trajectory so let's get our trajectory and I am going to promote this to a variable promote to variable and now that we have that as a variable let's compile and save this when we go back to our Locomotion and not our Locomotion we'll go back to our anom graph what we can do is we can basically choose this pose history node and over here on the right is a pen for the trajectory now I'm actually going to move this over so you all can see this a little better if I click on this pen I can choose to bind it in this case to the trajectory I just created as part of the anim blueprint I have to I don't have to do anything else I'm just going to plug that in okay so let's re dock everything and we have our now we have our trajectory being fed in however when we compile and save this and we play our character doesn't move yet none of our poses are updated why not so here's what's actually happening and we ran into this problem before and we basically solved this a different way but what I want to show you here is basically what is happening is this trajectory is not valid yet it hasn't been initialized and one way we can prove this to ourselves very quickly is let's just add in a delay here if we just put in a quick little delay2 seconds we compile and we save that when we press play all of a sudden our character is running now and without geeking out too much it's actually it's actually doing uh a pretty good job which is great so it's picking poses characters is running stopping doing all the things but let's not get lost in the excitement that motion matching is working let's just go back here so what this means is it's an initialization problem our our character trajectory is not actually valid yet now I'm going to keep this here because maybe depending on load times Etc that might be the case and what I'm going to do is I'm actually going to extend this down in our anom update and I am going to add in a check to see if our trajectory is valid so here's what will do I am going to get the trajectory and I'm going to rightclick this and I'm going to convert it to validated get and what we're going to do is if it is valid I am just going to go about the usual course of action and if it's not valid then I'm going to go ahead and do this over again okay now I could there's a bunch of stuff I could do here um you know rather than storing the character I could store the third person character then I wouldn't have to cast again Etc again purpose of the demo just understand the core concept here is the trajectory node is not valid yet we need to double check make sure that it is valid if it's not we need to actually go through the process of making sure we get it again so here we go we'll come in here now in a normal game setup you would wait till the experience is ready you would wait till the character's loaded there's all kinds of asynchronous loading stuff that you might do but for the purpose of the demo you get the idea so we're going to ensure that this is valid we're going to go ahead and get our trajectory component from the owning actor being cast to third person we're going to set our trajectory and feed this in so now what's going to happen is every time it comes in here if this component is invalid it's going to try again and then continue on and eventually after it could be a tick it could be 0.1 seconds who knows how long it is you can see I removed that delay and if we go ahead and we press play now all of a sudden we have our movement that's pretty cool and the great thing is now we can geek out about motion matching okay if I if I move forward very slowly we even have our walks you can see a transitioning between our walks and our runs and doing all of that stuff jumping still works because what's happening is our motion matching is actually feeding into Locomotion and in our main State you'll notice that Locomotion is part of our normal jump land Etc so that's why all of our jumps and everything still work now let's make a couple of changes so that we can um better visualize and debug what's happening this I'm going to go ahead and change my Orient rotation to movement because I want to set this up more in the way that these Lyra animations were authored for which was more of a stray it's more of something that looks like this so the cool thing is we've got we've got our pivots I'm not doing anything I've done no setup I've done no um we basically have no blend spaces I'm not tracking any variables I'm not checking vectors on directions I'm literally feeding the database the trajectory and it is going in and choosing the right pose based on what I'm doing so if I turn or move directions too fast it's actually choosing which which uh animation to play it's actually doing a really good job out of the box it's pretty quick now one of the things that we can do to visualize this is in our uh motion matching database we have a blend time over here and there's a bunch of uh there's a bunch of options that you can play with here as far as play rates and blend times Etc uh basically as you as you work with motion matching I would encourage you to explore what these different options do how they affect your animations and Playback but the one I want to show you specifically right now is this blend time is the blend time within the database within the post search database within motion matching if we turn it off it's a cool thing that shows you where the poses are being selected so when I switch you see this popping everywhere you see that crazy pop what's happening is it is switching to a new animation a new selection within the POS database and so what we're doing with this blend time if we change this to like. 3 for example is we're basically easing the transitions between those so we get this nice nice kind of like start and stop Etc that actually might be too much cuz we basically were covering up our switch from out of our other state so let's try 0.15 just to see what that looks like let's see how far we can push that yep so depending on how far you push that blending is going to change how all of that motion works but literally that's it that is we put if you take a look at this database this post search database the stuff that we have in here is basically everything this is all the walks all the jogs everything we didn't do I mean it's awesome it's a I mean all I can say is it's awesome okay so that is Method one and we're calling that the kitchen sync all motion matching all the time whatever you want to call it big things to to note there is in general you need your pose history and the trajectory so it knows which poses to look up and your post search database so now that we have method one let's go ahead and label this as method one this is going to be uh method one all motion match all the time okay so now that we have that what we are going to do is we are going to take a look at method two now method two what we're going to do is we are actually going to set up a traditional State machine and we're going to do that because I want to show you that basically we can still use motion matching even within a traditional State machine and it's actually kind of cool some of the uh additional controls you get as a result of doing that so we're going to set up a a a very simple State machine and then we're going to compare the two so let's take a look at what that looks like now okay for method 2 we need a new state machine so let's just go ahead and make a state machine and we are going to call this um motion match loo motion loo motion just so that we can keep them separate and we know and we'll go in here and we're going to set this up as a very basic state machine so we're going to have our idle stop and we're going to have run that's it so let's add a state and this is going to be run and the reason I want to keep this simple is I want to try as best as possible to compare apples to apples um and then I am going to add an alias and this is going to be R2 idle Alias and this is going to plug in here if you are not familiar with State machines and aliases and all these kinds of things and transition rules uh there's there's a Anam blueprint tutorial on that but basically this Alias allows me to get back to stop from anywhere so in this case I want to be able to get there from run okay so we need to control a couple of things so first off when we're in idle stop we want to actually play Just idle animations and when we're in run we want to play just run animations so we need and what we're going to do in here is we're basically going to put in our pose search motion matching lookups here but to do that we need two databases so let's go back to our databases we're going to take Manny all and I'm going to duplicate this and this is going to be Manny idle and then I'm going to duplicate it again and this is going to be Manny run all right and then our run we're going to keep this very simple we're going to get rid of idle so let's save that and then in our idle we're going to get rid of everything else we probably don't even need the rest of the stuff at all but the whole whole point is you can do this so there's you know the idea of a post search database with one pose in it not so sure about but it's good for the explanation all right so now that we have that in our idle stop all we need to do is plug in our pose search so here's our motion matching and in the idle the one we want is Manny idle I'm going to copy this so I don't have to redo it and in our run we want the Run so this is going to be our run and we're going to plug this in okay now what we need to do is we need to control our transitions the way we're going to do that is if we're if we should move we're going to run and if we should not move we're going to go back to idle this works because as part of the default if you're new to all this as part of the default third person character template project they were kind enough to set up a bunch of uh information and state variables for us so we have ground speed and we have should move and is falling for example so for us what we're going to use here in our transition rule we're just going to get should should move and we'll plug that in so if we should move then the character is going to run and then if we're running and we should not move then we're going to go back to idle so let's get should and remember what I said if we're if we if we should not move so that means we're going to flip this we're going to use a not which flips this then we're going to go back to idle okay so compile and save let's just save all just in case so we've now successfully set up our state machine so we can go from idle to run to end back etet and if we go back to our anom graph what we want to do is we want to plug this in so what I'm going to do is I am going to duplicate this and we're going to plug this into our pose history now I'm going to disconnect technically speaking I only need one of these so keep in mind I'm disconnecting the other one right this is no longer being used so this is just here as a comment for reference for when I upload these files to patreon and so on so here we go so now we have our motion matching that is going through our post history which is now updating our Locomotion so let's see what this animation looks like okay first off does our character move oh yeah character moves actually the character moves really well do we have our we we have our Jukes yes we have our U our pivots basically is what they're called now one of the things that I want to point out as part of this is look at what happens when I stop character stops on a dime I mean it it comes to a stop within the square that the character is standing on let's look at that compared to what we were doing before so if our character is running and goes to stop you see how the feet overshoot and come back that's because the database is trying to pick the best pose based on trajectory there is probably tuning that we would need to do with either the poses we have in the database the post selection uh some of our uh you know uh prioritization you can set the waiting of you know how how how important is Idle versus run and you can set all those V variables and values in there so there's definitely some tweaking we could do to make this but you can see we've got a little bit of an overstep if we're just using the All motion matching all the time if it's not properly tuned but when we switch back to our state machine version of it oh that is I mean that is pretty smooth I think that feels really good and actually as a result of that it feels so good that I can almost see using motion matching instead of blend spaces in a in a um controlled environment because imagine this you do forward run backward run left and right run set up your blend spaces and then you realize you need a little more Fidelity so you do forward left forward right back left back right then you have to go back to your blend space you have to reset up your variables you have to track all that stuff not with motion matching all you have to do is drop those in your run database and it just it's going going to find them which is pretty cool as long as they're authored right keep in mind there's a lot of work to be done with authoring and everything like that but that's kind of where my mind's going I where can we even even if we're not using all of motion matching I still think there's a lot of really cool winds in here where we can still have and create awesome art and save tons of time in implementation and use some of these tools Etc okay so we basically now have two different methods of setting up motion ma matching so let's go ahead and comment this this is going to be method two and this is going to be our state machine match okay so let's talk about method three what we are going to do with Mees um what we're going to do with method three is we're going to basically rebuild the state machine version but we're going to do it with a Chooser table and if you've never used a Chooser table the plugin I believe is also experimental but it's really cool and it's probably best Illustrated through example so let's just go ahead and go through it and then once you've seen all three of these methods you'll be able to kind of take that and apply it as fits best for your project so let's take a look at method three now okay so for method three what we want to do is we want we're we're going to do the same thing we have our POS history and we're going to choose a source however what we want to do is we are wanting to basically dynamically change which database is chosen based on some of our variables in this case we're going to use we're going to keep it simple for this one we're going to use the should move so how do we basically turn this database into a variable so what I'm going to do is I'm going to right click on this and I'm going to promote that to a variable now all we need to do is effectively set this variable so that's where the Chooser table comes in so let's go ahead and come back to our tutorial folder and what we are going to create is a new Chooser so if we type in here Chooser table I'm going to call this Chooser table um Manny uh Loco motion match or let's just just do Manny motion match for example okay and then what we're going to do when we open this up the way this works is you have to tell you have to give the table information about what kind of table it is what kind of assets does it store and what does it use to select the assets that it has so what we have over here on the right is we have our context data and our output now our output is what we want the table to choose so in this case what we want the table to choose for us is a post search database so for us we'll just go ahead and select post search database and we can go ahead with the object result we don't want the class we want the actual object because we're going to pick a specific database and then the input is what is used to determine which of the databases we are going to generate or or give as an output so the easiest thing to do here is when we go ahead and add a context data oops I accidentally added two we're going to choose in here a class and the class we're going to pick in this case is what are we using to determine which database we want in this casee we're going to be using information from our animation blueprint should we move how fast are we moving what's our ground speed move speed all those kinds of things so the class that we're going to choose here is going to be our motion match Manny ABP so here's our uh animation blueprint Manny motion match and so we have our class and we have our context let's go ahead and save this and what you'll find is now that we've find it it knows it knows what it's using to look for the object and it knows what kind of object is returning now so over here on the left we can now add rows so if I add a row I'm going to choose an asset the once I do that because I specified it's a post search database you'll notice that the only options I have are post search databases so I know I need idle and then we're going to add another one so let's add another row this is going to be an asset and I'm going going to choose our run because remember we're recreating that idle Run State machine but we're going to do it with a Chooser instead so now that we have two options for this Chooser table to return what we could now not what we could do what we need to do is we need to add in the selection criteria under this column so if we choose Boolean column and The Binding is going once we choose a Boolean column The Binding will come up this is notice it's picking our ABP Manny and it's already found our option for which kind of booleans in this particular case we're going to use should move so now once we have set this these are the values that will determine whether or not we get idle or run so if should move is true we want it to be run so that is true okay if should move is false we want it to return our idle so what's going to happen is and you basically have three options here you have true false or any so uh if you want if there may be some more complicated scenarios Etc but one of the other things you'll notice is you can actually uh you can actually have in here in addition to Boolean columns you can choose based on en num so for example what is your current movement State while are you flying whatever that might be a cool one to use um the other one is a float in range so maybe for example your you have a separate walk transition table or uh post search database and your walk happens when you're movement speed is greater than three but less than 300 as an example you might use that there but anyways so we've defined our choose choose our table and at this point we're almost there so all we need to do in our event graph is we need to on update basically we're in our animation update okay we're going to add a pen and I want to set this database and the value that I want to set it to is is going to come from the Chooser table so let's get the Chooser table so we're going to evaluate a Chooser and we're going to feed that into here and the Chooser that we're going to evaluate is the one we just made we only have one this makes this easy this is our Chooser table motion and what we're going to do is we're going to take the result of this which we know is a post search database so I'm able to plug it in here and plug it in okay so what's going to happen it's on animation update it's going to evaluate whether or not we should move or not and then the Chooser is going to give us back whether or not we should be using the idle database or the Run database which is great so now that we have that connected let's double check our an graph so this is our method three let's go ahead and comment this for some reason it's not letting me comment so we'll just go ahead and plug in The Locomotion let's compile and save all of this and and let's see how method 3 works so does it work yes we can definitely run we can definitely go right and left we have our pivots which is cool and when we stop uh interesting look at that when we stop there is definitely um there is definitely a little bit of uh either blending time or something that's going on with stopping and one of the things things that I wanted to show you about this and it's particularly bad when I'm going to the left right it's still running for quite sometime whereas to the right it stops relatively reasonably quick so why is this happening let's take a look at something in our animation that is going to be if we take a look at our PSD run and we look at I believe it's our pivots and we look at jog left pivot oh I didn't mean to double click that I meant to single click that let's look at our jog left pivot okay see the character runs and then stops okay now let's look at jog pivot right whoa the character keeps running look at the difference between these two one stops and one keeps going so it my my suspicion is that because these assets have not been authored to be the same it is potentially causing a a little bit of confusion in the system combined with some blend settings ideally when we when we do this we would want these to be roughly the same like that's the whole point of having left and right so the idea when and when you look at this animation this one is 100 this one's over 100 frames long if we go back and we look at the other side this one's only 60 frames long so it makes sense that on one side it is sticking with the animation a lot longer than on the other side just because of the the difference in the blend times now there's some other things that are also potentially happening in here um as far as the prioritization uh or even the blending let's see here if we go back here we have our database our motion matching and our posst history so there is if we take and we drop our motion matching blend time down to zero I want to see what happens here yeah we get that popping back but we still have the character running so this is not an internal post search blending time issue okay and this may be a case where maybe the post search normalization would help uh things like that but overall the point here or the the awesome part of this is this is method three and this is going to be the Chooser and basically between these three methods I love I love method one for quick and easy and fast setup get a bunch of stuff in test it on a character it's pretty awesome I like method two for the control I think method three is awesome because learning about choosers is amazing it's a powerful tool that we can potentially use in our animation Blueprinting and all kinds of other stuff I mean think about choosers um or even motion matching for corrective corrective animations and additive animations all kinds of stuff like it your your brain's like running a mile a minute but so each of these has a different win to it something awesome about it my favorite is probably the state machine largely because I probably come from a state machine world but I don't want to Discount how awesome and fast like this kitchen sink is but I love the control personally of method 2 and some of my own personal work these this is probably going to be the method that I am going to be exploring and extending so we did it motion matching First Look round two so probably second look but uh this was this was actually I think a more succinct and better presentation of motion matching the three different methods are really cool so hopefully there is something in one of those workflows that will help you in your own Endeavors at the very least uh we tackled a couple of the common setup problems step by step uh which you can follow along for your own projects and take care of before we wrap up our motion matching uh video for today just one more huge shout out to Andre his LinkedIn is going to be down in the uh comments down below as well as if you like what we're doing here there are lots of ways to support the channel we have the tips down below we have the patreon we have uh you know hopping in if you have if you just have a lot of knowledge on any particular topic you're an expert in your field hop in Discord help answer questions that's awesome the community is really great about helping each other out as well as and as always spreading the word is awesome so with that my name is Kevin thanks for checking out the video and I hope to see you in an upcoming live stream take it easy
Info
Channel: Ask A Dev
Views: 7,441
Rating: undefined out of 5
Keywords:
Id: pZBDXjBEA9s
Channel Id: undefined
Length: 48min 59sec (2939 seconds)
Published: Wed May 15 2024
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.