Download

Animations Don't play right.

So I’m currently creating a combo system and one of them is a simple attack three times with three different animations using a sequencer. However the animations look different when played then they do in the editor. My thoughts is that there merging with the other animations. Anyway I can fix this?

Any video and pictures ? i have problems too but your post is very not complete, add pictures and videos, that can help to see what happening !! cheers

Sorry for the lack of detail.
I’m basically creating a system where if you attack multiple times it will play different animations (see image for how.) However when I play the second animation it’s different to when I open it in the editor. And the third one wont play at all. I cant figure it out.

Flawed concept.

First you need to implement a move buffer.
honestlhonestly do this in C++ you can probably find shared code.
doing it in BP sort of defeats the purpose but it is possible.
You can just capture the buffer to a string from within the controller by overriding the key press event and doing nothing with it (return).
maybe use a string array, so you can pop stuff as it is consumed.

Once you have that, you can start implementing the system.

First, you make a function (or better a custom event) that plays the montage with pre-set vars.

Then you start to call it out for every entry that made it to the buffer.

Recursive, if you will…

So if you have a buffer that calls for
​kick kick punch up down up

you set it up so that automatically at the end of the first kick you call kick again with whatever the parameters.

I would suggest making your own Enum definition and using a Select.
Actually make it Key Map.
So the enum returns a montage to play for instance.

At that point you wont have to rely on bad strands of sequences and resets with gates to execute a combo.

Each event will cascade into the next until all of the buffer is consumed.

You can get something that works the way most action games work without a proper input buffer (which, honestly, would probably not feel right; if a player mashes the attack button 6 times in a second, you wouldn’t want him to be locked into 6 subsequent attack animations) by just using NotifyStates that listen for input in the animation.

Have the attack button set a var “pressed punch” or “pressed kick”. Then, check if any Montage is playing; if not, play your first attack animation Montage.

In that animation, and in all other animations, insert a NotifyState that covers the “bufferable frames”. This NotifyState should CLEAR the “pressed punch” and “pressed kick” values on your character on NotifyStart, and on NotifyEnd it should check if they are set; if they are, it should play a new Montage (you can use a var for this so you can recycle the NotifyState for all attack animations; just set the desired next-attack animation in each instance).

So what happens is, when an attack fires, you’ve unset the punch/kick values… if, after doing that but BEFORE the end of the active frames of your attack, the attack button is pressed again, you will re-set the relevant var to “prime” your NotifyState to play the next desired animation. The advantage to this setup (apart from being extremely easy to implement at a basic level, working entirely in BP, etc) is that if your player presses attack 25 times during the attack animation, they will still only queue the next attack, at which point they have to press it again to get the third attack.

As an extension of this, you can also put a check in the NotifyTick state which listens for the same variable and performs the same playback. So now you can create, for example, two attack windows in an attack; the first one covers the start of the active frames and queues the next attack to play when those frames are complete, and the second one covers the recovery/latent frames and causes the attack to fire the instant the input is triggered. If you set the second to play a different attack animation than the first, you have the standard DMC/Bayonetta “pause combo” system, where tapping a button quickly causes one combo to occur, but waiting between presses can switch you to a different combo.

Creating a true input buffer is useful for fighting games or other games where you would want the player to be able to buffer multiple inputs at once (e.g. right, down, down-right, heavy punch + light punch) and get a true read of the entire sequence, but for simple action game “light attack combo” type stuff, setting up buffers in the animations is easier and IMO more flexible.

Yea, absolutely NO.
You have no guarantee at all that Any of those notifies are actually going to fire at all. Let alone at the right time.

And an input buffer obviously prevents this behavior. Maybe go look at how an input buffer acrually works.
Or did the last fighting game you played just chain 6 subsequent attacks altogether? (If yes, do tell which game it was so we can all collectively go shame de devs of it).

Sorry bud.
You are doing it wrong and passing on bad advice as a result of just doing what is “convenient”.

Sure, it’s easier to setup notifies. Sure that may fly for your case (if your notifies are set correctly in an ABP transition state and not in a montage timeline).
Realistically chances are you just haven’t fed your end product to enough people to actually find out just how unreliable that is. And just how prone to cheating it gets.

Before you ask “how” it’s prone to cheating.
Try replicating it on a network at all.
And set slomo to .5 on it even without replication. Which is something that the engine actually easily exposes for trainers to do consistently.

