Skip to content
Techniques & Technology

Hitboxes

Collision boundaries

Hitboxes define the invisible collision boundaries around game objects, determining when attacks connect, pickups are collected, and characters collide with the world.

commodore-64sinclair-zx-spectrumcommodore-amiganintendo-entertainment-systemsega-mega-drive collisiongameplayprogramming 1978–present

Overview

What you see isn't always what the game detects. Hitboxes are the simplified collision boundaries that determine interactions between game objects. A character sprite might be 32 pixels tall, but their vulnerable hitbox could be a small rectangle at chest height — making the game feel fair despite the simplification. Done well, hitboxes make a fighting game's frame data, a platformer's "this jump should make it" forgiveness, and a shooter's "the bullet didn't seem to hit" satisfaction.

The technique is alive and central to modern games — fighting-game frame data discussions on YouTube and Twitch (Street Fighter, Tekken, Smash Bros.) revolve around hitbox / hurtbox visualisations.

Fast facts

  • Purpose: Collision detection boundaries.
  • Shape: Usually rectangles (axis-aligned bounding boxes); circles, capsules, or hand-tuned polygons for higher precision.
  • Visibility: Hidden from players in-game; visible in debug modes and frame-data analysis.
  • Design goal: Feel fair and responsive.

Hitbox types

Modern games typically use multiple distinct box types per object:

TypePurposeExample
HurtboxWhere the character can be hitBody, head — separate boxes per limb in fighters
Hitbox / attack boxWhere an attack deals damageSword swing, punch, projectile body
Collision box / pushboxSolid-world collision; characters can't overlapPlayer vs player, player vs wall
Trigger boxEvent activation (no physical collision)Door entry, area-of-effect, cutscene trigger
Grab boxThrow-attack rangeFighter grabs
Counter boxActive-during-counter windowParry / counter mechanics
Block boxBlocking-attack registrationShield raised states

Different games have different needs — a platformer might just have collision and hurt; a fighting game has all of the above plus more.

Design considerations

FactorApproach
Fairness to playerPlayer hurtbox often smaller than sprite — gives a "felt fair" advantage on close calls
Hostile to playerEnemy hitboxes can be slightly larger than visuals to give attacks reach
Forgiveness on pickupsGenerous trigger boxes — coin pickups feel snappy
Precision in skill gamesTight boxes that exactly match the visual (fighting games, bullet-hells)
Animation matchingPer-frame boxes that follow the sprite's actual extension (a sword swing's hitbox grows during the swing animation)

The "player hurtbox smaller than sprite" rule is the secret behind why classic Nintendo games "felt good" — a tiny hurtbox at Mario's centre means most close-call jumps barely-cleared rather than barely-failed.

Platform approaches

PlatformCommon method
NES / 8-bitBounding box comparison — single rect per object, simple AABB intersection
C64Same, plus optional hardware sprite-sprite collision register $D01E
Mega Drive / SNESMultiple boxes per object; software AABB; sometimes hierarchical
Arcade fightersMultiple boxes per character per frame; Street Fighter II introduced the per-frame approach
Modern enginesHierarchical: broad-phase via spatial partition + narrow-phase via per-bone capsules / boxes

Fighting game precision

Fighting games made hitboxes their own art form:

ElementImplementation
Per-frame boxesDifferent shapes each animation frame
Active framesAttack only hits during specific frames of the animation
Recovery framesVulnerable hurtboxes during cooldown — punishable
Invincibility frames (i-frames)No hurtbox during certain moves (dragon-punches, dodges)
Counter-hit windowHitbox registers as "counter" only during specific opponent frames
Hurtbox extensionsSome attacks expose the attacker's hurtbox during startup

The Street Fighter II fighting-game tradition — startup, active, recovery — is now standard across genres. Modern fighting-game training modes show all boxes in real time so players can study frame data.

Common optimisations

TechniqueBenefit
Axis-aligned boxes (AABB)Simplest overlap maths — 4 comparisons per pair
Hierarchical checksBroad-phase (large box around the whole entity) before narrow-phase (per-limb boxes)
Spatial partitioningQuadtree / grid bucketing — only check pairs that share a region
Sweep and pruneSort objects by axis, only check pairs whose axes overlap
Frame skippingSome checks can run every other frame for non-critical objects

The broad-then-narrow approach is universal: an axis-aligned bounding box is cheap to test; per-bone capsules are expensive. Test the cheap one first, fall through to the expensive one only when the cheap one says "maybe."

Visualising hitboxes

Modern fighting game communities have made hitbox visualisation a public discourse:

  • Training mode toggles — Street Fighter, Tekken, Smash Bros training modes show boxes
  • Mods / hacks — older fighting games have community mods to expose boxes
  • Frame data sites — Dustloop, SuperCombo Wiki, Smash Wiki document boxes per frame
  • Streamer culture — Maximilian Dood, Sajam, and others routinely overlay box data during analysis

This transparency is relatively recent; original game designers often guarded box layouts as design secrets.

See also