five-on-it / packages/catalogue/src/region/ground
packages/catalogue/src/region/ground
What colour a region's ground is where nothing else decides it, for its rich details and its landuse areas (terrain.ts asks for each triangle):
- Rich ground (richTone): the biome's tones (
tiles.json'stones) spread by seeded value noise (valueNoise) at three scales: wide drifts of moister and drier grass (grassDark,grass,grass2), dry patches where it is driest, bare earth in small patches, and flowers (accent) here and there; its rock in two tones. - Landuse (landuseTone): an area's paint (
tiles.json'slanduse, colours of itsgrounds) in its pattern:fields(strips of crops, each length its own crop),rows(bands that alternate, a vineyard's),fill,patches(two colours by noise),paths(a lawn crossed by two paths) andplots(beds between paths).
Everything is a pure function of the point, the seed and the area, so the mesh is the same wherever it is built. The patterns' bands line up with the ground's 4 m grid.