协作头脑风暴
brainstorming
在实现前澄清需求、探索设计选择,并形成清晰的开发方向。
matchmaking-lobby【开发与工程】Expert matchmaking and lobby engineering — skill rating, match formation, queue fairness, region/ping routing, party state and lobby session sync.
独立 GitHub 快照 · 自动分类 · 以原作者文档为准
Matchmaking turns "players waiting" into "a fair game started fast." The lobby keeps a group of players synced until the match host is assigned. This skill covers skill rating, match formation, queue design, region/ping routing, party/lobby state and the mechanics that make wait times feel fair.
They're separate services with separate state, but one UX.
| System | Model | Notes |
|---|---|---|
| Elo | points, k-factor | simple, moody on big deltas |
| Glicko-2 | (mu, phi, sigma) | uncertainty-aware → used by most modern |
| TrueSkill | Gaussian per player | popular, parametrized |
Pick based on match structure (1v1 vs team). Key trick: uncertainty (phi) — new players search wider; established pros narrow. Do NOT shrink phi to 0 (a swinger's streak becomes untrustworthy).
Update after the match (asynchronously, event-driven). Rules:
phi catches a fresh account; correlated accounts (same IP) — flag not ban.t = 0: strict window (skill sigma = 100, region local)
t = 15s: widen sigma (200) + relax region
t = 60s: widen further + allow higher ping
t = 120s: "mercy" — worst match still better than no match (queue guard)
The widen over time is what makes wait times fair: a 3:00 min queue gives up skill to start faster. Config per title (ranked mode: stricter always).
|teamA_avgRating - teamB_avgRating|, not just pooled).A match quality score (m) combined from: skill variance, party-fulfillment, region/ping cost, queue-wait penalty. Choose the configuration with the best score via search over candidates (not greedy). Data-driven tune (see match-formation.md).
Many players join at once → avoid stampede by offering the match slot (accept window 10–30 s) then confirming server.
A party = a persistent group (friends). A lobby = a party + pending invitees, pre-match.
PARTY_IDLE → (search) → QUEUEING → (match formed) → MATCH_HANDOFF
└─ (leave) → PARTY_IDLE (handoff owner = leader)
ready, left, kicked, ownerChanged.matchmaker picks a free server as matchHost
→ sends {matchId, playerList, region, mode, seed} to lobby service
lobby announces to all members: "match ready → join {serverIp}"
members connect to the authoritative server with their session token
server validates token + sends ACK to matchmaker (consumption)
Atomicity: the token single-use prevents double-join. If a member never arrives, the server holds a short grace and starts with a bot/penalty.
| Cheat | Counter |
|---|---|
| Queue-dodge | cooldown + MMR loss after N dodges |
| Smurf (new account) | uncertainty phi catches outliers |
| Stack-smurf (4 pros with 1 new) | average-teaming guard + region/ping still apply |
| Long-wait exploit | merciless auto-start out of mercy |
| Fake region (VPN) | ping measured, not claimed |
| Metric | Watch |
|---|---|
| P50/P95 queue wait | compare per mode/bucket |
| Match quality score distribution | mean rising = bad |
| Abandon rate post-match-made | dodge tool |
| Avg rating delta per side | fairness guard |
| Region hops | cross-region rate |
references/skill-rating.md — Elo/Glicko-2/TrueSkill math, phi, team updates, smurf detectionreferences/match-formation.md — search window, widening, score function, fairness across teamsreferences/queue-engineering.md — push queue, accept windows, join race, dodging/cooldownsreferences/regions-and-ping.md — ping measurement, region routing, cross-region penaltiesreferences/party-and-lobby-state.md — party/lobby lifecycle, ownership, invites, ready checksreferences/server-handoff.md — matchmaker→server assignment, single-use tokens, join validation