five-on-it / packages/net-client/src/predictor / AGREEMENT
Variable: AGREEMENT
constAGREEMENT:object
Defined in: packages/net-client/src/predictor.ts:133
How far the server's word may lie from the prediction's for the same tick and still be the same state: a position within 2 mm, a velocity within 2 cm/s, a rotation within 1e-4 per component, a spin within 0.01 rad/s (the pose travels whole, as 13 floats of single precision), and the steering, the boost meter, the grips and the landing stun within one step of the byte each travels as (codec.ts: the steering in 127ths, the meter and the grips in 255ths, the stun in hundredths of a second). Both sides step the same world from the same state in single precision, so an agreeing prediction agrees to the last bit and a wrong one is off by centimetres at the least; the margins only cover the wire.
Type Declaration
landing
readonlylanding:0.01=0.01
meter
readonlymeter:number
position
readonlyposition:0.002=0.002
rotation
readonlyrotation:0.0001=1e-4
spin
readonlyspin:0.01=0.01
steer
readonlysteer:number
velocity
readonlyvelocity:0.02=0.02