| name | gd-design-game-loop |
| description | Core gameplay loop design documentation. Use when defining the core gameplay loop, mapping the player experience over time, designing session structures, or identifying pacing issues. |
Game Loop Design
Core Loop Template
# Core Loop Specification v[X.X]
**Last Updated:** YYYY-MM-DD
**Owners:** [Designers]
## Loop Overview
[PRE-GAME] โ [SESSION] โ [POST-GAME] โ [LOOP BACK]
## Session Structure
### Pre-Game Phase
**Duration:** [Target time]
**Player Actions:**
1. [Action 1]
2. [Action 2]
3. [Action 3]
**Emotional Beat:** [Feeling player has]
**Objectives:**
- [Goal 1]
- [Goal 2]
---
### Session Start (0:00 - [X:XX])
**State:** Players [enter spawn/start]
**Objectives:** [Initial goals]
**Threats:** [What can hurt players]
**Emotional Beat:** [Feeling]
**Key Events:**
- [X:XX] - [Event 1]
- [Y:YY] - [Event 2]
---
### Early Game ([X:XX] - [Y:YY])
**State:** [Game state description]
**Objectives:** [What players should do]
**Threats:** [What challenges exist]
**Emotional Beat:** [Feeling]
---
### Mid Game ([Y:YY] - [Z:ZZ])
**State:** [Game state description]
**Objectives:** [What players should do]
**Threats:** [What challenges exist]
**Emotional Beat:** [Feeling]
---
### Late Game ([Z:ZZ] - [End])
**State:** [Game state description]
**Objectives:** [Final objectives]
**Threats:** [Maximum challenges]
**Emotional Beat:** [Feeling]
---
### End Game
**Victory Conditions:**
- [Condition 1]
- [Condition 2]
**Defeat Conditions:**
- [Condition 1]
- [Condition 2]
**Rewards:**
- [What players earn]
- [Progression updates]
---
## Post-Game Phase
**Duration:** [Target time]
**Player Actions:**
1. [Action 1]
2. [Action 2]
**Emotional Beat:** [Feeling]
**Session Loop:** [What brings players back]
Loop Design Principles
Engagement
Keep players engaged by:
- Immediate action - Something to do right away
- Clear goals - Know what to do next
- Meaningful choices - Decisions that matter
- Feedback - See results of actions
Pacing
Create tension through:
- Buildup - Escalate towards climax
- Variation - Mix fast/slow moments
- Surprises - Unexpected events
- Release - Tension breaks
Progression
Enable growth through:
- Learning - Skills improve over time
- Unlocking - New content available
- Building - Accumulate resources
- Advancing - Move through content
Session Flow Diagrams
Text-Based Flow
โโโโโโโโโโโ
โ LOBBY โ
โโโโโโฌโโโโโ
โ
โผ
โโโโโโโโโโโ
โ MATCH โโโโโโโโโโโโโโโโโโโโโโโโโ
โโโโโโฌโโโโโ โ
โ โ
โโโโโโโโโโโโฌโโโโโโโโโโ โ
โ โ โ โ
โผ โผ โผ โผ
โโโโโโโโโโ โโโโโโโโโ โโโโโโโโ โโโโโโโโ
โEXPLOREโ โFIGHT โ โLOOT โ โOBJ โ
โโโโโโโโโโ โโโโโโโโโ โโโโโโโโ โโโโโโโโ
โ โ โ โ
โโโโโโโโโโโโดโโโโโโโโโโดโโโโโโโ
โ
โผ
โโโโโโโโโโโ
โEXTRACT โ
โโโโโโโโโโโ
โ
โผ
โโโโโโโโโโโ
โ SUMMARY โ
โโโโโโฌโโโโโ
โ
โผ
โโโโโโโโโโโ
โ LOBBY โ
โโโโโโโโโโโ
Common Loop Patterns
Round-Based
Discrete turns with planning phases:
- Plan phase
- Execution phase
- Resolution phase
- Reward phase
Real-Time
Continuous action with moments:
- Constant engagement
- Peaks and valleys
- No pausing
- Immediate feedback
Session-Based
Complete matches with:
- Preparation phase
- Main gameplay
- Conclusion phase
- Summary/rewards
Loop Review Checklist
Before finalizing the core loop:
Multiplayer State Synchronization (NEW - 2026-01-28)
Design considerations for server-authoritative multiplayer games.
State Authority Model
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ SERVER AUTHORITATIVE โ
โ โโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโ โ
โ โ Game State โโโโโโ Physics โโโโโโ Player โ โ
โ โ (Truth) โ โ Simulation โ โ Inputs โ โ
โ โโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโ โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ โ
โ State sync (20Hz) โ Input (client)
โผ โผ
โโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโโโโ
โ CLIENT STATE โ โ PREDICTED STATE โ
โ (Display only) โ โ (Immediate feedback)โ
โโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโโโโ
State Design Principles
Server State (Authoritative):
- Player positions (x, y, z, rotation)
- Health, armor, weapon state
- Match state (lobby, playing, ended)
- Projectile positions and velocities
Client State (Predicted):
- Local player position (client-side prediction)
- Visual effects (immediate feedback)
- UI state (local only)
Shared State (Synced):
- Match scores
- Leaderboard
- Player alive/dead status
State Update Categories
| Category | Update Rate | Authority | Rollback |
|---|
| Player Input | Client โ Server (immediate) | Client | No |
| Player Position | Server โ Client (20Hz) | Server | Yes |
| Health/Armor | Server โ Client (on change) | Server | Yes |
| Visual Effects | Client only | Client | No |
| Match State | Server โ Client (on change) | Server | No |
Prediction vs Reconciliation
Client sends input โ Client predicts result โ Display immediately
โ
Server processes input โ Sends correction
โ
Client reconciles (smooth correction)
Design Checklist for Multiplayer Features
Before adding gameplay features:
State Management for Multiplayer
Store Structure:
src/store/
โโโ connectionStore.ts - Server connection status
โโโ playerStore.ts - Local player state (predicted)
โโโ matchStore.ts - Match/server state (authoritative)
โโโ uiStore.ts - UI state (local only)
Integration Points:
connectionStore.sessionId - Unique player identifier
playerStore.position - Predicted local position
matchStore.players - Server-authoritative player list
matchStore.leaderboard - Synced match state
Sources: