返回提示词目录第 1444 页

多人游戏后端架构与容量规划

根据游戏类型与规模设计匹配、会话托管和玩家数据服务,输出架构图及峰值容量估算。

完整提示词

<context>
A multiplayer game backend is several systems: identity and accounts, matchmaking, session hosting, persistent player data, and live operations (events, configuration, analytics, moderation). Real-time competitive games need an authoritative server per match so clients cannot decide outcomes; turn-based or casual co-op games can often use relays or simpler request-response backends. Session servers are stateful and short-lived, so they are allocated from a fleet per region, sized by players per server and peak concurrency, and drained rather than killed. Matchmaking always trades queue time against match quality (skill, latency, party size); strict rules at low population produce empty queues, so rules relax over time in the queue. Player inventory and currency need transactional, idempotent writes and a server-side ledger, because duplication exploits destroy game economies. Launch days create load spikes of many times the steady state, especially on login and matchmaking. Managed game backend services and server hosting platforms save a lot of work for small teams; building everything is justified only at scale or with unusual needs. Netcode inside the match is a separate design.
</context>

<task>
<game>
{{game}}
</game>
{{#scale}}
Scale: {{scale}}
{{/scale}}
{{#constraints}}
Constraints: {{constraints}}
{{/constraints}}

1. Classify the game's needs: real-time or turn-based, competitive or casual, players per match, session length, and which state must be authoritative on the server.
2. Decide build or buy per service (identity, matchmaking, server hosting, player data, live-ops) from team size and scale, naming the capability to look for rather than inventing vendor features.
3. Design session hosting: dedicated, relay or peer, server allocation from a regional fleet, scaling on queue depth and peak, draining for updates, and region selection from latency.
4. Design matchmaking: tickets, skill rating, latency constraints, parties, rule relaxation over queue time, backfill, and what happens at low population.
5. Design persistence: player profile, progression, inventory and currency with server-side transactions, idempotency on grants and purchases, and an audit ledger.
6. List what the server must own to limit cheating (match results, currency, inventory, rate limits) and abuse handling (reports, bans).
7. Estimate peak session servers from the given numbers, name the launch-day bottlenecks (login, matchmaking, database), and the load tests to run.
</task>

<constraints>
- Never let the client be authoritative for match results, currency or inventory in competitive or monetised games.
- Do not invent vendor features, prices or limits; describe the capability and say what to verify.
- Keep the design proportional; a small co-op game does not need a global fleet.
- In-match netcode is out of scope; refer to it instead of designing it here.
{{> output/uncertainty}}
</constraints>

<output_format>
## Recommendation
The overall shape and build or buy choices, in at most five lines.
## Services
A Mermaid diagram of client, identity, matchmaking, session servers, persistence and live-ops services, then one line each.
## Session hosting
Dedicated servers, relays or peer hosting, fleet allocation and region placement.
## Matchmaking
Rules, skill rating, latency buckets, party handling and queue time trade-offs.
## Persistence and economy
Player data, inventory and currency transactions, consistency rules.
## Cheating and abuse
What the server must own and validate.
## Capacity and cost
Estimate of servers at peak from the stated numbers, and what to load test.
</output_format>

可替换内容

  • {{game}}
  • {{#scale}}
  • {{scale}}
  • {{/scale}}
  • {{#constraints}}
  • {{constraints}}
  • {{/constraints}}
  • {{> output/uncertainty}}

分类与标签

编程开发、游戏后端、匹配系统、会话托管、容量规划

前往 AI 图片创作