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
fix: buffered linear interpolator jitter and exposing more properties (#3355)
After doing some testing I noticed a few anomalies with the updated
`BufferedLinearInterpolator<T>`. As it turns out, there are more than
one approaches a user might need depending upon what they are trying to
accomplish and each option really performs best when tweaking some
properties within the `BufferedLinearInterpolator<T>` that were not
completely exposed.
### Various options:
- You might want to enable, disable, or adjust the maximum interpolation
time of the last smooth lerp phase for each interpolator type.
- You might want to manually adjust the tick latency offset
(`NetworkTransform.InterpolationBufferTickOffset`) used depending upon
context.
- When using a client-server topology, you might want this to be set to
something like 0 or 1 (depending upon interpolator).
- You might want this value to be higher (like say +2-3 depending on
latency and interpolation type) on non-authority instances where the
authority is some other client and not the host/server.
### This PR renames `Lerp` to `LegacyLerp` and adds a 3rd new `Lerp`
interpolator type:
#### Lerp (new)
Uses a 1 to 2 phase approach that lerps towards the target, lerps
towards the next target (if one exists) ahead by 1 frame delta, blends
the two results, and (optionally) smooth the final value.
- The first phase lerps towards the current tick state update being
processed.
- The fourth phase (optional) performs a lerp smoothing where the
current respective transform value is lerped towards the result of the
first phase at a rate of 1.0f minus the max interpolation time.
## Changelog
- Added: `Lerp` interpolation type that still uses a lerp approach but
uses the new buffer consumption logic.
- Added: Property to enable or disable lerp smoothing for position,
rotation, and scale interpolators.
- Added: `NetworkTransform.InterpolationBufferTickOffset` static
property to provide users with a way to increase or decrease the time
marker where interpolators will pull state update from the queue.
- Fixed: Issue where the time delta that interpolators used would not be
properly updated during multiple fixed update invocations within the
same player loop frame.
- Changed: The original `Lerp` to be renamed to `LegacyLerp`.
## Testing and Documentation
- Includes integration test updates.
- Includes documentation for public API entry points.
- Includes updates to public documentation for `NetworkTransform`. (Will
be adding to
[PR-1443](Unity-Technologies/com.unity.multiplayer.docs#1443))
<!-- Uncomment and mark items off with a * if this PR deprecates any
API:
### Deprecated API
- [ ] An `[Obsolete]` attribute was added along with a `(RemovedAfter
yyyy-mm-dd)` entry.
- [ ] An [api updater] was added.
- [ ] Deprecation of the API is explained in the CHANGELOG.
- [ ] The users can understand why this API was removed and what they
should use instead.
-->
---------
Co-authored-by: Emma <[email protected]>
Copy file name to clipboardExpand all lines: com.unity.netcode.gameobjects/CHANGELOG.md
+6-1
Original file line number
Diff line number
Diff line change
@@ -11,6 +11,9 @@ Additional documentation and release notes are available at [Multiplayer Documen
11
11
### Added
12
12
13
13
- Added `NetworkManager.OnPreShutdown` which is called before the NetworkManager cleans up and shuts down. (#3366)
14
+
- Added `Lerp` interpolation type that still uses a lerp approach but uses the new buffer consumption logic. (#3355)
15
+
- Added property to enable or disable lerp smoothing for position, rotation, and scale interpolators. (#3355)
16
+
- Added `NetworkTransform.InterpolationBufferTickOffset` static property to provide users with a way to increase or decrease the time marker where interpolators will pull state update from the queue. (#3355)
14
17
- Added interpolator types as an inspector view selection for position, rotation, and scale. (#3337)
15
18
- Added a new smooth dampening interpolator type that provides a nice balance between precision and smoothing results. (#3337)
16
19
- Added `NetworkTimeSystem.TickLatency` property that provides the average latency of a client. (#3337)
@@ -19,6 +22,7 @@ Additional documentation and release notes are available at [Multiplayer Documen
19
22
20
23
### Fixed
21
24
25
+
- Fixed issue where the time delta that interpolators used would not be properly updated during multiple fixed update invocations within the same player loop frame. (#3355)
22
26
- Fixed issue when using a distributed authority network topology and many clients attempt to connect simultaneously the session owner could max-out the maximum in-flight reliable messages allowed, start dropping packets, and some of the connecting clients would fail to fully synchronize. (#3350)
23
27
- Fixed issue when using a distributed authority network topology and scene management was disabled clients would not be able to spawn any new network prefab instances until synchronization was complete. (#3350)
24
28
- Fixed issue where an owner that changes ownership, when using a distributed authority network topology, could yield identical previous and current owner identifiers. This could also cause `NetworkTransform` to fail to change ownership which would leave the previous owner still subscribed to network tick events. (#3347)
@@ -39,8 +43,9 @@ Additional documentation and release notes are available at [Multiplayer Documen
39
43
40
44
### Changed
41
45
46
+
- Changed the original `Lerp` interpolation type to `LegacyLerp`. (#3355)
42
47
- Changed `BufferedLinearInterpolator<T>.Update(float deltaTime, NetworkTime serverTime)` as being deprecated since this method is only used for internal testing purposes. (#3337)
43
-
-Ensured that a useful error is thrown when attempting to build a dedicated server with Unity Transport that uses websockets. (#3336)
48
+
-Changed error thrown when attempting to build a dedicated server with Unity Transport that uses websockets to provide more useful information to the user. (#3336)
44
49
- Changed root in-scene placed `NetworkObject` instances now will always have either the `Distributable` permission set unless the `SessionOwner` permission is set. (#3305)
45
50
- Changed the `DestroyObject` message to reduce the serialized message size and remove the unnecessary message field. (#3304)
46
51
- Changed the `NetworkTimeSystem.Sync` method to use half RTT to calculate the desired local time offset as opposed to the full RTT. (#3212)
0 commit comments