@bendyline/molen-tooling 0.0.9 → 0.0.11

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 (95) hide show
  1. package/dist/capture/harness.js +261 -240
  2. package/dist/capture/worldgen-preview.js +309 -309
  3. package/dist/cli.mjs +6 -5
  4. package/dist/docs-src/guide/3d-model-assets.md +13 -0
  5. package/dist/docs-src/guide/adaptive-performance.md +5 -2
  6. package/dist/docs-src/guide/aircraft.md +113 -40
  7. package/dist/docs-src/guide/ambient-life.md +100 -11
  8. package/dist/docs-src/guide/audio.md +1 -1
  9. package/dist/docs-src/guide/boats.md +99 -0
  10. package/dist/docs-src/guide/determinism.md +1 -1
  11. package/dist/docs-src/guide/dioramas.md +167 -0
  12. package/dist/docs-src/guide/earth-view.md +241 -3
  13. package/dist/docs-src/guide/entities.md +32 -1
  14. package/dist/docs-src/guide/figures.md +7 -1
  15. package/dist/docs-src/guide/graphics-performance.md +16 -3
  16. package/dist/docs-src/guide/medium-fi.md +15 -6
  17. package/dist/docs-src/guide/regional-world.md +387 -0
  18. package/dist/docs-src/guide/sky.md +3 -2
  19. package/dist/docs-src/guide/surface-rendering.md +4 -1
  20. package/dist/docs-src/guide/vehicle-interiors.md +40 -2
  21. package/dist/docs-src/guide/vehicles.md +121 -19
  22. package/dist/docs-src/guide/weather.md +45 -3
  23. package/dist/docs-src/guide/worldgen.md +15 -1
  24. package/dist/docs-src/llms.txt +7 -4
  25. package/dist/docs-src/schemas/README.md +3 -0
  26. package/dist/docs-src/schemas/archstyle.md +144 -0
  27. package/dist/docs-src/schemas/components.md +1589 -137
  28. package/dist/docs-src/schemas/ecology-atlas.md +236 -0
  29. package/dist/docs-src/schemas/region-atlas.md +6 -0
  30. package/dist/docs-src/schemas/regional-catalog.md +1436 -0
  31. package/dist/docs-src/schemas/scatter.md +110 -4
  32. package/dist/docs-src/schemas/scene.md +6 -3
  33. package/dist/docs-src/schemas/terrain-package.md +41 -0
  34. package/dist/docs-src/schemas/transport-network.md +4 -2
  35. package/dist/docs-src/schemas/wildlife-ranges.md +251 -0
  36. package/dist/docs-src/schemas/worldgen-batch.md +21 -0
  37. package/dist/index.mjs +1 -1
  38. package/dist/{mcp-BbHk4ibu.mjs → mcp-BbxqqnD1.mjs} +3 -2
  39. package/dist/{ops-CErtZh2t.mjs → ops-b4Pag8U-.mjs} +7 -5
  40. package/dist/templates/city-courier/README.md +18 -0
  41. package/dist/templates/city-courier/gen/molen-types.ts +217 -15
  42. package/dist/templates/city-courier/index.html +1 -1
  43. package/dist/templates/city-courier/scripts/molen-scripts.d.ts +219 -17
  44. package/dist/templates/city-courier/src/audio.ts +26 -4
  45. package/dist/templates/city-courier/src/game-shell.css +7 -3
  46. package/dist/templates/city-courier/src/main.ts +25 -3
  47. package/dist/templates/city-courier/src/shared/accessibility.css +325 -0
  48. package/dist/templates/city-courier/src/shared/game-controls.ts +406 -0
  49. package/dist/templates/city-courier/src/shared/game-descriptions.ts +143 -0
  50. package/dist/templates/city-courier/src/shared/playback.ts +146 -0
  51. package/dist/templates/city-courier/src/worker.ts +5 -1
  52. package/dist/templates/cubes/index.html +6 -1
  53. package/dist/templates/cubes/src/main.ts +25 -2
  54. package/dist/templates/cubes/src/shared/accessibility.css +325 -0
  55. package/dist/templates/cubes/src/shared/playback.ts +146 -0
  56. package/dist/templates/cubes/src/vite-env.d.ts +1 -0
  57. package/dist/templates/cubes/src/worker.ts +1 -0
  58. package/dist/templates/data-viz/README.md +4 -0
  59. package/dist/templates/data-viz/index.html +6 -1
  60. package/dist/templates/data-viz/src/main.ts +53 -11
  61. package/dist/templates/data-viz/src/shared/accessibility.css +325 -0
  62. package/dist/templates/data-viz/src/shared/playback.ts +146 -0
  63. package/dist/templates/data-viz/src/vite-env.d.ts +1 -0
  64. package/dist/templates/data-viz/src/worker.ts +1 -0
  65. package/dist/templates/figures-gallery/index.html +6 -1
  66. package/dist/templates/figures-gallery/src/main.ts +21 -2
  67. package/dist/templates/figures-gallery/src/shared/accessibility.css +325 -0
  68. package/dist/templates/figures-gallery/src/shared/playback.ts +146 -0
  69. package/dist/templates/figures-gallery/src/vite-env.d.ts +1 -0
  70. package/dist/templates/figures-gallery/src/worker.ts +1 -0
  71. package/dist/templates/index.json +36 -16
  72. package/dist/templates/skybound/README.md +18 -0
  73. package/dist/templates/skybound/gen/molen-types.ts +217 -15
  74. package/dist/templates/skybound/index.html +1 -1
  75. package/dist/templates/skybound/scripts/molen-scripts.d.ts +219 -17
  76. package/dist/templates/skybound/src/audio.ts +26 -4
  77. package/dist/templates/skybound/src/game-shell.css +7 -3
  78. package/dist/templates/skybound/src/main.ts +25 -3
  79. package/dist/templates/skybound/src/shared/accessibility.css +325 -0
  80. package/dist/templates/skybound/src/shared/game-controls.ts +406 -0
  81. package/dist/templates/skybound/src/shared/game-descriptions.ts +143 -0
  82. package/dist/templates/skybound/src/shared/playback.ts +146 -0
  83. package/dist/templates/skybound/src/worker.ts +1 -1
  84. package/dist/templates/terrain-flyover/README.md +5 -1
  85. package/dist/templates/terrain-flyover/index.html +4 -1
  86. package/dist/templates/terrain-flyover/src/main.ts +40 -39
  87. package/dist/templates/top-down-arena/index.html +6 -1
  88. package/dist/templates/top-down-arena/scripts/molen-scripts.d.ts +219 -17
  89. package/dist/templates/top-down-arena/src/audio.ts +26 -4
  90. package/dist/templates/top-down-arena/src/gen/molen-types.ts +217 -15
  91. package/dist/templates/top-down-arena/src/main.ts +31 -5
  92. package/dist/templates/top-down-arena/src/shared/accessibility.css +325 -0
  93. package/dist/templates/top-down-arena/src/shared/playback.ts +146 -0
  94. package/dist/templates/top-down-arena/src/worker.ts +1 -1
  95. package/package.json +12 -12