a buffer would sort of prevent that. If anything, you have more time to screw up the sequence…

Set them as Branching Points and you do. Notifies (and NotifyStates) set as Branching Points are guaranteed to fire synchronously in the animation. They can cause hitches as a result of this, but if you’re doing anything action- or fighting-game oriented you need your framerate to be rock solid anyway for other reasons.

If you actually looked into this you would know that input buffers in every fighting game and action game you cared to name are tied to animations. There’s a reason it’s called frame data, it’s tied specifically to animation frames. This is also why those games are designed (typically) to play back at a constant frame rate, rather than a variable one like UE4 uses; if the game slows down, the animations themselves slow down, because crucial game code is tied to animation frames and it’s critical none be skipped.

Seriously, go pull the memory data from DMC4. Go look at how the input system actually works. The game is not tracking all of your inputs in a buffer and then pulling them out, it is observing where an input occurs within the frame data of the existing animation to determine which animation to do next. That’s why there are very specific frame durations for attack sequences and cancels, and why all of those frame durations are shortened when playing in Turbo mode. The game is not simply reading back the last input you pressed within some duration, it’s reading where your input occurred within a given fixed duration of an animation. All *sorts *of action game logic is tied to animations in this way; consider i-frames, or invul frames, of an animation. Hell, consider hitbox and hurtbox data itself, for games that use it rather than bone colliders (action games don’t tend to, but fighting games definitely do), that’s not being handled with timers and buffers, it’s being handled by defining that data at frames of an animation.

Now, arguably leveraging the notify system to do this work in UE4 is pushing it beyond its intended scope, and some sort of custom frame-logic would maybe be a better solution, but for this simple case it’s no less hacky than anything else you might ordinarily do. It’s perfectly stable under normal local conditions. I have used it extensively with no issues.

I won’t speak to network replication, I’ve never tried it in that context and there are all sorts of considerations there regarding how UE4 specifically handles animation replication versus other state replication. That may be one of those cases where it’s beyond the scope of what a NotifyState can be counted on to do. So I don’t know if it would work in that context versus a single-player or local-only context. Slomo works just fine, though, as does turbo.

Sounds like you never built or consumed an input buffer to me.

Maybe go and actually try it.
it’ll only make whatever hack of an implementation you built so far better, and you’ll learn something new on top of it. Win win.

Better yet, look into any sort of netcode implementation before posting again. Ok maybe “briefly” look at. If you start down the rabbit hole you won’t post for a month or more.

That said. Even sync branching is hit/miss at times. While a necessity for a fighting game buffer situation type thing.

Usually, You would be better off tying a timer to the montage with proper dilation and running the registration of an event and the removal of said event manually.
more work, sure. Better accuracy and easier to replicate over network.

You talk like someone who knows what he’s doing/

I built this using only NotifyStates to read inputs, so I can say with certainty how well it works (albeit not replicated, since this was only single player)

What does your action game look like?

Look really has nothing to do with this.

Playability and feel is where it’s at.

That’s what a proper setup and animation driven combos get you.

The look, can really be whatever.
While I don’t care much for any of those devil may cry / Bayonetta / jrpg style things - visually - when you look at playability and feel for combos and the like, that’s where (some, yet obviously not all) jrpg shine.

As far as looks, personally I’m far more into having proper graphics and realism - which at 4k is basically an oxymoron even with a custom engine build due to performance limits.

As far as functionality, there isn’t much I can share due to ndas - but eventually if you stick on the forums you might get to see a final release (who knows when).

In my personal project the combo system is for melee / sword / spear / (and shield) mostly in first person (some killer combos shift to third).
So it’s kinda radically different from what you see in a 3rd person situation / yet animation timings are perhaps more critical, since much like in VR you could potentially make players throw up via head bob.
It also involves mouse and buttons which is a total nightmare in itself but kinda worth it in terms of how it actually plays this far.
Who knows, 2 or 3 months I might be able to release a beta on that with the AI fighting back and all.

ok, so I’ve been doing game dev for 3 years but I just moved to unreal like 2 months ago (hence I cant use c++).
Anyway I did a little research and what about if I use a list to judge what input is being pressed and then create a combo list depending
on the input from the Input Variable? Also if I did do this (and keep in mind i’m a beginner) what variables would I use for this list?

