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
* AddMeasurement doesn't sort anymore and relies on consumption to keep track of last item to consume.
It'll also give up interpolating beyond a certain amount of bursted incoming netvar changes.
Fixing endtime vs start time comparison, to make sure we don't have floating point approximation errors
* adding doc
updating burst test to adapt to new behaviour
fixing some algo issue
* Better comments
* making sure buffer will always be the same capacity
Co-authored-by: Matt Walsh <[email protected]>
// | 4 | 5 | 6 | 7 | 8 | --> consume all and teleport to last value <8> --> this is the nuclear option, ideally this example would consume 4 and 5
86
+
// instead of jumping to 8, but since in OnValueChange we don't yet have an updated server time (updated in pre-update) to know which value
87
+
// we should keep and which we should drop, we don't have enough information to do this. Another thing would be to not have the burst in the first place.
88
+
89
+
// Constant absolute value for max buffer count instead of dynamic time based value. This is in case we have very low tick rates, so
90
+
// that we don't have a very small buffer because of this.
@@ -132,9 +184,9 @@ public T Update(float deltaTime)
132
184
if(m_LifetimeConsumedCount>=1)// shouldn't interpolate between default values, let's wait to receive data first, should only interpolate between real measurements
// This situation can happen after a game is paused. When starting to receive again, the server will have sent a bunch of messages in the meantime
219
+
// instead of going through thousands of value updates just to get a big teleport, we're giving up on interpolation and teleporting to the latest value
220
+
if(m_NbItemsReceivedThisFrame>k_BufferCountLimit)
164
221
{
165
-
Debug.LogWarning("Going over buffer size limit while adding new interpolation values, interpolation buffering isn't consuming fast enough, removing oldest value now.");
0 commit comments