Transport.GetBatchThreshold()
.NetworkTransform
receives the server's positions and then interpolates between them. For a smooth interpolation, we need to exactly reconstruct what happened on the server. For that, we need to know when an object has been at a certain position on the server.timestamp
and position
every time:NetworkTransform
component did.float
(or even better, an 8 byte double
for higher precision). When synchronizing large worlds, the bandwidth would add up quickly.NetworkTransform
is only one of many components. Several others might need timestamps too, which would increase bandwidth even further.double
precision timestamp
in every Batch. Instead of including it in every message, we include it once per ~1200 byte batch which is barely noticeable when it comes to bandwidth.NetworkConnection.remoteTimeStamp
.Rpc
/OnDeserialize
/OnMessage
handler was sent by the server via NetworkClient.connection.remoteTimeStamp
.connectionToServer
because only the player owned objects have connections to the server. Instead we use the client's NetworkClient.connection
to server, which is always guaranteed to be there.Cmd
/OnDeserialize
/OnMessage
handler was sent by the client via connectionToClient.remoteTimeStamp
.