with one click
multiplayer
多人游戏开发原则。架构、网络、同步。
Install with Codex or Claude Copy this prompt, paste it into Codex, Claude, or another assistant, and let it review the skill page and install it for you.
Menu
多人游戏开发原则。架构、网络、同步。
Install with Codex or Claude Copy this prompt, paste it into Codex, Claude, or another assistant, and let it review the skill page and install it for you.
Based on SOC occupation classification
务实的编码标准—— 简洁、直接、不做过度设计、不写无用注释(Pragmatic coding standards)
性能分析原则。测量、分析与优化技术。
API design principles and decision-making(API 设计原则与决策逻辑)。REST vs GraphQL vs tRPC selection(选择)、response formats(响应格式)、versioning(版本控制)、pagination(分页)。
App Builder(应用构建编排器)主编排器。根据自然语言请求创建全栈应用,确定项目类型、选择技术栈并协调智能体。
Project scaffolding templates(项目脚手架模板)。用于从零创建新项目。包含 12 个技术栈模板。
Architectural decision-making framework(架构决策框架)。Requirements analysis(需求分析)、trade-off evaluation(权衡评估)、ADR documentation(架构决策记录)。Use when making architecture decisions or analyzing system design(用于架构决策与系统设计分析)。
| name | multiplayer |
| description | 多人游戏开发原则。架构、网络、同步。 |
| allowed-tools | Read, Write, Edit, Glob, Grep, Bash |
网络架构与同步原则。
什么类型的多人游戏?
|
+-- 竞技 / 实时
| +-- Dedicated Server(专用服务器,权威)
|
+-- 合作 / 休闲
| +-- Host-based(基于主机,一个玩家作为服务器)
|
+-- 回合制
| +-- Client-server(客户端-服务器,简单)
|
+-- 大型(MMO)
+-- 分布式服务器
| 架构 | 延迟 | 成本 | 安全性 |
|---|---|---|---|
| Dedicated(专用) | 低 | 高 | 强 |
| P2P | 可变 | 低 | 弱 |
| Host-based(主机) | 中 | 低 | 中 |
| 方法 | 同步什么 | 最适合 |
|---|---|---|
| State Sync(状态同步) | 游戏状态 | 简单、对象少 |
| Input Sync(输入同步) | 玩家输入 | 动作游戏 |
| Hybrid(混合) | 两者 | 大多数游戏 |
| 技术 | 目的 |
|---|---|
| Prediction(预测) | 客户端预测服务器 |
| Interpolation(插值) | 平滑远程玩家 |
| Reconciliation(和解) | 修正错误预测 |
| Lag compensation(延迟补偿) | 回滚以进行命中检测 |
| 技术 | 节省 |
|---|---|
| Delta compression(增量压缩) | 仅发送变化 |
| Quantization(量化) | 降低精度 |
| Priority(优先级) | 重要数据优先 |
| Area of interest(兴趣区域) | 仅附近实体 |
| 类型 | 速率 |
|---|---|
| 位置 | 20-60 Hz |
| 生命值 | 变化时 |
| 库存 | 变化时 |
| 聊天 | 发送时 |
客户端: "我击中了敌人"
服务器: 验证 -> 抛射物真的击中了吗?
-> 玩家处于有效状态吗?
-> 时间上可能吗?
| 作弊 | 预防 |
|---|---|
| Speed hack(速度挂) | 服务器验证移动 |
| Aimbot(自瞄) | 服务器验证视线 |
| Item dupe(复制物品) | 服务器拥有库存 |
| Wall hack(透视) | 不发送隐藏数据 |
| 因素 | 影响 |
|---|---|
| Skill(技能) | 公平比赛 |
| Latency(延迟) | 可玩的连接 |
| Wait time(等待时间) | 玩家耐心 |
| Party size(队伍大小) | 组队游玩 |
| [FAIL] 禁止 | [OK] 推荐 |
|---|---|
| 信任客户端 | 服务器是权威 |
| 发送一切 | 仅发送必要的 |
| 忽略延迟 | 为 100-200ms 设计 |
| 同步精确位置 | 插值/预测 |
记住: 永远不要信任客户端。服务器是真理之源。