settlemaker 3.0.0 → 3.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (55) hide show
  1. package/README.md +162 -277
  2. package/dist/output/geojson-builder.d.ts +1 -1
  3. package/dist/output/geojson-builder.js +1 -1
  4. package/dist/settlemaker.browser.js +1 -1
  5. package/docs/README.md +54 -0
  6. package/docs/api.md +175 -0
  7. package/docs/artwork-integration.md +104 -0
  8. package/docs/current-symbol-library.md +62 -42
  9. package/docs/development.md +102 -0
  10. package/docs/examples/gallery/coastal-city.png +0 -0
  11. package/docs/examples/gallery/coastal-city.svg +4253 -0
  12. package/docs/examples/gallery/coastal-village.png +0 -0
  13. package/docs/examples/gallery/coastal-village.svg +1211 -0
  14. package/docs/examples/gallery/copperline-city.png +0 -0
  15. package/docs/examples/gallery/copperline-city.svg +1139 -0
  16. package/docs/examples/gallery/copperline-village.png +0 -0
  17. package/docs/examples/gallery/copperline-village.svg +2382 -0
  18. package/docs/examples/gallery/desert-city.png +0 -0
  19. package/docs/examples/gallery/desert-city.svg +3509 -0
  20. package/docs/examples/gallery/desert-village.png +0 -0
  21. package/docs/examples/gallery/desert-village.svg +455 -0
  22. package/docs/examples/gallery/fixtures.json +449 -0
  23. package/docs/examples/gallery/temperate-city-night.png +0 -0
  24. package/docs/examples/gallery/temperate-city-night.svg +3511 -0
  25. package/docs/examples/gallery/temperate-city.png +0 -0
  26. package/docs/examples/gallery/temperate-city.svg +3511 -0
  27. package/docs/examples/gallery/temperate-village.png +0 -0
  28. package/docs/examples/gallery/temperate-village.svg +3227 -0
  29. package/docs/examples/gallery/tropical-city.png +0 -0
  30. package/docs/examples/gallery/tropical-city.svg +3508 -0
  31. package/docs/examples/gallery/tropical-village.png +0 -0
  32. package/docs/examples/gallery/tropical-village.svg +3761 -0
  33. package/docs/examples/gallery/tundra-city.png +0 -0
  34. package/docs/examples/gallery/tundra-city.svg +3509 -0
  35. package/docs/examples/gallery/tundra-village.png +0 -0
  36. package/docs/examples/gallery/tundra-village.svg +1549 -0
  37. package/docs/fmg-embed-zoom.md +54 -0
  38. package/docs/gallery.md +139 -0
  39. package/docs/geojson.md +188 -0
  40. package/docs/getting-started.md +157 -0
  41. package/docs/landscape-character-review.md +55 -0
  42. package/docs/releases/3.0.1.md +18 -0
  43. package/docs/scene-schema.md +160 -0
  44. package/docs/schema-v3.md +38 -0
  45. package/docs/skins.md +52 -0
  46. package/docs/test-urls.md +39 -0
  47. package/docs/url-api.md +252 -0
  48. package/docs/water-context-v1.md +384 -0
  49. package/package.json +15 -8
  50. package/scripts/check-docs.mjs +106 -0
  51. package/scripts/generate-copperline.mjs +255 -0
  52. package/scripts/generate-examples.mjs +54 -0
  53. package/scripts/render-copperline.mjs +36 -0
  54. package/src/output/geojson-builder.ts +1 -1
  55. package/symbols/copperline/README.md +10 -3
