Pre-Introduction
现代多人体验须要同步海量数据在分布于世界各地的大量终端之间。
有两个选择特别重要,对提供引人入胜的用户体验来说:
- What data you send
- How you send it
Replication is the name for the process of synchronizing data and procedure calls between clients and servers.
Replication系统提供了一个高阶抽象,同时也附带低阶自定义的能力,来共同应对在线多人游戏中可能会碰到的所有状况。
Introduction
Getting Started
新手入门。
Fundamentals
- Character Movement Component
- Multiplayer in Blueprints
- Performance and Bandwidth Tips
个人经验
跨关卡传递数据可以通过SaveGameObject来实现。
- 本地只需要执行一次的代码可以考虑放在关卡蓝图里实现
- 通用的第三人称支持方法:
- 设置一个前置关卡:用于读取本地参数
在前置关卡中自定义一个GameMode
--GameMode中设定特制的UMyPlayerController,这个特制PC的作用是用来获取特制的UMyLocalPlayer,该LocalPlayer通过定制的AddGameLoginOption接口设定连接参数,然后发起远程连接。这个参数可以有SpectatorOnly=1--
无需上面这么复杂。针对OB,只需要在open server时传递SpectatorOnly=1参数即可,即open server?SpectatorOnly=1即可。