@@ -0,0 +1,387 @@
1
+ # Regional plants, wildlife, ground, and ordinary buildings
2
+
3
+ Earth content has three independent regional channels. Ecological geography selects vegetation
4
+ and ground palettes. Architectural geography selects building recipes. Wildlife combines ecology,
5
+ native-country limits, and mapped habitat. They share composable content packs and bounded
6
+ quality settings; plants/buildings use deterministic tile generation, while animals use a
7
+ separate deterministic population and movement loop.
8
+ Mapped land cover, building use, footprints, and measurements remain the local evidence.
9
+
10
+ ## Content and downloads
11
+
12
+ | Pack | Regional content | Role |
13
+ | --- | --- | --- |
14
+ | `molen.ecology` | Ecological atlas, plant presets, habitat profiles | `ecology-atlas`, `regional-catalog` |
15
+ | `molen.wildlife` | Procedural animals, habitat populations, attributed native-country limits | `wildlife-ranges`, `regional-catalog` |
16
+ | `molen.earth` | Architectural region outlines | `atlas` |
17
+ | `molen.worldgen.default` | Architectural profiles, archstyles, shared materials | `regional-catalog`, `stylepack` |
18
+
19
+ `openPacksFromIndex` includes ecology and wildlife among the default Earth pack IDs. Hosts still supply the
20
+ index URL and opened packs; the kernel never fetches data. `loadEarthContent` discovers regional
21
+ catalogs across those packs, validates references, and passes plain documents to the worker.
22
+ An architecture-only catalog works without an ecological atlas. A catalog scoped to a different
23
+ style pack is omitted, so a custom style pack can retain the ecological content.
24
+
25
+ The ecological atlas and catalog total about 169 KB gzip (173 KB as a content pack). Its 264 procedural plant presets need no
26
+ GLB downloads. The architectural atlas is about 313 KB gzip; ordinary regional recipes are small
27
+ JSON files using the default pack's shared material graphs. Authored landmark GLBs continue to
28
+ use the existing geographically sharded, lazy model archives.
29
+
30
+ ## Geographic evidence
31
+
32
+ The ecological atlas derives from [RESOLVE Ecoregions 2017](https://developers.google.com/earth-engine/datasets/catalog/RESOLVE_ECOREGIONS_2017)
33
+ under CC-BY-4.0. It uses a quarter-degree grid with run-length encoded rows. Metadata retains 847
34
+ source entries, including rock and ice; 843 appear in the reduced grid. Small islands use
35
+ intersecting land polygons when a cell center misses land. Four very small source regions fall
36
+ below this resolution. This describes potential habitat, not current vegetation or species
37
+ observations. Actual local land cover controls whether a plant can be placed.
38
+
39
+ Architectural envelopes derive from [Natural Earth 1:50m country outlines](https://www.naturalearthdata.com/downloads/50m-cultural-vectors/50m-admin-0-countries-2/),
40
+ which are [public domain](https://www.naturalearthdata.com/about/terms-of-use/). Exterior rings are
41
+ simplified at 0.02 degrees and coordinates rounded to 0.001 degrees. The shipped atlas groups 241
42
+ country/territory features into 53 broad envelopes, retaining the Pacific Northwest and US
43
+ Southwest subregions. Exact containment wins; an optional nearest-outline fallback fills
44
+ otherwise unclassified coastal gaps within 2.5 km in local world coordinates. These envelopes
45
+ are visual priors, not building-style surveys or a political boundary service.
46
+
47
+ Ecological lookup uses a separate grid, so a national border does not move a forest. Each plant
48
+ candidate and each building centroid resolves its own profile. Ground meshes sample regional
49
+ palettes at vertices, and worker-generated surfaces use the same samples. Uncovered ecological
50
+ cells are visible in generation diagnostics and do not receive invented wild vegetation.
51
+
52
+ Bare and distant terrain receives the same ecological ground palette before detailed map
53
+ surfaces arrive. `createRegionalGroundColor` supplies the terrain stream's optional
54
+ `surfaceColor` callback; it runs before upload for both worker-prepared and local meshes and
55
+ returns linear RGB. An explicit host `style.ground` palette takes precedence in `mountEarthView`.
56
+ Nature-reserve, national-park and protected-area designations retain their protection metadata,
57
+ but do not paint over the physical habitat beneath them. With no mapped physical cover, sparse
58
+ open-ground planting remains a prior, rather than inferred forest or a wildlife-presence claim.
59
+
60
+ ## Composable catalogs
61
+
62
+ `molen/regional-catalog@1` contains `profiles`, `scatters`, optional `plants`, `animals`, `populations`, and exact-version
63
+ `requires`. The `overrides` list names items intentionally replaced from required catalogs.
64
+ Load order has no effect. Missing dependencies, accidental ID collisions, unused overrides,
65
+ missing references, and equal-priority overlapping profiles in the same channel are errors.
66
+
67
+ A profile matches any listed value within a dimension and all specified dimensions together:
68
+ `biomes`, `realms`, `ecoregions`, and architectural atlas `regions`. Higher `priority` wins
69
+ independently for `scatter`, `buildings`, and `wildlife`. A botanical module can refine the vegetation without
70
+ changing buildings; a city architecture module can refine buildings without rearranging plants.
71
+ Architecture catalogs may name `stylePack`, matching the resolved style pack's `name` identity
72
+ (the default is `molen-worldgen-default`, distinct from its content-pack ID).
73
+
74
+ Use the registered schemas through `molen schema get regional-catalog` and
75
+ `molen schema get ecology-atlas`. The low-level API accepts already-loaded data:
76
+
77
+ ```ts
78
+ import {
79
+ createRegionalEnvironment,
80
+ createRegionalLibrary,
81
+ } from '@bendyline/molen-worldgen-earth/kernel';
82
+
83
+ // Validate dependencies and architectural references against the host's resolved pack.
84
+ const library = createRegionalLibrary(catalogs, pack);
85
+ const environment = createRegionalEnvironment(
86
+ { atlas: ecologicalAtlas, catalogs: [...library.catalogs] },
87
+ metersPerUnit,
88
+ architecturalRegionResolver,
89
+ );
90
+ const selection = environment.at(worldX, worldZ);
91
+ ```
92
+
93
+ Pass this environment to the Earth tile adapter/renderer; pass its `docs` to the corresponding
94
+ worker bridge. The worker and renderer must use the same documents. `ModelLibrary` accepts the
95
+ environment's `library.plants` as its fourth constructor argument (including any derived seasonal
96
+ variants). Geometry is cached separately by preset
97
+ and LOD, and released when its last consumer drops it. Content hashes include regional documents;
98
+ placement seeds stay tied to individual scatter IDs/versions rather than unrelated catalogs.
99
+
100
+ ## Plant and building selection
101
+
102
+ The plant families cover broadleaf, conifer, palm, cactus, succulent, bamboo, banana, grass, fern, reed,
103
+ mangrove, deadwood, shrub, thicket, forb, vine, mat, and fallen-wood silhouettes. Habitats combine canopy, understory, ground cover, open land,
104
+ parks, orchards, and wetlands. Regional refinements keep American cacti out of Old World wild
105
+ desert profiles and avoid applying Australian eucalyptus profiles to New Zealand.
106
+
107
+ Each of the 78 plant forms has a base, spreading, and slender preset, available in
108
+ every applicable habitat and crop rule. Optional `shapeSeed` varies branch/frond arrangements,
109
+ crown contours and stem profiles independently of the placement seed. Dimensions, crown height,
110
+ trunk lean and restrained foliage tones also vary; these are visual forms, not additional taxa.
111
+ All 19 procedural families share the existing near/medium/far triangle limits.
112
+
113
+ ### Brush and ground coverage
114
+
115
+ Shrubs and thickets have multiple stems and foliage at several heights. Grass and reed `patch`
116
+ recipes contain five tussocks with seed heads; fern colonies contain three overlapping plants.
117
+ Herb patches, trailing ground vines, low moss/litter mats, fallen trunks and small trees fill the
118
+ space below the canopy. Humid tropical `climber` recipes add vines around their own generated
119
+ trunk and hanging from their branches. They do not attach to arbitrary mapped trees or buildings.
120
+
121
+ Natural forest, wood, scrub and heath receive an `understory` scatter layer. Open grassland and
122
+ savanna receive sparser brush. Cultivated polygons, parks, gardens and residential land do not
123
+ receive wild overgrowth from these rules. Explicit wetland labels permit sedge patches; desert
124
+ profiles retain sparse dry forms and never acquire humid forest plants.
125
+
126
+ The optional clustering `sharedSeed` coordinates broad patches across vegetation layers while
127
+ keeping each rule's placements independent. `detailScale` adds smaller clumps and gaps inside
128
+ those patches. These are deterministic visual density fields, not a simulation of individual
129
+ plants competing for sunlight or measured local occupancy. Low vegetation uses smaller path and
130
+ building clearances than trees; road surfaces, buildings and water remain excluded.
131
+
132
+ Earth tiles reserve `maxUnderstoryInstances` / `maxUnderstoryModels` separately from canopy and
133
+ groundcover. At the finest level, Economy allows 450 brush instances/two models, Balanced
134
+ 1,600/three, and High 2,400/four. One coarser level retains 80/250/400 instances respectively;
135
+ coarser levels omit brush. Existing groundcover instance caps stay at 0/5,000/8,000, with
136
+ 0/five/seven model slots. Economy keeps simplified shrub masses while omitting fine blades and
137
+ litter. These are per-tile limits, not whole-scene frame-rate guarantees.
138
+
139
+ The brush milestone's 234 recipes produce 324 appearances including deciduous seasons. All geometry
140
+ is generated and shared by recipe and LOD; the brush expansion adds about 25 KB to the compressed
141
+ ecology pack and no GLB downloads. Reproduce comparison captures with
142
+ `node content/ecology/source/preview-regions.mjs --brush` and
143
+ `node content/ecology/source/preview-diversity.mjs --brush` in the engine repository.
144
+
145
+ Scatter populations can supply weighted `variants: [{ model, weight }]`. The parent `model`
146
+ is their interchangeable fallback and its `weight` still controls species proportions. Variant
147
+ selection uses an independent random stream, keeping positions, density, crop rows and ordinary
148
+ quality thinning intact. A tile reserves a base form for each retained species before admitting
149
+ extra variants into spare model slots. Unretained forms use that base instead of disappearing;
150
+ Economy and distant views therefore show fewer forms without increasing draw limits. Variant
151
+ recipes must be suitable for the same habitat and placement-scale bounds as their parent.
152
+
153
+ Mapped trees preserve source `species`, `genus`, `leafType`, `height`, and `crownDiameter` when
154
+ available. Exact species names take precedence over genus names; preset `taxa` names match
155
+ case-insensitively. These choose a representative silhouette, not a botanically exact specimen.
156
+ Observed trees may be planted outside their native habitat. Unknown trees use compatible local
157
+ park-tree populations, with the legacy measured broadleaf/conifer form as a fallback. Crown
158
+ width and height scale independently to source measurements.
159
+
160
+ Observed land-cover `crop`, `trees`, and `irrigated` tags survive semantic decoding. Supported
161
+ crop tags select olive, date palm, coconut, oil palm, coffee, tea, banana, rubber, and grapevine
162
+ forms. Untyped orchards use a regional fruit-tree prior. `rows` on a scatter rule specifies
163
+ between-row `spacing`, along-row `interval`, `angle` in degrees, and bounded `jitter`. Rows share
164
+ the global placement grid across tile boundaries and retain nested quality subsets; density can
165
+ thin the grid but cannot overfill it. The default row bearing is an inferred presentation choice,
166
+ not a surveyed field orientation. Crops are confined to mapped cultivated polygons or explicit
167
+ crop tags; bare desert does not imply an irrigated oasis.
168
+
169
+ Scatter rules may require `nearWater: { maxDistance, classes? }`. This gates placement against
170
+ mapped water at the exclusion raster's resolution; it does not infer groundwater or tides.
171
+ Water polygons preserve dry island holes. Mangroves in an ecological coastal envelope require
172
+ nearby mapped water for generic forest/scrub, or mapped wetland/mangrove land cover. Riparian
173
+ populations use mapped river/lake proximity and gentler slopes. Missing water data can therefore
174
+ underpopulate a real habitat instead of planting wetland trees far inland.
175
+
176
+ ## Seasonal appearance
177
+
178
+ `mountEarthView` and `createEarthWorldgen` accept `vegetationMonth: 1..12`. The equivalent low-level
179
+ setting lives in `RegionalEnvironmentDocs` and is passed unchanged to workers and cache keys.
180
+ Omitting it keeps neutral leaf-on appearance. The World Explorer freezes the current UTC month
181
+ for its mount; `?month=1..12` selects a repeatable month and `?month=0` disables the seasonal cycle.
182
+
183
+ Only presets with explicit deciduous `phenology` change. Derived spring and autumn colors and
184
+ bare winter branching keep the same mature dimensions, instance positions, individual variation,
185
+ and placement seeds. The coarse calendar reverses the southern hemisphere and extends dormancy
186
+ at high latitudes. Tropical locations stay leaf-on; evergreen plants do not become bare. This
187
+ does not infer local weather, snow, tropical wet/dry seasons, crop harvest dates, or climate change.
188
+ Remount with another month to change appearance.
189
+
190
+ The ordinary architectural catalog supplies 273 recipes across 13 construction families and seven
191
+ uses: detached homes, attached homes, apartments, commercial, civic, industrial, and farm
192
+ buildings. Mapped use wins over neighborhood inference. Taller measured residential buildings
193
+ select compatible apartment recipes; source footprint, height, and levels still control the
194
+ generated geometry. Named precedents from the 120-entry structure library remain available
195
+ explicitly. Without evidence of age, the ordinary catalog does not randomly assign an iconic
196
+ historic building type to an untyped home.
197
+ Each family/use has three weighted recipes: base, compact facade, and open facade. Stable building
198
+ identity selects their window/bay rhythm, roof weighting, eaves, parapets and supported facade
199
+ details. The facade names do not resize the mapped building. Explicit original recipe IDs remain
200
+ available, and identity-free selection keeps the base recipe.
201
+
202
+ Near-detail ordinary facades include a bounded single, double, or service entrance. The inferred
203
+ entrance fits an eligible exterior wall, reserves a ground-floor window bay, and yields to known
204
+ structural openings, open ground floors, and raised buildings. It is a visual entrance; it does
205
+ not create a traversable opening or claim a surveyed door position. Industrial and farm recipes
206
+ also include high windows and larger service doors.
207
+
208
+ ## Agricultural land use
209
+
210
+ All 36 habitat profiles supply an independent `agriculture` channel, refined by ten worldwide
211
+ agricultural overrides (including the Corn Belt, Cerrado/Pampas and Indus/Gangetic plains). It activates only on
212
+ mapped or retrieved farmland, cropland, orchards, vineyards, plantations and pasture. Climate
213
+ alone never turns natural habitat into a farm. Ordinary farmland receives agricultural
214
+ appearance from the ecology pack without another download.
215
+
216
+ The 22 crop recipes cover maize, soybean, small cereals, rice, cotton, sugarcane, sunflower,
217
+ rapeseed, root vegetables, sorghum; olive, fruit, date, coconut, oil-palm, coffee, tea, banana,
218
+ rubber and grape cultivation; and pasture/fallow surfaces. Ten annual forms each have three
219
+ procedural variants. The complete catalog now has 264 plant recipes and 474 appearances with
220
+ crop stages and deciduous seasons. Several source tags share a visual recipe: wheat, barley
221
+ and rye use the small-cereal model. Preserve the source `crop` tag when presenting observations;
222
+ `cultivation.crop` identifies a rendering recipe.
223
+
224
+ Selection uses explicit `crop`/`trees` tags first, then a sufficiently confident retrieved crop,
225
+ then a deterministic regional mixture. Iowa's temperate mixture favors maize and soybeans;
226
+ Mediterranean profiles include olives and vines, Asian profiles include rice, and tropical
227
+ profiles include cane and plantation forms. These mixtures are authored visual priors, not
228
+ acreage statistics or a claim about this year's crop. The current Protomaps basemap collapses
229
+ some agricultural classes to farmland and does not generally retain crop tags, so inference
230
+ remains important even where field outlines are mapped.
231
+
232
+ The pure `prepareAgricultureTile` adapter derives matching surface and scatter parameters in
233
+ workers and the renderer. It retains holes, rejects roads/buildings/water and steep slopes,
234
+ reserves headlands, aligns plants to world-anchored rows, and excludes competing wild brush
235
+ inside cultivated fields. Known field identifiers retain their variation across clipping;
236
+ a supplied full-field anchor also stabilizes regional selection. Unnamed polygons are divided
237
+ on a fixed projected grid, clipped to agricultural land. These visual divisions are not surveyed
238
+ parcels. Derived `cultivation` metadata records recipe, `mapped`/`classified`/`inferred` evidence,
239
+ source, observation year where known, growth stage and row angle.
240
+
241
+ Near views instance bounded plant patches and orchard trees. Distant views retain soil/crop
242
+ bands through an antialiased procedural shader without downloading textures or drawing each
243
+ plant. Agriculture has a separate instance/model budget: finest-level Economy 500/2, Balanced
244
+ 3,500/5 and High 6,500/8. Annual patches disappear at medium detail; Economy uses their surface
245
+ patterns. Both WebGL and node-material paths consume the same field attributes, including
246
+ worker-built landcover. Custom ground materials must opt into `{ agriculture: true }` and use
247
+ landcover geometry's attributes; use a separate material for bare elevation meshes.
248
+
249
+ An explicit vegetation month selects sown, growing, mature, ripe or stubble appearances; the
250
+ default is mature. Coarse authored calendars shift six months in the southern hemisphere.
251
+ Tropical crops stay mature without a source calendar. Retrieved sowing/harvest months are
252
+ absolute calendar months and override that shift. This is illustrative growth, not a crop
253
+ rotation, weather, irrigation or multiple-cropping simulation. Mapped barns, sheds, stables
254
+ and generic buildings inside mapped farmyards select the regional farm architecture. A field
255
+ never invents a building footprint.
256
+
257
+ ### Optional global retrieval
258
+
259
+ A terrain package may declare a compact `agriculture` source:
260
+
261
+ ```json
262
+ {
263
+ "urlTemplate": "https://your-host.example/agriculture/worldcover-2021-v1/{z}/{x}/{y}.json",
264
+ "level": 10,
265
+ "source": "esa-worldcover-2021-v200",
266
+ "year": 2021,
267
+ "maxTileBytes": 131072
268
+ }
269
+ ```
270
+
271
+ This is a hosting example, not a deployed release. Earth View and World Explorer consume it
272
+ automatically for geospatial XYZ packages, after overzooming and joining semantic archives.
273
+ They share up to 32 parent-grid requests between visual layers, bound uncompressed responses,
274
+ validate coordinates/provenance and retain the basemap on missing or failed requests. Hydrology
275
+ does not request agricultural data. Add the source's license and attribution to the terrain
276
+ package; large source rasters stay outside ecology content packs.
277
+
278
+ `molen/agriculture-grid@1` uses a small palette and row-major `[count, paletteIndex]` runs.
279
+ Index zero is unknown/non-crop; a positive entry without a crop supplies only agricultural
280
+ extent. Optional crop, source confidence, irrigation and calendar information refine appearance.
281
+ Cells supplement missing land use; mapped surfaces and explicit crops take precedence.
282
+ Area-weighted majority observations refine untagged farmland while retaining mapped outlines.
283
+ At most 256 additional polygons are admitted per semantic tile.
284
+
285
+ The sibling Qualla repository's `pipeline/agriculture/` compiler reads range-addressable
286
+ [ESA WorldCover 2021 v200](https://esa-worldcover.org/en/data-access) COG windows and reduces
287
+ cropland class 40 to conservative sampled-majority cells. Its default is 64×64 cells per level-10
288
+ tile: about 612 projected meters per cell, with smaller ground distances toward the poles.
289
+ It supports every continent and bounded resumable shards. Source URLs, recipe/payload hashes,
290
+ year, attribution and exact covered tile inventory accompany each dataset. A partial shard
291
+ is never advertised as global coverage.
292
+
293
+ Optional categorical COG adapters support global
294
+ [WorldCereal 2021 products](https://esa-worldcereal.org/en/products/global-maps), including maize
295
+ and spring/winter cereals, and regional refinements. WorldCereal's cereal class is not a specific
296
+ wheat observation. Raw classification rasters are required; colored map previews are unsuitable.
297
+ The checked six-continent WorldCover sample is historical extent data, not crop-type evidence.
298
+ Production hosting and larger geographic builds are separate Qualla release operations.
299
+
300
+ `preview-agriculture.mjs` captures controlled six-region farm compositions, growth stages,
301
+ inference, near/far views and shader paths. `preview-diversity.mjs --agriculture` builds real GLB
302
+ review assets and exercises public import, inspection, simulation and capture APIs. Fixtures
303
+ are labeled separately from observations; inspect live terrain before claiming local accuracy.
304
+
305
+ ## Wildlife and habitat sound
306
+
307
+ The optional `molen.wildlife` pack adds an independent `wildlife` profile channel, `animals`, and
308
+ `populations` to regional catalogs. It depends on `molen.ecology.regional@1`; opening packs in a
309
+ different order does not change selection. Earth and World Explorer load it by default when it
310
+ is in the host's pack index. `ambient: { wildlife: false }` disables animals in `mountEarthView`;
311
+ World Explorer accepts `?wildlife=0`. Frozen captures retain the existing ambient opt-in rule.
312
+
313
+ The catalog has 90 recipes: three adult body/coat forms for each of 21 named mammal taxa and nine
314
+ functional bird, reptile, fish, and insect groups. These are modest visual variations, not claims
315
+ about sex, age or subspecies. Each trio shares habitat/range/season gates and divides the previous
316
+ visual density equally; total expected abundance and population caps stay unchanged. Mammal country membership comes from Mammal Diversity Database v2.5 under
317
+ CC BY 4.0. A quarter-degree Natural Earth map-unit grid preserves overseas territory distinctions.
318
+ The range document compresses to about 30 KB; the recipe catalog adds about 6 KB (40 KB as a content pack). No animal GLBs
319
+ are downloaded. Source hashes, transformations, licenses, and limitations ship in the pack.
320
+
321
+ Country membership is a coarse limit, not within-country occupancy. Named taxa require an
322
+ attributed range plus compatible biome/realm and actual mapped land cover. Recent introduced
323
+ populations and uncertain country memberships are omitted. Large/rare mammals also require
324
+ explicit mapped conservation habitat, and water-dependent animals require mapped nearby water.
325
+ An uncovered range cell cannot authorize a named mammal. Unnamed functional groups deliberately
326
+ make no precise species claim. These choices and visual densities are authored priors, not a census.
327
+
328
+ Wildlife reads the finest displayed land-cover and human-feature tiles. Unknown terrain, built
329
+ areas, roads, buildings, water inappropriate to the animal, and steep slopes reject placement.
330
+ Island/courtyard holes remain usable. Swimming animals share the rendered water datum; flight
331
+ uses a bounded clearance. The 20 Hz kernel uses stable world-grid candidates, independent seeds,
332
+ plain restorable state, bounded wandering, and path substeps. Population, distance and pose caps
333
+ follow Earth quality. Models share recipe geometry, use one opaque skinned draw per animal, and
334
+ dispose with the terrain stream. Tiny animals disappear at short distances.
335
+
336
+ An explicit vegetation month also suppresses the generic insect/lizard groups in the coarse
337
+ cold season and changes the arctic-fox coat. It does not simulate migration or actual weather.
338
+ Existing generic birdsong and cricket recordings are gated by regional habitat and season, then
339
+ by weather, daylight and height above ground. They are not recordings of the named visual taxa.
340
+ Hosts composing their own view can supply `EarthAudioFrame.regionalAmbience` or use
341
+ `EarthWildlife.ambience`; omission preserves the legacy generic soundscape.
342
+
343
+ ## Authoring and verification in this repository
344
+
345
+ The authoring source is in `content/ecology/source/`. Run `build-catalog.mjs` for plants/habitats
346
+ and `build-architecture.mjs` for regional archstyles and bindings; both support `--check`.
347
+ `packages/worldgen-earth/scripts/generate-structure-atlas.mjs` derives the runtime architectural
348
+ atlas from the checked-in reduced country data and geographic assignments.
349
+
350
+ Large upstream geography stays outside runtime packs. The Python converters under
351
+ `packages/worldgen-earth/scripts/` accept an explicitly supplied source ZIP and use the pinned
352
+ authoring requirements there. Source URLs, hashes, licenses, and reduction methods travel with
353
+ the data or its notice. Regeneration does not require downloading the upstream datasets during
354
+ ordinary builds.
355
+
356
+ `content/wildlife/source/build-catalog.mjs` builds the animal recipes and supports `--check`.
357
+ `build-wildlife-ranges.py` takes explicit, checksum-pinned MDD CSV, metadata CSV and Natural Earth
358
+ map-unit ZIP inputs. `content/wildlife/source/preview-animals.mjs` imports, inspects and captures
359
+ procedural bind poses through the public asset pipeline; it does not verify live animation.
360
+
361
+ `preview-plants.mjs`, `preview-regions.mjs`, and `preview-architecture.mjs` produce local review
362
+ artifacts. Landscape fixtures exercise the real scatter adapter but bake placements for portable
363
+ capture; they do not measure live instancing performance. Review real streamed locations as well
364
+ as fixtures, including camera movement, terrain slopes, boundaries, and quality changes. Follow
365
+ the [medium-fi style guide](medium-fi.md) for geometry, color, and LOD budgets.
366
+
367
+ `preview-live-viewer.mjs` accepts a local terrain package and geographic camera position, captures
368
+ the streamed Explorer in fixed daylight, and records loading failures, draw/geometry counts,
369
+ wildlife counts, and measured frame intervals. `profile-live-tile.mjs` separates scatter and
370
+ building CPU costs on real decoded map tiles. `preview-mounted-viewer.mjs` exercises the public
371
+ `mountEarthView` API through orbit, walking, driving and flight. Browser measurements describe
372
+ the reviewing machine; they are not portable device performance guarantees. The reusable terrain
373
+ extract builder accepts an explicit source release, bounds, package name and snapshot date, so
374
+ these small local QA extracts retain their own provenance.
375
+
376
+ `content/wildlife/source/preview-motion.mjs` captures changing skinned poses from the actual
377
+ wildlife renderer and deterministic movement system. It complements the static asset previews.
378
+ After completing those captures, `content/ecology/source/build-review-gallery.mjs` assembles a
379
+ searchable local gallery at `.artifacts/regional-world/review.html`, with separate live terrain,
380
+ controlled landscapes, building families, wildlife poses, and public API camera modes. It retains
381
+ the known visual limitations beside the evidence rather than treating successful capture as
382
+ art approval.
383
+
384
+ Fine habitat transitions, richer wildlife behavior/body variation, and detailed city/rural
385
+ architectural overrides need finer evidence and additional authored content. The repository's
386
+ `content/ecology/coverage-plan.json` records implementation, acceptance evidence, and these
387
+ remaining fidelity limits.
@@ -106,8 +106,9 @@ lighting changes visibly; moving the camera does not rebuild it. It is enabled b
106
106
  `mountEarthView` and the world explorer. General viewers keep the legacy default (`false`).
107
107
  The approximation provides sky reflections, not reflections of nearby buildings or trees.
108
108
  Without `environment.sky`, it uses the ambient/sun rig and background color. Its filtered map
109
- replaces the hemisphere's diffuse contribution during rendering to avoid lighting surfaces twice,
110
- and carries the same irradiance: `sky.lighting.dayAmbient` and `nightAmbient` (or
109
+ replaces the hemisphere light, which stays hidden (`visible` false, its intensity as authored)
110
+ while the map is the scene environment so surfaces are not lit twice. The map carries the same
111
+ irradiance: `sky.lighting.dayAmbient` and `nightAmbient` (or
111
112
  `environment.ambient.intensity`) set the sky fill whether reflections are on or off.
112
113
  A host-supplied `renderer.scene.environment` takes precedence; the host retains ownership of that
113
114
  texture and control of its light balance.
@@ -203,7 +203,10 @@ These are approximate interiors, not surveyed tunnel geometry. Semantic provider
203
203
  Fragments are clipped out of their tile buffers and joined across neighboring tiles before
204
204
  grading, so tile boundaries do not create portals or conflicting floor heights. Searches are
205
205
  bounded to 16 tiles. Unresolved long routes and branches are omitted rather than assigning a
206
- terrain height to an underground tile boundary. Tunnel inference runs at the finest source
206
+ terrain height to an underground tile boundary. A route end counts as a portal only where an
207
+ ordinary (non-tunnel) line continues from it: a gap between fragments of a longer buried line,
208
+ such as a city subway split into thousands of pieces, would otherwise grade the bore to the
209
+ street there and open the ground along its whole length. Tunnel inference runs at the finest source
207
210
  feature level and above. Hiding the Human layer also removes its portal cuts and navigation
208
211
  support; the original elevation heightfield always remains available for surface anchoring.
209
212
 
@@ -93,10 +93,12 @@ bind the loaded names explicitly. Two bindings cannot write the same node/proper
93
93
 
94
94
  Aircraft signals are `airspeed` (m/s), `altitude`/`altitudeAGL` (m), `verticalSpeed` (m/s),
95
95
  `heading`/`pitch`/`roll` (radians), `rpm`/`power` (0–1), `pitchInput`/`rollInput`/`yawInput`
96
- (-1–1), and `gear`/`flaps`/`engine` (0 or 1). Calibration belongs to each model.
96
+ and `elevator` (-1–1), `gear`/`flaps` (the positions 0–1 as they travel, 0 up), and
97
+ `engine`/`brake`/`grounded` (0 or 1). Calibration belongs to each model.
97
98
  Cars supply `steering` and `wheelAngle` (radians); their optional third `update` argument accepts
98
99
  additional signals. World explorer passes `speed` (signed m/s), `heading`/`pitch`/`roll` (radians),
99
- `throttle` (-1–1) and `brake` (0 or 1).
100
+ `throttle` (-1–1), `brake` (0 or 1) and the sprung body's `bodyRoll`/`bodyPitch` (radians), which
101
+ the car visual also uses to keep its wheels on the road.
100
102
 
101
103
  An interior can also include `sources`, using the same component/path mappings as `model.signals`.
102
104
  World explorer resolves these for each vehicle and merges them over the convenience signals,
@@ -117,6 +119,42 @@ Legacy explicit `controlStick`, `collective` and `steeringWheelNode` bindings wo
117
119
  convention is removed: assets must list instruments explicitly. `airspeedGaugeMax` remains
118
120
  legacy metadata and no longer drives a gauge.
119
121
 
122
+ ## Exterior animation
123
+
124
+ Landing gear, doors, flaps and control surfaces are bound the same way, in an `animation` block
125
+ beside `interior`: `aircraft.spec.visual.animation` or `vehicle.visual.animation`, with the same
126
+ `sources` and `bindings` and the same signals. The interior and the animation may not bind the
127
+ same node channel.
128
+
129
+ A binding can replace `scale` and `offset` with a keyframed curve: `keys` are `[signal,
130
+ displacement]` pairs with strictly ascending signals, and the displacement holds the first or
131
+ last value outside them. `"ease": "smooth"` eases out of and into every key, the way a hydraulic
132
+ actuator starts and stops; the default is `linear`. Keys let one signal sequence several parts.
133
+ The P-51's gear position runs from 0 (up) to 1 (down); its inner wheel doors open over the first
134
+ and last eighth of that travel and stay open in between, while the legs swing:
135
+
136
+ ```json
137
+ {
138
+ "animation": {
139
+ "bindings": [
140
+ { "node": "wheel-door-1", "source": "gear", "property": "rotation", "axis": "x",
141
+ "keys": [[0, 0], [0.12, 1.5], [0.88, 1.5], [1, 0]], "ease": "smooth" },
142
+ { "node": "gear-1", "source": "gear", "property": "rotation", "axis": "x",
143
+ "keys": [[0.12, 1.5708], [0.88, 0]], "ease": "smooth" },
144
+ { "node": "rudder", "source": "yawInput", "property": "rotation", "axis": "y", "scale": 0.44 }
145
+ ]
146
+ }
147
+ }
148
+ ```
149
+
150
+ Each moving part rotates about one local axis, so the model gives it a parent frame aligned with
151
+ its hinge: a canted trunnion, a door's edge. Author the GLB in the at-rest pose (gear down,
152
+ doors as they stand on the ground); keys are displacements from it. A model whose retracted parts
153
+ would show through the skin can also list them in `visual.gearNodes`, hidden while the gear is
154
+ fully up. Simulated gear and flap positions come from `airplane.gearTransitTime` and
155
+ `flapTransitTime` (see [Aircraft](aircraft.md)); a script can drive any other part by publishing
156
+ a component and naming it in `sources`.
157
+
120
158
  ## Exterior views and detail levels
121
159
 
122
160
  Cockpit and chase views share the GLB. An interior can be a high-detail portion of that model,