Photon Quantum 3.0.0

Classes | Public Member Functions | Public Attributes | Properties | Events | List of all members
Quantum.QuantumGame Class Reference

QuantumGame acts as an interface to the simulation from the client code's perspective. More...

Inheritance diagram for Quantum.QuantumGame:
Photon.Deterministic.IDeterministicGame

Classes

class  CallbackBase
 The base class of Quantum callbacks. More...
 
class  ConfigurationsContainer
 Stores runtime config and simulation config for this session. More...
 
class  FramesContainer
 Stores the different frames the simulation uses during one tick. More...
 

Public Member Functions

 QuantumGame (in QuantumGameStartParameters startParams)
 Create a Quantum game instance. More...
 
void AddPlayer (Int32 playerSlot, RuntimePlayer data)
 Send data for one local player to join the online match. More...
 
void AddPlayer (RuntimePlayer data)
 Send data for the local player to join the online match. If the client has multiple local players, the data will be sent for the first player set. More...
 
void AssignSession (DeterministicSession session)
 The DeterministicSession creates this reference during its initialization. More...
 
void CheckTrackedHeapAllocations ()
 Trigger the heap allocation tracker during OnDestroy. More...
 
Frame CreateFrame ()
 Create a new frame object using the internal frame context. More...
 
IDisposable CreateFrameContext ()
 Create the frame context. More...
 
QuantumReplayFile CreateSavegame (bool includeDb=false)
 Create a QuantumReplayFile file that represents a save game. More...
 
void DeserializeInputInto (int player, byte[] data, byte *buffer, bool verified)
 Asks the game to de-serialize input into the buffers, because it's game specific it cannot be done from here. More...
 
byte[] GetExtraErrorFrameDumpData (DeterministicFrame frame)
 Creates information send to the server when detecting a checksum error. More...
 
int GetInputInMemorySize ()
 Return the in memory input size. More...
 
Int32 GetInputSerializedFixedSize ()
 Returns the serialized input size. More...
 
Frame GetInstantReplaySnapshot (int frame)
 Get a recorded frame for a given frame number from the checksum or instant replay snapshot buffers. More...
 
void GetInstantReplaySnapshots (int startFrame, int endFrame, List< Frame > frames)
 Get recorded frames for a given frame number window from the checksum or instant replay snapshot buffers. More...
 
List< PlayerRefGetLocalPlayers ()
 Returns an array that is unique on every client and represents the global player indices that the local client controls in the Quantum simulation. More...
 
List< Int32 > GetLocalPlayerSlots ()
 Returns an array that is unique on every client and represents the player slots that the local client controls in the Quantum simulation. More...
 
QuantumReplayFile GetRecordedReplay (bool includeChecksums=false, bool includeDb=false, QuantumJsonFriendlyDataBlob.Encoder customAssetDbSerializer=null, QuantumJsonFriendlyDataBlob.Encoder customRuntimeConfigSerializer=null, QuantumJsonFriendlyDataBlob.Encoder customInputSerializer=null)
 Creates a replay file that represents a recorded replay of the complete simulation. Requires the RecordingFlags to be set accordingly. More...
 
DeterministicFrame GetVerifiedFrame (int tick)
 Tries to get the verified frame for a given tick from the snapshot buffer. More...
 
void InitCallbacks ()
 Initializes all callbacks. More...
 
void OnChecksumComputed (Int32 frame, ulong checksum)
 The callback is called when the local checksum was computed. More...
 
void OnChecksumError (DeterministicTickChecksumError error, DeterministicFrame[] frames)
 The callback is called when a checksum error was detected. More...
 
void OnChecksumErrorFrameDump (int actorId, int frameNumber, DeterministicSessionConfig sessionConfig, byte[] runtimeConfig, byte[] frameData, byte[] extraData)
 The callback is called when the clients receives a frame dump of another client from the server. More...
 
void OnDestroy ()
 The game is destroyed. This is called from inside the DeterministicSession. More...
 
void OnGameEnded ()
 Not implemented. More...
 
void OnGameResync ()
 The callback is called when the game is starting from a snapshot after the snapshot has been received. More...
 
void OnGameStart (DeterministicFrame f)
 The callback is called when the actual simulation starts after the online protocol start sequence was successful. More...
 
void OnInputConfirmed (DeterministicFrameInputTemp input)
 The callback is called when an input object was confirmed by the server. More...
 
