What is the ideal way to recreate the random node from the UDK AnimTree

I’m currently working on a project where we need to randomize a set of attack animations. It’s important that we can blend between sequences as the start and end frames doesn’t match perfectly. This is because each animation has to loop well while at the same time be able to blend to another sequence.

We previously did this in UDK by using the random node which works exactly like we want, the animations looks great when blending. I thought this would be a no brainer when moving to UE4.

I have tried a few methods, but only one is close enough to what we need. (see image below) I decided to create a notify at the end of each attack sequence, where I want the blend to begin, and then set a random sequence to play in the EventGraph.

I can’t help but think that this has some unnecessary overhead as we are going to a have a lot of characters on screen doing this. But then, I suppose the RandomNode in UDK had some similar kind of notify for each AnimSequence to cause the same behavior.

Other methods I’ve tried

I have tried working with the Animation Montage, which I had a lot of grief with. AnimMontage has several limitations as mentioned in the documentation. You need to spend more time in the EventGraph to tweak the behaviors you want. Even if I get a similar result if I jump between sections in the AnimMontage, it happens without a blend.

I also tried messing with the branch points, but somehow I can’t move them around in the timeline after creation. I abandoned that idea by pure frustration. (branch points are just high resolution notifies if I got their purpose correctly, so no need for that)

I also thought of the possibility of using states for each sequence as a final resort… But I can’t help but think I’m using it for the wrong purposes. Like using a screw driver, instead of a hammer, to hit a nail. We’re currently using states to control different actions for each character, it is however redundant to add a state for each sequence. (think what happens when you try to randomize 5-10 sequences)

Problems with this workflow

In UDK all we have to do is have a shared AnimTree for multiple units and that is enough. If these methods are what we have to work with in UE4, we have to create notifies for each animation sequence that will ever be part of a randomized pattern. This causes a lot of work overhead as we have a lot of characters with unique animation sequences.

Summary

I’m posting this here to see if anyone has suggestions for a smoother workflow. What we want to end up with is an Attacking State with the random sequences shown in the image above. If this is as close as we can get, then we’re fine with it. It is preferred that we get to know all the alternatives early on so we don’t have to switch in the middle of production.

Thank you for your time.

I’d like to add that we discovered the possibility of using a base blueprint and base animation blueprint for our characters. So we’re using an array of input animations which is generalized.

We’re going to stick with this method, but any suggestions are still welcome!

Thanks for posting your findings up. I am also curious as to how to reproduce the old UDK method. I used it one time before and it seemed rather simple compared to what you have to do now. I’m hoping this is justmw not understanding the new method.

Ive made the exact same solution as you did and I also would prefer some sort of basic random animation node.