Namespace Unity.NetCode
Classes
ClientAndServerInitializationSystemGroup
ClientAndServerSimulationSystemGroup
ClientInitializationSystemGroup
ClientPresentationSystemGroup
ClientServerBootstrap
ClientSimulationSystemGroup
CommandDataUtility
CommandReceiveSystem<TCommandDataSerializer, TCommandData>
CommandReceiveSystemGroup
CommandSendSystem<TCommandDataSerializer, TCommandData>
CommandSendSystemGroup
ConvertToClientServerEntity
DefaultTranslateSmoothingAction.DefaultStaticUserParams
DontSerializeForCommand
Add the attribute to prevent a field ICommandData struct to be serialized
DontSupportPrefabOverrides
Use this attribute to prevent a GhostComponent to support any kind of variation.
DontSupportVariation
Use this attribute to prevent a GhostComponent to support any kind of variation.
GhostAuthoringComponent
GhostAuthoringConversion
GhostCollectionAuthoringComponent
GhostCollectionSystem
GhostComponentAttribute
This attribute can be used to tag components to control which ghost prefab variants they are included in and where they are sent for owner predicted ghosts.
GhostComponentModifier
A struct wich contains a set of new attributes that will alter the serialization behavior of a component.
GhostComponentUtilities
Utility methods for working with GhostComponent.
GhostComponentVariationAttribute
Generate a serialization variantion for a component using the GhostFieldAttribute annotations
present in variant declaration.
The component variant can be assigned at authoring time using the GhostAuthoringComponent editor.
GhostDespawnSystem
GhostDistancePartitioningSystem
GhostFieldAttribute
GhostFieldModifier
Used to alter the serialization behavior of struct field.
GhostInputSystemGroup
GhostOwnerComponentAuthoring
GhostPredictionHistorySystem
A system used to make a backup o the current predicted state right after the last full (not fractional) tick in a prediction loop for a frame has been completed. The backup does a memcopy of all components which are rolled back as part of prediction to a separate memory area connected to the chunk. The backup is used to restore the last full tick to continue prediction when no new data has arrived, when that happens only the fields which are actually serialized as part of the snapshot are copied back, not the full component. The backup data is also used to detect errors in the prediction as well as to add smoothing of predicted values.
GhostPredictionSmoothingSystem
GhostPredictionSystemGroup
GhostReceiveSystem
GhostSendSystem
GhostSimulationSystemGroup
GhostSpawnClassificationSystem
The default GhostSpawnClassificationSystem will set the SpawnType to the default specified in the GhostAuthoringComponent, unless some other classification has already set the SpawnType. This system will also check ghost owner to set the spawn type correctly for owner predicted ghosts. For predictive spawning you usually add a system after GhostSpawnClassificationSystem which only looks at items with SpawnType set to Predicted and set the PredictedSpawnEntity if you find a matching entity. The reason to put predictive spawn systems after the default is so the owner predicted logic has run.
GhostSpawnSystem
GhostSpawnSystemGroup
GhostUpdateSystem
HeartbeatReceiveSystem
HeartbeatReplySystem
HeartbeatSendSystem
IJobParallelForDeferRefExtensions
NetCodeBufferComponentExtensions
NetCodeDisableCommandCodeGenAttribute
This attribute is used to disable code generation for a struct implementing ICommandData or IRpcCommand
NetworkReceiveSystemGroup
NetworkStreamCloseSystem
NetworkStreamReceiveSystem
NetworkTimeSystem
PhysicsWorldHistory
PredictedGhostSpawnSystem
RpcCommandRequestSystem<TActionSerializer, TActionRequest>
RpcCommandRequestSystemGroup
RpcSystem
ServerInitializationSystemGroup
ServerSimulationSystemGroup
TickClientInitializationSystem
TickClientPresentationSystem
TickClientSimulationSystem
TickServerInitializationSystem
TickServerSimulationSystem
UpdateInWorld
Structs
ArchetypeChunkComponentTypeDynamic32
ArchetypeChunkComponentTypeDynamic8
ClientServerTickRate
ClientServerTickRateRefreshRequest
ClientTickRate
CollisionHistoryBufferRef
CommandDataInterpolationDelay
CommandReceiveSystem<TCommandDataSerializer, TCommandData>.ReceiveJobData
CommandSendSystem<TCommandDataSerializer, TCommandData>.SendJobData
CommandTargetComponent
DefaultTranslateSmoothingAction
DefaultUserParams
DisableLagCompensation
Singleton entity that allow to disable the NetCode LagCompensation system if present
DynamicTypeList
DynamicTypeList128
DynamicTypeList32
DynamicTypeList64
DynamicTypeList8
GameProtocolVersion
GhostChildEntityComponent
A tag added to child entities in a ghost with multiple entities. It should also be added to ghosts in a group if the ghost is not the root of the group.
GhostCollection
A component used to identify the singleton which owns the ghost collection lists and data. The singleton contains buffers for GhostCollectionPrefab, GhostCollectionPrefabSerializer, GhostCollectionComponentIndex and GhostComponentSerializer.State
GhostCollectionAuthoringComponent.Ghost
GhostCollectionComponentIndex
This list contains the set of entity + component for all serialization rules in GhostCollectionPrefabSerializer. GhostCollectionPrefabSerializer contains a FirstComponent and NumComponents which identifes the set of components to use from this array.
GhostCollectionComponentType
This list contains the set of uniques component witch support serialization. Used to map the DynamicComponentTypeHandle to a concreat ComponentType in jobs.
GhostCollectionPrefab
A list of all prefabs which can be used for ghosts. This is populated with all ghost prefabs onthe server and that list is sent for clients. Having a prefab in this list does not guarantee that there is a serializer for it yet.
GhostCollectionPrefabSerializer
A list of all serializer data for the prefabs in GhostCollectionPrefab. This list can be shorter if not all serializers are created yet.
GhostComponent
Component signaling an entity which is replicated over the network
GhostConnectionPosition
GhostDeltaPredictor
GhostDeserializerState
GhostDistanceImportance
Singleton component used to control distance based importance settings
GhostDistancePartition
GhostDistancePartitionShared
GhostGroup
GhostOwnerComponent
GhostPrefabBuffer
A buffer added to the ghost prefab collection singleton containing references to all ghost prefabs.
GhostPrefabCollectionComponent
Component added to the ghost collection in order to inditify teh singleton containing a GhostPrefabBuffer with the prefabs for all ghosts.
GhostPrefabMetaData
A BlobAsset containing all the meta data required for ghosts.
GhostPrefabMetaData.ComponentInfo
GhostPrefabMetaData.ComponentReference
GhostPrefabMetaDataComponent
A component added to all ghost prefabs. It contains the meta-data required to use the prefab as a ghost.
GhostPrefabRuntimeStrip
A component added to ghost prefabs which require runtime stripping of components before they can be used. The component is removed when the runtime stripping is performed.
GhostSerializerState
GhostSpawnBuffer
The GhostSpawnBuffer is the data for a GhostSpawnQueueComponent singleton. It contains a list of ghosts which will be spawned by the GhostSpawnSystem at the beginning of next frame. It is populated by the GhostReceiveSystem and there needs to be a classification system updating after the GhostReceiveSystem which sets the SpawnType so the spawn system knows how to spawn the ghost. A classification system should only modify the SpawnType and PredictedSpawnEntity fields of this struct.
GhostSpawnQueueComponent
GhostSPawnQueueComponent is used to identify the singleton component which contains the GhostSpawnBuffer.
GhostTypeComponent
Component storing the guid of the prefab the ghost was created from. This is used to lookup ghost type in a robust way which works even if two ghosts have the same archetype
HeartbeatComponent
IncomingCommandDataStreamBufferComponent
IncomingRpcDataStreamBufferComponent
IncomingSnapshotDataStreamBufferComponent
NetworkIdComponent
NetworkProtocolVersion
NetworkSnapshotAckComponent
NetworkStreamConnection
NetworkStreamDisconnected
NetworkStreamInGame
NetworkStreamRequestDisconnect
NetworkStreamSnapshotTargetSize
NullCommandData
OutgoingRpcDataStreamBufferComponent
PortableFunctionPointer<T>
PredictedGhostComponent
Component on client signaling that an entity is predicted instead of interpolated
PredictedGhostSpawn
PredictedGhostSpawnList
PredictedGhostSpawnRequestComponent
Component used to request predictive spawn of a ghost. Create an entity from a prefab in the ghost collection with this tag added. You need to implement a custom spawn classification system in order to use this.
PreSpawnedGhostId
The ghost ID on a pre-spawned entity, it's unique withing the subscene.
ReceiveRpcCommandRequestComponent
RelevantGhostForConnection
RpcCommandRequestSystem<TActionSerializer, TActionRequest>.SendRpcData
RpcDeserializerState
RpcExecutor
RpcExecutor.Parameters
RpcQueue<TActionSerializer, TActionRequest>
RpcSerializerState
SendRpcCommandRequestComponent
SharedGhostTypeComponent
Component used on the server to make sure ghosts of difference ghost types are in different chunks even if they have the same archetype (but different data)
SnapshotData
SnapshotData.DataAtTick
SnapshotDataBuffer
SnapshotDynamicBuffersHelper
Helper class for managing ghost buffers data
SnapshotDynamicDataBuffer
A data structure used to store ghosts dynamic buffers data content. BeginArray(SnapshotHistorySize] uint dataSize, (16 bytes aligned) current serialized data length for each slot. Used for delta compression EndArray BeginArray(SnapshotHistorySize] for each buffers: uint[maskBits] elements change bitmask byte[numElements] serialized buffers data EndArray The buffer grow in size as necessary to accomodate new data. All slots have the same size, usually larger than the data size. The serialized element size is aligned to the 16 bytes boundary
SpawnedGhost
SubSceneGhostComponentHash
The hash of all the ghost component data which exists in the scene. This can be used to sort the subscenes so the ghost IDs of the pre-spawned scene objects line up deterministically.
ThinClientComponent
Interfaces
ICommandData
Commands (usually inputs) that must be sent from client to server to control an entity (or any other thing) should implement the ICommandData interface. Prefer using the ICommandData over Rpc if you need to send a constant stream of data from client to server
ICommandData, being a subclass of IBufferElementData, can also be serialized from server to the clients and natively support the presence of GhostComponentAttribute and GhostFieldAttribute. As such, the same rule for buffers apply: if the command buffer must be serialized, then all fields must be annotated with a GhostFieldAttribute. Failure to do so will generate code-generation errors.
However, differently from normal component, ICommandData buffers are not serialized to all the clients by default. In particular, in absence of a GhostComponentAttribute governing the serialization behavior the following set of options are set: PrefabType is set to All. The buffer is present on all the ghost variant. OwnerPredictedSendType is set to Predicted. Only predicted ghost can receive the buffer and interpolated variant will have the component stripped or disabled. OwnerSendType is set to SendToNonOwner. If the ghost has an owner, is sent only to the clients who don't own the ghost.
Is generally not recommended to send back to the ghost owner its own commands. For that reason, setting the SendToOwner flag will be reported as a error and ignored. Also, because they way ICommandData works, some care must be used when setting the PrefabType property:
- Server: While possible, does not make much sense. A warning will be reported.
- Clients: The ICommandData buffer is stripped from the server ghost. A warning will be reported
- InterpolatedClient: ICommandData buffers are stripped from the server and predicted ghost. A warning will be reported
- Predicted: ICommandData buffers are stripped from the server and predicted ghost. A warning will be reported.
- AllPredicted: Interpolated ghost will not have the command buffer.
- All: All ghost will have the command buffer.