UNET Network Transform Component lags

I’m using the Unity 5.1.1 UNET network transform component for a multiplayer game. Movement is done by using the rigidbody2d component. However, even on clients running locally (=connected to “localhost”) there is way too much lag between server and client.

You can use the following demonstration project for unity to reproduce my problem.

Simply open the ControlBox2D.unity file in the Unity editor. Build the scene twice, start one as host and one as client. On the client window, press “s” to make your coinbox jump. On the host, press “s” to make your coinbox jump together with the client’s coinbox on top of it. Notice the input lag on the client side.

The jump is done by adding a force to the object’s rigidbody2d.

On the Cube2D prefab (it’s located in “Assets/Scenes”) you can check the settings of the Network Transform Component. It is set to sync it’s Rigidbody2D. Using syncmode “transform” would produce very jittered movements.
Next, check the Network Identity Component. It is not set to “local player authoraty”, as this would not allow the coinbox below to jump. The coinbox above it would refuse to move it’s position if set to “local player authority”.

Now on the Cube2D prefab, activate the option “Client Side Prediction”. This should reduce input lag on the client by adding the force on the server and on the client. However, all I’m experiencing is jittered movement.

For testing purposes, I deactivated the network transform component and activated the option “ClientSidePrediction”. This way, I bypassed the network transform component and only relied on rigidbody actions being correctly sent over the “network”. Due to scripting, it only works when pressing jump on the client! Interestingly, I cannot observe any input lag neither on the server nor on the client and the movement is completely smooth.

So my questions are:

1.) Why does the Unity Network manual recommend to use “local player authority” when it obviously breaks the physics system for all clients?

2.) Why does the UNET network transform component introduce that much lagging by default even when connected through localhost?

3.) What is the best workflow for making the rigidbodies sync smoothly in multiplayer games without adding any artificial latency on top of the internet latency? Should I avoid the UNET network transform component for a multiplayer game with physics based movement or am I using it the wrong way?

ok I seem to get a pretty good sync if I set the send rate to 29 and make the snap very high while keeping the movement threshold and the interpolation low. However it still seems very in accurate in intense quick combat situations.

If only using the command functions to sync, sometime server and client will accumulate very small offsets to a very big one, especially when the game is large and need a lot of physics…