five-on-it / packages/catalogue/src/city/plan
packages/catalogue/src/city/plan
The plan of a city: what the city template's solver (solve.ts) makes of a spec, and what Blender builds the level from (assets/blender/levels/city.py, handed the plan as a JSON file by generate.py --plan). Everything is resolved: every road is its final centre line with its cross-section, every district's ground is a map of cells, every park an outline. Blender draws and checks no network; it finds the junctions, the rounded corners and the bridges again from the roads (citygen's own code, shared with the other generators), and builds the ground, the buildings and the dressing.
Every point is in the game's frame, in metres: [x, z], x growing westward (east is −x) and z northward, the map's middle at the origin; heights are the town's, its streets at 0 (the level is lifted as its recipe is written).