Struct CombatEventBroadcast
Tells everyone who can see a character that it just took damage or was healed.
public struct CombatEventBroadcast : IBroadcast
- Implements
-
IBroadcast
- Inherited Members
Remarks
Ability hits are resolved on the server only, and CharacterDamageController reports
them through in-process static events — so before this message existed no client ever
learned about a hit it did not simulate itself, and the floating combat numbers were
invisible for every ability on every client. The owner's own predicted damage-over-time
ticks did produce a label, and produced it again on every replay of the same tick.
This is the single source of combat numbers on a client. The amount is the server's, after resistance, so what is shown is what actually happened. Sent unreliably to the target's observers — one lost label is not worth a resend — and coalesced per target per tick, so a burst of area hits on one creature costs one message rather than one per hit.
Fields
Amount
The amount, after every modifier the server applies. Never negative.
public int Amount
Field Value
DamageTemplateID
Cached template id of the DamageAttributeTemplate for a damage event, or 0.
public int DamageTemplateID
Field Value
Remarks
The client colours the label by damage type. The template id is the smallest handle that resolves through the existing scriptable-object cache on the client without a second table to keep in step; it is packed, so a small id costs one byte.
Kind
What happened; a CombatEventKind.
public byte Kind
Field Value
Occurrences
How many separate hits Amount was summed from. Always at least one.
public int Occurrences
Field Value
Remarks
The caster predicted each of them separately. The coalescer merges every hit
sharing a (source, kind, damage type) within one tick into a single entry, which is right
for display — one readable number instead of a stack of labels. But the caster's client
drew one predicted label PER HIT, and PredictedCombatEvents.TryConfirm consumes one
pending entry per report. A three-projectile volley landing together therefore confirmed
one prediction and left the other two to time out and grey themselves out, marking hits
that landed as hits that were denied — the one place the prediction display lied.
One packed byte-ish int, and it is 1 for every hit outside a multi-hit burst, so it costs a single byte in the overwhelming case.
SourceObjectID
NetworkObject id of the character responsible, or 0 when there was none.
public int SourceObjectID
Field Value
Remarks
Zero is FishNet's "unset" object id, so it can never collide with a real one. A damage tick from a lingering poison whose caster has left, or an environmental hazard, sends 0.
TargetObjectID
NetworkObject id of the character that took the damage or the heal.
public int TargetObjectID