Photon Fusion 2.1.1

TimeSyncConfiguration Class Reference

Public Types

enum  Selection
 The settings to use. More...
enum  Unit
 The base quantity of a setting. More...

Public Member Functions

void SanityCheck ()

Public Attributes

int ClientMaxResimsPerFrame = DEFAULT_MAX_RESIMS_PER_FRAME
bool ClientsCanAddInputDelayToLimitResims = false
Selection InputDelaySettings = Selection.Default
int InputReceiveBufferDelayAdded = DEFAULT_INPUT_BUFFER_DELAY_ADDED
Unit InputReceiveBufferDelayAddedUnit = DEFAULT_INPUT_BUFFER_DELAY_ADDED_UNIT
Selection InputReceiveBufferSettings = Selection.Default
float MaxLateInputs = DEFAULT_MAX_LATE_INPUTS_PERCENTILE
float MaxLateSnapshots = DEFAULT_MAX_LATE_SNAPSHOTS_PERCENTILE
int MinimumInputDelay = DEFAULT_MINIMUM_INPUT_DELAY
Unit MinimumInputDelayUnit = DEFAULT_MINIMUM_INPUT_DELAY_UNIT
float RedundantInputs = DEFAULT_REDUNDANT_INPUTS
float RedundantSnapshots = DEFAULT_REDUNDANT_SNAPSHOTS
int StateReceiveBufferDelayAdded = DEFAULT_STATE_BUFFER_DELAY_ADDED
Unit StateReceiveBufferDelayAddedUnit = DEFAULT_STATE_BUFFER_DELAY_ADDED_UNIT
Selection StateReceiveBufferSettings = Selection.Default

Detailed Description

A collection of settings that control input delay as well as how long inputs and snapshots are buffered to mitigate loss.

These settings influence how far ahead and behind the client's local and remote time frames are, respectively, relative to the latest snapshot.

Member Enumeration Documentation

◆ Selection

enum Selection

The settings to use.

Enumerator
Default 

Use the default settings.

Custom 

Use non-default settings.

◆ Unit

enum Unit

The base quantity of a setting.

Enumerator
Milliseconds 

Milliseconds.

Ticks 

Ticks.

Member Data Documentation

◆ ClientMaxResimsPerFrame

int ClientMaxResimsPerFrame = DEFAULT_MAX_RESIMS_PER_FRAME

The (soft) limit on the number of resimulations per frame.

The default value is -1, which means "no limit".

◆ ClientsCanAddInputDelayToLimitResims

bool ClientsCanAddInputDelayToLimitResims = false

If enabled, clients will dynamically adjust their input delay to (soft) limit the number of resimulations per frame.

◆ InputDelaySettings

Selection InputDelaySettings = Selection.Default

In client-server mode, clients can use input delay to reduce the number of resimulations per frame.

We recommend leaving the default values unchanged unless you fully understand their impact on client behavior.

◆ InputReceiveBufferDelayAdded

int InputReceiveBufferDelayAdded = DEFAULT_INPUT_BUFFER_DELAY_ADDED

This parameter sets the added amount.

Its default value is 0. Increasing this increases the client's simulation time offset.

◆ InputReceiveBufferDelayAddedUnit

Unit InputReceiveBufferDelayAddedUnit = DEFAULT_INPUT_BUFFER_DELAY_ADDED_UNIT

This parameter sets the unit for the added amount.

◆ InputReceiveBufferSettings

Selection InputReceiveBufferSettings = Selection.Default

Clients want to send inputs early enough so that "most" of them are received before they are needed. Fusion clients do this by figuring out how late "most" input packets could arrive and then moving time into the future to compensate (forming a buffer on the server).

Clients calculate the time offset as:

target = ((offset for MaxLateInputs percentile) * redundantInputs) + added

We recommend leaving the default values unchanged unless you fully understand their impact on client behavior.

◆ MaxLateInputs

float MaxLateInputs = DEFAULT_MAX_LATE_INPUTS_PERCENTILE

The maximum percentage of inputs that should ever arrive late because of jitter.

Decreasing this increases the client's simulation time offset.

◆ MaxLateSnapshots

float MaxLateSnapshots = DEFAULT_MAX_LATE_SNAPSHOTS_PERCENTILE

The maximum percentage of snapshots that should ever arrive late because of jitter.

Decreasing this increases the client's interpolation delay.

◆ MinimumInputDelay

int MinimumInputDelay = DEFAULT_MINIMUM_INPUT_DELAY

This parameter sets a minimum input delay for all players.

Its default value is 0.

◆ MinimumInputDelayUnit

Unit MinimumInputDelayUnit = DEFAULT_MINIMUM_INPUT_DELAY_UNIT

This parameter sets the unit for the minimum amount.

◆ RedundantInputs

float RedundantInputs = DEFAULT_REDUNDANT_INPUTS

The number of consecutive, additional, chances each input should have to reach the server before it's needed. E.g. when this is 1 each input has two chances to reach the server on time.

Increasing this increases the client's simulation time offset.

◆ RedundantSnapshots

float RedundantSnapshots = DEFAULT_REDUNDANT_SNAPSHOTS

The number of consecutive snapshots a client should be able to miss without disrupting their interpolation.

Increasing this increases the client's interpolation delay.

◆ StateReceiveBufferDelayAdded

int StateReceiveBufferDelayAdded = DEFAULT_STATE_BUFFER_DELAY_ADDED

This parameter sets the added amount.

Its default value is 0.

◆ StateReceiveBufferDelayAddedUnit

Unit StateReceiveBufferDelayAddedUnit = DEFAULT_STATE_BUFFER_DELAY_ADDED_UNIT

This parameter sets the unit for the added amount.

◆ StateReceiveBufferSettings

Selection StateReceiveBufferSettings = Selection.Default

Clients want to delay rendering remote objects enough so that "most" of their state updates are received before they are needed. Fusion clients do this by figuring out how late "most" snapshot packets could arrive and then moving remote time into the past to compensate (forming a buffer on the client).

Clients calculate the target buffer delay as:

target = ((offset for the MaxLateSnapshots percentile) * (redundantSnapshots + 1)) + added

Note: the '+1' in the calculation above is due to needing a pair of snapshops to interpolated between before we have any redundancy. In contrast only a single input is required.

We recommend leaving the default values unchanged unless you fully understand their impact on client behavior.