void OnInputSetConfirmed (int tick, int length, byte[] data)
 The callback is called when an input set (all clients) was confirmed by the server. More...
 
DeterministicFrameInputTemp OnLocalInput (Int32 frame, Int32 playerSlot)
 The callback is called to poll local input. More...
 
void OnLocalPlayerAddConfirmed (DeterministicFrame frame, int playerSlot, PlayerRef player)
 The callback is called when the server confirmed the addition of a (local) player. More...
 
void OnLocalPlayerAddFailed (int playerSlot, string message)
 The callback is called when the server failed to process the add player request. More...
 
void OnLocalPlayerRemoveConfirmed (DeterministicFrame frame, int playerSlot, PlayerRef player)
 The callback is called when the server confirmed the removal of a (local) player. More...
 
void OnLocalPlayerRemoveFailed (int playerSlot, string message)
 The callback is called when the server failed to process the remove player request. More...
 
void OnPluginDisconnect (string reason)
 The callback is called when the server plugin disconnected the client. More...
 
void OnSerializedInput (byte *encoded, Array result)
 The callback is called to serialize the game-specific input. More...
 
void OnSimulate (DeterministicFrame state)
 The callback is called when any simulation step was executed. More...
 
void OnSimulateFinished (DeterministicFrame state)
 The callback is called after any simulation step was executed and after the OnSimulate(DeterministicFrame) callback. More...
 
void OnSimulationBegin ()
 The callback is called before the session computes multiple simulation steps (frames). More...
 
void OnSimulationEnd ()
 The callback is called when multiple simulation steps (frames) were executed. More...
 
void OnUpdateDone ()
 The callback is called when when the session completed its DeterministicSession.Update loop. More...
 
Boolean PlayerIsLocal (PlayerRef playerRef)
 Helps to decide if a PlayerRef is associated with the local player. More...
 
void RemoveAllPlayers ()
 Removes all players from the game and acts as a spectator. More...
 
void RemovePlayer ()
 Remove the player. Assuming there is only one local player that this client controls. More...
 
void RemovePlayer (Int32 playerSlot)
 Remove a player slot from the game. More...
 
DeterministicCommandSendResult SendCommand (DeterministicCommand command)
 Sends a command to the server. More...
 
DeterministicCommandSendResult SendCommand (Int32 playerSlot, DeterministicCommand command)
 Sends a command to the server. More...
 
void SetPredictionArea (FPVector2 position, FP radius)
 See SetPredictionArea(FPVector3, FP). More...
 
void SetPredictionArea (FPVector3 position, FP radius)
 Set the prediction area. More...
 
void StartRecordingChecksums ()
 Manually start the recording of checksums. More...
 
void StartRecordingInput (Int32? startFrame=null)
 Manually start the input recording. Either accessible by RecordedInputs (if DeterministicSessionConfig.InputDeltaCompression is disabled) or RecordInputStream (if DeterministicSessionConfig.InputDeltaCompression is enabled). More...
 
void StartRecordingInstantReplaySnapshots ()
 Manually start recording instant replay snapshots. Requires InstantReplayConfig to be set accordingly. More...
 
void StartVerifyingChecksums (ChecksumFile checksums)
 Start verifying new checksums against a recorded checksum file. More...
 
- Public Member Functions inherited from Photon.Deterministic.IDeterministicGame
void OnChecksumErrorFrameDump (Int32 actorId, Int32 frameNumber, DeterministicSessionConfig sessionConfig, byte[] runtimeConfig, byte[] frameData, byte[] extraData)
 The callback is called when the clients receives a frame dump of another client from the server. More...
 
void OnInputSetConfirmed (Int32 tick, Int32 length, byte[] data)
 The callback is called when an input set (all clients) was confirmed by the server. More...
 

Public Attributes

int EventWaitingForConfirmationCount => _eventsConfirmationQueue.Count
 The number of events in the queue waiting for confirmation. More...
 
int GameFlags => _flags
 Game flags passer by QuantumGameStartParameters.GameFlags. See QuantumGameFlags. More...
 

Properties

IAssetSerializer AssetSerializer [get]
 Asset serializer passed by QuantumGameStartParameters.AssetSerializer. More...
 
ConfigurationsContainer Configurations [get]
 Access the configurations that the simulation is running with. Only set after the first CreateFrame() call. More...
 
