Ground.module
README.md
Ground
The forest's land, as pure functions of a seed: Ground.site(opts) builds a Site from size, seed, relief and an optional meandering stream (banks, a carved channel, a monotonically-falling water level), footpath and clearings, and the site answers height, terrain surface (forest floor, leaf litter, moss, dirt, wet mud, stream bed, long/short grass), footstep surface (leaves, moss, mud, path, grass, water), distance to the stream or the path, and whether a point sits inside the walkable square. Two sites built from the same options always agree, everywhere (see tests/forestKit.testSuite).
local Ground = require("~.Ground")
local site = Ground.site({ size = 160, seed = 21, stream = true, path = Route.path(2) })
site:height(x, z); site:surface(x, z); site:footSurface(x, z); site:stream(x, z); site:water(x, z)
Ground.setActive(site) / Ground.active() / Ground.surfaceAt(x, z) / Ground.streamDistance(x, z) let code elsewhere (forestKit's Footsteps, the showcase's route check) answer for "the forest that's live right now" without passing a site around. Ground.terrainSource(site) gives ForestBuilder the TerrainStream layer/height source; Ground.layers() names the terrain layer textures, found on disk from whichever installed ground-material collection provides them, so nothing here resolves a computed asset name on the gameplay path.