Muhannes / d7038e

Networked Game
0 stars 0 forks source link

implement Linear Convergence #19

Closed Muhannes closed 6 years ago

Muhannes commented 6 years ago

Currently only supports snapConvergence. This makes the game look "laggy".
It does predictions based on the latest known velocity, but linear convergence is still needed to be nice looking. This could be achieved by calculating a "merge point", such that the movementDirection is pointing to that point, and when it is reached, the real movementDirection is used instead. This way, data is not needed to be sent that often.

TrulsHaraldsson commented 6 years ago

Done. Could however tinker a bit more to make it more optimized or better. There is a little ice-skating effect on the client side because of current implementation walks a fraction of the distance towards the setpoint even though the player is not walking any more.