FramesContainer Frames [get]
 Access the frames of various times available during one tick. More...
 
int HeapExtraCount [get]
 Extra heaps to allocate for a session in case you need to create 'auxiliary' frames than actually required for the simulation itself. More...
 
InstantReplaySettings InstantReplayConfig [get]
 Instant replay configuration, initialized by QuantumGameStartParameters.InstantReplaySettings." More...
 
Single InterpolationFactor [get]
 Used for position interpolation on the client for smoother interpolation results. More...
 
ChecksumFile RecordedChecksums [get]
 The recorded checksums. The checksum recording automatically start when SessionRunner.Arguments.RecordingFlags contains RecordingFlags.Checksums and DeterministicSessionConfig.ChecksumInterval > 0. The recording can also be started by calling StartRecordingChecksums manually. More...
 
InputProvider RecordedInputs [get]
 The recorded raw inputs. The raw input recording automatically start when SessionRunner.Arguments.RecordingFlags contains RecordingFlags.Input and DeterministicSessionConfig.InputDeltaCompression is disabled. The recording can also be started by calling StartRecordingInput manually. More...
 
Stream RecordInputStream [get, set]
 The recorded delta compressed input stream. The raw input recording automatically start when SessionRunner.Arguments.RecordingFlags contains RecordingFlags.Input and DeterministicSessionConfig.InputDeltaCompression is enabled. The recording can also be started by calling StartRecordingInput manually. /// More...
 
IResourceManager ResourceManager [get]
 Resource manager passed by QuantumGameStartParameters.ResourceManager. More...
 
DeterministicSession Session [get]
 Access the Deterministic session object to query more internals. More...
 
- Properties inherited from Photon.Deterministic.IDeterministicGame
DeterministicSession Session [get]
 Get the deterministic session. More...
 

Events

Action< ProfilerContextDataProfilerSampleGenerated
 A callback that is invoked after the IDeterministicGame.OnSimulate callback. It uses the FrameContext.ProfilerContext to create a report. More...
 

Detailed Description

QuantumGame acts as an interface to the simulation from the client code's perspective.

Access and method to this class is always safe from the clients point of view.

Constructor & Destructor Documentation

◆ QuantumGame()

Quantum.QuantumGame.QuantumGame ( in QuantumGameStartParameters  startParams)
inline

Create a Quantum game instance.

Parameters
startParamsStart parameters.

Member Function Documentation

◆ GetLocalPlayers()

List<PlayerRef> Quantum.QuantumGame.GetLocalPlayers ( )
inline

Returns an array that is unique on every client and represents the global player indices that the local client controls in the Quantum simulation.

Returns
Array of global players this client controls.

◆ GetLocalPlayerSlots()

List<Int32> Quantum.QuantumGame.GetLocalPlayerSlots ( )
inline

Returns an array that is unique on every client and represents the player slots that the local client controls in the Quantum simulation.

Returns
Array of local player slots this client controls.

◆ PlayerIsLocal()

Boolean Quantum.QuantumGame.PlayerIsLocal ( PlayerRef  playerRef)
inline

Helps to decide if a PlayerRef is associated with the local player.

Parameters
playerRefPlayer reference
Returns
True if the player is the local player

◆ SendCommand() [1/2]

DeterministicCommandSendResult Quantum.QuantumGame.SendCommand ( DeterministicCommand  command)
inline

Sends a command to the server.

Parameters
commandCommand to send

Commands are similar to input, they drive the simulation, but do not have to be sent regularly.

RemoveUnitCommand command = new RemoveUnitCommand();
command.CellIndex = 42;
QuantumRunner.Default.Game.SendCommand(command);

◆ SendCommand() [2/2]

DeterministicCommandSendResult Quantum.QuantumGame.SendCommand ( Int32  playerSlot,
DeterministicCommand  command 
)
inline

Sends a command to the server.

Parameters
playerSlotSpecify the local player index when you have multiple players controlled from the same machine.
commandCommand to send

See SendCommand(DeterministicCommand)

Games that only have one local player can ignore the player index field.

◆ AddPlayer() [1/2]

void Quantum.QuantumGame.AddPlayer ( RuntimePlayer  data)
inline

Send data for the local player to join the online match. If the client has multiple local players, the data will be sent for the first player set.

Parameters
dataPlayer data

