regionScatter

function regionScatter
universe/src/scatter.ts:234
regionScatter(surface: SurfaceParameters, region: RegionAddress, slots?: { from: number; to: number }) → readonly ScatterRock[]

The rocks in one region, in slot order.

Pure and deterministic: the same surface and the same region give the same list, whatever else has been generated. Cost is one hash per slot and one field sample per slot that survives the first gate — about six hundred of the thousand on an airless body, and a field sample is the same band stack a heightfield vertex pays for. Measured across the zoo, 2.6 to 5.8 ms a region, of which 38 to 609 slots come back holding a rock.

slots is what makes that affordable, and it is a half-open range rather than a count. Five milliseconds is a third of a frame; a caller streams it a slice at a time and concatenates. The slice boundary changes nothing about the answer — slot 837 is slot 837 whichever call resolves it — so a region assembled over six frames is the region generated in one, which is the property that lets the budget move without moving a rock.

region is expected to be at scatterLevel; nothing enforces it, because a caller asking at another level gets a consistent answer for that level and the only cost of mixing them is drawing a rock twice.

surfaceSurfaceParameters
Undocumented
regionRegionAddress
Undocumented
slots{ from: number; to: number }
Undocumented
Returnsreadonly ScatterRock[]