Download

Is it possible to have two Locomotion graphs?

I have two sets of animations; one is animation when my character doesn’t have a weapon, and other is when my character does. Should I use one Locomotion graph, or can I use two? It seems that it would get very complex as you connect all the nodes. I also have to keep in mind the transitions with speed and direction; such as playing a walk animation when you’re weaponless, and then hitting a key to draw a weapon and playing that new walk animation with a weapon.

Any thoughts? Thanks!

I personally do it like that: https://www.youtube.com/watch?v=Dtewkn8qIE0 (for a basic gameplay) :slight_smile:

e.g This setup if from my game → includes different anims for “two hand sword”, “one hand sword”, bow and friendly mode + a mouse controled character bending + attack anims just for the upper body, different jump anims,… and a lot more stuff :stuck_out_tongue:

I have made it in different stages:

  1. this is how it look like in every state → so in one hand sword, two hand sword, bow ,…

animgraph.jpg

I saw that video as well but he has both sets of animations in one Locomotion graph. So you would have to create a “web” for every transition which would get very complicated. The screenshot was my first attempt. As you can see, creating transitions for all possibilities seems to get overwhelming, so I was looking for another way. Is it possible to have multiple State Machines; unarmed, Pistol, Rifle, etc., and then blend between those? As an example; say you’re unarmed walking, now you’re drawing a rifle. I would like to smoothly blend from the unarmed walking animation into the rifle walking animation. It should be possible, so I’m looking for some resources I could take a look at to get that functionality…

Yes, it is possible (on the picture I’m using that technique). On the 1st picture I have created the default state machine. In the defaul state machine (2nd picture) I have added more state machines for all the different modes (in your case weapon_mode and friendly_mode). Now in every of those states I have added the idle/walking, jumping, crouch,…

Then it wont be so confusing anymore (my anim graph would look the same as yours, even more complex, without all those state machines ^^)

How did you take into account your transition positions from one state to another; say you’re walking with a bow and you tap a key to draw a sword? Do you only have one Locomotion State, and you blend only the weapon animations keeping the same movement animations? How did you get your State Machines talking to one another so they blend?

I activate the other mode with a bool var wich gets activated when I pick up a bow/sword/… (on the 2nd picture the links between friendly and the other modes) (normally they should already blend smoothly). I use a different set of anims in all my modes (bow/two hand/…) → they are used in the 3rd picture

https://www.youtube.com/watch?v=LA8VUOsznBk&feature=youtu.be
1:14 -> here I blend between different stuff. In my case between the upper and lower body animation

Thanks, I’ll check it out!

Using only one state machine can become quite complicated, as stated by AdamZ before.

E.g. if you have a lot of different states it might be a better idea to do a switch inside your state machine.

You can do this by using a custom enum, like displayed here:

11faea5a29406f6d172675076c31f6f13b86e924.jpeg

Great, thanks!

The past 2 nights I’m trying to establish replication(replication is pretty easy for me now) with Animation Starter Pack, I did try to multiple state machine approach and see if I can figure out. But it comes pretty quickly that if you want to blend between 2 different set of animation, it’s better to use the style that order66 mentioned to use blend within your state with enum, you can always expand the enum and recompile to get the additional pins.

So, why not 2 state machines(in ASP there are a set of movement is rifle_hip, and another set is rifle_ironsight), the reason being you will see a lot animation glitches when you have toggle type of control, ie with ASP you have hip movement that includes idle, jog, stand jump, run jump, crouch. With ironsight movement you have idle, walk, crouch, stand jump. I also throw in the prone movement. Now, any time you blend between 1 state machine to another, the graph evaluates from that “entry” node. so if you set transition timing too long, or have animation that are not really compatible, you are going to get jumpy blend, not smooth blend. And after more and more conditions and animNotify come into play, it’s escalating too quickly to try add those extra booleans to shut off transitions and keep 2 state machines in sync. For example, when you start to prone, you can’t switch to crouch nor jump, you have to introduce a variable so when you toggle ironsight that new state machine taking over know which state to quickly blend into, if you didn’t do this properly, you will end up seeing stand_to_prone animation played again. With one state machien where all the states does the condition blend, you are free of such hassle and can focus on making the transition better.

There are also other gotchas like state machine transition really fast that animation played before the animNotify from transition rule can set a control variable to false.
My example would be during crouch you can’t not jump, however if you press jump during crouch, jump boolean is set, transition rule from crouch into idle will issue a event to unset the jump boolean but it will be too late and animation played, where the movement component don’t actually get to apply jump, but the animation is played regardless. So I still have to work this bit out or just re-do the jump logic that comes from ASP character’s anim blueprint. hours are easily gone when you have to carefully avoid sync and state glitches with more state machines. So stick with one main state machine like order66 says is your best bet.

And, if you are not happy with it, you can create another state machine with in the main state machine’s state. ie for idle/run state, you can create a state machine with in this state that are dedicated to handle what to output if it’s more complex than just blendspace nodes. This also gives you extra control without having to worry syncing 2 state machines.

Can someone explain this to me in more detail with a video or pictures showing steps? I do not quite understand how these different locomotion talk to each other and there are no tutorials out there on how to organize a complex animation blueprint. I have a bunch of animations for different weapons and I don’t understand how to make them all connect =(

You’d have to go through the content examples project first, they have a lot of animation setup in them.
General rule of thumb(I learn it hard way):

  1. don’t try to setup multiple state machines(with walk/run/jump/fire/etc) for each weapon and blend between them
    It’s a waste of time and you are not gonna be pleased.
  2. do the blend with in the main state machine, try to squeeze as much as possible to 1d/2d blendspace for smooth interpolation between blend.
  3. you can have sub state machine within a state, so any weapon specific animation you might wanna setup using this way(ie, if a weapon have different fire mode that have different animation say if you try to fire while clip is empty. )

I don’t know if anyone has done further tutorial on this or not after my last post. But since it’s such a big overhead I decide to do a game that does not require animation setup.
If you don’t understand what people was talking in this thread, make sure you start from content examples and other tutorial videos you can find.

Thanks Penguin! I appreciate your tips and I will give the content examples another try. Maybe I am missing something quite obvious and I just need to study the projects more. I will definitely come back here if I get any questions.

Where do I find this enum blend pose?

What do you mean exactly? You have to make an enum first. You can then pull that enum in the animation graph by right clicking and typing in blend by “youEnumName”. Does this help? Not sure how much or little you know about enums. Since my last post, I have learned a lot and I am willing to help you out, as best I can (until someone a lot more talented than me comes along, haha).

haha I appreciate it. I just can’t seem to figure out how to create the Blend Poses node where I can connect my Blend Space Player.

Hmm, what are you trying to do? Are you having trouble finding the node? Or is it a separate issue?

You can do it with an enum, as I mentioned before, or you can also use a “layered blend per bone node”. For actually creating the blend pose node, all you have to do is R-Click in empty space in the animation graph (not the event graph) and type in “Blend”. Here you get all the blend nodes. If you share more information on what you are trying to do, it might be better for me (or anyone else) to help. :slight_smile:

Sorry, I got caught up at work and didn’t have a change to reply until now… So I have 2 state machines; the 3rd person locomotion and the 3rd person rifle states from the AnimStarterPack. I’m trying to get those to blend with a key press. Both State Machine graphs are within my Anim Graph, but I dont quite understand how to create the Enum and then attach the states to the Blend Poses node like your screenshot above. I can create a new Variable, but what Enum variable type should I use?