The values every format encodes

August 13, 2026 · View on GitHub

All four encoders in this directory encode exactly these values. If you change one, change them all, or the comparison is meaningless.

fieldvaluenote
ship_typeDestroyerordinal 4 of None,Fighter,Corvette,Bomber,Destroyer,Carrier
position.x1234567bound ±8388608 (MaxWorldMeters * PositionUnits)
position.y-2345678
position.z3456789
rotation.x100bound ±1024 (RotationUnits)
rotation.y-200
rotation.z300
rotation.w400
linear_velocity.x12345bound ±2097152 (MaxSpeedMeters * VelocityUnits)
linear_velocity.y-23456
linear_velocity.z34567
has_flagstruethe branch is taken — the worst case for schema
flagsBoosting | Aimingbits 1 and 3, value 10
teamBlueordinal 2 of None,Red,Blue
health750bound [0, 1000]
thrust42bound [0, 100]

Two deliberate choices, both of which cost schema bytes rather than saving them:

  • has_flags is true. The untaken branch would cost schema zero bits for flags and make its number smaller. Taking the branch measures the longest wire path, which is also what the compiler's own ShipCreateMaxBits = 219 describes.
  • Values are large and non-zero. Protobuf varints and Cap'n Proto's packing both shrink on small or zero values. Encoding zeroes would have flattered schema considerably — a zeroed message packs to almost nothing in Cap'n Proto. These are realistic mid-range gameplay values.