TownLayout.module
This package holds more than this page lists. See all of its files in its world.
README.md
TownLayout
The plan of a castle town as a pure function of its settings, with no engine work: TownLayout.plan({ size, districts, density, seed, keepTiers }, infoOf?) answers a table holding the castle (bailey on the north, moat ring, walls, main south gate, rear east gate, corner towers, keep, hall), the streets (east-west streets the houses front onto, north-south streets, back lanes between plot rows), one plot per house (centre, yaw, frontage, depth, district, kind), the market street, the temple precinct to the south-east, the river down the east side with its arched and plank bridges, the paddy terraces and farm on the east bank, the bamboo groves, and the named stops of a walk (gate, street, market, teaHouse, temple, paddies, bridge, hall). North is +Z, east is +X, the centre is the origin. TownLayout.normalize(o) clamps the settings, and TownLayout.footprint(kind, info) answers a house's width, depth and height from sengokuProps' info or built-in fallbacks. Every number comes from Noise, so the same settings give the same plan everywhere. Called by TownBuilder (planFor, build), TownScatter, TownRender and TownColliders.