Download

Motion Matching for UE4

Hello everyone!

I’ve been Implementing Motion Matching into Unreal Engine, If you are unfamiliar with what Motion Matching is I highly suggest checking out this great GDC talk by
Kristjan Zadziuk: GDC 2016 - Motion Matching, The Future of Games Animation... Today - YouTube

Early implementation results:

I am sharing what I’ve done so far to see if more people get interested in working on this technology.

Github Link: GitHub - Hethger/UE4_MotionMatching-: Early Implementation of Motion Matching tech

Cheers.

Very impressive! Motion Matching is baller.

This would be awesome to use with VR for the leg animation, since all you really know is the direction and velocity.

Cool!
I did a few studies some time ago, but this is looking promising!

Awesome!! very cool plugin!

Is that working for another project?

Just heard about Motion Matching, looks incredible :stuck_out_tongue: The GDCs talk are highly instructive.

**Hi Hethger,
thanks for sharing your work.
here seems to be a need to install your previous plugin which is 60$ on the market place…
I really like the tech and would love to learn more or try implementing it myself but it seems like a big pricetag just to try.

I already watched **Kristjan Zadziuk’s video but he doesn’t show how you can implement it. You have to get a lot of motion capture data, ok. but how do you plug the “cards” before your state machine? Could you point me in the direction?

Hey this is really great!

I was wondering, i see right now you apply the motion matching result as Root Motion, is there a way to modify the system so the capsule is the main driver?

Ah cool, i played around with the motion data you provided, i noticed the big issue is that the locomotion loop itself always tries to weight between two motions which make the loop look a bit odd, would this be corrected with better initial data?

That would certainly help, but with this early implementation it would still look odd as the blending method is something I couldn’t quite nail down, using a blendtree like they do in For Honor would yield far better results.

Ah okay, can you explain what you mean with “blendtree” ? would that look like dividing or tagging specific motion areas like looped runs/walks, so the system is not always considering them for lowest cost?

EDIT: i watched the presentation Simon gave for motion matching in For Honor, it seems they resolve sliding feet by locking the IK when the toe has not a lot of movement, and another interesting thing is that you can play the whole game without any Art so it just runs a capsule, interesting is also when he talked about simulation space, it appears like if you were to translate this to the capsule it would mean that uses the default ue4 movement logic so pretty much normal velocity and then the character mesh tries to follow it, there was a video where he showed the character itself lagging behind trying to catch up with the player capsule / simulation, then his solution was to clamp the mesh to the capsule/player component and just allow a little bit of drag or fall off.

This is all very interesting and i am hoping to put some work into :), i have been planning to make a tool to create dance cards inside motionbuilder from animation clips ( for when you want to translate your legacy assets ).

This guy figured it out.

Seems to be a product to be released, so super excited to take a closer look at it.

@Hethger it’s really great you shared your project with the community, thanks man!

Thank you very much @**Hethger **for sharing your progress, it’s a very interesting project and some very decent work!

I happily tested the whole set up, the matching method works extremely fine, I instantly got good results on turning once I have my raw resources imported into the engine.
However, there are several problems I found, and I’d like to send feedback to you and to the community

This is my test result​​​​​​​

So basically, the sharp turns and rapid stops are nice, but I found it difficult to have my character go straight naturally ​​​​​​​

That has something to do with the blending method as @Hethger and @**Highflex **said, but yet also a lot to do with not ideal raw animation data, for in the raw data from given project, there are really not many sections contains a fine straight walking loop.

With some additional straight walking clips input into the system, I DO get nice straight, smooth walking actions going on now ​​​​​​​

But still, with only a tiny fraction of knowledge on C++, this system is more or less remains a black box to me​​​​​​​ …
I don’t have an idea on how to tweak, or how to regulate the range on the search for matching poses, this may be the last thing this system needs to expose to the artists to be working as a real solid solution.

I know that this demo is not intended to be treated and used as a polished finished tool, but in fact, this tool, this demo, is already showing great potential to be a really good one.

Thank you very much again for sharing your work @Hethger, really good job!! :smiley:

, for some reasons it didn’t open correctly for me, it says : the following modules are missing or built with a different engine version: UE4Editor-UE_MotMatch.dll then it asks me for a rebuild. when I press yes it says: UE_MotMatch could not be compiled. Try rebuilding from source manually… what should i do (my ue4 version is 4.18)
Show lessREPLY

this is what i’m looking for. thanks a lot for sharing this. @Hethger

about the advanced this topic,

i wonder how can i extend to other animations and controls, such as jump / punch / slide / climb / etc.

can i handle various situation with one motion field? if i need more how can i mix them?

make more parameters related with those situation and pass them to the motion field for evaluating candidates?

there are many things popped up in my head to achieve them.

i’ve tried to fix the character go straight naturally from idle to walk, run, sprint.

but it’s hard to imagine how to get the next step what i mentioned above.

how about crouch when the player pressed ctrl key? do i pass the flag for crouch to the motion field and change the cost equation to adjust pose?

any advice would be helpful for me.

here 's one way i’m trying.

about stand and crouch pose, i put the tag on the motion key between two poses.
when i changed my character from stand to crouch, find the motion with a tag, “Crouch” for candidates.
do the same thing about cover and uncover.

i’m trying to move from fsm to motionmatching for handling animations because of the complexity, but the motion matching gives me the other problem about how to make the cost function.

Hi **gawoon, **did you consider using FSM for blending those MotionMactching result? It could be an alternative way to get the result you want.

How are you setting tags? I cant figure it out. I can create a tag row that appears below the animation in the editor viewport but I have no idea what the red and white lines are and how to set an area as tagged.

Very cool stuff @Hethger .

Im trying to get it working with some of the marketplace packs, that are on shorter loops (root motion, but maybe 1 second) and im having issues with it as it doesnt seem to build the motion keys.

Does this need longer animations? Or its just me having a wrong setup.

I also want to know what exactly are the “motion bones” when you create a new motion matching asset.

Yes, seems that it requires longer clips from my brief testing. It probably has to do with tracking velocities and needing a certain amount of lead-in time for accurate prediction. That being said it seems like an abnormally long amount of padding.

Motion Bones are essentially which bones in the skeleton you want to be tracked/matched. Haven’t dug into Hethger’s system yet, but usually you can also weight the motion bones so certain bones matter more when matching motion.