After starting, joining the Quantum Game and after the OnGameStart signal has been fired each player needs to call the AddPlayer method to be added as a player in every ones simulation.
The reason this needs to be called explicitly is that it greatly simplifies late-joining players.

◆ AddPlayer() [2/2]

void Quantum.QuantumGame.AddPlayer ( Int32  playerSlot,
RuntimePlayer  data 
)
inline

Send data for one local player to join the online match.

Parameters
playerSlotLocal player index
dataPlayer data

After starting, joining the Quantum Game and after the OnGameStart signal has been fired each player needs to call the AddPlayer method to be added as a player in every ones simulation.
The reason this needs to be called explicitly is that it greatly simplifies late-joining players.

◆ RemovePlayer() [1/2]

void Quantum.QuantumGame.RemovePlayer ( )
inline

Remove the player. Assuming there is only one local player that this client controls.

◆ RemovePlayer() [2/2]

void Quantum.QuantumGame.RemovePlayer ( Int32  playerSlot)
inline

Remove a player slot from the game.

Parameters
playerSlotLocal player

◆ RemoveAllPlayers()

void Quantum.QuantumGame.RemoveAllPlayers ( )
inline

Removes all players from the game and acts as a spectator.

◆ OnDestroy()

void Quantum.QuantumGame.OnDestroy ( )
inline

The game is destroyed. This is called from inside the DeterministicSession.

Implements Photon.Deterministic.IDeterministicGame.

◆ CreateFrame()

Frame Quantum.QuantumGame.CreateFrame ( )
inline

Create a new frame object using the internal frame context.

Returns
Frame

◆ GetVerifiedFrame()

DeterministicFrame Quantum.QuantumGame.GetVerifiedFrame ( int  tick)
inline

Tries to get the verified frame for a given tick from the snapshot buffer.

Parameters
tickTick
Returns
Verified frame based on the requested tick or null.

Implements Photon.Deterministic.IDeterministicGame.

◆ CreateFrameContext()

IDisposable Quantum.QuantumGame.CreateFrameContext ( )
inline

Create the frame context.

Returns
Frame context
Exceptions
ArgumentExceptionIs raised when no SimulationConfig is set inside the RuntimeConfig.

Implements Photon.Deterministic.IDeterministicGame.

◆ SetPredictionArea() [1/2]

void Quantum.QuantumGame.SetPredictionArea ( FPVector3  position,
FP  radius 
)
inline

Set the prediction area.

Parameters
positionCenter of the prediction area
radiusRadius of the prediction area

This can be safely called from the main-thread.

Prediction Culling allows developers to save CPU time in games where the player has only a partial view of the game scene. Quantum prediction and rollbacks, which are time consuming, will only run for important entities that are visible to the local player(s). Leaving anything outside that area to be simulated only once per tick with no rollbacks as soon as the inputs are confirmed from server. It is safe and simple to activate and, depending on the game, the performance difference can be quite large.Imagine a 30Hz game to constantly rollback ten ticks for every confirmed input (with more players, the predictor eventually misses at least for one of them). This requires the game simulation to be lightweight to be able to run at almost 300Hz(because of the rollbacks). With Prediction Culling enabled the full frames will be simulated at the expected 30Hz all the time while the much smaller prediction area is the only one running within the prediction buffer.

◆ SetPredictionArea() [2/2]

void Quantum.QuantumGame.SetPredictionArea ( FPVector2  position,
FP  radius 
)
inline

See SetPredictionArea(FPVector3, FP).

Parameters
position
radius

◆ OnGameEnded()

void Quantum.QuantumGame.OnGameEnded ( )
inline

Not implemented.

Implements Photon.Deterministic.IDeterministicGame.

◆ OnGameStart()

void Quantum.QuantumGame.OnGameStart ( DeterministicFrame  f)
inline

The callback is called when the actual simulation starts after the online protocol start sequence was successful.

Parameters
fFirst frame

Implements Photon.Deterministic.IDeterministicGame.

◆ OnGameResync()

void Quantum.QuantumGame.OnGameResync ( )
inline

The callback is called when the game is starting from a snapshot after the snapshot has been received.

Implements Photon.Deterministic.IDeterministicGame.

◆ OnLocalInput()

DeterministicFrameInputTemp Quantum.QuantumGame.OnLocalInput ( Int32  frame,
Int32  playerSlot 
)
inline

The callback is called to poll local input.

