Lets say we send a snapshot from the server to the clients about world details, containing object positions, velocities etc, every second. We should send only delta-data based on the previous snapshot that was sent.
For example, if the player moved from
(x:50, y:0) to
(x:100, y:0), then the snapshot will only contain
(move_x:50: move_y:0), and the clients will add the previous position and
move_x. We should sending delta values, as it is less data to send.
My objects already have data stored in
TypedArray) and there is no
delta = currentPos - prevPos 20 = 100 - 80
okey, now I have 20 instead of 80, but this isn't less data to send.. still both will be send as Float32.
data.writeFloat32(delta); //for simplesness
there is no Float16 and I am afraid that even if JS will has Float16 TypedArrays, then it still would be not enough, because for example 20.3454356 from Float32 to Float16 will lose precision to lets say sth like 20.34, or I'm wrong?
How to send delta data in JS and gain the benefits of this technique in JS?