hello, i have made basic motion matching vaguely similar to what ubisoft uses.
ive not seen anyone really attempt this before (mainly because Roblox’s animations are terrible for anything procedural animation related and root-motion related ) so i decided to have a crack at it.
Without getting too deep into it, what motion matching does is it takes your player’s movement trajectory and some data about your current players pose, and then chooses a pose out of a big list of mocap data that makes the most sense to go next. (its a bit confusing)
For instance, if you are running forward and then decide to turn left, this system is able to look through the mocap data and find the “turn left” part, and then choose which pose makes the most sense to be used next.
This allows for nice looking animation with minimal foot-sliding to the standard of what you can get with root-motion, but with way more responsive controls.
The great thing about this system is that it uses no state machines! no need to mess around with :AdjustWeight()
on a billion animations at once! With motion matching, you can quite literally just throw mocap data at it, and it will figure out how to play the animation itself. Of course, getting a large amount of high quality mocap data is indeed a bit difficult, but once you get it, its smooth sailing from there.
but yeah, this is nerd stuff. I thought it was cool so maybe someone else will too
here it is. This uses a single Roblox animation, and again, uses no state machines of any kind.
and here’s a little bit of it in action
Obviously, its a bit rough, and is again still very basic (im only using about 16 seconds of mocap data here, which is nowhere near enough), but still definitely is better than a single looping run animation that we usually see in roblox games, and i can definately see potential for this becoming close to what AAA game companies can come up with.
(i especially like the detail where the player takes an extra step when turning, gives alot of life to it)
Although, a big problem ive found is with Roblox animations themselves. Roblox currently has no way to query AnimationTracks
for single frame data, so right now im having to set the TimePosition
, and then wait a frame for the animation to update, so when prepping mocap data, the system has to take a long while to go through the entire animation to create pose data and trajectory data for the motion matching to use. (can take up to 5+ minutes, depending on how long the animation is)
This definitely isnt ideal, since this sort of thing depends on a large amount of mocap
to pick from so that it looks the best it can. The more data, the better result.
i hope for the day that Roblox decides to upgrade animation functionality, so that we can actually do all these kinds of things easier
but yeah, cool stuff. hope to use this in my game someday if i can flesh this out.
thanks for reading
heres a GDC talk if you wanna learn about the details of something like this.