True Lag Compensation on CSP #937
VitIhn
started this conversation in
Feature Request
Replies: 1 comment
-
I believe I'm experiencing something similar in my project - running CSP on the same machine is resulting in the server running inputs from several ticks in the past, which is messing with my Lag Compensation as well as my State Prediction. It seems that setting I agree that an estimate should be exposed in some way, if possible. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I was running the CSP on the same machine and I still found that my server is running client-sent replicates several ticks behind.
(FishNet 4.6.9 Pro)
After debugging, I found the culprit:
Client has a queue of reconciles equal to:
So, assuming
stateInterpolation
=1 andIsAppendedStateOrder
(simple example), we would have 4 elements in reconcile queue.As such, he will have 5 elements in his replicateQueue: since he always runs reconcile 4 ticks behind => means he always predicts 5 ticks from the last Reconcile.
In result, client is going to call
Replicate_SendAuthoritative
with thereplicatesHistory.Count
= 5.In the same time, he will have
RedundancyCount
= 2 ( since it isstateInterpolation
+ 1)as such, offset in
Replicate_SendAuthoritative
inNetworkBehaviour.Prediction
going to be = 3:since
historyCount
= 5 (replicatesHistory.Count
) andpastInputs
= 2 (RedundancyCount
)With that in mind, client will always send his replicates with the lag of 3 Ticks; even though latency is essentially zero.
So, if one wants to do Lag Compensation on server with respect to replicates, one needs to further adjust for 3 ticks, even though TimeManager going to tell you that there's no latency between the client and server.
Note that if IsAppendedStateOrder = false, there should be no lag, I believe.
**Now, here's the feature request:
offset
value on the server and client (should be easy, as it is deterministic with respect to stateInterpolation and IsAppendedStateOrder) and have it available as a field to be used in the lag compensation for the client and server**I could estimate it myself, but I will have to rely on this logic being the same in the future versions of FishNet.
Beta Was this translation helpful? Give feedback.
All reactions