Skip to content

NetworkTransform sync can fail when Interpolation is off due to network conditions #3571

@zachstronaut

Description

@zachstronaut

Description

It is possible due to network conditions (jitter and packet loss non-zero) for NetworkTransform to receive in TransformStateUpdate() two incoming NetworkTransformState values in the same Unity frame.

If NetworkTransformState A contains an updated rotation but NetworkTransformState B only contains an updated position, then the m_LocalAuthoritativeNetworkState in ApplyAuthoritativeState() on the next OnUpdate() will only contain the data for state B, so the rotation change will never happen and the two clients will now be out of sync (different rotations).

I'm not exactly sure why Interpolation negates this problem, but I would suppose it has something to do with the fact OnNetworkStateChanged() is called on both A and B when they are received, so the data isn't lost to the interpolaters?

The problem will occur with real world network problems, but if you simulate something terrible like Delay=250, Jitter=40, Loss=20 it becomes a lot easier to reproduce.

Environment

OS: Windows 11
Unity Version: 6000.1.3f1
Netcode Version: 2.4.2
Netcode Topology: Client-Server

Metadata

Metadata

Assignees

No one assigned

    Labels

    stat:awaiting-triageStatus - Awaiting triage from the Netcode team.stat:reply-neededAwaiting reply from Unity accounttype:bugBug Report

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions