Orrery Terrain · OrreryTerrainCore module · function
Native::
ScatterKey
ExperimentalThe key of candidate Index.
Declaration
uint64_t ScatterKey(uint64_t WorldSeed, uint64_t VarietySeed, int32_t TileX, int32_t TileY, int32_t SubCell, uint32_t Index);- Header
#include "Native/TerrainScatter.h"- Module
PublicDependencyModuleNames.Add("OrreryTerrainCore");in your module’s Build.cs.- Stability
- Experimental: supported, may change in a minor version, with a changelog line.
- Thread
- Tier 1: plain C++, no allocation, deterministic in canonical order (ascending candidate index), any thread. (the header’s rule)
Description
With SplitMix64 S and M(h, v) = S(h ^ S(v)): K = M(B, Index), where the sub-cell's base B = M(M(M(S(WorldSeed ^ D), VarietySeed), uint32 TileX | uint32 TileY << 32), SubCell) and D = 0x6772617373763031 ("grassv01" in ASCII). The candidate's streams (keep, thin, yaw, scales, grid jitter) are S(K ^ s × 0xD1B54A32D192ED03) >> 40, s = 1..8, as floats in [0, 1) of 2^-24 steps; the Halton index offset and Cranley-Patterson shift come from B. Integer maths only: the same bytes on every machine.
Parameters
| Name | Type | Default | Meaning |
|---|---|---|---|
WorldSeed | uint64_ | — | — |
VarietySeed | uint64_ | — | — |
TileX | int32_ | — | — |
TileY | int32_ | — | — |
SubCell | int32_ | — | — |
Index | uint32_ | — | — |