Creation of crazy rotations & poses for intense melee combat attacks

I’m looking for realizing my dream of making a crazy game that got the best from legendary games like Ninja Gaiden and Devil May Cry series.

In those you will find stuff like:

  • Dante being upside-down in the air & spinning at high speed
  • Ryu jumping into the air, tilting 45-90 degrees and doing a tilted tornado spin attack rotating as high speed

To make things a bit more complicated; there is cancelling allowing you to go to block-state from attack states & you can get hit by an enemy taking you to massive-knockback-state or inPain-state

I have started to get an understanding of where to begin, gathering some knowledge from other threads:

So the extra tools at hand is setting up variable-curves & notifies in animations to apply extra modifiers in my C++ Character Controller & use state machines to handle the blending.

Given this, then what should I do in Cinema4D (3d modelling & animation program), Persona (setting up curves & notifies as input to C++) and C++ character controller (applying a extra transformation to the mesh-model).

Currently I’m thinking about doing the posing in Cinema4D, trigger rotations by using Persona, and have some modifiers running in C++ inside my character-controller.

The downside as I see it, is that I need to be playing the game to view the animation results, making me almost want to make my own animation editor running in-game.

So, does anyone have any ideas or feedback on this?

I would guess that stuff is all just in animation…the Root of the character is likely not rotated and just the character model is…at least that’s likely how I’d go about it…so my root even with an upside down character like Dante would still be closest to the ground and I’d animate it all (therefore being able to see it outside of the engine)…with cancelling and taking a hit to go back to the regular Right-side up poses from those I’d just use a .05 or .1 blend when the animation starts to play the Block or take hit animation…Unreal will figure out the rest for you…I may be totally confused on what you’re saying though so this all might be super unhelpful…

In my experience, Interpolating rotations is not as straightforward as it might look.

I know of atleast 4 ways to represent rotations:

Euler angles:
3 floats: yaw, pitch & roll
can be convenient for specifying a rotation as end-user but
suffers from gimbal lock and i honestly don’t know how to interpolate these when 2 or all 3 are non-zero

Axis-vector + angle:
can be convenient for debug drawing or when making your own rotation modifier and composing transforms, like having 1 rotate the model to set the global rotation and 1 applying extra rotation in local space
an overly simplistic way of interpolating 3599 degrees turn around an axis can be to go back all those 10 turns in reverse opposed to go forward 1 degree

there are usually super convenient, but has the quirk that the quaternion q and -q looks the same but have different internal representation, meaning it takes 2 turns to get back to the same value
is sortof stores the angle around an axis being like -360 to 0 to 360 degrees] around a vector but stores this as a 4-dimensional imaginary number on a unit sphere.
so given 2 quaternions there can be several ways to interpolate them, going the shortest arc or going backward.

then there is a 3x3 rotation matrix that actually stores the local X, Y & Z axis for the rotation
these are quite efficient if you want to transform a large number of vectors

So I hope this sheds some light on the subject showing that there are several ways to deal with storing and interpolating rotations, and different Tools might use different ways giving different results.

More specifically how they deal with -359, 1 & 3601 degrees of turn can have an impact on what result you get.

I do my upside-down or rotated anims purely in animation (the root bone and capsule maintain their orientation), UE4 is really good about interpolating bone rotations intelligently between poses; no odd quaternion flipping issues, no bones-rotating-through-bones, etc.

My advice is to handle rotated stances with your animation software. Only use UE4 to rotate dynamically (i.e. in the direction pressed when you hit the attack key) and to switch from grounded to airborne (for collision reasons).

Sure-fire way of getting these into your game:

  • Step 1: Learn how to do these movements IRL
  • Step 2: Purchase a motion capture suit
  • Step 3: Learn how to use said motion capture suit
  • Step 4: Perform said “crazy movement” while wearing said motion capture suit
  • Step 5: Clean up anything “weird” in the capture data
  • Step 6: Import motion capture data into animation software
  • Step 7: Go from there


I’m confused about what you mean by that!

I want to do this:

Hmm, you’d probably want some state machine inside your character class to handle inputs and move transitions. This would then feed animation blueprint’s state machines. Which would animate your character mesh appropriately. Your character would get overlap events on its mesh’s colliders, which you would handle in the character to do the appropriate damage or to transition its states.

So the character would have a state machine. The animation blueprint would have a state machine that resembled the character state machine, but you might want more transition states to be able to animate things properly. The character animations would use root motion to drive the character around.

