What's the best practice to use montage and anim state machine?

Sometimes I don’t know whether to use a montage or anim state machine. For example, my enemy will have the hit reaction flow of take upfloatingfallinghitting the wall or smashing the ground , and the floating time needs to be configurable. If I play each action in montage, the connection between them needs to be handled manually, which is more convenient if I use the anim state machine, but the anim state machine does not interact well with my hit ability. I am now using GAS, have a GA_HitReaction, and then play the hit montage that according to the type of hit, but once the hit reaction is more complex, it is difficult to deal with. I don’t know how monsters like DMC5 or GOW4 make such a rich performance, I want to achieve that.
Thanks.

Use state machine for real states of your character like moving, falling, jumping, …

Use montages to react on something, like being hit etc.

And really important, use slots to define when a montage is usable while being in specific states.

Let’s say you are vaulting over a wall, you perhaps want to ignore being hit animations, so don’t use you “being hit” montage slot in the state vaulting state.

Furthermore start using custom blends between states.

And at last: Don’t expect that it is easy to do a complex animation system like in AAA games. It is much work , much tinkering and much to learn, like everything in game development.

3 Likes

Well there is no such thing as “Best Practice” unless being applied with in context as to the purpose the design needs to serve along with the constant improvements that make past best pratice obsolete as part of a design logic. For example the game play plugin suggests yet another different approach of using components rather than the traditional animation BP.

As to my opinion what I would suggest as being best practice is to first determine the logic blocks and how the migration paths needs to function base on the required “context” of what your project requires.

State Machines are really good as to required locomotion states, as to making your player move. Blend Spaces is used well in State Machines and more so as to 8-way movement. I would also include hits as a 8way 2d blends space to account for hits form different directions.
Personally though I don’t use a single state machine to account for all locomotion states but rather use a tree based on the context of the current 8way animation state.

Action states is where the player is preforming a layered animation, torso and up, such as firing a weapon, reloading, and a montage works well as to the requirements that most times the sequence needs to be completed once the action state is triggered.

The consideration between state machines and Montages is to trigger a State Machine you have to push a trigger and hold it for the state to cycle. You keep running all the while the W key is pressed. Release W you stop.

Montages is a trigger once and forget so you only need to press R for example for a reload and no need to hold the key for the reload to complete.

Soooo

State Machines = where player needs to have full control over the player action at all timers.
Montages = Best used where the computer needs to take control based on a triggered event.

7 Likes

Thanks for the great advice!

Thanks for advice.