The difference between action-RPG combat that feels sluggish and combat that feels crisp (like Hades, Hollow Knight, or Elden Ring) rarely comes down to animations alone. It comes down to explicit 60 FPS frame windows and input buffering.
If you treat an attack as a single boolean (is_attacking = true), players get locked into recovery animations, dodges feel eaten, and hitboxes feel unfair. Splitting every move into deterministic frame phases fixes all three immediately.
1. The 5 Frame Windows Every Action Move Needs
At 60 FPS (16.67ms per frame), define every combat state using explicit frame numbers instead of loose timers:
- Startup Frames (
F01–F10): Telegraph / wind-up. Hurtbox is exposed, hitbox is OFF. - Active Hitbox Frames (
F11–F16): Damage window is LIVE. - Recovery Frames (
F17–F32): Follow-through. Hitbox is OFF. - Cancel Window (
F23–F32): The final recovery frames where a buffered Dodge or Parry can interrupt recovery early — this single mechanic is what makes combat feel responsive without removing commitment. - Invulnerability Frames / i-Frames (
F02–F13on Dash Roll): Incoming hits overlap the hurtbox cleanly with0 dmginstead of triggeringHitstun.
2. Typed Frame Data in Godot 4 (GDScript)
Keeping frame data in a typed resource or dictionary lets designers tune feel without touching state transition logic:
class_name CombatStateMachine extends Node enum State { IDLE, LIGHT_ATTACK, HEAVY_SLASH, DASH_ROLL, PARRY, HITSTUN } const MOVES := { State.HEAVY_SLASH: { "startup": 10, "active": 6, "recovery": 16, "cancel_start": 23, "iframes": Vector2i(0, 0), }, State.DASH_ROLL: { "startup": 1, "active": 12, "recovery": 11, "cancel_start": 18, "iframes": Vector2i(2, 13), }, } var current_state: State = State.IDLE var state_frame: int = 0 var buffered_action: int = -1 var buffer_frames_left: int = 0 func _physics_process(_delta: float) -> void: state_frame += 1 if buffer_frames_left > 0: buffer_frames_left -= 1 var move = MOVES.get(current_state) if move and state_frame >= move.cancel_start: transition_to(buffered_action) buffered_action = -1 buffer_frames_left = 0 A 6-frame (100ms) input buffer guarantees that if a player presses Dodge right before the Cancel Window opens, the dodge fires cleanly on the exact frame cancel_start is reached instead of dropping their input.
3. Prototype Frame Windows Live & Export Godot 4 / Unity Code
I built StateLab so indie devs can scrub F01–F36 at 60 FPS, toggle Startup / Active / Recovery / i-Frames / Cancel sliders, simulate live Perfect Parry!, i-Frame Dodge!, Cancel Transition!, and Hitstun! triggers against a visual hitbox rig, and export typed Godot 4 .gd, Unity C# .cs, or JSON in one click:
- StateLab Frame Studio (Free, No Login): https://nino-demos.pages.dev/statelab/
- Full Production Godot 4 Starter Kit: GodotCore 4 ($19)
- Unity URP Shaders & Systems: StylizedKit URP ($15)
- 3D Texel Density & VRAM Calculator: TexelCheck · Free 3D Starter Pack: 3D Props Showcase
All 59 free browser tools are live at https://nino-demos.pages.dev/.