Skip to main content

Report this content

We want the Dreams coMmunity to be a safe, diverse and tolerant place for everyone, no matter their age, gender, race, sexual orientation or otherwise. If you believe this content to contradict these principles, you can file a report for our coMmunity teams to investigate.

Note that misuse of the reporting tool will not be tolerated.

Item being reported:

A forum post by skillphiliac

You need timers, pretty much, or signal manipulators that blend over time or something.

Here's the deal: combos work sequentially and you have to give humans some time to input the next keypress. There are different ways to do this, of course:

Some games have logic that branches to check your input at runtime, i.e. the moment you press a button. So when you press square for a punch, you have to give the user some time to input the next square (for a left-right, let's say), otherwise you'd have a frame-perfect trick that nobody really could pull off all that well.

Other games buffer your input. Basically, each input is arranged in a list, regardless of how far into your combo you currently are. Your animations (and damage, visual logic etc.) then runs sequentially, depending on different conditions. Here's how I'm thinking you could achieve this:

Make timelines for each move in your combo. Arrange them according to what move they transition into, e.g. left-jab in timeline 1, right-jab in timeline 2. Arrange them horizontally. Between both timelines, you'll have to do something a bit more complicated to check whether you buffered the commands. Double-jab combo will be square square.

When playing the jab, you'll have a check in place asking whether there is currently any other animation playing or a combo in progress. If not, you're good. You'd need to find a way to keep track of your inputs. I can't quite visualize how at the moment, but there's definitely a way. Maybe like this:

Have variables for each button. If your max combo-length is 3, three should do. Assign the buffered button presses a number. When you press any significant button, and if no combo is running, you assign the combo button's value to the first variable.

So, the first variable is stored. Somewhere you have logic that checks whether the variable is non-zero/a specific number corresponding to your combo moves. Since this is the first move, we want it to play instantly - we already checked if there is a combo going on, which it isn't.

Now, one jab takes a couple of hundred milliseconds, and that is enough to allow humans to enter additional input. We'll be using the "is finished" output on the timeline and wire it up to check whether we continued the combo in time. First of all, when the timeline is finished and combo variable number 2, as mentioned earlier, has a value of 0 (meaning we never entered something during the window), we want to reset the combo - something I glossed over earlier in this part. Which, basically, means resetting the combo vars.

If you want to check whether you're in a combo, you just have to check your combo variables. On ending each timeline, you check whether the next possible combo moves have a corresponding variable, if not - you just break out and reset whatever would prevent you from starting a fresh, new combo.

There's lots to consider and it can get confusing, but if you know the basic structure, things can get easier, You also don't have to buffer inputs, although I think it'd be a nice project. And remember to share your stuff so we can look at it, debugging verbally is way slower, regardless of how happy I am to help. This was more like a conceptual tutorial.

It's totally feasible, by the way. I've experienced a bug where the in-game animation differs from when I play it back in my timeline, so watch out for discrepancies; some bugs still need fixing.

Oh dear! Your browser is either unsupported or there has been a problem loading the page.