That would get you most of the way there. Some additional character code for dealing with the environment (i.e, you might want to be able to detect a pending impact with the ground and transition from movement to landing, or do the same for walls etc).

Maybe have a look at how they’re doing their setup for Unreal Tournament wall handling?

I think root motion is the key though. Especially for some of the more extreme moves. But its always a tradeoff between fluid movement and responsiveness.

Thanks for your guidance zoombapup!

So you are saying that I’m on the right track?

Yeah, I’d be inclined to do some of the control of the state machine in the character class rather than in the animation blueprint though. It’d be super useful if someone could mod the animation state machine editing stuff into a generic state machine component actually.

But basically yes, have a heirarchical state machine controlling things. Work out the transitions. Make sure you have a parallel version for animations. Win :slight_smile:

For my game (which, again, heavily inspired by DMC and other cuhrayzee games), I use my anim State Machine to control “player states”, not just poses.

Almost every anim state itself uses transition Notifies (upon leaving, entering, or moving between states) to set flags and trigger changes to the Character BP.

Thus if my character enters the “Dodge” state, it flips flags which disable movement control. If he enters the “Melee Ground” state, it flips flags which cease parsing stick inputs to capsule movement and instead queue up rotation interpolations for attacks. Etc.

So I use the pose states as “character states”; if a player is in the dodge pose, or the grind pose, or the shoot pose, and/ or their corresponding networks of sub-poses (reloading, dequipping, whatever), that information is relayed BACK to the character blueprint.

My AnimBP probably handles as much direct character control as my main BP. That seems appropriate for a DMC-type game, though, since animation is non-reactive. In shooters (the kind of game UE was originally built to handle and which many of its paradigms assume), animation reacts to player movement. Whatever the player does, the animation attempts to respond. Combat games are different; frame-canceling rules get complex, and what the animation is doing DICTATES what the player can he do (he cannot run mid-swing, he cannot dodge while in a hitstun anim, he cannot block while moving, whatever).

Personally, I say embrace it. Don’t get hung up on wanting State Machine access from the player BP since that’s where player movement is “supposed” to be controlled. Don’t be afraid to use InputActions to do nothing more than casting to the AnimBP to drive custom events (such as having the attack key do nothing in the player BP except tell the AnimBP to handle the incoming execution) or placing lots of logic inside the AnimBP or Notifies and Notify States.

Thanks RhythmScript!

Judging from that video you showed me some time ago, you have gotten quite far.

How would you suggest learning how to make a game like DMC4 with stuff like quick weapon switching, combo trees, cancelling etc?

Keep experimenting and see what happens? Follow some specific tutorial? Keep putting things on here for “peer-review”?

I guess I have a tendency to believe that the stuff I want to do, is more complex, crazy & intense than the stuff that is documented and targeted to “simpler” games.

I really want to make my game stand out, but I’m sorry if I unintentionally upset some people in the process :confused:

Easy as pie! Just gotta animate the weapons and such… see here:

edit: Please do not try this at home!!! Or anywhere else unless you have the proper training!!

Thanks for the tip SaviorNT, but that looks completely out of reach for me at the moment!

Even if you had access to mocap I wouldn’t use it.

In fact, when Ninja Theory was submitting drafts of DmC to Capcom one of the things Capcom made them do was go back and hand-pose all of their attack anims. The DMC games make extensive use of mocap for cutscenes but almost none for actual in-game combat.

Remember that when making a game like this, you’re intentionally having the player do things human beings CANNOT DO. Trying to model those movements on real human movement is a good way to make a game look like really bad wire-fighting Kung-Fu, because the curvature you would expect from a 12-foot vertical jump or a roundhouse swing of a 5-foot long broadsword as wide as the character’s torso is simply not something the human body does naturally. You get decent results by careful consideration of key poses and timing, the way hand-animators do in cartoons/comic books, and you get something that seems “believably unbelievable”.

Doubly so since it would look extremely jarring for a character to engage in a super-realistic run loop or simple slashing motion and then suddenly become an impossibly graceful acrobat an instant later when a different key was pressed.

So true, RhythmScript, it is more about stimulation than realistic simulation.

I have found a 3D artist that is willing to help me, so now I can focus on trying to learn how to turn those animations that he’ll make into attacks that behaves correctly in the game.

Therefore I’m more interested in the technical implementation rather that content creation, right now.

Hey, are you still working on this? I’m kind of curious because I myself am trying to make something like this.