---
title: "Attack startup, active and recovery frames: how they work"
description: "Every attack has startup, active and recovery frames: before it can hit, while it hits, and until you can act again. See 35, 100 and 200 ms and play them."
date: 2026-11-18
url: https://valdemird.com/blog/attack-startup-active-recovery/
lang: en
tags: ["game-feel", "game-design", "godot", "combat"]
---

**Playable sheet: Anatomy of a hit** (the real game, in the page)

- Video: https://valdemird.com/videos/play/platformer-lab/combate-c_anatomy.mp4 (Mashes attack a little faster than the swing allows. With the attack buffer every early press comes out as the next hit of the combo; after T the early presses are lost and the combo breaks.)
- Play: https://valdemird.com/play/platformer-lab/index.html?plano=combate&lamina=c_anatomy&lang=en

How to try it:
1. Walk right with → and attack with C. Watch the ruler over your head: startup, active and recovery, to scale.
2. Slash the two dummies standing together. One swing, two hits: each box takes one hit per activation.
3. At the last dummy, press C a little faster than the swing. Each early press shows a green BUFFER tag with how early it was, and the combo keeps going.
4. Press T and mash again. Early presses now show a red × PRONTO tag (Spanish for "too early"), and they're gone.

# Attack startup, active and recovery frames: how they work

> Every attack has startup, active and recovery frames: before it can hit, while it hits, and until you can act again. See 35, 100 and 200 ms and play them.

Every attack has three phases: **startup** until it can hit, **active** while the hitbox is on, and **recovery** until you can act again. Here the slash lasts **35, 100 and 200 ms**, and only the middle 100 ms can hurt anything.

**One slash in a combo.**
- attack buffer (150 ms): with the technique, Kept: the next hit starts at 225 ms, n ms from now. Without it, Lost: without the buffer a press only counts on its own tick.
- cancel (from 90 ms into recovery): with the technique, Cancel: the next hit cuts the recovery and starts now. Without it, Lost: n ms too early.

Startup, active and recovery: what each phase decides

Startup decides how fast the button feels, active how forgiving the timing is, and recovery what a miss costs. [Infil's Fighting Game Glossary](https://glossary.infil.net/?t=Startup) calls them the three stages of an attack, and only the active frames have a hitbox. At 60 fps this slash is about 2, 6 and 12 frames.

Attack buffer: an early press is still a press

An attack buffer remembers a press made while the character is busy for **150 ms**, and the attack comes out as soon as it can: the [jump buffer](/blog/coyote-time-jump-buffer/) on another button. In a combo, a stored press also cuts the recovery from 90 ms in, so the next hit starts at 225 ms instead of 335. Fighting games call that a [cancel](https://glossary.infil.net/?t=Cancel). Waiting out the whole recovery is a [link](https://glossary.infil.net/?t=Link), and it's all T leaves you.

How to implement attack phases and an attack buffer

1. **One timer per swing.** Each phase compares it with its own length. The hitbox turns on when startup ends and off when active ends.
2. **The button only fills a buffer.** The swing starts when the character is idle and the buffer still has time left.
3. **In a combo, let a buffered press cut the recovery,** here from 45% of it.
4. **Never set recovery to zero, and don't make the buffer much longer than it.** Without recovery nobody thinks before pressing. With a huge buffer, a press the player gave up on still comes out.

**The code in Godot 4.**

`addons/combat_kit/player/player_combat.gd`:

```gdscript
		if Lab.on(&"attack_buffer"):
			_attack_buffer = params.attack_buffer_time
	# ...
	match phase:
		Phase.STARTUP:
			if _phase_time >= startup_time():
				_set_phase(Phase.ACTIVE)
				slash.begin()
		Phase.ACTIVE:
			# ...
			if _phase_time >= active_time() or grounded:
				slash.end()
				_set_phase(Phase.RECOVERY)
		Phase.RECOVERY:
			if _phase_time >= recovery_time():
				_end_attack()
			elif _attack_buffer > 0.0 and not is_healing and Lab.on(&"attack_buffer") \
					and _phase_time >= recovery_time() * params.combo_cancel and _chains(_decide(true)):
				_end_attack()
	# ...
	if phase == Phase.IDLE and _attack_buffer > 0.0 and not is_healing and not dashing and not spent:
		_start_attack()
```

`slash.begin()` also empties the list of hurtboxes already hit, so each target takes one hit per activation.

Quick answers

How long should attack startup be?

For the player, as short as the animation allows: 35 ms here, about two frames at 60 fps. For enemies it's the opposite, because their startup is the warning that lets you react.

How many active frames should an attack have?

Fighting games usually use 1 to 4, according to Infil's [active entry](https://glossary.infil.net/?t=Active). This slash uses 6 (100 ms), a wide window for a game where you and your targets keep moving mid-swing.
