Skip to content

Commit 6b8df1d

Browse files
style
Simplified the TransformHandleAllocator class comments.
1 parent 112b302 commit 6b8df1d

1 file changed

Lines changed: 9 additions & 16 deletions

File tree

com.unity.netcode.gameobjects/Runtime/Components/TransformHandleAllocator.cs

Lines changed: 9 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -3,24 +3,17 @@
33
namespace Unity.Netcode.Components
44
{
55
/// <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.
87
/// </summary>
98
/// <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.
2417
/// </remarks>
2518
internal class TransformHandleAllocator
2619
{

0 commit comments

Comments
 (0)