Use when you have a written implementation plan to execute in a separate session with review checkpoints
npx skills add pluginagentmarketplace/custom-plugin-game-developer --skill "game-servers"
Install specific skill from multi-skill repository
# Description
|
# SKILL.md
name: game-servers
version: "2.0.0"
description: |
Game server architecture, scalability, matchmaking, and backend systems
for online games. Build robust, scalable multiplayer infrastructure.
sasmp_version: "1.3.0"
bonded_agent: 05-networking-multiplayer
bond_type: SECONDARY_BOND
parameters:
- name: architecture
type: string
required: false
validation:
enum: [dedicated, listen, relay, hybrid]
- name: scale
type: string
required: false
validation:
enum: [small, medium, large, massive]
retry_policy:
enabled: true
max_attempts: 5
backoff: exponential
jitter: true
observability:
log_events: [start, complete, error, scale_event]
metrics: [player_count, server_count, match_time, queue_time]
Game Servers
Server Architecture Patterns
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β SERVER ARCHITECTURES β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β DEDICATED SERVER: β
β β’ Server runs game simulation β
β β’ Clients send inputs, receive state β
β β’ Best security and consistency β
β β’ Higher infrastructure cost β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β LISTEN SERVER: β
β β’ One player hosts the game β
β β’ Free infrastructure β
β β’ Host has advantage (no latency) β
β β’ Session ends if host leaves β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β RELAY SERVER: β
β β’ Routes packets between peers β
β β’ No game logic on server β
β β’ Good for P2P with NAT traversal β
β β’ Less secure than dedicated β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
Scalable Architecture
SCALABLE GAME BACKEND:
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β GLOBAL LOAD BALANCER β
β β β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β GATEWAY SERVERS β
β Authentication, Routing, Rate Limiting β
β β β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β βββββββββββββββ βββββββββββββββ βββββββββββββββ β
β β MATCHMAKING β β LOBBY β β SOCIAL β β
β β SERVICE β β SERVICE β β SERVICE β β
β βββββββββββββββ βββββββββββββββ βββββββββββββββ β
β β β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β GAME SERVER ORCHESTRATOR β
β (Spawns/despawns based on demand) β
β β β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β βββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β β GAME SERVERS (Regional, Auto-scaled) β β
β β [US-East] [US-West] [EU-West] [Asia] [Oceania] β β
β βββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β β β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β DATABASE CLUSTER β
β [Player Profiles] [Leaderboards] [Match History] [Items] β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
Matchmaking System
MATCHMAKING FLOW:
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β 1. QUEUE: Player enters matchmaking queue β
β β Store: skill rating, region, preferences β
β β
β 2. SEARCH: Find compatible players β
β β Same region (or expand after timeout) β
β β Similar skill (Β±100 MMR, expand over time) β
β β Compatible party sizes β
β β
β 3. MATCH: Form teams when criteria met β
β β Balance teams by total MMR β
β β Check for premade groups β
β β
β 4. PROVISION: Request game server β
β β Orchestrator spawns or assigns server β
β β Wait for server ready β
β β
β 5. CONNECT: Send connection info to all players β
β β IP:Port or relay token β
β β Timeout if player doesn't connect β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
Player Data Management
// β
Production-Ready: Player Session
public class PlayerSession
{
public string PlayerId { get; }
public string SessionToken { get; }
public DateTime CreatedAt { get; }
public DateTime LastActivity { get; private set; }
private readonly IDatabase _db;
private readonly ICache _cache;
public async Task<PlayerProfile> GetProfile()
{
// Try cache first
var cached = await _cache.GetAsync<PlayerProfile>($"profile:{PlayerId}");
if (cached != null)
{
return cached;
}
// Fall back to database
var profile = await _db.GetPlayerProfile(PlayerId);
// Cache for 5 minutes
await _cache.SetAsync($"profile:{PlayerId}", profile, TimeSpan.FromMinutes(5));
return profile;
}
public async Task UpdateStats(MatchResult result)
{
LastActivity = DateTime.UtcNow;
// Update in database
await _db.UpdatePlayerStats(PlayerId, result);
// Invalidate cache
await _cache.DeleteAsync($"profile:{PlayerId}");
}
}
Auto-Scaling Strategy
SCALING TRIGGERS:
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β SCALE UP when: β
β β’ Queue time > 60 seconds β
β β’ Server utilization > 70% β
β β’ Approaching peak hours β
β β
β SCALE DOWN when: β
β β’ Server utilization < 30% for 15+ minutes β
β β’ Off-peak hours β
β β’ Allow graceful drain (don't kill active matches) β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β PRE-WARMING: β
β β’ Spin up servers before expected peak β
β β’ Use historical data to predict demand β
β β’ Keep warm pool for instant availability β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
π§ Troubleshooting
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β PROBLEM: Long matchmaking times β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β SOLUTIONS: β
β β Expand skill range over time β
β β Allow cross-region matching β
β β Reduce minimum player count β
β β Add bots to fill partial matches β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β PROBLEM: Server crashes during peak β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β SOLUTIONS: β
β β Pre-warm servers before peak β
β β Increase max server instances β
β β Add circuit breakers β
β β Implement graceful degradation β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β PROBLEM: Database bottleneck β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β SOLUTIONS: β
β β Add caching layer (Redis) β
β β Use read replicas β
β β Shard by player ID β
β β Queue non-critical writes β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
Infrastructure Costs
| Scale | Players | Servers | Monthly Cost |
|---|---|---|---|
| Small | 1K CCU | 10 | $500-1K |
| Medium | 10K CCU | 100 | $5K-10K |
| Large | 100K CCU | 1000 | $50K-100K |
| Massive | 1M+ CCU | 10000+ | $500K+ |
Use this skill: When building online backends, scaling systems, or implementing matchmaking.
# Supported AI Coding Agents
This skill is compatible with the SKILL.md standard and works with all major AI coding agents:
Learn more about the SKILL.md standard and how to use these skills with your preferred AI coding agent.