I Shot You First: Networking the Gameplay of Halo: Reach

Refer to: I Shot You First: Networking the Gameplay of Halo: Reach

Architecture

Common simplifying approaches

  1. Lockstep(deterministic, input-passing)

    对于输入和模拟及时性要求不高的游戏,例如RTS。

    通过Game Loop来控制游戏的演进

  2. Reliable transport protocols(TCP or homegrown)

    需要高带宽和可靠的环境

    TCP的延迟问题需要解决

  3. Send all networked state as a single blob(atomically)

    总是同步所有物体的情况,对于小规模的网络是非常好的

Halo has to solve the hard problem

Highly competitive multiplayer action game

对于现代的射击游戏,每个玩家都会对游戏产生关键影响,生成大量数据
75fabf2ee588209b82c06dd08ab51f57.png
显然,将一切物体网络化(需要同步)的成本是非常高的

TRIBES points the way

The TRIBES Engine Networking Model

A host/client model, resilient to cheating

Protocols for semi-reliable data delivery(不强制重传)

Terms

Replication

The communication of state or events to a remote peer

peers 之间的同步性

Authority

Permission to update the persistent sate of an object

Prediction

Extrapolating the current properties of an entitiy based on historial authoritative data and local guesses about the future

客户端在收到两个网络状态(信息)之间,本地对网络游戏物体的预测、判断

Bungie’s Networking Stack

Layer Purpose
Game Runs the game
Game Interface Extract and apply replicated data(提取游戏世界中的定量数据)
Prioritization Rate the priority of all possible replication options (选择优先发送什么数据)
Replication Protocols with various reliability guarantees
Channel Manager Flow and congestion control
Transport Send & receive on sockets

Replication Protocol

State Data

hots -> only client

Guaranteed eventual delivery of most current state, host -> client only

  • Object position

  • Object health

  • Other Key Game Info

Events(describing transitions )

Unreliable notifications of transient occurrences, telling why something happen.

Why player is dead

host -> client and client -> host

  • Fire the Weapon

  • This weapon was fired

几乎所有Event都有可能被dropped

Control data