-
Notifications
You must be signed in to change notification settings - Fork 443
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
fix: NetworkTransform dropped packets can cause interpolation stutter [MTT-7551] #2713
fix: NetworkTransform dropped packets can cause interpolation stutter [MTT-7551] #2713
Conversation
This resolves the issue with client authoritative network transforms and the random "noise" that would occur when transitioning ownership from a remote client back to the host-server. - Latent messages from the client would still be received and processed after ownership changed. - Ownership changed messages would proceed the NetworkTransform initialization state update message. Now ownership changed messages precede the NetworkTransform initialization state update message. - Clients could sometimes have the same network tick value even when the tick event had triggered, which for NetworkDeltaPosition would cause dropped state updates.
This is another bug in the validation test suite where removing an override of a virtual method that can still be overridden will throw an API validation error.
…rpolation-stutter
More adjustments to handle sending unreliable deltas. These changes will (when sending unreliable deltas): - Stagger NetworkTransform axial frame synchronization - Axial frame synchronization is sent reliably - Axial frame synchronization is sent only if deltas have been sent (once to assure when an object stops it no longer sends syncs) This also adjusts the "one tick event updates all NetworkTransform authority instances" addition.
Removing unused namespace. Removing reference to static variable that no longer exists (was for debugging)
…rpolation-stutter
Fixing bad changelog merge
adding CR/LF
…rpolation-stutter
Discovered a long time standing parenting issue with the initial synchronization (while working on something else). The issue involves WorldPositionStays, InLocalSpace, and the initial synchronization. Added comments to describe the adjustments. Basically, when synchronizing, ignore the InLocalSpace setting and only use the WorldPositionStays value to determine which position space to use on the authoritative side only when building the initial synchronization state update.
…rpolation-stutter
@@ -269,6 +274,7 @@ public void TestSyncAxes([Values] SynchronizationType synchronizationType, [Valu | |||
|
|||
if (syncPosX || syncPosY || syncPosZ || syncRotX || syncRotY || syncRotZ || syncScaX || syncScaY || syncScaZ) | |||
{ | |||
Assert.IsTrue(networkTransform.NetworkManager != null, "NetworkManager is NULL!"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You could use Assert.NotNull(networkTransform.NetworkManager)
or Assert.That(networkTransform.NetworkManager, Is.Not.Null)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ahh... true that! I would think that would help clarify the context faster for reviewers.
(nice tip)
👍
Just adjusting the way a test asserts on null based on suggested review feedback.
…rpolation-stutter
Fixes
NetworkTransform can handle latency issues but not dropping packets when interpolation is enabled due to the original default delivery method being reliable fragmented sequenced. This update sends common delta state updates as unreliable fragmented while also assuring that the following more critical state updates are still sent as reliable fragmented sequenced:
NetworkDeltaPosition
delta exceeds the maximum delta forcing the axis in question to be collapsed into the core base position, the state update will be sent as reliable fragmented sequenced.In order to preserve a continual consistency of axial values when unreliable delta messaging is enabled ( due to the possibility of dropping packets), NetworkTransform instances will send 1 axial frame synchronization update per second (only for the axis marked to synchronize) as long as at least one delta state update had been previously sent. When a NetworkObject is at rest, axial frame synchronization updates are not sent.
In order to prevent "stacking" of axial frame synchronization updates, NetworkTransform instances are assigned to a tick position from the total total number of ticks that can occur within a second (i.e. a NetworkConfig.TickRate of 30 would mean there are 30 possible tick positions available). All instances' tick positions are assigned in a way that distributes their axial frame synchronization updates across the allotted 1 second time interval as best possible.
The additional bandwidth cost per instance is one full axis synchronization per second per instance:
Example:
90 instances with half precision and quaternion synchronization enabled and the X, Y, and Z axis for position marked for synchronization would send full axis synchronizations for 3 instances per network tick over a 1 second period of time. Each full axis synchronization update would have a payload size of 14 bytes per instance at a total cost of an additional 42 bytes per network tick if all 90 instances were continually moving/rotating.
Additional Updates & Fixes
NetworkTransform
instances now use a tick system registration process in order to improve performance. Invoking all authoritative tick updates directly from within a single tick event can shave up to 1-2ms off of total processing time (with ~500 or more instances updating).NetworkDeltaPosition
now has a unique state update whenUseUnreliableDeltas
is enabled to assure collapsing of an axis into theNetworkDeltaPosition.CurrentBasePosition
is sent using reliable fragmented sequenced network delivery.NetworkTransform
is using world or local space.MTT-7551
Changelog
NetworkTransform
instance with interpolation enabled would result in wide visual motion gaps (stuttering) under above normal latency conditions and a 1-5% or higher packet are drop rate.NetworkTransform
authoritative instance tick registration so a singleNetworkTransform
specific tick event update will update all authoritative instances to improve perofmance.Testing and Documentation
NetworkTransformPacketLossTests.ParentedNetworkTransformTest
NetworkTransformPacketLossTests.NetworkTransformMultipleChangesOverTime
NetworkTransformPacketLossTests.TestAuthoritativeTransformChangeOneAtATime
UseUnreliableDeltas
to validate the original reliable fragmented sequenced mode still works as expectedUX/UI Update:
Added additional "Use Unreliable Deltas" property to

NetworkTransformEditor
: