Design multiplayer systems including networking architecture, matchmaking, social features, anti-cheat, and multiplayer game modes. Use when adding online or local multiplayer to a game. Also trigger for "multiplayer", "online play", "co-op design", "PvP design", "matchmaking", "netcode", or "multiplayer architecture".
PEER-TO-PEER (P2P) CLIENT-SERVER RELAY/HYBRID
───────────────── ────────────── ────────────
P1 ←──→ P2 Server Relay
↕ ✕ ↕ ╱ │ ╲ ╱ │ ╲
P3 ←──→ P4 C1 C2 C3 C1 C2 C3
Pros: Pros: Pros:
- No server cost - Authoritative - NAT traversal
- Low latency (direct) - Anti-cheat control - Fallback for P2P
- Works offline/LAN - Scalable - Lower cost than full server
- Consistent state
Cons: Cons: Cons:
- Host advantage - Server cost - Higher latency
- NAT issues - Single point fail - Complex architecture
- Cheat-vulnerable - Latency to server - Harder to debug
- Hard to scale
Best for: Best for: Best for:
Fighting games Shooters, MMOs Casual multiplayer
Local co-op Competitive games Mobile games
Small sessions Large player counts Cross-platform
Synchronization Models
Model
How It Works
Latency Feel
Best For
Lockstep
All clients wait for all inputs each frame
Laggy at high ping
RTS, fighting games
State sync
Server sends full game state snapshots
Smooth with interpolation
Shooters, action games
Input prediction
Client predicts, server corrects
Responsive but rollback-y
Fighting games, platformers
Eventual consistency
Clients diverge, periodically sync
Loose, async feel
MMOs, strategy, async
Step 3: Lag Compensation
Techniques
CLIENT-SIDE PREDICTION:
Client: Player presses "move right"
Client: Immediately moves character right (predicted)
Client: Sends input to server
Server: Processes input, sends authoritative position
Client: If server disagrees → smooth correction (rubber-banding)
SERVER RECONCILIATION:
Client stores history of all inputs with timestamps
When server state arrives (past), re-simulate from that point
Apply all inputs that happened after the server snapshot
→ Minimizes visible corrections
ENTITY INTERPOLATION:
Render other players at a past state (e.g., 100ms behind)
Interpolate between two known positions for smooth movement
Player sees slightly delayed but smooth other players
LAG COMPENSATION (HIT DETECTION):
Server rewinds time by shooter's ping
Checks if shot would have hit at the time the player fired
→ "Peeker's advantage" but fair to the shooter
Acceptable Latency by Genre
Genre
Max Acceptable Ping
Tick Rate
Notes
Fighting
<60ms
60Hz
Rollback netcode essential
FPS
<80ms
64-128Hz
Client prediction + server auth
MOBA
<100ms
30-60Hz
Input buffering acceptable
Racing
<100ms
30-60Hz
Rubber-banding visible but ok
RPG/MMO
<200ms
10-30Hz
Higher tolerance for non-combat
Turn-based
<1000ms
On demand
Async is fine
Step 4: Matchmaking
Matchmaking System Design
QUEUE ENTRY:
Player → [Skill Rating] + [Region] + [Preferences] → Queue
MATCHING ALGORITHM:
1. Find players within ±[tolerance] skill rating
2. Prioritize same-region for low latency
3. Expand tolerance by +X every [Y] seconds in queue
4. Balance teams by aggregate skill if team mode
5. Consider party sizes — match parties against parties
SKILL RATING SYSTEMS:
Elo: Simple, good for 1v1 (chess-like)
Glicko-2: Better uncertainty handling, good for all
TrueSkill: Microsoft's Bayesian, good for teams
MMR+: Custom composite (win rate + performance metrics)
QUEUE TIME vs MATCH QUALITY:
0-30s: Strict matching (±100 MMR)
30-60s: Relaxed matching (±200 MMR)
60-120s: Wide matching (±400 MMR)
120s+: Any match + show warning
Ranked System Template
RANKS:
Bronze → Silver → Gold → Platinum → Diamond → Master → Grandmaster
PROMOTION:
Win X games at current rank → promote
Promotion series at tier boundaries (optional)
DEMOTION PROTECTION:
Shield games after promotion (3-5 games)
Demotion only after Y losses at 0 points
SEASON STRUCTURE:
Season length: 3 months
Soft reset: MMR compressed toward median by 25%
Season rewards: Based on peak rank achieved
Step 5: Anti-Cheat & Security
Cheat Prevention Layers
LAYER 1 — AUTHORITATIVE SERVER:
Server validates all game state changes
Clients send inputs only, never positions or health
→ Prevents speed hacks, teleports, god mode
LAYER 2 — INPUT VALIDATION:
Server checks input plausibility
Max movement speed, fire rate, action frequency
Flag and investigate anomalies
LAYER 3 — CLIENT INTEGRITY:
Memory protection (anti-tamper)
File integrity checks
Process monitoring
LAYER 4 — BEHAVIORAL DETECTION:
Statistical analysis of player behavior
Aim snap detection (inhuman accuracy patterns)
Economy anomaly detection
LAYER 5 — SOCIAL ENFORCEMENT:
Player reports → review queue
Reputation system
Tribunal / community moderation
Common Cheats to Defend Against
Cheat
Prevention
Wallhack
Don't send hidden entity data to clients
Aimbot
Server-side aim pattern analysis
Speed hack
Server-side movement validation
Duplication
Authoritative server inventory
DDoS
Rate limiting, DDoS protection service
Account sharing
Device fingerprinting, behavioral analysis
Step 6: Social Features
Social System Checklist
Friends list — add, remove, block, online status
Party system — invite, join, leave, party leader
Communication — voice chat, text chat, ping system, emotes
Moderation tools — mute, report, block, avoid player
Content sharing — custom levels, skins, replays
Toxicity Mitigation
Strategy
Implementation
Default mute
Strangers muted by default, opt-in to hear
Ping system
Structured communication without voice (Apex Legends)
Positive reinforcement
Honor/commend system for good behavior
Escalating punishment
Warning → mute → temp ban → perma ban
AI chat filter
Real-time toxicity detection in text
Output
Save to artifacts/game-design/[project-name]-multiplayer.md
Guidelines
Design for the worst connection — if it's fun at 150ms ping, it's great at 30ms
Never trust the client — the server is the source of truth
Start with the simplest networking model that works — complexity grows fast
Social features make or break retention — players stay for friends
Test with simulated lag from day one — don't wait for real players to find issues
Cross-reference /mechanics-design to identify which mechanics are latency-sensitive
Use /game-testing to plan multiplayer-specific test scenarios
1---2name: multiplayer-design3description: Design multiplayer systems including networking architecture, matchmaking, social features, anti-cheat, and multiplayer game modes. Use when adding online or local multiplayer to a game. Also trigger for "multiplayer", "online play", "co-op design", "PvP design", "matchmaking", "netcode", or "multiplayer architecture".4---56# Multiplayer Design — Networking, Social & Competition78Design multiplayer systems that feel fair, responsive, and social — from netcode architecture to matchmaking to community features.910## Inputs1112- Game concept and mechanics (use `/game-concept` and `/mechanics-design`)13- Multiplayer type (co-op, competitive, MMO, async)14- Target player count per session15- Platform and infrastructure budget16- Latency tolerance of core mechanics1718## Step 1: Multiplayer Mode Definition1920### Mode Types2122| Mode | Player Count | Interaction | Examples |23|------|-------------|-------------|---------|24| **Local co-op** | 2-4 | Same screen | Overcooked, It Takes Two |25| **Online co-op** | 2-8 | Cooperative PvE | Deep Rock Galactic, Destiny |26| **Competitive PvP** | 2-100+ | Adversarial | CS2, Fortnite, Street Fighter |27| **Asymmetric** | 2-5 | Different roles | Dead by Daylight, Among Us |28| **MMO** | 100-1000s | Shared world | WoW, FFXIV, EVE |29| **Asynchronous** | Any | Indirect | Dark Souls messages, Clash of Clans |3031### Mode Specification Template3233```markdown34## Mode: [Name]3536**Players:** [Min-Max]37**Teams:** [FFA / Teams of X / Asymmetric roles]38**Objective:** [Win condition]39**Duration:** [Session length]40**Progression:** [Per-match rewards, rankings]41**Social:** [Voice chat, text, emotes, pings]42**Drop-in/out:** [Can players join/leave mid-match?]43```4445## Step 2: Network Architecture4647### Architecture Selection4849```50PEER-TO-PEER (P2P) CLIENT-SERVER RELAY/HYBRID51───────────────── ────────────── ────────────52 P1 ←──→ P2 Server Relay53 ↕ ✕ ↕ ╱ │ ╲ ╱ │ ╲54 P3 ←──→ P4 C1 C2 C3 C1 C2 C35556Pros: Pros: Pros:57 - No server cost - Authoritative - NAT traversal58 - Low latency (direct) - Anti-cheat control - Fallback for P2P59 - Works offline/LAN - Scalable - Lower cost than full server60 - Consistent state6162Cons: Cons: Cons:63 - Host advantage - Server cost - Higher latency64 - NAT issues - Single point fail - Complex architecture65 - Cheat-vulnerable - Latency to server - Harder to debug66 - Hard to scale6768Best for: Best for: Best for:69 Fighting games Shooters, MMOs Casual multiplayer70 Local co-op Competitive games Mobile games71 Small sessions Large player counts Cross-platform72```7374### Synchronization Models7576| Model | How It Works | Latency Feel | Best For |77|-------|-------------|-------------|---------|78| **Lockstep** | All clients wait for all inputs each frame | Laggy at high ping | RTS, fighting games |79| **State sync** | Server sends full game state snapshots | Smooth with interpolation | Shooters, action games |80| **Input prediction** | Client predicts, server corrects | Responsive but rollback-y | Fighting games, platformers |81| **Eventual consistency** | Clients diverge, periodically sync | Loose, async feel | MMOs, strategy, async |8283## Step 3: Lag Compensation8485### Techniques8687```88CLIENT-SIDE PREDICTION:89 Client: Player presses "move right"90 Client: Immediately moves character right (predicted)91 Client: Sends input to server92 Server: Processes input, sends authoritative position93 Client: If server disagrees → smooth correction (rubber-banding)9495SERVER RECONCILIATION:96 Client stores history of all inputs with timestamps97 When server state arrives (past), re-simulate from that point98 Apply all inputs that happened after the server snapshot99 → Minimizes visible corrections100101ENTITY INTERPOLATION:102 Render other players at a past state (e.g., 100ms behind)103 Interpolate between two known positions for smooth movement104 Player sees slightly delayed but smooth other players105106LAG COMPENSATION (HIT DETECTION):107 Server rewinds time by shooter's ping108 Checks if shot would have hit at the time the player fired109 → "Peeker's advantage" but fair to the shooter110```111112### Acceptable Latency by Genre113114| Genre | Max Acceptable Ping | Tick Rate | Notes |115|-------|-------------------|-----------|-------|116| Fighting | <60ms | 60Hz | Rollback netcode essential |117| FPS | <80ms | 64-128Hz | Client prediction + server auth |118| MOBA | <100ms | 30-60Hz | Input buffering acceptable |119| Racing | <100ms | 30-60Hz | Rubber-banding visible but ok |120| RPG/MMO | <200ms | 10-30Hz | Higher tolerance for non-combat |121| Turn-based | <1000ms | On demand | Async is fine |122123## Step 4: Matchmaking124125### Matchmaking System Design126127```128QUEUE ENTRY:129 Player → [Skill Rating] + [Region] + [Preferences] → Queue130131MATCHING ALGORITHM:132 1. Find players within ±[tolerance] skill rating133 2. Prioritize same-region for low latency134 3. Expand tolerance by +X every [Y] seconds in queue135 4. Balance teams by aggregate skill if team mode136 5. Consider party sizes — match parties against parties137138SKILL RATING SYSTEMS:139 Elo: Simple, good for 1v1 (chess-like)140 Glicko-2: Better uncertainty handling, good for all141 TrueSkill: Microsoft's Bayesian, good for teams142 MMR+: Custom composite (win rate + performance metrics)143144QUEUE TIME vs MATCH QUALITY:145 0-30s: Strict matching (±100 MMR)146 30-60s: Relaxed matching (±200 MMR)147 60-120s: Wide matching (±400 MMR)148 120s+: Any match + show warning149```150151### Ranked System Template152153```154RANKS:155 Bronze → Silver → Gold → Platinum → Diamond → Master → Grandmaster156157PROMOTION:158 Win X games at current rank → promote159 Promotion series at tier boundaries (optional)160161DEMOTION PROTECTION:162 Shield games after promotion (3-5 games)163 Demotion only after Y losses at 0 points164165SEASON STRUCTURE:166 Season length: 3 months167 Soft reset: MMR compressed toward median by 25%168 Season rewards: Based on peak rank achieved169```170171## Step 5: Anti-Cheat & Security172173### Cheat Prevention Layers174175```176LAYER 1 — AUTHORITATIVE SERVER:177 Server validates all game state changes178 Clients send inputs only, never positions or health179 → Prevents speed hacks, teleports, god mode180181LAYER 2 — INPUT VALIDATION:182 Server checks input plausibility183 Max movement speed, fire rate, action frequency184 Flag and investigate anomalies185186LAYER 3 — CLIENT INTEGRITY:187 Memory protection (anti-tamper)188 File integrity checks189 Process monitoring190191LAYER 4 — BEHAVIORAL DETECTION:192 Statistical analysis of player behavior193 Aim snap detection (inhuman accuracy patterns)194 Economy anomaly detection195196LAYER 5 — SOCIAL ENFORCEMENT:197 Player reports → review queue198 Reputation system199 Tribunal / community moderation200```201202### Common Cheats to Defend Against203204| Cheat | Prevention |205|-------|-----------|206| **Wallhack** | Don't send hidden entity data to clients |207| **Aimbot** | Server-side aim pattern analysis |208| **Speed hack** | Server-side movement validation |209| **Duplication** | Authoritative server inventory |210| **DDoS** | Rate limiting, DDoS protection service |211| **Account sharing** | Device fingerprinting, behavioral analysis |212213## Step 6: Social Features214215### Social System Checklist216217- [ ] **Friends list** — add, remove, block, online status218- [ ] **Party system** — invite, join, leave, party leader219- [ ] **Communication** — voice chat, text chat, ping system, emotes220- [ ] **Spectating** — watch friends or top players221- [ ] **Leaderboards** — global, friends, regional, seasonal222- [ ] **Clans/guilds** — create, manage, recruit, clan wars223- [ ] **Replay system** — record, share, highlight clips224- [ ] **Moderation tools** — mute, report, block, avoid player225- [ ] **Content sharing** — custom levels, skins, replays226227### Toxicity Mitigation228229| Strategy | Implementation |230|----------|---------------|231| **Default mute** | Strangers muted by default, opt-in to hear |232| **Ping system** | Structured communication without voice (Apex Legends) |233| **Positive reinforcement** | Honor/commend system for good behavior |234| **Escalating punishment** | Warning → mute → temp ban → perma ban |235| **AI chat filter** | Real-time toxicity detection in text |236237## Output238239Save to `artifacts/game-design/[project-name]-multiplayer.md`240241## Guidelines242243- **Design for the worst connection** — if it's fun at 150ms ping, it's great at 30ms244- **Never trust the client** — the server is the source of truth245- Start with the simplest networking model that works — complexity grows fast246- Social features make or break retention — players stay for friends247- Test with simulated lag from day one — don't wait for real players to find issues248- Cross-reference `/mechanics-design` to identify which mechanics are latency-sensitive249- Use `/game-testing` to plan multiplayer-specific test scenarios
Run npx skillmds@latest add michaelschecht/multiplayer-design in your terminal (requires Node.js), paste this page's agent-chat prompt into Claude, Cursor, or any MCP-connected agent, or download the SKILL.md file and copy it into your agent's skills directory.
Design multiplayer systems including networking architecture, matchmaking, social features, anti-cheat, and multiplayer game modes. Use when adding online or local multiplayer to a game. Also trigger for "multiplayer", "online play", "co-op design", "PvP design", "matchmaking", "netcode", or "multiplayer architecture". It is listed under Coding & Dev Tools on SkillMD.
SkillMD's automated safety review verdict for this skill is PASS. Independent scanners report: SkillSpector: PASS, Skill Scanner: PASS. Capability flags: docs only. SkillMD never runs a skill's scripts for you; review the SKILL.md before installing.
This skill is tagged as working with Claude Code, Claude.ai, OpenAI Codex. SKILL.md is an open format, so most agents that read a skills directory can load it too.
Yes. Installing skills from SkillMD is free, and the skill stays under its author's original license.
michaelschecht (@michaelschecht) published this skill. Their other Agent Skills are listed on their SkillMD profile.