Skip to content

five-on-it / packages/net-client/src/predictor / AGREEMENT

Variable: AGREEMENT ​

const AGREEMENT: 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 ​

readonly landing: 0.01 = 0.01

meter ​

readonly meter: number

position ​

readonly position: 0.002 = 0.002

rotation ​

readonly rotation: 0.0001 = 1e-4

spin ​

readonly spin: 0.01 = 0.01

steer ​

readonly steer: number

velocity ​

readonly velocity: 0.02 = 0.02