package/docs/README.md ADDED
@@ -0,0 +1,54 @@
1
+ # SettleMaker documentation
2
+
3
+ These guides describe the 3.0.x npm library. The declarations shipped in `dist/`
4
+ and the corresponding [source](../src/index.ts) are the complete type reference.
5
+
6
+ ## Start here
7
+
8
+ - [Getting started](getting-started.md): install, generate a map, use TypeScript or a browser.
9
+ - [Gallery](gallery.md): current output across five biomes and both planners, plus Copperline.
10
+ - [Library API](api.md): input fields, engine selection, options, errors and reproducibility.
11
+ - [GeoJSON and coordinates](geojson.md): schema 4, local units, IDs, road geometry and tiling.
12
+
13
+ ## Create a setting
14
+
15
+ - [Skin authoring](skins.md): portable JSON, SVG slots, biome inheritance and validation.
16
+ - [Skin JSON schema](skins.schema.json): editor assistance for skin format 1.
17
+ - [Current symbol library](current-symbol-library.md): downloadable collections versus runtime slots.
18
+ - [Artwork integration](artwork-integration.md): how the planners place the current artwork.
19
+ - [Copperline](../symbols/copperline/README.md): a complete example skin for technological settings.
20
+
21
+ ## Integrate an application
22
+
23
+ - [URL adapter contract](url-api.md): compressed inputs and presentation parameters for `/fmg` hosts.
24
+ - [Water context v1](water-context-v1.md): measured village water, precision, precedence and errors.
25
+ - [Scene and rendering](scene-schema.md): city Scene v2, appearance controls and SVG embedding.
26
+ - [Embedding and zoom](fmg-embed-zoom.md): responsive previews and host-owned navigation.
27
+
28
+ ## Maintain the project
29
+
30
+ - [Development](development.md): build, checks, documentation images and release workflow.
31
+ - [Example URLs](test-urls.md): reproducible fixtures for integration checks.
32
+ - [3.0.1](releases/3.0.1.md) and [3.0.0](releases/3.0.0.md) release notes.
33
+
34
+ ## Contract versions
35
+
36
+ | Contract | Current value | Meaning |
37
+ | --- | --- | --- |
38
+ | npm package | 3.0.1 | A specific engine and documentation release. |
39
+ | GeoJSON `metadata.schema_version` | 4 | Output structure; both planners share this number. |
40
+ | City `Scene.version` | 2 | Semantic city scene; villages do not use this scene type. |
41
+ | URL envelope `v` | 1 | Compressed burg input for a URL adapter. |
42
+ | Skin `version` | 1 | Portable artwork and biome definition. |
43
+ | `waterContext.version` | 1 | Measured-water input, supported for villages only. |
44
+
45
+ A shared schema version does not imply identical fields in every engine's feature
46
+ properties. Check the [output reference](geojson.md) before sharing a renderer.
47
+ Cache against the package version, inputs, seed and rendering/skin configuration.
48
+
49
+ ## Historical material
50
+
51
+ [Schema v3](schema-v3.md) records an earlier city-output migration. Files under
52
+ `plans/`, `superpowers/`, and older release notes record design discussions and
53
+ past behaviour; they are not the current API specification. Start from the guides
54
+ above when building a new integration.
package/docs/api.md ADDED
@@ -0,0 +1,175 @@
1
+ # Library API
2
+
3
+ The normal entry point is `generateSettlement(burg, options?)`. It returns
4
+ synchronously and selects the planner by population. Import functions and types
5
+ from `settlemaker`; the published declarations are the complete reference.
6
+
7
+ ## Engine selection
8
+
9
+ | Entry point | Planner | Result |
10
+ | --- | --- | --- |
11
+ | `generateSettlement(burg, options)` | Village at population ≤ `VILLAGE_POP_CEILING` (1,000); city above it | Discriminated result: `kind: 'village'` or `'settlement'`. |
12
+ | `generateFromBurg(burg, options)` | City, regardless of population | City result without a `kind` discriminator. |
13
+ | `generateVillage(burg, seed)` | Village | `VillageModel`; call `renderVillage` and `generateVillageGeoJson` separately. |
14
+
15
+ Use positive populations. The high-level API is typed but is not a complete
16
+ validator of arbitrary input JSON. Validate external data in your application;
17
+ water context and skin definitions have their own explicit validation gates.
18
+
19
+ ## Burg input
20
+
21
+ The name `AzgaarBurgInput` reflects the original integration; you do not need an
22
+ Azgaar map or database to use it.
23
+
24
+ | Field | Type | Contract |
25
+ | --- | --- | --- |
26
+ | `name` | `string` | Required; also used to derive the default seed. |
27
+ | `population` | `number` | Required; selects the planner and drives the building budget. |
28
+ | `port` | `boolean` | Required; requests harbour/jetty infrastructure. Does not supply water. |
29
+ | `citadel` | `boolean` | Required; requests a city citadel. |
30
+ | `walls` | `boolean` | Required; requests fortifications. Village and city wall planners differ. |
31
+ | `plaza` | `boolean` | Required; city plaza request. Villages have their own green planner. |
32
+ | `temple` | `boolean` | Required; requests religious features, interpreted by each planner. |
33
+ | `shanty` | `boolean` | Required; city shanty request. |
34
+ | `capital` | `boolean` | Required; city capital/administrative request. |
35
+ | `biome` | `string` | Optional; terrain and artwork selection, or a named biome from the supplied skin. |
36
+ | `roadBearings` | `RoadBearingInput[]` | Optional; actual external approaches. See [roads](#roads). |
37
+ | `oceanBearing` | `number` | Optional compass bearing for a generated coast when explicit water does not take precedence. |
38
+ | `harbourSize` | `'large'` or `'small'` | Optional city harbour scale, used with `port: true`. |
39
+ | `urbanDensity` | `number` | Optional positive occupancy input; alters the population/building budget. |
40
+ | `coreCapacity` | `number` | Optional city core-population input; default 10,000. It is a planning input, not a certified housed population. |
41
+ | `coastlineGeometry` | `{x, y}[][]` | Optional filled water polygons; **village metres or city mesh units**, never lon/lat. |
42
+ | `rivers` | `{centreline, widthM, meander?}[]` | Optional village river surveys in metres. City generation does not use this field. |
43
+ | `waterContext` | `WaterContextV1` | Optional measured/unknown-unit water mode; supported for villages only. |
44
+ | `trade` | `boolean` | Optional city trade-centre/market request. |
45
+ | `culture`, `elevation`, `temperature` | `string`, `number`, `number` | Accepted optional source metadata. No general culture, elevation or climate simulation is exposed by these fields. |
46
+
47
+ Set all seven required flags explicitly, including `false` values. Flags are
48
+ requests, not a promise that every output contains the feature. Do not infer
49
+ village support for a city feature merely because the input interface is shared.
50
+ In particular, villages do not use city wards or the city citadel planner.
51
+
52
+ ## Roads
53
+
54
+ Bearings run clockwise from north: 0 north, 90 east, 180 south, 270 west.
55
+ Each approach can be a number or a record:
56
+
57
+ ```ts
58
+ import type { RoadBearingInput } from 'settlemaker';
59
+
60
+ const roads: RoadBearingInput[] = [
61
+ { bearing_deg: 36, kind: 'royal', route_id: 'r17', through: true },
62
+ { bearing_deg: 209, kind: 'royal', route_id: 'r17', through: true },
63
+ { bearing_deg: 117, kind: 'town', route_id: 'r23', relief: 'valley' },
64
+ { bearing_deg: 281, kind: 'footpath', route_id: 'p4', group: 'trails' },
65
+ ];
66
+ ```
67
+
68
+ Land classes are `royal`, `main`, `market`, `town`, `local`, `trail`, `footpath`.
69
+ Legacy `road`, `foot`, `sea`, and group aliases `roads`, `trails` are also
70
+ accepted. Bare bearings use the default main-road meaning in villages. Cities
71
+ map rich classes to their legacy road/foot/sea categories. Sea records do not
72
+ become village land streets.
73
+
74
+ `through` is a continuation/growth hint; it **never invents another approach**.
75
+ Supply both independently measured sides of a continuing road, with the same
76
+ `route_id`. `group`, `relief` (`flat`, `valley`, `descent`, `ascent`, `ridge`) and
77
+ `followsRiver` provide city growth hints. `followsRiver` does not generate water.
78
+
79
+ `roadBearings: []` explicitly says there are no external approaches. Omitting the
80
+ field also leaves villages without external approaches, but allows the city's
81
+ legacy random-gate fallback. Shared village streets may carry several route IDs;
82
+ input record count is not a promised street count. Road classes can change inside
83
+ a village while approach provenance remains available in GeoJSON.
84
+
85
+ ## Water
86
+
87
+ `coastlineGeometry` describes filled water areas, including rivers and lakes,
88
+ using simple rings with at least three distinct points. Closure is implicit;
89
+ repeating the first point is also accepted. Input rings are combined as filled
90
+ water rather than interpreted as outer/hole pairs. Send banks, not a shoreline
91
+ polyline. Use burg-local x-east/y-south coordinates with the correct engine's units.
92
+
93
+ A nonempty polygon array takes precedence over the legacy `oceanBearing` coast.
94
+ Without `waterContext`, an empty array does not declare a measured dry survey.
95
+ Village `rivers` add channel polygons from at least two centreline points and a
96
+ positive `widthM`. Generated meanders are on by default; `meander: false` preserves
97
+ the surveyed centreline. Do not send the same river in both input fields.
98
+
99
+ For physical distance/coverage guarantees, use [water context v1](water-context-v1.md).
100
+ An empty measured survey suppresses a legacy coast; `unknown-units` reports missing
101
+ scale rather than inventing a survey. A city call with `waterContext` throws
102
+ `WaterContextError`, including a direct `generateFromBurg` call. City polygon units
103
+ must not be guessed from the village metre convention.
104
+
105
+ ## Generation options
106
+
107
+ | Option | Used by | Meaning |
108
+ | --- | --- | --- |
109
+ | `seed` | Both | Explicit numeric seed; otherwise derived from the settlement name. |
110
+ | `skin` | Both | A validated handle from `createSkin`; selects artwork/materials and custom biome inheritance. |
111
+ | `village.pxPerMetre` | Village | SVG display scale; default 4. Model and GeoJSON stay in metres. |
112
+ | `village.theme` | Village | A complete `VillageTheme`; use `villageThemeFor` to start from a preset. |
113
+ | `svg.palette` | City | A `PALETTES` entry. |
114
+ | `svg.theme` | City | Partial `RenderTheme` overrides. |
115
+ | `svg.assetSet` | City | Explicit low-level artwork set; overrides skin artwork. |
116
+ | `svg.symbols` | City | Defaults true; false hides placed symbols/marks and exposes building polygons. Vegetation remains. |
117
+ | `svg.padding` | City | Bounds padding in local units; default 20. |
118
+ | `svg.clipId` | City | Frame clipping ID. Does not namespace all other SVG IDs. |
119
+ | `svg.skin`, `svg.skinBiome` | City | Lower-level skin selection; prefer the top-level `skin` for shared generation. |
120
+ | `geojson.generatedAt` | City | Override the output timestamp. |
121
+ | `geojson.padding` | City | Bounds padding; match `svg.padding` if you change it. |
122
+ | `geojson.settlemakerVersion` | City | Metadata override for specialised consumers; normally leave it alone. |
123
+
124
+ Options are grouped by renderer, but the TypeScript signature does **not** infer
125
+ an engine from the numeric population. City options are ignored on the village
126
+ branch and village options on the city branch. `svg.shift` is a low-level
127
+ rendering option; `generateFromBurg` calculates and supplies its own coastal
128
+ shift, so callers should use the returned `originShift` for subsequent renders.
129
+
130
+ Available city palette keys are `default`, `classic`, `parchment`, `blueprint`,
131
+ `bw`, `ink`, `night`, `ancient`, `colour`, `simple`. Palette controls affect the
132
+ city renderer's exposed styling; native artwork also carries material tokens.
133
+ Use a skin when you need control across both planners and the full artwork set.
134
+
135
+ The five named village themes are `temperate`, `desert`, `tundra`, `tropical`,
136
+ `coastal`. Changing `village.theme` changes appearance without selecting a new
137
+ building deck. Changing the input biome can change layout. Skin bases also accept
138
+ `steppe`; it is not a sixth standalone village theme or downloadable collection.
139
+
140
+ ## Results and diagnostics
141
+
142
+ `svg`, `geojson`, `model`, `degradedFlags` and `originShift` are present on both
143
+ high-level branches. Narrow `result.kind` before using planner-specific model fields.
144
+ `waterContextResult` is optional and belongs to the measured village-water path.
145
+
146
+ City `degradedFlags` reports dropped `walls`/`citadel` requests. Villages return
147
+ `[]`; that is not a guarantee that every supplied city-oriented flag was honoured.
148
+ City `metadata.building_capacity` reports the ordinary-building target, placement
149
+ and any shortfall. Village `metadata.diagnostics` reports its own planner diagnostics.
150
+ See [GeoJSON](geojson.md) before treating building counts as population accounting.
151
+
152
+ Fatal measured-water errors throw `WaterContextError`, whose
153
+ `waterContextResult` contains the issue code and any required survey radius.
154
+ Other generation errors should also be surfaced by your application rather than
155
+ replaced with a successful-looking empty map.
156
+
157
+ ## Reproducibility and versioning
158
+
159
+ Keep the full input, resolved seed, package version, options and skin definition.
160
+ Seeded geometry and SVG output are deterministic within that configuration and
161
+ version. GeoJSON's `generated_at` timestamp is deliberately time-dependent.
162
+ Feature IDs are deterministic within a build, not permanent IDs across upgrades.
163
+ The city's generation hash and the village's literal `'village'` metadata value
164
+ are not substitutes for recording the package version and skin configuration.
165
+
166
+ ## Lower-level entry points
167
+
168
+ - `mapToGenerationParams`, `Model`, `buildScene`, `assembleSvg`, `generateSvg`,
169
+ `generateGeoJson`: [city scene and rendering](scene-schema.md).
170
+ - `generateVillage`, `renderVillage`, `generateVillageGeoJson`: village stages.
171
+ - `createSkin`, `skinBiomeFor`, `SKIN_SLOTS`, `SKIN_TOKENS`: [skin authoring](skins.md).
172
+ - `encodeBurgParam`, `decodeBurgParam`, `encodeJsonParam`, `decodeJsonParam`,
173
+ `parseSettlementUrl`: [URL integration](url-api.md).
174
+ - `parseSvgViewBox`, `declaredMetersPerUnit`, `computeTileInfo`, `cropSvgToTile`,
175
+ `enumerateTiles`, `totalTileCount`: [tiling](geojson.md#tiling).
@@ -0,0 +1,104 @@
1
+ # Integrated settlement artwork
2
+
3
+ In 3.0.x, `generateSettlement` uses the reviewed city, village, landscape and shared
4
+ infrastructure libraries by default. The village/city population routing remains
5
+ unchanged. No feature flag or asset download is required.
6
+
7
+ See the [current gallery](gallery.md) for output from both planners, the
8
+ [collection catalogue](current-symbol-library.md) for source drawings, and the
9
+ [skin guide](skins.md) for replacing their appearance in your own setting. This
10
+ page describes placement behaviour; it is not a requirement to edit generator
11
+ code when creating a skin.
12
+
13
+ ## Runtime contract
14
+
15
+ - Villages retain their dwelling decks, detached forms, landmark sites and
16
+ per-building identities. Updated rural SVGs replace the old bodies under the
17
+ same IDs. Placement, collision and exported building bounds use freshly
18
+ measured roof and porch extents rather than generic house/hut ratios.
19
+ - Cities fit native urban buildings to existing surveyed lots. The fitter uses
20
+ guarded ink measurements and preserves the building polygon/GeoJSON identity.
21
+ Central housing has one seeded row-house family, with five restrained biome roof
22
+ tones. Demand favours the centre; outer roofs sit in progressively larger gardens
23
+ and mix detached rural houses with urban forms. Parks scale with neighbourhood
24
+ count. Gardens are also exported as `layer: green`, `kind: garden` polygons. Actual POI assignments select
25
+ inns, shops, workshops, bathhouses, guildhalls and warehouses. The principal
26
+ religious form varies independently of biome. Castle keeps/barracks and capital
27
+ administrative halls/wings use the dedicated kits. Court-bearing forms scale
28
+ uniformly and their holes stay transparent. Unsuitable lots retain their real
29
+ polygon, coloured to match the city's roof palette.
30
+ - Multi-building terrace and complete compound presets are available in the
31
+ artwork registry/catalogue but are not substituted for individual household
32
+ lots. Compound planning must retain constituent identities and real capacities;
33
+ this integration does not invent households to fill an aggregate illustration.
34
+ - Vegetation uses native seeded variants, with separate metre footprints for
35
+ trees, shrubs and low plants. Tundra defaults to low vegetation, including snow
36
+ variants; treeline trees are not scattered across open tundra. Wet-margin
37
+ options require nearby water. Mangroves and geographically restricted cacti
38
+ remain explicit library options rather than indiscriminate default scatter.
39
+ Flora casts no ground shadows, and village clearance accounts for crown size.
40
+ Broad crown highlights have no internal outlines; conifer tiers share a light
41
+ outer contour. Seeded stands group dominant species over roughly 48 metres,
42
+ with local understory and individual saved variants in both engines.
43
+ - Both engines fill their **actual field polygons** with native seamless tiles;
44
+ no rectangular preset is stretched across a planner's parcel. Texture pitch
45
+ is independent of parcel dimensions and crop angle lives on the pattern.
46
+ Cultivated parcels gain headlands and access strips. Desert irrigation uses
47
+ a local well/cistern and narrow channels. Tropical paddies use muted shallow
48
+ flooded beds with earth bunds, and are selected only when a river is supplied;
49
+ coastlines alone do not enable them. Other tropical crops use dry ground.
50
+ This is not a groundwater-yield or hydraulic simulation. Tundra ground remains
51
+ natural grazing/lichen/sedge, with no default arable fields or fringe gardens.
52
+ - City walls follow existing arbitrary polylines, with actual gate gaps and
53
+ native towers. Walled villages enclose measured roof/porch extents with a
54
+ 3.5-metre rear clearance, including intersecting reserved henge clearings.
55
+ Gates are cut where roads cross that enclosure. Wet wall segments are omitted.
56
+ Village walls and gates are included in GeoJSON.
57
+ - Greens use biome-specific turf, sand or moss colours, a single soft earth
58
+ edge and sparse botanical marks. Village shapes and junction outlines keep
59
+ their surveyed geometry; city gardens and parks use actual parcel boundaries.
60
+ The 60 standalone variants are in `symbols/greens/`.
61
+ - Bridges use planned river crossings. Village decks follow the existing
62
+ surveyed centreline and width. City scenes publish additive `layers.bridges`
63
+ records for bounded wet road runs between two dry banks; roads terminating in
64
+ open water do not produce a bridge. Ordinary city roads are masked off water.
65
+ Deck width remains independent of span; very short sections crop the detail.
66
+ - The existing stone-circle POI now selects a biome-native henge form and saved
67
+ variation, preserving the POI kind and its placement clearances.
68
+
69
+ Older version-2 scenes remain readable: field `glyph`, wall `material` and
70
+ `layers.bridges` and symbol `materialVariant` are additive optional properties. The original `REFINED_SET`
71
+ and `SCHEMATIC_SET` remain explicit rendering alternatives. The default is
72
+ `SETTLEMENT_SET`. `symbols: false` still exposes real city building polygons.
73
+
74
+ ## Source and regeneration
75
+
76
+ `src/assets/artwork.ts` is the shared registry. `scripts/build-runtime-art.mjs`
77
+ compiles reviewed source drawings, metadata and measured bounds. Authored village
78
+ and city building SVGs are embedded; procedural flora, fields and henges are
79
+ generated and cached only when requested, using the same pure functions as the
80
+ review galleries. The generated modules have no filesystem, DOM or Node dependency.
81
+
82
+ ```sh
83
+ # Regenerate the landscape and green sources:
84
+ node scripts/build-landscape-symbols.mjs
85
+ node scripts/build-green-symbols.mjs
86
+
87
+ # Compile reviewed drawings into the runtime:
88
+ npm run build:art
89
+ npm run build
90
+ npm run build:lib
91
+
92
+ # Public-API outputs: five biomes, large cities, river crossings and paddies:
93
+ npm run review:art
94
+ ```
95
+
96
+ The review writes SVGs, PNGs, GeoJSON, generation counts and a local gallery to
97
+ `output/art-integration/`. It calls the public generator; it does not assemble
98
+ separate demonstration scenes.
99
+
100
+ The artwork integration tests cover native lookup, scale differences, POI
101
+ coherence, seams/footprints through the existing asset checks, a closing-vertex
102
+ wall gate, village wall exports, bounded river crossings and henge selection.
103
+ Existing population, street, collision, deterministic scene and GeoJSON tests
104
+ remain part of the regression suite.
@@ -1,44 +1,64 @@
1
1
  # Current symbol library
2
2
 
3
- The downloadable library contains 852 drawings in six collections:
4
-
5
- | Collection | Drawings | Manifest |
6
- | --- | ---: | --- |
7
- | Village | 49 | `symbols/village/symbols.json` |
8
- | City | 170 | `symbols/city/symbols.json` |
9
- | Infrastructure | 165 | `symbols/infrastructure/symbols.json` |
10
- | Landscape | 372 | `symbols/landscape/symbols.json` |
11
- | Greens | 60 | `symbols/greens/symbols.json` |
12
- | Markers | 36 | `symbols/markers/markers.json` |
13
-
14
- Counts exclude structure silhouettes and combined sprites. Every declared drawing
15
- has a standalone SVG. Markers live directly in their collection directory; the
16
- other collections use `individual/`. View boxes vary: consumers must preserve
17
- aspect ratio rather than assume every drawing is a 64-unit square.
18
-
19
- The `symbols/batch001` and `symbols/refined` directories and their source extraction
20
- scripts have been retired. Village authoring now reads independent placement
21
- metadata from `scripts/art/village-footprints.json`; it no longer needs an older
22
- sprite collection to build. Village review sheets and their PNGs show only current
23
- art. Greens have a combined `catalogue.svg` review sheet.
24
-
25
- The existing embedded compatibility exports in `src/assets` remain available to
26
- API consumers and supply shared placement metadata and remaining common map
27
- primitives. They are not a downloadable collection or a source for the web gallery.
28
- Current runtime art continues to come from `scripts/build-runtime-art.mjs` and the
29
- procedural authoring modules. This change does not remove public rendering APIs.
30
-
31
- Settlemaker-web builds its catalogue from the six manifests in its pinned checkout.
32
- Its Vite plugin emits only allowlisted current drawings, silhouettes, sprites,
33
- manifests, review sheets and licence files; it does not maintain a copied library.
34
- No legacy comparison plates are published. Library and website licences remain
35
- separate from the generator's GPL licence.
36
-
37
- ## Validation
38
-
39
- - Generator suite: 1,414 tests passed after retiring source extraction tests and
40
- adding current-collection/placement checks.
41
- - TypeScript build, script typecheck and browser library bundle passed.
42
- - Marker check: all 36 original types and pin metadata retained; 38 SVG documents
43
- parsed, matching standalone/sprite raster output, 144 small-size renders,
44
- centred unclipped bounds, working gallery links and byte-checked ZIP contents.
3
+ SettleMaker 3.0.x ships six default artwork collections containing **852 drawings**.
4
+ These are the current authoring and download sources, distinct from the runtime
5
+ slots used by the generator and by portable skins.
6
+
7
+ | Collection | Drawings | Contents | Manifest |
8
+ | --- | ---: | --- | --- |
9
+ | Village | 49 | Rural dwellings and village forms | [symbols.json](../symbols/village/symbols.json) |
10
+ | City | 170 | Urban buildings, religious forms and landmark kits | [symbols.json](../symbols/city/symbols.json) |
11
+ | Infrastructure | 165 | Walls, gates, bridges, henges and supporting structures | [symbols.json](../symbols/infrastructure/symbols.json) |
12
+ | Landscape | 372 | Flora, field textures and agricultural forms | [symbols.json](../symbols/landscape/symbols.json) |
13
+ | Greens | 60 | Biome-specific green and ground variants | [symbols.json](../symbols/greens/symbols.json) |
14
+ | Markers | 36 | Map markers, separate from automatic settlement placement | [markers.json](../symbols/markers/markers.json) |
15
+
16
+ Counts exclude structure silhouettes and combined sprites. Every drawing has a
17
+ standalone SVG: markers sit directly in their collection directory; the other
18
+ collections use `individual/`. View boxes vary; preserve their aspect ratios.
19
+ A drawing's presence in a download does not promise the engine automatically
20
+ places it or that a portable skin can add a new placement category.
21
+
22
+ ## Runtime slots and portable skins
23
+
24
+ The public `SKIN_SLOTS` catalogue contains **693 supported runtime slots**,
25
+ including compatibility IDs. It provides each slot's view box, anchor, footprint,
26
+ rotation, z-band and minimum scale. Use it as the exact contract when replacing
27
+ engine artwork. For example, some native field slots use 32-unit art boxes even
28
+ when other authoring assets have larger coordinate systems.
29
+
30
+ ```js
31
+ import { SKIN_SLOTS, SKIN_TOKENS } from 'settlemaker';
32
+ console.log(Object.keys(SKIN_SLOTS).length);
33
+ console.log(SKIN_SLOTS['sm-house']);
34
+ console.log(SKIN_TOKENS);
35
+ ```
36
+
37
+ The current city default is `SETTLEMENT_SET`. Some older exports in `src/assets`
38
+ remain for compatibility and shared placement metadata; they are not additional
39
+ download collections. The retired `symbols/batch001` and `symbols/refined`
40
+ directories are not required for skin authoring or current source generation.
41
+
42
+ [Skin authoring](skins.md) explains inert SVG fragments, tokens, silhouettes,
43
+ partial coverage and inherited biomes. [Artwork integration](artwork-integration.md)
44
+ explains how existing planners select and fit the drawings. The [gallery](gallery.md)
45
+ shows actual public-API output rather than assembled catalogue illustrations.
46
+
47
+ ## Copperline
48
+
49
+ [Copperline](../symbols/copperline/README.md) is a separate, complete example skin.
50
+ It maps 47 original drawings and shared variants across all 693 runtime slots,
51
+ with industrial, steampunk and modern presets. It is not included in the 852
52
+ count for the six default collections.
53
+
54
+ ## Source and licensing
55
+
56
+ Collection authoring lives under `scripts/art/` and the `build-*-symbols.mjs`
57
+ scripts. `scripts/build-runtime-art.mjs` compiles the current reviewed assets and
58
+ placement measurements into browser-safe source modules. See
59
+ [regeneration](artwork-integration.md#source-and-regeneration).
60
+
61
+ The six default collections use [CC BY 4.0 with a rendered-output exception](../symbols/LICENSE),
62
+ with attribution in [CREDITS](../symbols/CREDITS). Copperline uses the repository's
63
+ [GPL-3.0-only license](../LICENSE). The engine's code license and the default
64
+ artwork license are separate; `NOTICE` records the scopes and provenance.
@@ -0,0 +1,102 @@
1
+ # Development and documentation
2
+
3
+ Use a source checkout for development and review commands. The npm tarball contains
4
+ compiled modules, source maps, TypeScript source, build inputs, public docs and
5
+ artwork, but is not a complete clone of the development repository.
6
+
7
+ ## Build
8
+
9
+ ```sh
10
+ git clone https://github.com/barrulus/settlemaker.git
11
+ cd settlemaker
12
+ npm ci
13
+ npm run build
14
+ npm run build:lib
15
+ ```
16
+
17
+ The 3.0.x release checks use Node 24. A Nix flake is available with `nix develop`
18
+ if you prefer that environment; it is optional. No unlisted `tsx` command or
19
+ root-level smoke-test file is required.
20
+
21
+ `build` emits ESM JavaScript, declarations and source maps under `dist`.
22
+ `build:lib` creates the standalone ESM browser bundle. `npm pack` runs `prepack`,
23
+ which removes `dist` before rebuilding both formats so stale files cannot ship.
24
+ `npm run build` alone does not clean an existing output directory.
25
+
26
+ ## Checks
27
+
28
+ ```sh
29
+ npm run build
30
+ npm run typecheck:scripts
31
+ npm test -- --maxWorkers=2 --pool=threads
32
+ npm run docs:check
33
+ ```
34
+
35
+ The thread-pool invocation passed the full release suite without the worker RPC
36
+ reporting timeout encountered in earlier runs with process workers. No assertions
37
+ are disabled by these options. Use focused test files while iterating, then the
38
+ appropriate release checks before publishing.
39
+
40
+ For artwork or geometry changes, use the public-API review tools:
41
+
42
+ ```sh
43
+ npm run review:art
44
+ npm run review:roads
45
+ npm run review:cities
46
+ ```
47
+
48
+ They write local galleries and measurements under ignored `output/` directories.
49
+ The public [artwork integration guide](artwork-integration.md) documents source
50
+ regeneration when SVG authoring changes. Review images as well as measurements.
51
+
52
+ ## Documentation checks
53
+
54
+ ```sh
55
+ npm run docs:images
56
+ npm run docs:check
57
+ ```
58
+
59
+ `docs:images` builds the library and runs `scripts/generate-examples.mjs`. It
60
+ regenerates PNGs and SVGs together, the exact fixture manifest and `docs/gallery.md`.
61
+ All maps use `generateSettlement`; the displayed engine is checked against the
62
+ population. The same script supplies both the README images and the full gallery.
63
+ PNG previews resolve the renderer-provided CSS-variable fallbacks for librsvg.
64
+ Do not hand-replace gallery images with illustrations that bypass the engine.
65
+
66
+ `docs:check` checks current documentation links and anchors, release-pinned README
67
+ image paths, the fixture version and public API examples. It executes the README
68
+ quick start and skin example and typechecks the standalone TypeScript examples.
69
+ It also exercises the current URL/rendering examples and validates their outputs.
70
+ Historical plans and release notes are not treated as current API guidance.
71
+
72
+ Review the gallery at readable size, including the full SVGs. Version-pinned
73
+ absolute README image/documentation links work from npm as well as GitHub; update
74
+ their release tag when publishing the next documentation revision. They should
75
+ point to committed artifacts belonging to that version.
76
+
77
+ ## Package verification
78
+
79
+ ```sh
80
+ npm pack --pack-destination /tmp
81
+ ```
82
+
83
+ Inspect the tarball's file list, then install that exact file in a fresh temporary
84
+ project with production dependencies only. Exercise Node ESM import, CommonJS
85
+ dynamic import, browser bundle import and strict NodeNext TypeScript compilation.
86
+ Generate both a village and a city, with and without a skin. Verify that source
87
+ maps resolve to packaged TypeScript source and that artwork LICENSE/CREDITS ship.
88
+
89
+ ## Release workflow
90
+
91
+ 1. Update `package.json`, lockfile and `SETTLEMAKER_VERSION` together; update the
92
+ metadata assertions and release notes.
93
+ 2. Regenerate documentation if the version or output changes, and run the checks.
94
+ 3. Pack and verify the artifact in an isolated consumer.
95
+ 4. Commit through a PR to protected `master`; tag the merged source.
96
+ 5. Publish the verified tarball, completing npm's authentication when prompted.
97
+ 6. Verify registry version, `latest` tag, integrity and a clean registry install;
98
+ publish the matching GitHub release notes.
99
+
100
+ An npm version is immutable; README changes on npm require a new package version.
101
+ A website consuming this repository or package must update its own pin/dependency
102
+ and deploy separately. An npm release does not deploy `settlemaker.com`.