Jitter fixed


The jitter of networked characters should be fixed.

Whenever networked movement is involved, de-synchronization is inevitable. For this reason position corrections of various sizes are common.

Usually the default character movement component would smooth out the corrections so that the error is invisible to the players, as long as the correction is small and frequent this usually works.

What hasn't worked is the position corrections in this game, visible character jitter used to be a frequent occurance. The characters were literally shaking.

After throwing various objects at the wall we managed to find what stuck.

Whenever a correction occurs the character is immediately snapped to where it should be, but the mesh receives the negative transform so as to remain in place. However the correction error is measured in the global coordinate system whereas the mesh offset is measured in a local coordinate system. Long story short, this only works when the scale is 1. If the scale is below 1 the mesh offset will undercorrect, a scale above 1 means an overcorrection.

Smoothing code should now take character scale in account and as a result position corrections should appear smooth during good network conditions. Of course this will likely break down during adverse networking conditions but overall the result should be acceptable.

Get Kitsune no Kenshi 2

Buy Now$3.00 USD or more

Leave a comment

Log in with itch.io to leave a comment.