Parameters
frameFrame
playerSlotPlayer slot
Returns
Polled input for this frame

Implements Photon.Deterministic.IDeterministicGame.

◆ OnSerializedInput()

void Quantum.QuantumGame.OnSerializedInput ( byte *  encoded,
Array  result 
)
inline

The callback is called to serialize the game-specific input.

Parameters
encodedThe source input
resultThe destination input

Implements Photon.Deterministic.IDeterministicGame.

◆ OnSimulate()

void Quantum.QuantumGame.OnSimulate ( DeterministicFrame  state)
inline

The callback is called when any simulation step was executed.

Parameters
stateFrame that was simulated

Implements Photon.Deterministic.IDeterministicGame.

◆ OnSimulateFinished()

void Quantum.QuantumGame.OnSimulateFinished ( DeterministicFrame  state)
inline

The callback is called after any simulation step was executed and after the OnSimulate(DeterministicFrame) callback.

Parameters
stateFrame that was simulated

Implements Photon.Deterministic.IDeterministicGame.

◆ OnUpdateDone()

void Quantum.QuantumGame.OnUpdateDone ( )
inline

The callback is called when when the session completed its DeterministicSession.Update loop.

Implements Photon.Deterministic.IDeterministicGame.

◆ AssignSession()

void Quantum.QuantumGame.AssignSession ( DeterministicSession  session)
inline

The DeterministicSession creates this reference during its initialization.

Parameters
sessionDeterministic session that this game uses

Implements Photon.Deterministic.IDeterministicGame.

◆ OnChecksumError()

void Quantum.QuantumGame.OnChecksumError ( DeterministicTickChecksumError  error,
DeterministicFrame[]  frames 
)
inline

The callback is called when a checksum error was detected.

Parameters
errorChecksum error information
framesContains the verified frame that was failed to validate

Implements Photon.Deterministic.IDeterministicGame.

◆ OnChecksumComputed()

void Quantum.QuantumGame.OnChecksumComputed ( Int32  frame,
ulong  checksum 
)
inline

The callback is called when the local checksum was computed.

Parameters
frameThe frame the checksum belongs to
checksumThe checksum that will be send to the server

Implements Photon.Deterministic.IDeterministicGame.

◆ OnSimulationBegin()

void Quantum.QuantumGame.OnSimulationBegin ( )
inline

The callback is called before the session computes multiple simulation steps (frames).

Implements Photon.Deterministic.IDeterministicGame.

◆ OnSimulationEnd()

void Quantum.QuantumGame.OnSimulationEnd ( )
inline

The callback is called when multiple simulation steps (frames) were executed.

Implements Photon.Deterministic.IDeterministicGame.

◆ OnInputConfirmed()

void Quantum.QuantumGame.OnInputConfirmed ( DeterministicFrameInputTemp  input)
inline

The callback is called when an input object was confirmed by the server.

Parameters
inputInput object

Implements Photon.Deterministic.IDeterministicGame.

◆ OnInputSetConfirmed()

void Quantum.QuantumGame.OnInputSetConfirmed ( int  tick,
int  length,
byte[]  data 
)
inline

The callback is called when an input set (all clients) was confirmed by the server.

Parameters
tickTick
lengthLength of input object array
dataInput objects

◆ OnChecksumErrorFrameDump()

void Quantum.QuantumGame.OnChecksumErrorFrameDump ( int  actorId,
int  frameNumber,
DeterministicSessionConfig  sessionConfig,
byte[]  runtimeConfig,
byte[]  frameData,
byte[]  extraData 
)
inline

The callback is called when the clients receives a frame dump of another client from the server.

Parameters
actorIdThe Photon actor id that the dump belongs to
frameNumberThe frame number of the dump
sessionConfigThe session config
runtimeConfigThe runtime config
frameDataThe frame data
extraDataExtra dump meta information

◆ OnPluginDisconnect()

void Quantum.QuantumGame.OnPluginDisconnect ( string  reason)
inline

The callback is called when the server plugin disconnected the client.

Parameters
reasonDebug string

Implements Photon.Deterministic.IDeterministicGame.

◆ OnLocalPlayerAddConfirmed()

void Quantum.QuantumGame.OnLocalPlayerAddConfirmed ( DeterministicFrame  frame,
int  playerSlot,
PlayerRef  player 
)
inline

The callback is called when the server confirmed the addition of a (local) player.

