Lag Compensation Misinformation on Docs #721
Jazz23
started this conversation in
Documentation
Replies: 1 comment
-
Tick is a guess as to what the current tick is on the server. If client fires on Tick 100 and it takes 5 ticks to get to the server, the server will then be on ~tick 105. Subtracting 100 from 105 = 5 ticks passed. I'll check into the API being wrong on the docs though, ty! |
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
-
The projectile lag compensation example passes
TimeManager.Tick
into theServerFire
RPC to calculate time passed. I recently tried to implement this in 4.3.7 and theTimeManager.Tick
value is already lag compensated, which results inTimeManager.TimePassed
returning0
.The proper way for the client to send it's current tick at the time of fire would be to follow the guide for rollback raycasting, which sends a
PreciseTick
using the last received packet. The projectile lag compensation example should instead look something likeServerFire(position, direction, base.TimeManager.GetPreciseTick(TickType.LastPacketTick).Tick);
Realistically you would want to send thePreciseTick
as it contains thePercentAsDouble
field for a more accurate time discrepancy measurement.Funny enough, the raycast page in the docs linked above also contains a typo. The syntax
PreciseTick pt = base.TimeManager.GetPreciseTick(base.TimeManager.LastPacketTick);
no longer compiles, and should be replaced withPreciseTick pt = base.TimeManager.GetPreciseTick(TickType.LastPacketTick);
Beta Was this translation helpful? Give feedback.
All reactions