Download

Advice on how to make a freely rotating & jumping character

This is what I’m trying to learn to do with Unreal:

https://www.youtube.com/watch?v=0rkd5-n1N-c

What I want
I want a character that can jump up in the air and tilt there and rotate around an arbitrary axis, like tilt 45-90 degrees & spinning like a tilted tornado while holding a melee weapon.

States should be able to be interrupted quickly if the character gets hit (or does a block/guard-cancel).

This should also work correctly with collisions against other characters and the static map.

And finally the character should preferably also interact reasonably with slopes & stairs.

My ideas
I’m considering having 2 collision shapes for the character: 1 hard that is not allowed to overlap anything & 1 soft that acts like a force-field that will cause the characters so separate slowly if 2 soft shapes overlap.

The melee weapon will ignore collisions against the static map, and is considered to hit a character if it hits the soft shape of a character from the opposing team (player is team 1, enemies are in team 2).

Closing notes
As I’m new to Unreal, I don’t really know what to do in c++, BP-state-machines and what to do in the animation program.

Maybe I’m taking on a too big challenge, but I want to learn, so I can take cool & crazy gameplay to the next level.

If you got this working in c++, then I would not mind paying a little to get a peek, so I can learn and have an easier time making my version.

Or if you have any ideas to help me and the community make better games inspired by games like Ninja Gaiden and Original Devil May Cry series, then please join in and post your ideas.

You don’t want your c++ character representation to do this, unless you are aiming for a phyics simulation. You should use the normal ACharacter and it’s default movement and have the spinning, flipping and all the ninja stuff be handled via animation. For jumping, leaping and dashing you probably want animations that handle the root movement for you.

Check AnimationBlueprints for that and probably watch Zack Perrish’s ThirPerson Tutorial.

Thanks DennyR, that was a really helpful list of tutorials, especially part 22 about Animation Notifies!

This did take my previous attempt further:
https://answers.unrealengine.com/questions/188305/what-is-wrong-with-my-combat-system-logic.html

Tho, for now I will look into making my own movement component that will implement my own version of root movement using animation variable curves in Persona.

Thanks for providing keywords to search for and the general advice!

I’m thinking about using special animation Notifies that will cause the C++ code to start reading animation Variable Curves and apply extra rotation (tilt + local yaw) to the mesh during the tornado attacks.

Currently the characters can’t push each other, so for this I’m thinking about adding a trigger volume to them that will cause the C++ code to try to separate them slowly.

I saw your post on my thread, so since you asked… I’ll give some of my theory about creating moves. I’ll try not to ramble on about things too much… :slight_smile:

The way I approach it is basically to break it down, to understand the move in stages. So as simple as, what does the capsule need to do, even regardless of the skeletal mesh animating in any way. That can make or break a move from it’s foundation.

The move is pretty much always gonna depend heavily on the animation though. What I do there is break it down to find what needs to be separate and what can be done in one go. With aerial moves I find you need to figure your air motion out first, which is actually based on manipulating the capsule directly. I’m sure as with most things, there’s more than one way to skin this cat, but I find that controlling the capsule there through gravity and pushing it into directions manually, works quite well. The biggest reason for this is so any given move can be performed in any given location or situation and function within the games real physics. If it’s all pre-animated, you can’t do that.

So, for example, my jump up attack move needs to work on various heights. If I stand on a wall, jump up and attack and go slightly forwards, the fall will be much greater than if simply doing it from the ground. So the “stages” in the move needs to function regardless of this. So a move like that is broken up into sections, the jump, the air motion and the landing. You’ll see in Ninja Gaiden the same sort of effect with jump moves. The “in air” has basically any length it’ll work, you can jump off a building and do a jump move and it’ll function as expected.

How I control the capsule is with the jump, it’s simply jumps, but as you engage the move, I do lower gravity, since my gravity is much higher than the engine default, I do lower gravity for a smoother up motion, throw the character up, negating any current Z velocity, then do real heavy gravity so the down motion is much quicker, then hitting the ground, the 3rd stage kicks in and the move plays the final animation and resets gravity… etc.

So, the whole “up / down” motion is purely engine controlled and the rest is animation. I’ll mention that root motion can be a factor as well. Though I don’t use it in any of my moves, it is also possible to use that in some cases. The reason I did not use it is because in most cases I want to be able to take control of player motion earlier, than what the attack animation actually allows. With root motion the animation has to play through for this to happen. I have basically one move that uses root motion, which is my dodge move, the cartwheel you may have seen in the videos. That’s all root motion driven, it’s all purely animation.

Anyway, with the move you’re talking about, jump up and spin… etc. I see similar control on that. Jump up, maybe through gravity control the “float”, negate any velocity… etc. Make the guy float basically through code. Then deal with the move through animation. All I can suggest is to break it down and start to experiment with it. Have maybe some simple animation to plug in and test with. I guess I’ll mention here as well that timing is kinda important. Your animation timing, when a move is “active” for doing damage… etc. The feel of it, how snappy is it… all this stuff has great impact on how the game feels. So that you’ll find as you work on it. I had a fair amount of trial and error on that in my moves, some more so than others.

Having moves cancel out… etc. That you just need to set up the events that can do it. Based on how you apply animation, through states or through montage, you would then just set it. So through states you would set booleans to cancel out a move and through montage you would call the current montage and stop it and then it’ll return to it’s normal states. I use montage by the way, I find it easier to deal with for attacks and stuff like that, that kind of interrupts general looping animations.

Anyway, I guess that’s basically the way I approach it. You can pretty much take any move and break it into sections and build out a complete move based on certain criteria for what happens when.

Hope this helps… in some way. I don’t try and tell you … do this or that, but this is all my own theories and approach to things. There’s always multiple ways to do it and this is just my way.

Thanks Obihb for writing such a lengthy response :slight_smile:
I have started on a test to see what can be done with state machines but I’ll take a closer look at montages soon.
Using-animation-BP-state-machine-for-implementing-a-combo-system

iam in the same boat as you let me know if you found anything i also have a project iam working on thats dmc/ninja gaidenish like that i want to work on.