Parameters
frameThe frame the player has been added
playerSlotThe player slot that was used to assign the player
playerThe player

Implements Photon.Deterministic.IDeterministicGame.

◆ OnLocalPlayerRemoveConfirmed()

void Quantum.QuantumGame.OnLocalPlayerRemoveConfirmed ( DeterministicFrame  frame,
int  playerSlot,
PlayerRef  player 
)
inline

The callback is called when the server confirmed the removal of a (local) player.

Parameters
frameThe frame when the request was confirmed
playerSlotThe player slot of the removed player
playerThe player that was removed

Implements Photon.Deterministic.IDeterministicGame.

◆ OnLocalPlayerAddFailed()

void Quantum.QuantumGame.OnLocalPlayerAddFailed ( int  playerSlot,
string  message 
)
inline

The callback is called when the server failed to process the add player request.

Parameters
playerSlotThe player slot that was requested
messageDebug message

Implements Photon.Deterministic.IDeterministicGame.

◆ OnLocalPlayerRemoveFailed()

void Quantum.QuantumGame.OnLocalPlayerRemoveFailed ( int  playerSlot,
string  message 
)
inline

The callback is called when the server failed to process the remove player request.

Parameters
playerSlotThe player slot that was tried to remove
messageDebug message

Implements Photon.Deterministic.IDeterministicGame.

◆ GetInputInMemorySize()

int Quantum.QuantumGame.GetInputInMemorySize ( )
inline

Return the in memory input size.

Returns
Input object size

Implements Photon.Deterministic.IDeterministicGame.

◆ GetInputSerializedFixedSize()

Int32 Quantum.QuantumGame.GetInputSerializedFixedSize ( )
inline

Returns the serialized input size.

Returns
Serialized input size

Implements Photon.Deterministic.IDeterministicGame.

◆ DeserializeInputInto()

void Quantum.QuantumGame.DeserializeInputInto ( int  player,
byte[]  data,
byte *  buffer,
bool  verified 
)
inline

Asks the game to de-serialize input into the buffers, because it's game specific it cannot be done from here.

Parameters
playerThe player the input is for
dataThe input data
bufferThe destination buffer
verifiedIs the input verified

Implements Photon.Deterministic.IDeterministicGame.

◆ GetExtraErrorFrameDumpData()

byte [] Quantum.QuantumGame.GetExtraErrorFrameDumpData ( DeterministicFrame  frame)
inline

Creates information send to the server when detecting a checksum error.

Parameters
frameFrame
Returns
Serialized frame dump context

Implements Photon.Deterministic.IDeterministicGame.

◆ CheckTrackedHeapAllocations()

void Quantum.QuantumGame.CheckTrackedHeapAllocations ( )
inline

Trigger the heap allocation tracker during OnDestroy.

Exceptions
ArgumentOutOfRangeExceptionIs raised when HeapTrackingMode is unknown

◆ GetInstantReplaySnapshot()

Frame Quantum.QuantumGame.GetInstantReplaySnapshot ( int  frame)
inline

Get a recorded frame for a given frame number from the checksum or instant replay snapshot buffers.

Parameters
frameFrame number
Returns
Frame

◆ GetInstantReplaySnapshots()

void Quantum.QuantumGame.GetInstantReplaySnapshots ( int  startFrame,
int  endFrame,
List< Frame frames 
)
inline

Get recorded frames for a given frame number window from the checksum or instant replay snapshot buffers.

Parameters
startFrameStart frame
endFrameEnd frame
framesResulting frames

◆ CreateSavegame()

QuantumReplayFile Quantum.QuantumGame.CreateSavegame ( bool  includeDb = false)
inline

Create a QuantumReplayFile file that represents a save game.

Parameters
includeDbInclude the AssetDb
Returns
Replay file to be stored

◆ GetRecordedReplay()

QuantumReplayFile Quantum.QuantumGame.GetRecordedReplay ( bool  includeChecksums = false,
bool  includeDb = false,
QuantumJsonFriendlyDataBlob.Encoder  customAssetDbSerializer = null,
QuantumJsonFriendlyDataBlob.Encoder  customRuntimeConfigSerializer = null,
QuantumJsonFriendlyDataBlob.Encoder  customInputSerializer = null 
)
inline

Creates a replay file that represents a recorded replay of the complete simulation. Requires the RecordingFlags to be set accordingly.

