Skip to main content

Module view

Module view 

Source
Expand description

What one subscriber was sent, kept so the server can see what that subscriber drew at an earlier tick (lag compensation).

A ViewHistory records the frames sent to one subscriber the way the clients’ entity interpolators record them (EntityInterpolator in packages/realtime and packages/csharp), and ViewHistory::position_at places an entity at a fractional tick with the same rule. The two agree exactly for an interpolator with its default options: holdWhenQuiet on and no snapDistance.

The rules, as in the clients:

  • A spawn starts a life with one sample at the spawn tick. A despawn ends the open life at its tick. An entity is drawn from its spawn tick until the tick its life ended.
  • An update adds a sample when the position or a component changed. A second update in the same tick replaces the tick’s sample. When the entity moved and its last sample is older than the tick before, a copy of the last sample is added at the tick before: it stood still until then.
  • A full frame lists every entity the subscriber has. Open lives of entities it does not list end at its tick.
  • At a render tick, the entity is between the last sample at or before it and the next sample, linearly, and holds at the last sample after it. There is no extrapolation.

Positions are the quantized positions times the frame precision, in f64, as the clients compute them.

Structs§

Sent
One entity in a frame sent to the subscriber.
ViewHistory
The entities sent to one subscriber over the last ticks, as its interpolator holds them. See the module docs.