Table of Contents

Namespace Shard.Gameplay.Universe.World.Chunks.Palettes

Classes

BitFieldArray

A packed array of length fixed-width unsigned indices, bits each, laid out LSB-first across a byte stream (Java: BitFieldArr). Index i's low bit sits at bit (ibits) % 8 of byte (ibits) / 8; a value that straddles a byte boundary spills its remaining high bits into the next byte starting at bit 0. Backing size is ceil(length*bits / 8) bytes.

ColumnBytePalette

A per-column palette of one value per (x,z) cell over a 32×32 column (Java: IntBytePalette for tints, ShortBytePalette for heights). Distinct values are interned into a key table and each of the 1024 cells stores a 10-bit index into it (via BitFieldArray). Cell 0 defaults to key 0.

The wire format is [u16 count][count × key][i32 packedByteLength][packed indices], little-endian, with no leading type byte — height and tint are told apart by their position in SetColumn. The key width is the only difference between the two: SerializeShortKeys() (heights) vs SerializeIntKeys() (tints).