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.
Fast facts
- Purpose: Collision detection boundaries.
- Shape: Usually rectangles (boxes).
- Visibility: Hidden from players.
- Design goal: Feel fair and responsive.
Hitbox types
| Type | Purpose | Example |
|---|
| Hurtbox | Vulnerable to damage | Character body |
| Attack box | Deals damage | Sword swing |
| Collision box | World interaction | Platform landing |
| Trigger box | Event activation | Door entry |
Design considerations
| Factor | Approach |
|---|
| Fairness | Player hitbox smaller than sprite |
| Responsiveness | Attack boxes match animation |
| Forgiveness | Generous pickup collection |
| Precision | Tight for skill-based games |
| Platform | Common method |
|---|
| NES | Bounding box comparison |
| Mega Drive | Hardware sprite collision |
| Arcade | Multiple boxes per character |
| Fighting games | Frame-specific boxes |
Fighting game precision
| Element | Implementation |
|---|
| Per-frame boxes | Different shapes each animation frame |
| Active frames | Attack only hits during specific frames |
| Recovery | Vulnerable boxes during cooldown |
| Invincibility | No hurtbox during certain moves |
Common optimisations
| Technique | Benefit |
|---|
| Axis-aligned boxes | Simple overlap maths |
| Spatial partitioning | Reduce comparison count |
| Hierarchical checks | Broad then narrow |
See also