Networking · const
INPUT_HEADER_BYTES
Header bytes before an input run's payloads: kind, participant, first tick, count, stride.
Explained in Networking and rollback.
const INPUT_HEADER_BYTES: numberimport { INPUT_HEADER_BYTES } from '@driftengine/network';In depth
An input message carries a run of consecutive ticks, and a run of one is the degenerate case. That is not generality for its own sake — it is what makes lockstep survive a lossy link. An input is only useful for the tick it names, so retransmitting a lost one after a round trip delivers it too late to use; sending the last few inputs in every packet covers a loss before anybody notices, and costs a handful of bytes on a message that already has a header. A test at 15% loss is what turned this from a nicety into a requirement: without it a dropped input is lost for good and that peer's world is permanently wrong.