Hi Sunny,
If you absolutely have an aversion to c++
(because as I mentioned you can probably find a whole buffer class free to use out there, maybe even specifically made for unreal with Bluprint Functions)

I would suggest using a simple array.

An array map would be nice, but they don’t support multiple entries with the same key (first value).

Usually youd use a multidimensional array or a class construct.

Let me give you an example to explain.
(The following is not real code for unreal just a C example without headers to explain a concetp. It won’t work if you just paste jt.)



Public class inputbuffer() { 
    List<mybuffer> inputbuffer {get; set;}
}
public class mybuffer() {
     string inputstring {get; set;}
     byte input {get; set;}
}


In the code above an inputbuffer class is defined that contains a “list” of items of the mybuffer type.

The mybuffer type contains 2 properties. the input in bite value, and the string of what that input means to us- an arbitrary value you set at runtime.

In unreal BP you have no such niceties. The best you can hope for is a a single dimension array.

an array is essentially a class, in which methods are defined to allow you to do things - pop for remove, add to add things, or edit to change a value.

the values are organized by ID and automatically sorted.

If you pop entry 0, entry 1 becomes entry 0, and all other values are shifted down by one.

In your case, you may be better off storing a custom string identifier as the value.
literally “a” “b” “x” or “y” “up” “down” each.

At the time the move is executing you can read the first 3 values, compile them into a single string with append, and compare it to a string of your choice to see if you should indeed be activating the specific combo or not.

… that’s all I got for you at 3am :stuck_out_tongue:
I would suggest having a look for a tutorial in BP. Maybe there is one out there…

Thanks a lot I’ll look into it.

Ok I tried A bunch of stuff and It didn’t work so I guess I’ll try c++ now. But I have no clue how (because I haven’t used it before). I know how to code (generally) from my Unity days but how exactly would I implement it? (Also pls explain as if your talking to a baby)

Here, try breaking this down to learn

Man, play some more action games. Seriously. Go analyze input responsiveness in DMC5, see how the buffer works. It’s 100% frame-driven.

You’re talking about using a recursive input buffer as a substitute for frame data (i.e. anim notifies) but even IF you construct an input buffer, you still need frame data. Reading a sequence of inputs back is useful when you need to know that the player pressed “forward, down, down+forward” before pressing punch, but that doesn’t obviate the need for actual data in the animation frames telling it when an action can be cancelled or what it should be cancelled by.

Yes, a simple boolean check is “primitive”. So what? Most action games only use a single input “buffer” anyway. Go boot up DMC5 right now and try pressing melee, then jump, during the same input window in an attack animation. What do you get? The next melee attack with no regard to the jump input. The game doesn’t care about anything but the first input registered, and nobody complains. And if you tell me DMC5 is “unresponsive” I’m redoubling my demand that you post your obviously superior game because you’re up against the best in the business.

You can create a complex sequential input buffer to solve a simple problem, but it won’t SOLVE the problem, and it’s overkill for the OP use case anyway. Best case scenario you still wind up using NotifyStates, and just use your input buffer to read complex special inputs (qcf+punch, back-forward-melee, whatever) to determine what it plays, you still need something IN the animation itself that dictates the next animation. If all you care about is one input, think of a boolean check as a “single input buffer”; it only cares about one input, and only buffers one input, because that’s the only one relevant to the combo system.

Here’s a useful link for you, MostHost:
https://www.sebastiansylvan.com/post/the-perils-of-future-coding/

Read and learn about why using a sequential input buffer as the basis for checking whether a single input was pressed is friggin’ ridiculous.

SunnyWhiskers, you’re already going to have to use NotifyStates (or a very complicated series of timers) to determine when an attack animation is “done” so you can transition to the next combo hit. No way around that. Using a simple boolean check built in to that logic, as I detailed above, will 100% solve the problem for your use case unless you have an actual need to read multiple sequential inputs at once (i.e. the player pressing light melee, forward, then heavy melee does something different from just pressing heavy melee, or whatever). Don’t overcook your system with a bunch of future-proofing that’s beyond the scope of your intended input logic.

Sure, because devilmaycry doesn’t use an input buffer.
Matter of fact, you can’t have multi button combinations that lead to a different attack in that game at all…

And you have worked on how many professional fighting or jrpg or any other type of games before coming here to this forum to tell us how an input buffer is a useless piece of overengeneering?

Dude seriously, just stop posting trash.