Struct ClientTickRate
Create a ClientTickRate singleton in the client world (either at runtime or by loading it from sub-scene) to configure all the network time synchronization, interpolation delay, prediction batching and other setting for the client. See the individual fields for more information about the individual properties.
Inherited Members
Namespace: Unity.NetCode
Assembly: solution.dll
Syntax
[Serializable]
public struct ClientTickRate : IComponentData, IQueryTypeParameter
Fields
Name | Description |
---|---|
Command |
The percentage of the error in the predicted server tick that can be corrected each frame. Used to control the client deltaTime scaling, used to slow-down/speed-up the server tick estimate. Must be in (0, 1) range.
DefaultValue: 10% of the error. The two major causes affecting the command age are:
Small time scale values allow for smooth adjustments of the prediction tick but slower reaction to changes in both network and server frame rate. By using larger values, is faster to recovery to desync situation (caused by bad network and condition or/and slow server performance) but the predicted ticks delta are larger. Good ranges: [0.075 - 0.2] |
Interpolation |
The percentage of the error in the interpolation delay that can be corrected in one frame. Used to control InterpolationTickTimeScale. Must be in range (0, 1).
DefaultValue: 10% of the delta in between the current and next desired interpolation tick. Good ranges: [0.075 - 0.2] |
Interpolation |
Multiplier used to compensate received snapshot rate jitter when calculating the Interpolation Delay. Default Value: 1.25. |
Interpolation |
Used to limit the maximum InterpolationDelay changes in one frame, as percentage of the frame deltaTicks. Default value: 10% of the frame delta ticks. Smaller values will result in slow adaptation to the network state (loss and jitter) but would result in smooth delay changes. Larger values would make the InterpolationDelay change quickly adapt but may cause sudden jump in the interpolated values. Good ranges: [0.10 - 0.3] |
Interpolation |
The time in ms to use as an interpolation buffer for interpolated ghosts, this will take precedence and override the interpolation time in ticks if specified. |
Interpolation |
The number of network ticks to use as an interpolation buffer for interpolated ghosts. |
Interpolation |
The maximum value for the InterpolateTimeScale. Must be greater that 1.0. Default: 1.1. |
Interpolation |
The minimum value for the InterpolateTimeScale. Must be in range (0, 1) Default: 0.85. |
Max |
The maximum time in simulation ticks which the client can extrapolate ahead when data is missing. |
Max |
This is the maximum accepted ping, rtt will be clamped to this value when calculating server tick on the client, which means if ping is higher than this the server will get old commands. Increasing this makes the client able to deal with higher ping, but the client needs to run more prediction steps which takes more CPU time |
Max |
The client can batch simulation steps in the prediction loop. This setting controls how many simulation steps the simulation can batch for ticks which are being predicted for the first time. Setting this to a value larger than 1 will save performance, but the gameplay systems needs to be adapted. |
Max |
The client can batch simulation steps in the prediction loop. This setting controls how many simulation steps the simulation can batch for ticks which have previously been predicted. Setting this to a value larger than 1 will save performance, but the gameplay systems needs to be adapted. |
Prediction |
PredictionTick time scale max value, max be greater then 1.0f. Default: 1.1f Note: it is not mandatory to have the min-max symmetric. Good Range: (1.05 - 1.2) |
Prediction |
PredictionTick time scale min value, max be less then 1.0f. Default: 0.9f. Note: it is not mandatory to have the min-max symmetric. Good Range: (0.8 - 0.95) |
Target |
Specifies the number of simulation ticks the client tries to make sure the commands are received by the server before they are used on the server. |