What do I do when this happens?

UE4 animation system includes a lot of stuff as you can see from here, so I'd like to explain some situational examples.

Here is a character, what do I use when I want him to walk?


We have lots of locomotion examples, but usually you use AnimGraph from Animation Blueprint. Animation Blueprint consists of two graph. One is AnimGraph and second is EventGraph. What are the differences? Animation Graph is the one running animation system and outputs bone transform, where as Event Graph runs BEFORE Animation Graph and update inputs using awesome blueprint system.

Because AnimGraph works with bone transforms, it is expensive and a bit complicated. But basically when you have character with random states such as running or flying or crouch, it is easy to use Anim Graph.

Do I use state or blend node?


State or blend nodes are almost same thing except they provide different features in terms of UX and some detail features - i.e. custom transitions. You can almost implement same system using both. For example, instead of using transition rules, you can evaluate the active index of blend list node and feed that to blend list.

It is more of options for you whether you'd like to use states or blend node. Some people prefers states because it's easier to visualize than blend node.

When do I use AnimMontages?


AnimMontages are a special asset that can be used for one-time event. Like swing or melee attacks or special event triggered animation. It provides different slots or different sections that you can control based on your gameplay.

AnimMontage plays inside of AnimGraph. It doesn't play alone. You have to create AnimGraph with a proper slot that AnimMontage can play on. You can have multiple slots for them to blend.

So many options?


You can implement rifle fire animation using states or montage. You could have fire states, where it plays once and get out. Or  you can play using montages, and finish. What works better for you? How do you want to transition out of it? Do you want to blend to specific animations? If so, it's better to work with states because you can have specific animation to play all the time instead of triggering through montages.

Note that you can't play multiple montages IN THE SAME GROUP. You can play multiple montages in different groups. So when you design your system, you have to think about limitations. States allow you to blend as many as you'd like, but not montages. Montages have special rules on how many can play within the same group.

The default way of doing it is to use AnimGraph with states if it's not one time event. It is more intuitive and it is easy to understand visually.

If it's one time event that you can forget about it, then you could use AnimMontage. You can also design simple states using AnimMontage - for example, start->loop->....->end, where loop section loops until gameplay tells it to get out.

Note that deep nested states can be expensive, so watch it out. You want to design your AnimGraph to be flexible but also efficient as well as easy to maintain.

Thanks for visiting and reading my first blog. If you have any question, hit me up on twitter. (@nikolobin)



Comments

Popular posts from this blog

Master pose vs copy pose vs mesh merge in UE4

How to avoid Spagettie AnimGraph?