Files
nexus/wiki/sources/unreal-multiplayer-architect.md

58 lines
3.9 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
---
title: "Unreal Multiplayer Architect"
type: source
tags: [game-development, unreal-engine, networking, multiplayer, ue5]
date: 2026-04-26
---
## Source File
- [[raw/Agent/agency-agents/game-development/unreal-engine/unreal-multiplayer-architect.md]]
## Summary用中文描述
- 核心主题UE5多人游戏网络架构专家角色定义——构建服务器权威模型、延迟容忍、作弊防护的多人游戏系统
- 问题域Actor复制、网络预测、RPC安全验证、带宽优化、GAS复制、专用服务器构建
- 方法/机制Server-authoritative架构、UFUNCTION(Server, Reliable, WithValidation)、GetLifetimeReplicatedProps、Replication Graph、双路径GAS初始化
- 结论/价值提供生产级UE5多人游戏网络系统的完整技术方案涵盖从基础复制到高级预测框架的全栈实现
## Key Claims用中文描述
- 服务器必须拥有所有游戏状态变化的执行权威客户端仅发送RPC请求由服务器验证后复制
- 所有游戏逻辑相关的Server RPC必须实现WithValidation不得省略_Validate()实现
- 网络复制频率应按Actor类型差异化配置默认100Hz过高大多数Actor仅需20-30Hz
- GAS的AbilitySystemComponent初始化必须在PossessedBy服务器路径和OnRep_PlayerState客户端路径两个入口点分别执行
- 专用服务器构建必须使用Linux平台+Shipping配置+Cooked内容
## Key Quotes
> "The server owns truth. The client requests it — the server decides." — 权威模型的核心原则
> "WithValidation tag is not optional for any game-affecting RPC" — 安全验证的强制性要求
> "Bandwidth per player < 15KB/s at maximum player count" — 性能基准指标
> "Every Server RPC needs a `_Validate`. No exceptions. One missing is a cheat vector." — 作弊防护的非妥协立场
## Key Concepts
- [[ServerAuthoritativeModel]]:服务器权威模型——服务器模拟真实状态,客户端预测并对账,所有游戏逻辑在服务器执行
- [[ActorReplication]]Actor复制——UPROPERTY(Replicated)将状态从服务器同步到客户端支持ReplicatedUsing触发RepNotify
- [[RPC]]远程过程调用——Client/Server/NetMulticast三种RPC类型Server RPC必须带验证
- [[NetworkPrediction]]:网络预测——客户端本地预测操作,服务器确认后校正,减少感知延迟
- [[ReplicationGraph]]复制图——空间分区优化仅向相关客户端复制区域内的Actor降低带宽
- [[GAS]]Gameplay Ability System——UE5技能系统支持复制和预测的技能与属性管理
- [[DedicatedServer]]:专用服务器——无图形界面的纯服务器实例,处理所有游戏逻辑
- [[NetworkRelevancy]]网络相关性——根据客户端视角决定哪些Actor需要复制节省带宽
- [[NetMulticast]]多播RPC——服务器向所有客户端广播事件用于仅表现层效果
## Key Entities
- [[GameMode]]:服务器独有(永不复制)——生成逻辑、规则仲裁、胜负条件判定
- [[GameState]]:复制到所有客户端——共享世界状态(回合计时器、队伍分数等)
- [[PlayerState]]:复制到所有客户端——每玩家公开数据(名称、延迟、击杀数)
- [[PlayerController]]仅复制到拥有客户端——输入处理、摄像机、HUD控制
- [[AbilitySystemComponent]]GAS核心组件——管理技能和属性必须正确配置复制
- [[ReplicationGraph]]UE5复制图插件——用空间分区替代默认扁平相关性模型
## Connections
- [[GameMode]] ← spawns + governs ← [[GameState]]
- [[PlayerController]] ← possesses ← [[PlayerState]]
- [[GameplayAbilitySystem]] ← depends_on ← [[ActorReplication]]
- [[NetworkPrediction]] ← extends ← [[ActorReplication]]
- [[DedicatedServer]] ← hosts ← [[GameMode]]
## Contradictions
- 与现有Wiki内容暂无冲突——本页面为独立技术领域UE5网络架构