-
Notifications
You must be signed in to change notification settings - Fork 444
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: buffered linear interpolator jitter and exposing more properties #3355
Open
NoelStephensUnity
wants to merge
40
commits into
develop-2.0.0
Choose a base branch
from
fix/bufferedlinearinterpolator-jitter
base: develop-2.0.0
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
fix: buffered linear interpolator jitter and exposing more properties #3355
NoelStephensUnity
wants to merge
40
commits into
develop-2.0.0
from
fix/bufferedlinearinterpolator-jitter
+846
−229
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- Removed the lerp smoothing parameter and made it an internal bool (don't need to add to API and it should be set through the NetworkTransform anyway). - Added additional BufferedLinearInterpolator debug code. - Added additional PreUpdate pass for NetworkTransforms using Rigidbody motion in order to reset a fixed time delta. - Added incemental fixed time delta when the FixedUpdate is invoked multiple times within a single frame. - Added internal time sync counter. - Added a "1/3rd" rule to smooth dampening and LerpExtrapolateBlend when smooth lerp is enabled in order to still be able to balance between smoothing the final lerped value and reaching the target (or getting much closer).
Some adjustments to handle coming to a stop and to no longer clamp the timespan between state updates for LerpExtrapolateBlend and SmoothDampening. Adding fixed delta to server time (if it is of any value then multiple fixed updates have run within a single frame). Updated XML API documentation (again).
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 theBufferedLinearInterpolator<T>
that were not completely exposed.Various options:
NetworkTransform.InterpolationBufferTickOffset
) used depending upon context.This PR adds a 3rd interpolator type:
LerpExtrapolateBlend
Lerp, Extrapolate, and Blend
Uses a 3 to 5 phase lerp towards the target, extrapolate towards the target, blend the two results, and (optionally) smooth the final value.
InterpolationBufferTickOffset
. The sum is multiplied by the tick frequency (one over tick rate).LerpExtrapolateBlend
andSmoothDampening
have an additional interplation pass during smooth lerping that interpolates 1/3rd towards the target and then smooths the result of that based on theMaximumInterpolationTime
divided into the delta time.Changelog
LerpExtrapolateBlend
interpolation type that provides users with something between standard lerp and smooth dampening.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.Testing and Documentation
NetworkTransform
. (Will be adding to PR-1443)