Class BeginPredictedSimulationEntityCommandBufferSystem
The EntityCommandBufferSystem at the beginning of the PredictedSimulationSystemGroup. This command buffer can update mulitple time per frame on the client, based on the network condition and the frequency of server packet received by the client.
Inheritance
Inherited Members
Namespace: Unity.NetCode
Assembly: Unity.NetCode.dll
Syntax
[WorldSystemFilter(WorldSystemFilterFlags.Default|WorldSystemFilterFlags.ThinClientSimulation, WorldSystemFilterFlags.Default)]
[UpdateInGroup(typeof(PredictedSimulationSystemGroup), OrderFirst = true)]
public class BeginPredictedSimulationEntityCommandBufferSystem : EntityCommandBufferSystem
Remarks
This system update may not be called on the client if there are no predicted ghost entities. Pending commands may be stale and processed
later, when new predicted ghost entities are spawned.
Pending commands are executed in the same frame they are added to the buffer only in these cases:
- Commands are queued before the PredictedSimulationSystemGroup update.
- Commands are queued by a system or job executed inside the PredictedSimulationSystemGroup and the group still has to run at least another tick, either partial or full.
For the latter case, notice that for application that run at fixed tick rate (i.e the server or the client when v-synced) that is never the case and all commands are always delayed by one tick.
In general, prefer using the EndPredictedSimulationEntityCommandBufferSystem to queue operation that are expected be executed by the end of the prediction group update or in general in the current frame. For example:
- spawning entities (predicted spawning) on the client or the server
- removing / adding components