Combo System
A combo system links attacks into a chain. Each attack lands one hit. Press during an attack and the game remembers it; a short window after it accepts the next press. Miss the window and the chain drops. The last hit ends in a recovery that ignores presses, so every chain ends.

Paste this to your AI
Copy it into Claude, Cursor or ChatGPT. It already has good values and the usual mistakes in it.
Add "Combo System" to my game.
What it should do: Combos reward timing: the same button does more for a player who presses it at the right moment.
Build it exactly as this state machine. First check that it fits my game, then build it like this:
```mermaid
stateDiagram-v2
[*] --> idle
idle: At rest
attack: Attack
link: Link window
finisher: Finisher
recovery: Recovery
idle --> attack: press
attack --> attack: press kept, next hit
attack --> finisher: press kept, last hit
attack --> link: over, no press kept
link --> attack: press in time
link --> finisher: press, last hit
link --> idle: window missed
finisher --> recovery: finisher is over
recovery --> recovery: press does nothing
recovery --> idle: recovery is over
```
Use these starting values:
- maxChain: 4
- attackTime: 0.24 s
- linkWindow: 0.3 s
- finisherRecovery: 0.55 s
- baseDamage: 10
- damageStep: 3
Watch out for these common mistakes:
- Mashing skips the timing: Tell your AI to remember one press during an attack and act on it when the attack ends. Extra presses add nothing.
- A press just before the window is lost: Tell your AI to keep a press made during the attack, the way jump buffering keeps a jump.
- The chain never ends: Tell your AI to end the chain at its full length and ignore presses during recovery.
- One attack hits again and again: Tell your AI to land the hit once as the attack starts, or to keep a list of who this attack has already hit.
Do not change anything else in the game. Do not claim anything without proof: model what it takes, and show me what your solution rests on and how I can see that it works. If you cannot show something, say you do not know. When you are done, tell me in plain words how to try it.Or skip this and connect the MCP: your AI then finds all of this by itself.Connect the MCP
What it does
Combos reward timing: the same button does more for a player who presses it at the right moment.
How it runs, as a diagram
Everything it can be in, and what moves it on. Your AI builds from exactly this.
How it runs, as a diagram
- At rest → Attack: press
- Attack → Attack: press kept, next hit
- Attack → Finisher: press kept, last hit
- Attack → Link window: over, no press kept
- Link window → Attack: press in time
- Link window → Finisher: press, last hit
- Link window → At rest: window missed
- Finisher → Recovery: finisher is over
- Recovery → Recovery: press does nothing
- Recovery → At rest: recovery is over
Good starting values
| Value | Start with | What it changes |
|---|---|---|
| maxChain | 4 | How many hits a full chain has, the finisher included. More hits make a longer chain to master. |
| attackTime | 0.24 s | How long one attack lasts, which sets the rhythm of the chain. |
| linkWindow | 0.3 s | How long the player has after an attack for the next press. Shorter asks for better timing. |
| finisherRecovery | 0.55 s | How long the character is stuck after the last hit, which is the price of a full chain. |
| baseDamage | 10 | How much damage the opening hit does. |
| damageStep | 3 | How much more damage each next hit does, so the chain builds up. |
What usually goes wrong
Mashing skips the timing
If presses during an attack count straight away, mashing the button runs through the chain faster than intended.
Fix: Tell your AI to remember one press during an attack and act on it when the attack ends. Extra presses add nothing.
A press just before the window is lost
A press a moment too early does nothing, and the player feels the game dropped it.
Fix: Tell your AI to keep a press made during the attack, the way jump buffering keeps a jump.
The chain never ends
Without a limit or a recovery, a player who keeps pressing keeps attacking and can never be punished.
Fix: Tell your AI to end the chain at its full length and ignore presses during recovery.
One attack hits again and again
An attack that looks for a hit at every moment it is active hits the same target many times.
Fix: Tell your AI to land the hit once as the attack starts, or to keep a list of who this attack has already hit.
How to check it works
- Your character is at rest. you press attack: the chain is at 1 and the opening hit lands.
- An attack has just ended and the window is open. you press attack: the chain is at 2 and the second hit lands.
- An attack has just ended. you let the window run out without pressing: the character is at rest and the chain is back at 0.
- An attack is under way. you press attack once during it: the next hit starts when the attack ends.
- An attack is under way. you keep pressing attack all the way through it: the chain goes up by one only.
- A full chain, with attack held down. it runs to the finisher: exactly as many hits land as a full chain has.
- A full chain. the last attack ends: the character goes into recovery.
- Recovery is under way. you keep pressing attack all the way through it: no hit lands, and recovery runs its full length back to rest.
- A chain set to just 1 hit. the attack ends: the character goes into recovery.
- A chain. you compare the damage of its hits: each hit does more than the one before, by the same amount.
Works well with
- Stamina System: Our tests here do not cover the two together. Take the stamina when an attack starts. If there is not enough, the chain ends.
Common questions
how do you make a combo system
Give the character four stages: at rest, attacking, a window for the next press, and a recovery after the last hit. A press during an attack is remembered, and a press in the window starts the next hit.
what do i tell my ai to add a combo system
Paste this: Add a combo system where one press during an attack carries into the next hit, a short window after each attack accepts the next press, the chain drops if the window runs out, and a full chain ends in a recovery that ignores presses.
how long should a combo window be
Start at about 0.3 seconds. Shorter asks for real timing, longer is forgiving. Remembering a press made during the attack matters more than the exact length.
how do i stop button mashing in a combo
Count one remembered press per attack and act on it when the attack ends, so mashing cannot run faster than the attacks do. A recovery after the finisher adds a price.
Where it comes from
Earliest example we could find: Shanghai Kid / Hokuha Syourin Hiryu no Ken (Nihon Game, later Culture Brain; arcade) (1985). When the game shows the word 'rush', timed button presses make the character perform a series of strikes. Hardcore Gaming 101 and Wikipedia both treat this as a combo system. It is a prompted sequence in a mostly reactive game, not free linking of separate moves as in Street Fighter II, so the continuity between the two is not established.
- 1985 Shanghai Kid / Hokuha Syourin Hiryu no Ken (Nihon Game, later Culture Brain; arcade): When the game shows the word 'rush', timed button presses make the character perform a series of strikes. Hardcore Gaming 101 and Wikipedia both treat this as a combo system. It is a prompted sequence in a mostly reactive game, not free linking of separate moves as in Street Fighter II, so the continuity between the two is not established. [Pre-Street Fighter II Fighting Games (Hardcore Gaming 101)][Combo (video games) (Wikipedia)][Shanghai Kid, The (Killer List of Videogames / Arcade Museum)][Hiryū no Ken (Wikipedia)]
- 1991 Street Fighter II: The World Warrior (Capcom; arcade): Lead designer Akira Nishitani says loosening the input check for special moves had a side effect: a special could follow a landed normal attack. The team noticed this and chose to keep it. He also says they tested a version in which a second hit would miss, and found it dull. Producer Noritaka Funamizu's account, as reported by Game Informer, is that he found the combo system as a glitch during playtesting. [Street Fighter II designer opens up about the cancelling 'bug' (Mike Rose, Gamasutra/Game Developer, 2013)][Returning To Round One: The History Of Street Fighter (Brian Shea, Game Informer, 2022)][Combos were removed at one point by Street Fighter 2's dev team, stage rock moves around to make corner traps tougher - SF2's 25th anniversary today (EventHubs, 2016)]
- 1993 Super Street Fighter II (Capcom; arcade): Its scoring system tracks the hits in a combo, and Gigazine says this is when the phenomenon came to be called a combo inside the game. Both sources are weak: the Wikipedia statement has no citation, and Gigazine relies on a list from 1UP.com that was not read. [Super Street Fighter II (Wikipedia)][20 Little-Known Secrets About the Street Fighter Series (Gigazine, 2011)]
- 1994 Killer Instinct (Rare; arcade): Co-designer Ken Lobb says he wanted longer combos but disliked standing by while being hit, and that this led to the Combo Breaker, a way for the defender to interrupt. This is a designer's account, quoted by Time Extension from an interview with Hold Back To Block. [The Making Of Killer Instinct, Nintendo's Street Fighter And Mortal Kombat Killer (Damien McFerran, Time Extension, 2022; first published by Nintendo Life, 2019)]
- 1996 Next Generation 1996 Lexicon, entry 'Combo' (Next Generation no. 15, March 1996): A games magazine's glossary defines a combo for general readers as moves that follow each other so closely the opponent cannot respond. It also says that in some recent games a combo does more damage than its moves would separately, and that some moves exist only within combos. This shows the term and its meaning in print during the period. [Next Generation Issue 015, March 1996, full text (Internet Archive)]
- 2001 Devil May Cry (Capcom; PlayStation 2): Director Hideki Kamiya says a bug he saw in Onimusha, in which enemies flew into the air, prompted him to ask programmer Kazunori Inoue for that effect. The game brought launchers, juggling and aerial combos into 3D action, with a live grade for how the player fights. The bug account is Kamiya's own post, as reported by Siliconera. [Devil May Cry Stylish Combat Was the Result of an Onimusha Bug (Kazuma Hashimoto, Siliconera, 2021)][Smokin' Sexy Style: The Arcade Soul and Genre-Defining Legacy of Devil May Cry (Karol Ascot Obrzut, GOG, 2025)][Devil May Cry (video game) (Wikipedia)]
What was checked
- 14 tests pass on the reference code.
- The state diagram was checked against the code, at the default values and at every listed low and high value.
Your AI gets the code
Tested example code comes through the Spielerando connection, so your AI can use it right away. How to connect it