Open Serverator opened 4 months ago
Thanks for the report, I can confirm that something weird is going on when server_send_interval = 0
.
In general, the interpolation depends on server_send_interval
and might be broken if you set it to 0.
2 solutions:
You can update the InterpolationConfig
to use a minimum delay instead of a multiple of server_send_interal
, like this:
interpolation: InterpolationConfig {
delay: InterpolationDelay {
min_delay: Duration::from_millis(16),
send_interval_ratio: 0.0,
},
},
For example this applies 1 frame of delay for interpolation and the results look good to me.
When you're sending packets this fast you can also disable interpolation altogether and results look good (but still interpolation might be better in case you have jitter/packet-loss)
Problem
If you set the tick rate above 60Hz, interpolated entities using the default linear interpolation will start to look very laggy, teleporting and freezing in place.
How to reproduce
In the
client_replication
example setserver_tick_interval
to 0 in theSharedConfig
and run the example. Cursor will look choppy to another player.Showcase
https://github.com/cBournhonesque/lightyear/assets/5243255/22b6744b-5389-425c-98ea-d52763f44b44
Workaround
Lowering the tick rate to around 20Hz or below fixes it.