Parameters
includeChecksumsInclude checksums
includeDbInclude the asset db
customAssetDbSerializerA custom asset serializer
customRuntimeConfigSerializerA custom runtime config serializer
customInputSerializerA custom input serialized
Returns
Replay file to store

◆ StartRecordingInput()

void Quantum.QuantumGame.StartRecordingInput ( Int32?  startFrame = null)
inline

Manually start the input recording. Either accessible by RecordedInputs (if DeterministicSessionConfig.InputDeltaCompression is disabled) or RecordInputStream (if DeterministicSessionConfig.InputDeltaCompression is enabled).

Parameters
startFrame

◆ StartRecordingChecksums()

void Quantum.QuantumGame.StartRecordingChecksums ( )
inline

Manually start the recording of checksums.

◆ StartVerifyingChecksums()

void Quantum.QuantumGame.StartVerifyingChecksums ( ChecksumFile  checksums)
inline

Start verifying new checksums against a recorded checksum file.

Parameters
checksumsRecorded checksum file

◆ StartRecordingInstantReplaySnapshots()

void Quantum.QuantumGame.StartRecordingInstantReplaySnapshots ( )
inline

Manually start recording instant replay snapshots. Requires InstantReplayConfig to be set accordingly.

◆ InitCallbacks()

void Quantum.QuantumGame.InitCallbacks ( )
inline

Initializes all callbacks.

Member Data Documentation

◆ GameFlags

int Quantum.QuantumGame.GameFlags => _flags

◆ EventWaitingForConfirmationCount

int Quantum.QuantumGame.EventWaitingForConfirmationCount => _eventsConfirmationQueue.Count

The number of events in the queue waiting for confirmation.

Property Documentation

◆ Frames

FramesContainer Quantum.QuantumGame.Frames
get

Access the frames of various times available during one tick.

◆ Configurations

ConfigurationsContainer Quantum.QuantumGame.Configurations
get

Access the configurations that the simulation is running with. Only set after the first CreateFrame() call.

◆ Session

DeterministicSession Quantum.QuantumGame.Session
get

Access the Deterministic session object to query more internals.

◆ InterpolationFactor

Single Quantum.QuantumGame.InterpolationFactor
get

Used for position interpolation on the client for smoother interpolation results.

◆ InstantReplayConfig

InstantReplaySettings Quantum.QuantumGame.InstantReplayConfig
get

Instant replay configuration, initialized by QuantumGameStartParameters.InstantReplaySettings."

◆ AssetSerializer

IAssetSerializer Quantum.QuantumGame.AssetSerializer
get

Asset serializer passed by QuantumGameStartParameters.AssetSerializer.

◆ ResourceManager

IResourceManager Quantum.QuantumGame.ResourceManager
get

Resource manager passed by QuantumGameStartParameters.ResourceManager.

◆ HeapExtraCount

int Quantum.QuantumGame.HeapExtraCount
get

Extra heaps to allocate for a session in case you need to create 'auxiliary' frames than actually required for the simulation itself.

◆ RecordedInputs

InputProvider Quantum.QuantumGame.RecordedInputs
get

The recorded raw inputs. The raw input recording automatically start when SessionRunner.Arguments.RecordingFlags contains RecordingFlags.Input and DeterministicSessionConfig.InputDeltaCompression is disabled. The recording can also be started by calling StartRecordingInput manually.

◆ RecordedChecksums

ChecksumFile Quantum.QuantumGame.RecordedChecksums
get

The recorded checksums. The checksum recording automatically start when SessionRunner.Arguments.RecordingFlags contains RecordingFlags.Checksums and DeterministicSessionConfig.ChecksumInterval > 0. The recording can also be started by calling StartRecordingChecksums manually.

◆ RecordInputStream

Stream Quantum.QuantumGame.RecordInputStream
getset

The recorded delta compressed input stream. The raw input recording automatically start when SessionRunner.Arguments.RecordingFlags contains RecordingFlags.Input and DeterministicSessionConfig.InputDeltaCompression is enabled. The recording can also be started by calling StartRecordingInput manually. ///

Event Documentation

◆ ProfilerSampleGenerated

Action<ProfilerContextData> Quantum.QuantumGame.ProfilerSampleGenerated

A callback that is invoked after the IDeterministicGame.OnSimulate callback. It uses the FrameContext.ProfilerContext to create a report.