|
3 | 3 | namespace Unity.Netcode.Components |
4 | 4 | { |
5 | 5 | /// <summary> |
6 | | - /// A compressed/bandwidth-friendly identifier allocation system that is used when <see cref="TransformSyncModes.Batched"/> |
7 | | - /// mode is set. This helps to reduce the identifier from a bitpacked ulong and uint down to a ushort. |
| 6 | + /// Allocates the ushort handles that identify instances in <see cref="TransformSyncModes.Batched"/> mode. |
8 | 7 | /// </summary> |
9 | 8 | /// <remarks> |
10 | | - /// A batched state update identifies its instance by this handle rather than by a |
11 | | - /// <see cref="NetworkObject.NetworkObjectId"/> and <see cref="NetworkBehaviour.NetworkBehaviourId"/> pair. |
12 | | - /// The pair costs two to four bytes once bit packed and grows as object ids climb, where a "dense handle" |
13 | | - /// ranges between one to two bytes for the lifetime of a session.<br /> |
14 | | - /// <br /> |
15 | | - /// Only the instance writing synchronization data (the server, or the session owner in a distributed |
16 | | - /// authority topology) allocates. Everyone else is told the handle at spawn. Allocating on the owner would |
17 | | - /// reassign the handle on every ownership change, and the identity has to outlive ownership.<br /> |
18 | | - /// <br /> |
19 | | - /// Freed handles are not re-issued immediately.<br /> |
20 | | - /// An unreliable state update naming a handle can still be in flight when the instance it referred to despawns, |
21 | | - /// and reissuing straight away would let that packet apply to whichever instance picked the handle up next. |
22 | | - /// Holding to-be-released handles for <see cref="k_RecycleDelaySeconds"/> has no impact/cost and avoids running |
23 | | - /// into this scenario. |
| 9 | + /// A batched state update names its instance by a handle. The alternative is a |
| 10 | + /// <see cref="NetworkObject.NetworkObjectId"/> and <see cref="NetworkBehaviour.NetworkBehaviourId"/> pair, |
| 11 | + /// which costs more once bit packed and grows as object ids climb.<br /> |
| 12 | + /// Only the instance writing synchronization data allocates: the server, or the session owner in a |
| 13 | + /// distributed authority topology. Everyone else is told the handle at spawn.<br /> |
| 14 | + /// The owner does not allocate. A handle has to outlive ownership changes.<br /> |
| 15 | + /// Freed handles are held for <see cref="k_RecycleDelaySeconds"/> before being reissued. An unreliable |
| 16 | + /// state update naming a handle can still be in flight when its instance despawns. |
24 | 17 | /// </remarks> |
25 | 18 | internal class TransformHandleAllocator |
26 | 19 | { |
|
0 commit comments