Struct CharacterAttributesBroadcast
Carries changed character attributes to everyone observing a character.
public struct CharacterAttributesBroadcast : IBroadcast
- Implements
-
IBroadcast
- Inherited Members
Remarks
What this replaces. While state forwarding was enabled, an observer received the whole
of CharacterReconcileData every tick, and its Attributes array is what kept a
peer's attribute sheet current. Forwarding is off on every prefab now — relaying each owner's
input and state to each observer is what made a busy scene unaffordable — so that channel is
gone, and this message is what keeps observers correct instead. The spawn payload seeds the
full sheet; this carries every change after that.
Why observers need attributes at all. A resource's maximum is a formula over them. An observer that holds strength but not the ring that raised it draws the wrong maximum health under every bar, and any client-side display derived from a peer's attributes is wrong in the same way.
Delta. Only attributes whose value or external modifier actually changed are written —
one equip or one buff expiring costs one entry, not the character's whole sheet. Each entry
carries its own TemplateID and its absolute values rather than an index into the
previous array and a difference from it. That costs a few bytes per entry and buys two things
worth far more: a receiver applies an entry correctly no matter what state it was in
beforehand, and a message can never be decoded against a baseline the sender has since moved
past. FishNet's difference-encoded deltas have exactly that failure mode, which is why they
need a sequence number and a periodic absolute resend to be safe.
Reliable. Attribute changes are rare and event driven — gear, buffs, levels — so the cost of reliability is negligible, and it removes the whole question of what a dropped update would leave behind. An unreliable attribute update that went missing would leave an observer holding a stale sheet until that same attribute happened to change again, which for a maximum-health ring could be never.
Fields
Attributes
The attributes that changed, or the whole sheet when IsFullSet.
public AttributeReconcileEntry[] Attributes
Field Value
CharacterObjectID
NetworkObject id of the character these attributes belong to.
public int CharacterObjectID
Field Value
Remarks
A broadcast is not addressed to a NetworkBehaviour the way an RPC is; the handler is registered once per client and has to be told which character it is about.
IsFullSet
True when Attributes is the character's entire sheet rather than the entries that changed.
public bool IsFullSet
Field Value
Remarks
Sent when the sender has no usable baseline for this character — its first push, or after the attribute set itself was rebuilt. A receiver treats a full set as authoritative for every attribute it names; it does not clear attributes the message omits, because the sheet is fixed at spawn and an omission means "unchanged", never "gone".