Nebula
Core

NetworkTime

Tick model.

generated from the sources
Static class in namespace Nebula · Packages/com.1by3.nebula/Runtime/Core/NetworkTime.cs
public static class NetworkTime

Tick model. Every worker derives the tick it should be simulating from the wall clock and a fixed origin, so workers agree on tick numbers without a tick master (a restarted worker knows the correct tick immediately, and the control plane is never on the hot path). Gameplay code should only ever see tick numbers, never wall-clock time.

Fields

TickRate

public const int TickRate = 60;

TickInterval

public const float TickInterval = 1f / TickRate;

Properties

DerivedTick

public static uint DerivedTick { get; }

The tick the wall clock says it is right now.

DerivedTickExact

public static double DerivedTickExact { get; }

Tick

public static uint Tick { get; }

The tick currently being simulated. On a worker this is the authoritative simulation tick. On a client it is the tick the local player is predicting (ahead of the server by the input lead).

LatestServerTick

public static uint LatestServerTick { get; }

Latest server tick the client has heard about (client only).

RenderTick

public static double RenderTick { get; }

The (fractional) tick non-authoritative copies are presenting right now: on a client a few ticks behind the newest snapshot (InterpolationDelayTicks), on a worker one tick behind the simulation tick for ghosts. Buffered interpolators sample at this tick.

Methods

TicksToSeconds

public static float TicksToSeconds(uint ticks);

On this page