cBournhonesque / lightyear

A networking library to make multiplayer games for the Bevy game engine
https://cbournhonesque.github.io/lightyear/book
Apache License 2.0
438 stars 45 forks source link

Interpolation looks very choppy on high tick rates #423

Open Serverator opened 4 months ago

Serverator commented 4 months ago

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 set server_tick_interval to 0 in the SharedConfig 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.

cBournhonesque commented 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: