Quantum 3
3.1.0
The deterministic game interface is the main hub that holds information about the simulation on the Quantum.Deterministic level. More...
Public Member Functions | |
| void | AssignSession (DeterministicSession session) |
| The DeterministicSession creates this reference during its initialization. More... | |
| DeterministicFrame | CreateFrame (IDisposable context, bool verified=false, bool enableHeapTrackerDuringInit=false) |
| Creates a new frame object using the context. More... | |
| DeterministicFrame | CreateFrame (IDisposable context, Byte[] data) |
| Creates a new frame object using the context and external frame data. More... | |
| IDisposable | CreateFrameContext () |
| Creates a frame context in the beginning of the simulation. 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... | |
| Int32 | GetInputInMemorySize () |
| Return the in memory input size. More... | |
| Int32 | GetInputSerializedFixedSize () |
| Returns the serialized input size. More... | |
| DeterministicFrame | GetVerifiedFrame (int tick) |
| Try to get the verified frame for a given tick from the snapshot buffer. More... | |
| void | OnBeforeSimulationStage (SimulatorContext context) |
| The callback is called once before the Verification and once before the Prediction stage of each session update. 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 (Int32 actorId, Int32 frameNumber, DeterministicSessionConfig sessionConfig, byte[] runtimeConfig, byte[] frameData, byte[] extraData) |
| The callback is called when the clients receive a frame dump of another client from the server. More... | |
| void | OnDestroy () |
| The callback is called when the simulation is destroyed. More... | |
| void | OnGameEnded () |
| Not implemented. More... | |
| void | OnGameResultResponse (bool success, GameResultResponseCode code) |
| Is invoked when the server received the game result. 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 state) |
| 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 (Int32 tick, Int32 length, byte[] data) |
| The callback is called when an input set (all clients) was confirmed by the server. The data array is a reused internal buffer that is only valid for the duration of the call and may be larger than length . Copy the first length bytes to retain them. More... | |
| DeterministicFrameInputTemp | OnLocalInput (Int32 frame, Int32 playerSlot) |
| Polls the game for 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 dst) |
| Asks the game to serialize the input, because it's game specific it cannot be done from here. More... | |
| void | OnSimulate (DeterministicFrame state) |
| The callback is called when any simulation step was executed. More... | |
| void | OnSimulateFinished (DeterministicFrame state, SimulatorContext context) |
| 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 | OnSimulationStageFinished (SimulatorContext context) |
| The callback is called once after the Verification and once after the Prediction stages of each session update. More... | |
| void | OnUpdateCopyPreviousPredicted (DeterministicFrame previousPredicted, SimulatorContext context) |
| The callback is called just before the tick the local input was polled up to is simulated, before input is applied to it. More... | |
| void | OnUpdateCopyPreviousUpdatePredicted (DeterministicFrame previousUpdatePredicted, SimulatorContext context) |
| The callback is called when the frame last predicted in the previous update is available in the current update. More... | |
| void | OnUpdateDone () |
| The callback is called when the session completed its DeterministicSession.Update loop. More... | |
| void | SendBufferedCommands () |
| Sends commands queued during the last frame to the server. More... | |
Properties | |
| DeterministicSession | Session [get] |
| Get the deterministic session. More... | |
The deterministic game interface is the main hub that holds information about the simulation on the Quantum.Deterministic level.
| void Photon.Deterministic.IDeterministicGame.SendBufferedCommands | ( | ) |
Sends commands queued during the last frame to the server.
Implemented in Quantum.QuantumGame.
| Int32 Photon.Deterministic.IDeterministicGame.GetInputSerializedFixedSize | ( | ) |
| Int32 Photon.Deterministic.IDeterministicGame.GetInputInMemorySize | ( | ) |
| void Photon.Deterministic.IDeterministicGame.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.
| player | The player the input is for |
| data | The input data |
| buffer | The destination buffer |
| verified | Is the input verified |
Implemented in Quantum.QuantumGame.
| DeterministicFrameInputTemp Photon.Deterministic.IDeterministicGame.OnLocalInput | ( | Int32 | frame, |
| Int32 | playerSlot | ||
| ) |
Polls the game for local input.
| frame | The frame that the input is for |
| playerSlot | The player slot that is polling |
Implemented in Quantum.QuantumGame.
| void Photon.Deterministic.IDeterministicGame.OnSerializedInput | ( | byte * | encoded, |
| Array | dst | ||
| ) |
Asks the game to serialize the input, because it's game specific it cannot be done from here.
| encoded | |
| dst |
Implemented in Quantum.QuantumGame.
| IDisposable Photon.Deterministic.IDeterministicGame.CreateFrameContext | ( | ) |
Creates a frame context in the beginning of the simulation.
Implemented in Quantum.QuantumGame.
| DeterministicFrame Photon.Deterministic.IDeterministicGame.CreateFrame | ( | IDisposable | context, |
| bool | verified = false, |
||
| bool | enableHeapTrackerDuringInit = false |
||
| ) |
Creates a new frame object using the context.
| context | The context the frame should be created under. |
| verified | Whether or not this is a verified frame. |
| enableHeapTrackerDuringInit | Enables frame heap tracking immediately. |
| DeterministicFrame Photon.Deterministic.IDeterministicGame.CreateFrame | ( | IDisposable | context, |
| Byte[] | data | ||
| ) |
Creates a new frame object using the context and external frame data.
| context | Frame context |
| data |
| DeterministicFrame Photon.Deterministic.IDeterministicGame.GetVerifiedFrame | ( | int | tick | ) |
Try to get the verified frame for a given tick from the snapshot buffer.
| tick | Requested tick |
nullImplemented in Quantum.QuantumGame.
| byte [] Photon.Deterministic.IDeterministicGame.GetExtraErrorFrameDumpData | ( | DeterministicFrame | frame | ) |
Creates information send to the server when detecting a checksum error.
| frame | Frame |
Implemented in Quantum.QuantumGame.
| void Photon.Deterministic.IDeterministicGame.OnDestroy | ( | ) |
The callback is called when the simulation is destroyed.
Implemented in Quantum.QuantumGame.
| void Photon.Deterministic.IDeterministicGame.AssignSession | ( | DeterministicSession | session | ) |
The DeterministicSession creates this reference during its initialization.
| session | Deterministic session that this game uses |
Implemented in Quantum.QuantumGame.
| void Photon.Deterministic.IDeterministicGame.OnGameStart | ( | DeterministicFrame | state | ) |
The callback is called when the actual simulation starts after the online protocol start sequence was successful.
| state | Initial deterministic frame |
Implemented in Quantum.QuantumGame.
| void Photon.Deterministic.IDeterministicGame.OnGameResync | ( | ) |
The callback is called when the game is starting from a snapshot after the snapshot has been received.
Implemented in Quantum.QuantumGame.
| void Photon.Deterministic.IDeterministicGame.OnGameEnded | ( | ) |
Not implemented.
Implemented in Quantum.QuantumGame.
| void Photon.Deterministic.IDeterministicGame.OnBeforeSimulationStage | ( | SimulatorContext | context | ) |
The callback is called once before the Verification and once before the Prediction stage of each session update.
| context | The current SimulatorContext. |
Implemented in Quantum.QuantumGame.
| void Photon.Deterministic.IDeterministicGame.OnSimulationStageFinished | ( | SimulatorContext | context | ) |
The callback is called once after the Verification and once after the Prediction stages of each session update.
| context | The current SimulatorContext. |
Implemented in Quantum.QuantumGame.
| void Photon.Deterministic.IDeterministicGame.OnSimulate | ( | DeterministicFrame | state | ) |
The callback is called when any simulation step was executed.
| state | Frame that was simulated |
Implemented in Quantum.QuantumGame.
| void Photon.Deterministic.IDeterministicGame.OnSimulateFinished | ( | DeterministicFrame | state, |
| SimulatorContext | context | ||
| ) |
The callback is called after any simulation step was executed and after the OnSimulate(DeterministicFrame) callback.
| state | Frame that was simulated |
| context | The current SimulatorContext. |
Implemented in Quantum.QuantumGame.
| void Photon.Deterministic.IDeterministicGame.OnUpdateCopyPreviousPredicted | ( | DeterministicFrame | previousPredicted, |
| SimulatorContext | context | ||
| ) |
The callback is called just before the tick the local input was polled up to is simulated, before input is applied to it.
previousPredicted still holds the tick that frame advances from, i.e. previousPredicted.Number == context.NextTickToSimulate - 1. It is the live simulation frame and is mutated right after the callback returns, read it during the callback only.
This callback can be used to interpolate transforms (or any other data) between previousPredicted and the predicted frame.
| previousPredicted | The state the last frame simulated in the current update advances from. |
| context | The current SimulatorContext. |
Implemented in Quantum.QuantumGame.
| void Photon.Deterministic.IDeterministicGame.OnUpdateCopyPreviousUpdatePredicted | ( | DeterministicFrame | previousUpdatePredicted, |
| SimulatorContext | context | ||
| ) |
The callback is called when the frame last predicted in the previous update is available in the current update.
If the last frame predicted in the previous update is re-simulated in the current update, previousUpdatePredicted will be the updated version.
This callback can be used to calculate and smoothly correct transform (or any other data) view errors caused by misprediction.
| previousUpdatePredicted | The latest version of the last frame simulated in the previous update. |
| context | The current SimulatorContext. |
Implemented in Quantum.QuantumGame.
| void Photon.Deterministic.IDeterministicGame.OnUpdateDone | ( | ) |
The callback is called when the session completed its DeterministicSession.Update loop.
Implemented in Quantum.QuantumGame.
| void Photon.Deterministic.IDeterministicGame.OnChecksumError | ( | DeterministicTickChecksumError | error, |
| DeterministicFrame[] | frames | ||
| ) |
The callback is called when a checksum error was detected.
| error | Checksum error information |
| frames | Contains the verified frame that was failed to validate |
Implemented in Quantum.QuantumGame.
| void Photon.Deterministic.IDeterministicGame.OnChecksumErrorFrameDump | ( | Int32 | actorId, |
| Int32 | frameNumber, | ||
| DeterministicSessionConfig | sessionConfig, | ||
| byte[] | runtimeConfig, | ||
| byte[] | frameData, | ||
| byte[] | extraData | ||
| ) |
The callback is called when the clients receive a frame dump of another client from the server.
| actorId | The Photon actor id that the dump belongs to |
| frameNumber | The frame number of the dump |
| sessionConfig | The session config |
| runtimeConfig | The runtime config |
| frameData | The frame data |
| extraData | Extra dump meta information |
| void Photon.Deterministic.IDeterministicGame.OnInputConfirmed | ( | DeterministicFrameInputTemp | input | ) |
The callback is called when an input object was confirmed by the server.
| input | Input object |
Implemented in Quantum.QuantumGame.
| void Photon.Deterministic.IDeterministicGame.OnInputSetConfirmed | ( | Int32 | tick, |
| Int32 | length, | ||
| byte[] | data | ||
| ) |
The callback is called when an input set (all clients) was confirmed by the server. The data array is a reused internal buffer that is only valid for the duration of the call and may be larger than length . Copy the first length bytes to retain them.
| tick | Tick |
| length | Number of valid bytes in data |
| data | Delta compressed input set, only valid during the call |
| void Photon.Deterministic.IDeterministicGame.OnChecksumComputed | ( | Int32 | frame, |
| ulong | checksum | ||
| ) |
The callback is called when the local checksum was computed.
| frame | The frame the checksum belongs to |
| checksum | The checksum that will be sent to the server |
Implemented in Quantum.QuantumGame.
| void Photon.Deterministic.IDeterministicGame.OnSimulationBegin | ( | ) |
The callback is called before the session computes multiple simulation steps (frames).
Implemented in Quantum.QuantumGame.
| void Photon.Deterministic.IDeterministicGame.OnSimulationEnd | ( | ) |
The callback is called when multiple simulation steps (frames) were executed.
Implemented in Quantum.QuantumGame.
| void Photon.Deterministic.IDeterministicGame.OnPluginDisconnect | ( | string | reason | ) |
The callback is called when the server plugin disconnected the client.
| reason | Debug string |
Implemented in Quantum.QuantumGame.
| void Photon.Deterministic.IDeterministicGame.OnLocalPlayerAddConfirmed | ( | DeterministicFrame | frame, |
| int | playerSlot, | ||
| PlayerRef | player | ||
| ) |
The callback is called when the server confirmed the addition of a (local) player.
| frame | The frame the player has been added |
| playerSlot | The player slot that was used to assign the player |
| player | The player |
Implemented in Quantum.QuantumGame.
| void Photon.Deterministic.IDeterministicGame.OnLocalPlayerRemoveConfirmed | ( | DeterministicFrame | frame, |
| int | playerSlot, | ||
| PlayerRef | player | ||
| ) |
The callback is called when the server confirmed the removal of a (local) player.
| frame | The frame when the request was confirmed |
| playerSlot | The player slot of the removed player |
| player | The player that was removed |
Implemented in Quantum.QuantumGame.
| void Photon.Deterministic.IDeterministicGame.OnLocalPlayerAddFailed | ( | int | playerSlot, |
| string | message | ||
| ) |
The callback is called when the server failed to process the add player request.
| playerSlot | The player slot that was requested |
| message | Debug message |
Implemented in Quantum.QuantumGame.
| void Photon.Deterministic.IDeterministicGame.OnLocalPlayerRemoveFailed | ( | int | playerSlot, |
| string | message | ||
| ) |
The callback is called when the server failed to process the remove player request.
| playerSlot | The player slot that was tried to remove |
| message | Debug message |
Implemented in Quantum.QuantumGame.
| void Photon.Deterministic.IDeterministicGame.OnGameResultResponse | ( | bool | success, |
| GameResultResponseCode | code | ||
| ) |
Is invoked when the server received the game result.
Implemented in Quantum.QuantumGame.
|
get |
Get the deterministic session.