Multiplayer Game Architecture

Multiplayer

by davila7 · MIT license · ★ 32,299 on GitHub

Multiplayer cover

Multiplayer game development principles. Architecture, networking, synchronization.

---
name: multiplayer
description: Multiplayer game development principles. Architecture, networking, synchronization.
allowed-tools: Read, Write, Edit, Glob, Grep, Bash
---

# Multiplayer Game Development

> Networking architecture and synchronization principles.

---

## 1. Architecture Selection

### Decision Tree

```
What type of multiplayer?

Overview

Multiplayer game development principles. Architecture, networking, synchronization.

Manual install (npx, ZIP)
Claude Codenpx skills add davila7/claude-code-templates --skill multiplayer -g -a claude-code
Claude Code (degit)npx degit davila7/claude-code-templates/cli-tool/components/skills/creative-design/game-development/multiplayer#main ~/.claude/skills/multiplayer
Claude.ai / desktopZip the folder and upload it under Settings → Capabilities → Skills.
Codex, Cursor, other agentsPoint them at SKILL.md. The other files are plain text.

Connects with Agent Alley MCP · agentalley.io/mcp

Files included

  • SKILL.md2.7 KB
Read SKILL.md here
davila7/main1 file shown
SKILL.md
Show the full text133 lines

Multiplayer Game Development

Networking architecture and synchronization principles.


1. Architecture Selection

Decision Tree
What type of multiplayer?
│
├── Competitive / Real-time
│   └── Dedicated Server (authoritative)
│
├── Cooperative / Casual
│   └── Host-based (one player is server)
│
├── Turn-based
│   └── Client-server (simple)
│
└── Massive (MMO)
    └── Distributed servers
Comparison
Architecture Latency Cost Security
Dedicated Low High Strong
P2P Variable Low Weak
Host-based Medium Low Medium

2. Synchronization Principles

State vs Input
Approach Sync What Best For
State Sync Game state Simple, few objects
Input Sync Player inputs Action games
Hybrid Both Most games
Lag Compensation
Technique Purpose
Prediction Client predicts server
Interpolation Smooth remote players
Reconciliation Fix mispredictions
Lag compensation Rewind for hit detection

3. Network Optimization

Bandwidth Reduction
Technique Savings
Delta compression Send only changes
Quantization Reduce precision
Priority Important data first
Area of interest Only nearby entities
Update Rates
Type Rate
Position 20-60 Hz
Health On change
Inventory On change
Chat On send

4. Security Principles

Server Authority
Client: "I hit the enemy"
Server: Validate → did projectile actually hit?
         → was player in valid state?
         → was timing possible?
Anti-Cheat
Cheat Prevention
Speed hack Server validates movement
Aimbot Server validates sight line
Item dupe Server owns inventory
Wall hack Don't send hidden data

5. Matchmaking

Considerations
Factor Impact
Skill Fair matches
Latency Playable connection
Wait time Player patience
Party size Group play

6. Anti-Patterns

❌ Don't ✅ Do
Trust the client Server is authority
Send everything Send only necessary
Ignore latency Design for 100-200ms
Sync exact positions Interpolate/predict

Remember: Never trust the client. The server is the source of truth.

1---
2name: multiplayer
3description: Multiplayer game development principles. Architecture, networking, synchronization.
4allowed-tools: Read, Write, Edit, Glob, Grep, Bash
5---
6 
7# Multiplayer Game Development
8 
9> Networking architecture and synchronization principles.
10 
11---
12 
13## 1. Architecture Selection
14 
15### Decision Tree
16 
17```
18What type of multiplayer?
19│
20├── Competitive / Real-time
21│ └── Dedicated Server (authoritative)
22│
23├── Cooperative / Casual
24│ └── Host-based (one player is server)
25│
26├── Turn-based
27│ └── Client-server (simple)
28│
29└── Massive (MMO)
30 └── Distributed servers
31```
32 
33### Comparison
34 
35| Architecture | Latency | Cost | Security |
36|--------------|---------|------|----------|
37| **Dedicated** | Low | High | Strong |
38| **P2P** | Variable | Low | Weak |
39| **Host-based** | Medium | Low | Medium |
40 
41---
42 
43## 2. Synchronization Principles
44 
45### State vs Input
46 
47| Approach | Sync What | Best For |
48|----------|-----------|----------|
49| **State Sync** | Game state | Simple, few objects |
50| **Input Sync** | Player inputs | Action games |
51| **Hybrid** | Both | Most games |
52 
53### Lag Compensation
54 
55| Technique | Purpose |
56|-----------|---------|
57| **Prediction** | Client predicts server |
58| **Interpolation** | Smooth remote players |
59| **Reconciliation** | Fix mispredictions |
60| **Lag compensation** | Rewind for hit detection |
61 
62---
63 
64## 3. Network Optimization
65 
66### Bandwidth Reduction
67 
68| Technique | Savings |
69|-----------|---------|
70| **Delta compression** | Send only changes |
71| **Quantization** | Reduce precision |
72| **Priority** | Important data first |
73| **Area of interest** | Only nearby entities |
74 
75### Update Rates
76 
77| Type | Rate |
78|------|------|
79| Position | 20-60 Hz |
80| Health | On change |
81| Inventory | On change |
82| Chat | On send |
83 
84---
85 
86## 4. Security Principles
87 
88### Server Authority
89 
90```
91Client: "I hit the enemy"
92Server: Validate → did projectile actually hit?
93 → was player in valid state?
94 → was timing possible?
95```
96 
97### Anti-Cheat
98 
99| Cheat | Prevention |
100|-------|------------|
101| Speed hack | Server validates movement |
102| Aimbot | Server validates sight line |
103| Item dupe | Server owns inventory |
104| Wall hack | Don't send hidden data |
105 
106---
107 
108## 5. Matchmaking
109 
110### Considerations
111 
112| Factor | Impact |
113|--------|--------|
114| **Skill** | Fair matches |
115| **Latency** | Playable connection |
116| **Wait time** | Player patience |
117| **Party size** | Group play |
118 
119---
120 
121## 6. Anti-Patterns
122 
123| ❌ Don't | ✅ Do |
124|----------|-------|
125| Trust the client | Server is authority |
126| Send everything | Send only necessary |
127| Ignore latency | Design for 100-200ms |
128| Sync exact positions | Interpolate/predict |
129 
130---
131 
132> **Remember:** Never trust the client. The server is the source of truth.
133 
View all files on GitHub →

Details

License
MIT
Stars on the repo
★ 32,299
Checked
Source
davila7/claude-code-templates ↗
Creator
davila7 · 212 listings
View creator

Similar skills

See all →

More from davila7

Skill2D Game Developmentdavila7/claude-code-templates · by davila72D game development principles. Sprites, tilemaps, physics, camera.★ 32.3k GitHub starsSkill3D Game Development Principlesdavila7/claude-code-templates · by davila73D game development principles. Rendering, shaders, physics, cameras.★ 32.3k GitHub starsSkill3D Web Experience Builderdavila7/claude-code-templates · by davila7Expert in building 3D experiences for the web - Three.js, React Three Fiber, Spline, WebGL, and interactive 3D scenes. Covers product configurators, 3D portfolios, immersive websites, and bringing depth to web experiences. Use when: 3D website, three.js, WebGL, react three fiber, 3D experience.★ 32.3k GitHub starsSkillSplit Test Setupdavila7/claude-code-templates · by davila7When the user wants to plan, design, or implement an A/B test or experiment. Also use when the user mentions "A/B test," "split test," "experiment," "test this change," "variant copy," "multivariate test," or "hypothesis." For tracking implementation, see analytics-tracking.★ 32.3k GitHub starsAgentResearch Literature Synthesizerdavila7/claude-code-templates · by davila7Academic research synthesis specialist. Use PROACTIVELY for comprehensive research on academic topics, literature reviews, technical investigations, and well-cited analysis combining multiple sources. <example>Context: A podcast episode needs a segment grounded in peer-reviewed evidence with formal citations. user: "Research the current state of transformer efficiency techniques for the episode, with proper academic citations." assistant: "I'll use the academic-research-synthesizer agent to search arXiv and Semantic Scholar, extract full-text findings via WebFetch, and produce a cited literature synthesis with confidence levels." <commentary>Use academic-research-synthesizer (not comprehensive-researcher) when the episode segment needs peer-reviewed sourcing, formal citation format, and explicit confidence tagging rather than general-purpose multi-source coverage.</commentary></example> <example>Context: The episode-orchestrator has routed a "literature review" request for a technical deep-dive segment. user: "Summarize the research landscape on federated learning privacy guarantees." assistant: "I'll invoke academic-research-synthesizer to systematically search academic sources, note peer-review status per source, and synthesize consensus vs. open debates."</example>★ 32.3k GitHub starsAgentAcademic Research Specialistdavila7/claude-code-templates · by davila7Academic research specialist for scholarly sources, peer-reviewed papers, and academic literature. Use PROACTIVELY for research paper analysis, literature reviews, citation tracking, and academic methodology evaluation. <example>Context: The research-orchestrator has kicked off Phase 4 parallel research on 'efficacy of intermittent fasting' and needs peer-reviewed evidence. user: "Find the academic evidence on intermittent fasting outcomes." assistant: "I'll use the academic-researcher agent to search Semantic Scholar, PubMed, and OpenAlex for peer-reviewed studies and write structured findings to academic-research.md." <commentary>The request is specifically for scholarly/peer-reviewed evidence rather than general web coverage or code, so academic-researcher (not web-researcher or technical-researcher) is the right specialist.</commentary></example> <example>Context: The user wants a literature review comparing methodologies across studies on a topic. user: "Can you review the literature on transformer model interpretability and identify research gaps?" assistant: "Let me invoke the academic-researcher agent to pull foundational and recent papers, extract methodologies, and surface open research gaps." <commentary>Literature review, methodology extraction, and research-gap identification are core academic-researcher capabilities, distinct from technical-researcher's focus on code repositories and implementations.</commentary></example>★ 32.3k GitHub stars