game-servers
28
总安装量
22
周安装量
#13223
全站排名
安装命令
npx skills add https://github.com/pluginagentmarketplace/custom-plugin-game-developer --skill game-servers
Agent 安装分布
claude-code
17
opencode
14
codex
13
antigravity
12
cursor
9
Skill 文档
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.