Skip to content

Terrain height and node storage

AnvilTerrainApplies toRR

The open world’s ground has two representations: a whole-world FloorHeightData grid and detailed TNLChunk tiles addressed by TerrainNodeLayer. The detailed tiles include heights, colour, material IDs and other terrain rasters. Observed

The USNAT floor grid is 8192×8192 cells at 2 metres per cell, covering x and y from −8192 to +8192 metres. Its 4,194,304 blocks each encode 4×4 height words. Both stored FloorHeightData bodies, including WhiteRoom’s empty one, close exactly with the grammar below. Proven · all two bodies and USNAT block count

FloorHeightData bodyvariable44% known
ProvenObservedSourcedInferredUnknownNot described
OffsetSizeTypeFieldConfidenceNotes
0x04bytesstored headerUnknown01 00 00 00 in both bodies
0x44f32cell side in metresObserved2 in USNAT; 0 in the empty WhiteRoom grid
0x81u8stored byteUnknown0 in both bodies
0x98 × block countFloorBlock[]blocksProven
body length - 5151bytestrailerObserved
Floor height block8 bytes100% known
ProvenObservedSourcedInferredUnknownNot described
OffsetSizeTypeFieldConfidenceNotes
0x02u16low endpointObserved
0x22u16high endpointObserved
0x44u32sixteen two-bit indicesObservedcell (row,column) uses bits 2*(4*row+column)

The reconstructed word is lo+(hi-lo)*index/3; blocks and cells run row-major with row along y. Every block has lo<=hi. Border continuity discriminates this order from a transposed one. Proven · endpoint ordering Observed · border comparison

The trailer holds zero u32, f32 scale .0618794 (0x3D7D7540), f32 338.86, float3 origin (−8192,−8192,−3584), zero u32, dimensions 8192,8192, and 15 further bytes. The scale’s interpretation as metres per word agrees within .16% with a robust fit to 20,000 ground-related entities; the vertical offset of about 925–929 metres is a fit, not a stored decoded origin. Observed · trailer and fit Inferred · vertical offset

FloorHeightData trailer51 bytes39% known
ProvenObservedSourcedInferredUnknownNot described
OffsetSizeTypeFieldConfidenceNotes
0x04u32stored wordUnknown0
0x44f32height scaleObserved0.0618794; interpretation supported by the entity fit
0x84f32unnamed floatUnknown338.86
0xC8float2grid XY originObserved-8192, -8192
0x144f32stored Z originUnknown-3584; relation to decoded height unresolved
0x184u32stored wordUnknown0
0x1C8u32[2]cell dimensionsProven8192, 8192 in USNAT
0x2415bytesremaining fieldsUnknown01 01; u32 4; f32 2; 01; u32 1 in USNAT

The layer contains byte 1, u32 count n, n 25-byte items and n repeated as a u32. All 87,381 node positions fill a nine-level quadtree: level L starts at (4^L-1)/3, and its local index is row-major over 2^L columns. Leaf level 8 has 256×256 nodes of 64 metres. Proven · whole layer and all node positions

TerrainNodeLayer item25 bytes48% known
ProvenObservedSourcedInferredUnknownNot described
OffsetSizeTypeFieldConfidenceNotes
0x02u16stored wordUnknownretained without an established meaning
0x210bytesstored prefixUnknownretained without an established meaning
0xC4u32quadtree positionProven
0x101u8stored byteUnknown0 throughout the layer
0x118u64TNLChunk identityProven

A chunk contains byte 1, u32 body length minus 5, u16 0xFEED, u16 tag, nine length-prefixed blocks, two f32 height bounds and a 32-byte material mask. Leaf chunks append a tenth length-prefixed block. The tag’s version is tag&0x3FF = 0x14, flags tag&0x7C00 = 0x1C00, and bit 15 indicates the tenth block. Tags are 0x1C14 internal and 0x9C14 leaf. Proven · all chunk framing

File block Data / runtime destination Confidence
0 Height residuals → 132×132 heights Proven · whole-node decode
1 LZ4 planar BC1 → far colour t17 Observed · decoder and upload
2 Material ID → low byte of t16 Observed · loader and decoded-node checks
3 Region/flags → high byte of t16; low nibble is region Observed · loader and shader
4 Grass weight; constant 0x60 over every node Proven · constant raster census
5 Grass group override; 0xFE means use the material’s group Observed · loader and picker
6 Constant zero, decoded and not copied into the final node Proven · constant census Observed · builder
7 Third channel of t18; coarse nodes force 0xFF where block-3 bit 0x20 is set Observed · loader
8 LZ4 planar BC4 → t19, sampled as an occlusion multiplier Observed · upload and shader
Leaf block 10 Height-coded physics snow depth, subtracted as value/255 metres Observed · 45 decoded leaves and physics reader

Blocks 0 and 2–7 start with a little-endian u32 N. Stream A is bytes 4 through N, and B is the remainder. A uses the H.264 CABAC arithmetic mechanism with range 510, 50 contexts initialized to state 0/MPS 0 and the standard LPS/state tables. B supplies big-endian raw bits. Arithmetic reads may run past the nominal A boundary into B, as in the engine decoder. Proven · all 611,667 coded blocks; raw-bit lengths and independent node invariants

The unpacked runtime image holds the standard H.264 tables in its read-only data, rangeTabLPS at RVA 0x292BDF0 and transIdxLPS at RVA 0x292EF70; the executable on disk contains neither, because its code and data are packed. Observed · runtime image and on-disk executable

Rasters start B with chunk length, palette count and palette bytes. Samples traverse an order-8 Hilbert curve, first step +x, clipped to 132×132. A context-8 decision marks uniform chunks; other samples use unary rank lengths, raw suffix bits and a one-based adaptive symbol list. A rank above one swaps with rank/2. Proven · all six raster blocks of every one of the 87,381 nodes

Heights use unary prefix contexts min(j,15), a raw suffix, v=2^k-1+suffix, and signed reconstruction (v+1)/2 for odd v or -v/2 for even v. Accumulations down the first column, across the first row, vertically for later rows, then horizontally reconstruct the raster. World height is decoded × 5000 × 2^(8-L-20). Observed · engine decoder Proven · all 87,381 nodes’ height-bound and edge checks

All 611,667 coded blocks decode across the detailed quadtree; palettes, material masks, height bounds, raw-bit lengths and four-sample neighbour strips supply independent invariants. Each tile has a 128-sample core and four samples shared with its +x/+y neighbours. Proven · whole-node validation

The BC tiles decompress to 8,712 bytes: 1,089 eight-byte blocks, with all endpoint portions followed by all index portions. Re-interleaving these planes yields ordinary BC1 or BC4 blocks. Both blocks 1 and 8 have the expected decoded size on every one of the 87,381 nodes. Proven · all 174,762 BC tile blocks

The terrain’s physical sample origin is offset by (2,2) in the 132×132 tile; this differs from treating the first stored sample as the visible 128×128 core’s corner. Observed · physics builder and sampled surfaces

Which unresolved floor and terrain fields have runtime meaning?

FloorHeightData’s 338.86, its stored z origin, the eight zero-height cells in the first row, and the exact floor-to-rendered-surface relation remain unresolved. The last eight bytes of coded B streams are not consumed by the inspected node loader or decoder; their producer and purpose are unknown. Unknown