Skip to content

Add ContinuousChannel field to NetworkAnimator for split-channel sync (events stay reliable, continuous values opt-in unreliable) - #1039

Merged
FirstGearGames merged 1 commit into
FirstGearGames:mainfrom
isaiahgrant:feature/networkanimator-split-channel
Aug 9, 2026
Merged

FirstGearGames merged 1 commit into
FirstGearGames:mainfrom
isaiahgrant:feature/networkanimator-split-channel

Conversation

@isaiahgrant

Copy link
Copy Markdown
Contributor

Problem

In games with many concurrent NetworkAnimators (zombie hordes, large-scale RTS, etc.), continuous parameter sync (floats, layer weights, speed) generates steady reliable-channel pressure on every tick. With enough instances this saturates the reliable lane on lossy transports — in our case we hit Steam P2P send-buffer overflow during high-density frames, eventually causing connections to drop.

Our take: The reliable channel isn't the right fit for continuous interpolated values: a missed packet doesn't matter, the next tick supersedes it. But triggers and state changes are one-shots that do need to arrive.

Solution

Add a per-instance ContinuousChannel field on NetworkAnimator that lets you opt continuous values onto Unreliable while keeping triggers, state changes, and crossfades on Reliable.

  • Continuous values (bool/float/int parameters, layer weights, speed) → _continuousChannel
  • Events (triggers, STATE, CROSSFADE) → always Reliable

Default is Channel.Reliable, which routes through the original code path bit-for-bit unchanged. Existing projects see no behavior change. The split-channel path is only entered when an instance opts in.

ContinuousChannel is exposed as a public property and can be flipped at runtime — useful for distance-based importance (Reliable when close to a player, Unreliable when far).

Implementation notes

  • New AnimatorUpdatedSplit writes to two pooled writers in parallel — same logic as AnimatorUpdated, just routed by category.
  • Two new TargetRpcs and two new ServerRpcs carry the streams. Receive logic is shared with the existing path via
    ReceiveTargetAnimatorPayload / ReceiveServerAnimatorPayload, so deserialization stays identical.
  • No changes to wire format on the existing path. No changes to existing public API.

Testing

Tested in a 4-player co-op zombie game with up to 300 concurrent NetworkAnimators per host. Reliable-lane pressure on the host's outbound traffic dropped substantially with ContinuousChannel = Unreliable, and Steam P2P disconnects during burst spawns stopped reproducing. Triggers (hit reactions, attack states) still arrive reliably.

… (events stay reliable, continuous values opt-in unreliable).
@FirstGearGames

Copy link
Copy Markdown
Owner

Thank you for this PR. The code was reviewed but I'm not able to fully test this, and given the current animator is hardened I'm hesitant to ship this as default. I'll add this in as a 'Beta' component. which you can toggle via the Fish-Networking menu.

@FirstGearGames

Copy link
Copy Markdown
Owner
image

@FirstGearGames
FirstGearGames merged commit e3df174 into FirstGearGames:main Aug 9, 2026
FirstGearGames pushed a commit that referenced this pull request Sep 2, 2026
- Fixed ZigZagDecode improperly decoding values in IL2CPP with specific backing CPP libraries.
- Fixed Scene object expecting prefab ID (#1032).
- Fixed eliminated or significantly reduced wobble in local reconcile resimulations on server-authoritative objects.
- Fixed NetworkAnimator delay/desync on host owned object, observed by clients (#1062).
- Fixed NetworkCollider/2D tick comparison error (#1041).
- Fixed prefab objects generator cannot include folders with spaces in the path (#1045).
- Fixed large writers pooling incorrectly, causing them to not be re-used (#1054).
- Fixed LiteNetLib wrong data length after BasePacketLayer modification (#1064).
- Fixed NetworkTrigger2D by uncommenting entire file.
- Fixed nested NetworkObjects not spawning recursively when spawned via OnStartServer of their parent.
- Fixed SyncType values being reset to default before OnStopServer as clientHost (#1036).
- Fixed disconnecting clients not being cleared on Transport shutdown (#1044).
- Fixed Quaternion ScaleToFloat helper math, cause of marginal rotational errors (#1067).
- Fixed loading scenes by path not loading the scene for clients under certain conditions (#1060).
- Obsoleted SceneLookupData.Name in favor of SceneLookupData.FullName.
- Added NetworkBehaviour.ToString null safety (#1046).
- Added Unity 6.5 scene handle change support (#1052 / #1051 merge).
- Added Unity 6.5 GetEntityId/GetInstanceId support.
- Added NetworkCollider2D use PhysicsScene2D.OverlapCollider as a fallback (#1042).
- Added NetworkCollider/2D.RemoveEnteredCollider.
- Added NetworkCollider/2D InvokeStayOnEnter.
- Added NetworkAnimator channel option - under Beta menu, Animator Channel (#1039).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants