You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 44b7386
Browse filesBrowse the repository at this point in the historyBrowse files
fix: network clock adjustment overshoot and per-frame NetworkManager scene search (#4195)
* fix: stop the network clock adjustment on its target instead of stepping past it
Once a client's clock reached the offset it adjusts towards, each frame
stepped the full AdjustmentRatio past it and back, so LocalTime and
ServerTime alternated between running fast and slow every frame.
* fix: keep a list of NetworkManagers instead of searching the scene for them every frame
UnifiedUpdateConnections called Object.FindObjectsByType<NetworkManager>() on every update, whose cost
grows with the number of MonoBehaviours in the scene: about 1.5 ms a call with 10,000 and 14 ms with
50,000. NetworkManager.Instances is filled in Awake and emptied in OnDestroy, and the system visits that.
* docs: describe the clock adjustment fix by what users saw
* fix: bind connection updates to the hybrid world's own NetworkManager
UnifiedUpdateConnections now runs only in client and server worlds that hold
the NetworkManager they were created for, and updates that NetworkManager
alone. This replaces the NetworkManager.Instances list, which a derived
NetworkManager declaring its own Awake never entered.
* fix: create a server only world for hybrid mode in dedicated server builds
Netcode for Entities cannot create a single world host in a dedicated server
build, which every hybrid server used. A build for only one side now logs an
error when asked to start the side it does not support.
* fix: treat a destroyed NetworkManager as shutting down in connection updates
The hybrid world outlives its NetworkManager if ShutdownInternal throws before
disposing it, so UnifiedUpdateConnections now disconnects every connection and
announces none instead of throwing each frame. HybridNetworkManager.Value is
renamed to NetworkManager, the clock adjustment comment says what the clamp
does, and the unused Unity.Entities using that failed the Standards check is
removed.
* ci: TEMPORARY run the unified job on b1.xlarge to test the memory pressure theory
Revert before merge.
* fix: return no RTT for a hybrid connection that has already been removed
A client drains its incoming queue while it disconnects, after the unified transport has removed the
server connection, so a queued TimeSyncMessage made GetCurrentRtt throw KeyNotFoundException. It now
returns 0 for a connection it no longer has, as UnityTransport does.
* ci: TEMPORARY run the unified job on b1.large with 6000.7.0b4 to test whether 6000.7.0b6 raised memory use
Replaces the b1.xlarge test. Revert before merge.
* ci: compile testproject in a separate editor session before the unified test pass
The IL post-processor and compiler processes the editor starts stay resident through the test pass
and, on a b1.large agent, leave too little memory for the hybrid tests. The project is now imported
and compiled in its own batchmode session that exits first, any build process that outlives it is
stopped, and the job log lists the largest processes left before the tests start.
Also drops the temporary 6000.7.0b4 editor pin.
* ci: pin the unified warm-up to the Release code configuration
The test runner compiles in Release. An editor whose code optimization preference is Debug builds the
other configuration in the warm-up, and the test session then recompiles every assembly and restarts
the IL post-processor. CI's agents already default to Release, so this is a guard rather than a fix
there; it removed the recompile on a machine set to Debug.
Copy file name to clipboardExpand all lines: com.unity.netcode.gameobjects/CHANGELOG.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -23,6 +23,7 @@ Additional documentation and release notes are available at [Multiplayer Documen
23
23
24
24
### Fixed
25
25
26
+
- Issue where a client's clock kept alternating between running slightly fast and slightly slow on every frame, even after it had synchronized with the server. Interpolated objects juddered (a periodic motion artifact caused by mismatched frame rates): they moved in uneven steps instead of smoothly. Barely noticeable at the default `NetworkTimeSystem.AdjustmentRatio`, and clearly visible at higher values.
26
27
- Issue where the IL post-processor could not resolve core library types, such as `Guid` and `List<T>`, in assemblies compiled against .NET reference assemblies, for example when targeting .NET 10. Those split the core library across `System.Runtime`, `System.Collections` and other assemblies.
27
28
- Fixed issue where a prefab added to a `NetworkPrefabsList` while a session was running was registered more than once and logged a duplicate `GlobalObjectIdHash` error. (#4184)
28
29
- Issue where moving a `NetworkObject` into another scene made the clients that did not observe it log "Trying to synchronize NetworkObjectId but it was not spawned". The scene migration is now only sent to the clients that observe the `NetworkObject`. (#4176)
Debug.LogError($"[{nameof(UnifiedBootstrap)}] A client only build cannot start a {(networkManager.IsClient?"host":"server")} in hybrid mode. Set the Netcode for Entities client build target to ClientAndServer.");
Copy file name to clipboardExpand all lines: com.unity.netcode.gameobjects/Tests/Editor/Timing/ClientNetworkTimeSystemTests.cs
+30Lines changed: 30 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -138,6 +138,36 @@ public void RttCatchupSlowdownTest()
138
138
Assert.True(Math.Abs(totalServerSpeedUpTime)<k_AcceptableRttOffset,$"Expected server speed up time to be less than {k_AcceptableRttOffset}ms but it was {expectedServerSpeedUpTime}!");
139
139
}
140
140
141
+
/// <summary>
142
+
/// Validates that once the clock has caught up with a time sync, its local and server time both advance by
143
+
/// exactly the frame's delta time on every frame, instead of alternating between slightly fast and slightly slow.
0 commit comments