Design a matchmaking system with skill-based rating, queue management, team balancing, and regional optimization for competitive multiplayer games.
## ROLE You are a matchmaking systems engineer who has designed skill-based matchmaking for competitive multiplayer games. You understand rating algorithms (Elo, Glicko, TrueSkill), queue theory, and the complex balancing act between match quality, wait times, and player experience. ## OBJECTIVE Design a complete matchmaking system that creates fair, balanced matches quickly while accounting for skill level, latency, party sizes, and player preferences. ## TASK Create a comprehensive matchmaking system: ### Skill Rating System **1. Rating Algorithm Selection** **Elo Rating:** - Simple, well-understood, works for 1v1 - K-factor tuning for volatility control - Limitation: Designed for 1v1, not teams - Best for: Chess-like games, 1v1 fighters **Glicko-2:** - Adds rating deviation (confidence interval) - Accounts for time since last game (rating decay) - Better for infrequent players - Best for: Games with varying play frequency **TrueSkill / TrueSkill 2:** - Designed for team games and free-for-all - Separates individual skill from team performance - Handles partial play and different team sizes - Best for: Team-based competitive games **Custom Composite Rating:** - Combine multiple factors beyond win/loss - Performance metrics (KDA, objective score, damage dealt) - Role-specific ratings - Consistency weighting - Best for: Complex team games with roles **2. Rating Calculation** - Initial rating assignment for new players - Placement match system (10-25 games for calibration) - Rating adjustment formula per match - Win/loss, margin of victory, individual performance weighting - Party MMR adjustment (groups rated differently than solo) - Smurf detection and accelerated placement - Rating decay for inactive players - Season reset strategy (hard, soft, proportional) ### Queue Management **1. Queue Architecture** ``` Player joins queue -> Validate eligibility (rank, level, behavior score) -> Add to pool with preferences (region, mode, role) -> Matching algorithm runs periodically -> Propose match to players -> Accept/decline handling -> Match confirmed -> Launch game server ``` **2. Matching Algorithm** - Priority-based matching: - Priority 1: Skill proximity (tight at first, widens over time) - Priority 2: Latency (geographic proximity) - Priority 3: Wait time fairness - Priority 4: Party size balance - Priority 5: Role composition (if applicable) - Search range expansion over time - 0-30 sec: Tight skill range (plus or minus 100 MMR) - 30-60 sec: Medium range (plus or minus 200 MMR) - 60-120 sec: Wide range (plus or minus 400 MMR) - 120+ sec: Very wide with match quality warning - Maximum wait time before fallback match **3. Team Balancing** - Equal average MMR between teams - Minimize MMR spread within teams - Party together on same team - Role distribution balance - Experience level distribution - Avoid repeated matchups (recent opponents filter) ### Regional & Infrastructure **Server Selection:** - Geographic server regions and coverage - Player latency measurement and server ranking - Cross-region matching rules and thresholds - Peak time handling per region - Low-population region merging strategy **Infrastructure:** - Matchmaking server architecture - Game server allocation and scaling - Session management and cleanup - Database design for player profiles and match history - Redis/cache layer for real-time queue data ### Anti-Abuse & Fair Play **Smurf Prevention:** - New account detection heuristics - Accelerated MMR adjustment for new accounts - Performance anomaly detection - Phone/identity verification requirements - Hardware/IP based detection **Queue Abuse Prevention:** - Dodge penalty system - AFK detection and penalties - Queue sniping prevention (streamer mode) - Win trading detection - Boosting detection (party with much lower-rated players) **Behavior Score Integration:** - Toxic players matched with each other - Good behavior rewarded with better match quality - Report system integration - Abandonment penalty system ### Player Experience **Visible vs. Hidden MMR:** - Hidden MMR for matchmaking accuracy - Visible rank for progression feeling - Rank tier system (Bronze through Champion) - Promotion and demotion mechanics - Season rewards and reset **Match Quality Indicators:** - Pre-match predicted balance score - Post-match feedback collection - Match quality metrics tracking - Player satisfaction correlation with match parameters ### Analytics & Tuning - Match quality distribution tracking - Wait time percentile monitoring - Balance accuracy analysis (predicted vs. actual outcomes) - Queue abandonment rate - Rating distribution curves - A/B testing framework for algorithm changes
Or press ⌘C to copy