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".4metadata:5 source: https://skillmd.com/skills/michaelschecht/multiplayer-design6---78# Multiplayer Design — Networking, Social & Competition910Design multiplayer systems that feel fair, responsive, and social — from netcode architecture to matchmaking to community features.1112## Inputs1314- Game concept and mechanics (use `/game-concept` and `/mechanics-design`)15- Multiplayer type (co-op, competitive, MMO, async)16- Target player count per session17- Platform and infrastructure budget18- Latency tolerance of core mechanics1920## Step 1: Multiplayer Mode Definition2122### Mode Types2324| Mode | Player Count | Interaction | Examples |25|------|-------------|-------------|---------|26| **Local co-op** | 2-4 | Same screen | Overcooked, It Takes Two |27| **Online co-op** | 2-8 | Cooperative PvE | Deep Rock Galactic, Destiny |28| **Competitive PvP** | 2-100+ | Adversarial | CS2, Fortnite, Street Fighter |29| **Asymmetric** | 2-5 | Different roles | Dead by Daylight, Among Us |30| **MMO** | 100-1000s | Shared world | WoW, FFXIV, EVE |31| **Asynchronous** | Any | Indirect | Dark Souls messages, Clash of Clans |3233### Mode Specification Template3435```markdown36## Mode: [Name]3738**Players:** [Min-Max]39**Teams:** [FFA / Teams of X / Asymmetric roles]40**Objective:** [Win condition]41**Duration:** [Session length]42**Progression:** [Per-match rewards, rankings]43**Social:** [Voice chat, text, emotes, pings]44**Drop-in/out:** [Can players join/leave mid-match?]45```4647## Step 2: Network Architecture4849### Architecture Selection5051```52PEER-TO-PEER (P2P) CLIENT-SERVER RELAY/HYBRID53───────────────── ────────────── ────────────54 P1 ←──→ P2 Server Relay55 ↕ ✕ ↕ ╱ │ ╲ ╱ │ ╲56 P3 ←──→ P4 C1 C2 C3 C1 C2 C35758Pros: Pros: Pros:59 - No server cost - Authoritative - NAT traversal60 - Low latency (direct) - Anti-cheat control - Fallback for P2P61 - Works offline/LAN - Scalable - Lower cost than full server62 - Consistent state6364Cons: Cons: Cons:65 - Host advantage - Server cost - Higher latency66 - NAT issues - Single point fail - Complex architecture67 - Cheat-vulnerable - Latency to server - Harder to debug68 - Hard to scale6970Best for: Best for: Best for:71 Fighting games Shooters, MMOs Casual multiplayer72 Local co-op Competitive games Mobile games73 Small sessions Large player counts Cross-platform74```7576### Synchronization Models7778| Model | How It Works | Latency Feel | Best For |79|-------|-------------|-------------|---------|80| **Lockstep** | All clients wait for all inputs each frame | Laggy at high ping | RTS, fighting games |81| **State sync** | Server sends full game state snapshots | Smooth with interpolation | Shooters, action games |82| **Input prediction** | Client predicts, server corrects | Responsive but rollback-y | Fighting games, platformers |83| **Eventual consistency** | Clients diverge, periodically sync | Loose, async feel | MMOs, strategy, async |8485## Step 3: Lag Compensation8687### Techniques8889```90CLIENT-SIDE PREDICTION:91 Client: Player presses "move right"92 Client: Immediately moves character right (predicted)93 Client: Sends input to server94 Server: Processes input, sends authoritative position95 Client: If server disagrees → smooth correction (rubber-banding)9697SERVER RECONCILIATION:98 Client stores history of all inputs with timestamps99 When server state arrives (past), re-simulate from that point100 Apply all inputs that happened after the server snapshot101 → Minimizes visible corrections102103ENTITY INTERPOLATION:104 Render other players at a past state (e.g., 100ms behind)105 Interpolate between two known positions for smooth movement106 Player sees slightly delayed but smooth other players107108LAG COMPENSATION (HIT DETECTION):109 Server rewinds time by shooter's ping110 Checks if shot would have hit at the time the player fired111 → "Peeker's advantage" but fair to the shooter112```113114### Acceptable Latency by Genre115116| Genre | Max Acceptable Ping | Tick Rate | Notes |117|-------|-------------------|-----------|-------|118| Fighting | <60ms | 60Hz | Rollback netcode essential |119| FPS | <80ms | 64-128Hz | Client prediction + server auth |120| MOBA | <100ms | 30-60Hz | Input buffering acceptable |121| Racing | <100ms | 30-60Hz | Rubber-banding visible but ok |122| RPG/MMO | <200ms | 10-30Hz | Higher tolerance for non-combat |123| Turn-based | <1000ms | On demand | Async is fine |124125## Step 4: Matchmaking126127### Matchmaking System Design128129```130QUEUE ENTRY:131 Player → [Skill Rating] + [Region] + [Preferences] → Queue132133MATCHING ALGORITHM:134 1. Find players within ±[tolerance] skill rating135 2. Prioritize same-region for low latency136 3. Expand tolerance by +X every [Y] seconds in queue137 4. Balance teams by aggregate skill if team mode138 5. Consider party sizes — match parties against parties139140SKILL RATING SYSTEMS:141 Elo: Simple, good for 1v1 (chess-like)142 Glicko-2: Better uncertainty handling, good for all143 TrueSkill: Microsoft's Bayesian, good for teams144 MMR+: Custom composite (win rate + performance metrics)145146QUEUE TIME vs MATCH QUALITY:147 0-30s: Strict matching (±100 MMR)148 30-60s: Relaxed matching (±200 MMR)149 60-120s: Wide matching (±400 MMR)150 120s+: Any match + show warning151```152153### Ranked System Template154155```156RANKS:157 Bronze → Silver → Gold → Platinum → Diamond → Master → Grandmaster158159PROMOTION:160 Win X games at current rank → promote161 Promotion series at tier boundaries (optional)162163DEMOTION PROTECTION:164 Shield games after promotion (3-5 games)165 Demotion only after Y losses at 0 points166167SEASON STRUCTURE:168 Season length: 3 months169 Soft reset: MMR compressed toward median by 25%170 Season rewards: Based on peak rank achieved171```172173## Step 5: Anti-Cheat & Security174175### Cheat Prevention Layers176177```178LAYER 1 — AUTHORITATIVE SERVER:179 Server validates all game state changes180 Clients send inputs only, never positions or health181 → Prevents speed hacks, teleports, god mode182183LAYER 2 — INPUT VALIDATION:184 Server checks input plausibility185 Max movement speed, fire rate, action frequency186 Flag and investigate anomalies187188LAYER 3 — CLIENT INTEGRITY:189 Memory protection (anti-tamper)190 File integrity checks191 Process monitoring192193LAYER 4 — BEHAVIORAL DETECTION:194 Statistical analysis of player behavior195 Aim snap detection (inhuman accuracy patterns)196 Economy anomaly detection197198LAYER 5 — SOCIAL ENFORCEMENT:199 Player reports → review queue200 Reputation system201 Tribunal / community moderation202```203204### Common Cheats to Defend Against205206| Cheat | Prevention |207|-------|-----------|208| **Wallhack** | Don't send hidden entity data to clients |209| **Aimbot** | Server-side aim pattern analysis |210| **Speed hack** | Server-side movement validation |211| **Duplication** | Authoritative server inventory |212| **DDoS** | Rate limiting, DDoS protection service |213| **Account sharing** | Device fingerprinting, behavioral analysis |214215## Step 6: Social Features216217### Social System Checklist218219- [ ] **Friends list** — add, remove, block, online status220- [ ] **Party system** — invite, join, leave, party leader221- [ ] **Communication** — voice chat, text chat, ping system, emotes222- [ ] **Spectating** — watch friends or top players223- [ ] **Leaderboards** — global, friends, regional, seasonal224- [ ] **Clans/guilds** — create, manage, recruit, clan wars225- [ ] **Replay system** — record, share, highlight clips226- [ ] **Moderation tools** — mute, report, block, avoid player227- [ ] **Content sharing** — custom levels, skins, replays228229### Toxicity Mitigation230231| Strategy | Implementation |232|----------|---------------|233| **Default mute** | Strangers muted by default, opt-in to hear |234| **Ping system** | Structured communication without voice (Apex Legends) |235| **Positive reinforcement** | Honor/commend system for good behavior |236| **Escalating punishment** | Warning → mute → temp ban → perma ban |237| **AI chat filter** | Real-time toxicity detection in text |238239## Output240241Save to `artifacts/game-design/[project-name]-multiplayer.md`242243## Guidelines244245- **Design for the worst connection** — if it's fun at 150ms ping, it's great at 30ms246- **Never trust the client** — the server is the source of truth247- Start with the simplest networking model that works — complexity grows fast248- Social features make or break retention — players stay for friends249- Test with simulated lag from day one — don't wait for real players to find issues250- Cross-reference `/mechanics-design` to identify which mechanics are latency-sensitive251- Use `/game-testing` to plan multiplayer-specific test scenarios
Run npx get-skill 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.