Vixen
02b45cc4
csharp
public readonly record struct TickRate

How often the simulation ticks, and therefore what one Tick is worth.

No guide page documents this yet — the page shows what the code says about itself.

Remarks

The network tick is a divisor of the engine's fixed step rather than a clock of its own — networking does not get its own loop. Thirty a second is the default, against the engine's sixty: a snapshot every other simulation step is the usual shape, and doubling the send rate for no gameplay reason is the most common way to double a bandwidth bill.

The duration is computed in TimeSpan ticks rather than from seconds, for the reason the engine's accumulator gives: TimeSpan.FromSeconds(1d / 30d) rounds to the nearest millisecond and hands back 33 ms, which is a 1 % error that shows up as a missing tick in every frame whose length is a whole number of milliseconds.

Fields and properties (4)

  • public static TickRate Default

    Thirty a second — one tick per two engine steps at the default fixed step.

  • public int TicksPerSecond

    How many ticks a second. Between 1 and 1000.

  • public TimeSpan Duration

    How long one tick lasts.

  • public bool IsValid

    Whether this rate was constructed rather than defaulted.

Methods (4)

  • public TickRate(int TicksPerSecond)

    How often the simulation ticks, and therefore what one Tick is worth.

  • public int ToTicks(TimeSpan time)

    How many whole ticks fit in a span of time.

  • public TimeSpan ToTime(int ticks)

    How long a number of ticks lasts.

  • public override string ToString()

Used by (13)

  • ArenaMultiplayer
  • GameClientMultiplayer
  • GameServerMultiplayer
  • LocalMatchMultiplayer
  • SoakNetworkSoak
  • LagCompensationTestsVixen.Net.Physics.Tests
  • LagCompensatorVixen.Net.Physics
  • PredictionWiringTestsVixen.Net.Tests
  • SessionOptionsVixen.Net
  • TickManagerVixen.Net
  • TickManagerTestsVixen.Net.Tests
  • TickTestsVixen.Net.Tests
  • RealmVixen.Live.Realm