Struct NetworkTime
Present on both client and server world, singleton component that contains all the timing characterist of the client/server simulation loop.
Inherited Members
Namespace: Unity.NetCode
Assembly: solution.dll
Syntax
public struct NetworkTime : IComponentData, IQueryTypeParameter
Fields
| Name | Description |
|---|---|
| InterpolationTick | The current interpolated tick (integral part). Always less then the ServerTick on the Client (and equals to ServerTick on the server). |
| InterpolationTickFraction | The fractional part of the tick (XXX.fraction). Always in between (0.0, 1.0] |
| ServerTick | The current simulated server tick the server will run this frame. Always start from 1. 0 is consider an invalid value. The ServerTick value behave differently on client and server. On the server:
|
| ServerTickFraction | Only meaningful on the client that run at variable step rate. On the server is always 1.0. Always in range is (0.0 and 1.0]. |
| SimulationStepBatchSize | The number of simulation steps this tick is scaled with. This is used to make one update which covers N ticks in order to reduce CPU cost. This is always 1 for partial ticks in the prediction loop, but can be more than 1 for partial ticks outside the prediction loop. |
Properties
| Name | Description |
|---|---|
| IsCatchUpTick | Only valid on server. True when the current simulated tick is running with a variabled delta time to recover from a previous long running frame. |
| IsFinalFullPredictionTick | Only valid inside the prediction loop. The current server tick which will be the last full tick we are predicting |
| IsFinalPredictionTick | Only valid inside the prediction loop. The current server tick which will be the last tick to predict |
| IsFirstPredictionTick | Only valid inside the prediction loop. The server tick the prediction is starting from. |
| IsFirstTimeFullyPredictingTick | Only valid inside the prediction loop. True when this |
| IsInPredictionLoop | Indicate that the current server tick is a predicted one and the simulation is running inside the prediction group. |
| IsPartialTick | True if the current tick is running with delta time that is a fraction of the ServerTickDeltaTime. Only true on the client when running at variable frame rate. |
| PredictedTickIndex | Counts the number of predicted ticks triggered on this frame (while inside the prediction loop). Thus, client only, and increments BEFORE the tick occurs (i.e. the first predicted tick will have a value of 1). Outside the prediction loop, records the current or last frames prediction tick count (until prediction restarts). |