benilla-re systems structs docs

s_radiusToChunks

global · terrain

Address
0x810354 · 4 bytes, up to 0x810357
Type
float
Meaning
Holds 0.24, the factor from a search radius in yards to chunks
Confidence
verified, proof one
Finding
terrain/liquidpass#nearest-liquid-cells

Finding: Nearest liquid cells in terrain: liquid passes

0x68af10 finds, for a point, the nearest liquid cell of each type among the areas near it, and 0x68b0d0 does it inside one area. The point maps to an area index (((17066.666 − p) × 0.24 − 0.5) rounded, >> 7, 64 × 64 areas); the search takes the 3 × 3 areas around it, skipping empty ones and those whose box misses the radius sphere. In an area it takes ceil(radius × 0.24) chunks either side (clamped to 16 × 16) and keeps, per type, the cell of the chunks' four slots (flag nibble not 0xf) nearest the point, at its corner and the slot's middle height, as an offset.

The derivation is in the doc.