@bendyline/molen-tooling 0.0.10 → 0.0.12
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.
- package/dist/capture/harness.js +610 -271
- package/dist/capture/worldgen-preview.js +396 -298
- package/dist/cli.mjs +2 -2
- package/dist/docs-src/guide/3d-art-guidelines.md +34 -10
- package/dist/docs-src/guide/3d-model-assets.md +40 -2
- package/dist/docs-src/guide/adaptive-performance.md +12 -4
- package/dist/docs-src/guide/aircraft.md +126 -26
- package/dist/docs-src/guide/ambient-life.md +13 -4
- package/dist/docs-src/guide/audio.md +19 -5
- package/dist/docs-src/guide/building-interiors.md +7 -2
- package/dist/docs-src/guide/determinism.md +1 -1
- package/dist/docs-src/guide/dioramas.md +6 -0
- package/dist/docs-src/guide/earth-view.md +121 -20
- package/dist/docs-src/guide/entities.md +84 -5
- package/dist/docs-src/guide/figures.md +31 -7
- package/dist/docs-src/guide/graphics-performance.md +27 -12
- package/dist/docs-src/guide/medium-fi.md +269 -25
- package/dist/docs-src/guide/navigation.md +5 -2
- package/dist/docs-src/guide/project.md +5 -0
- package/dist/docs-src/guide/recognizable-places.md +6 -0
- package/dist/docs-src/guide/regional-fleets.md +94 -0
- package/dist/docs-src/guide/regional-world.md +398 -0
- package/dist/docs-src/guide/sky.md +36 -3
- package/dist/docs-src/guide/structure-library.md +4 -1
- package/dist/docs-src/guide/surface-rendering.md +264 -2
- package/dist/docs-src/guide/terrain.md +5 -0
- package/dist/docs-src/guide/typography.md +105 -0
- package/dist/docs-src/guide/vehicle-interiors.md +169 -9
- package/dist/docs-src/guide/vehicles.md +13 -2
- package/dist/docs-src/guide/weather.md +15 -8
- package/dist/docs-src/guide/worldgen.md +88 -10
- package/dist/docs-src/llms.txt +5 -1
- package/dist/docs-src/schemas/README.md +6 -0
- package/dist/docs-src/schemas/archstyle.md +66 -0
- package/dist/docs-src/schemas/components.md +1087 -66
- package/dist/docs-src/schemas/ecology-atlas.md +236 -0
- package/dist/docs-src/schemas/fleet-catalog.md +113 -0
- package/dist/docs-src/schemas/landmark.md +10 -0
- package/dist/docs-src/schemas/matgraph.md +11 -1
- package/dist/docs-src/schemas/pack-source.md +11 -1
- package/dist/docs-src/schemas/pack.md +1 -1
- package/dist/docs-src/schemas/project.md +1 -1
- package/dist/docs-src/schemas/region-atlas.md +6 -0
- package/dist/docs-src/schemas/regional-catalog.md +1436 -0
- package/dist/docs-src/schemas/scatter.md +110 -4
- package/dist/docs-src/schemas/structure-placement-data.md +662 -0
- package/dist/docs-src/schemas/structure-placement-index.md +87 -0
- package/dist/docs-src/schemas/structure-placements.md +183 -0
- package/dist/docs-src/schemas/terrain-package.md +41 -0
- package/dist/docs-src/schemas/transport-network.md +8 -0
- package/dist/docs-src/schemas/types.md +1 -1
- package/dist/docs-src/schemas/wildlife-ranges.md +251 -0
- package/dist/docs-src/schemas/worldgen-batch.md +61 -0
- package/dist/index.d.mts +2 -0
- package/dist/index.mjs +1 -1
- package/dist/{mcp-BbxqqnD1.mjs → mcp-BXaK46X-.mjs} +1 -1
- package/dist/{ops-b4Pag8U-.mjs → ops-Cm7WNvb9.mjs} +55 -22
- package/dist/templates/city-courier/gen/molen-types.ts +138 -17
- package/dist/templates/city-courier/scripts/molen-scripts.d.ts +138 -17
- package/dist/templates/figures-gallery/test/headless.test.ts +2 -1
- package/dist/templates/index.json +17 -17
- package/dist/templates/skybound/gen/molen-types.ts +138 -17
- package/dist/templates/skybound/scripts/molen-scripts.d.ts +138 -17
- package/dist/templates/top-down-arena/scripts/molen-scripts.d.ts +138 -17
- package/dist/templates/top-down-arena/src/gen/molen-types.ts +138 -17
- package/package.json +13 -13
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
composes:
|
|
5
5
|
|
|
6
6
|
- streamed terrain from a `molen/terrain-package@1`;
|
|
7
|
-
- worldgen buildings, street surfaces, trees and parked cars from content packs;
|
|
7
|
+
- worldgen buildings, seeded infill for streets with missing outlines, street surfaces, trees and parked cars from content packs;
|
|
8
8
|
- traffic, pedestrians, trains and aircraft that come and go around the viewer;
|
|
9
9
|
- orbit, walk, drive and fly navigation, with cars and aircraft the host can put the viewer in;
|
|
10
10
|
- markers placed by latitude/longitude;
|
|
@@ -57,14 +57,19 @@ Pass `reflections: false` for the legacy light-only appearance. A host-assigned
|
|
|
57
57
|
`view.viewer.renderer.scene.environment` takes precedence if you supply your own HDR environment.
|
|
58
58
|
|
|
59
59
|
Without a `style`, the view uses the shared medium-fi look: a strong warm sun over a sky fill,
|
|
60
|
-
|
|
60
|
+
ACES filmic tone mapping, and haze in the sky's horizon color. Its values are exported as
|
|
61
61
|
`EARTH_SKY_PALETTE`, `EARTH_LIGHTING`, `EARTH_TONE_MAPPING`, `EARTH_EXPOSURE` and
|
|
62
62
|
`EARTH_WATER_COLOR`, so a host that builds its own viewer can match it. `earthHazeColor` converts
|
|
63
63
|
a sky color into the fog color for the backend. Terrain and landcover share one ground material
|
|
64
64
|
from `createTerrainGroundMaterialAsync` (`@bendyline/molen-terrain/client`) with world-space
|
|
65
65
|
variation; a custom host passes it to the terrain stream's `material` and to `createEarthWorldgen`
|
|
66
|
-
as `groundMaterial`, and calls `setTerrainGroundOrigin` with the world origin each frame.
|
|
67
|
-
|
|
66
|
+
as `groundMaterial`, and calls `setTerrainGroundOrigin` with the world origin each frame. Roads,
|
|
67
|
+
sidewalks and lots take `createTerrainPavementMaterialAsync` through the surface renderer's
|
|
68
|
+
`setMaterial`, with the same origin call. Trees, shrubs and props take
|
|
69
|
+
`createScatterMaterialAsync` (`@bendyline/molen-worldgen/client`) as `createEarthWorldgen`'s
|
|
70
|
+
`modelMaterial`, and generated buildings `createBuildingWeatheringAsync` as its
|
|
71
|
+
`buildingDecorator`. The [medium-fi style guide](medium-fi.md) explains the look and the rules
|
|
72
|
+
models follow inside it.
|
|
68
73
|
|
|
69
74
|
`style` sets the look: `sky.sunElevation` and `sky.sunAzimuth` (degrees; the azimuth is a
|
|
70
75
|
compass bearing, 0 north and clockwise) place the sun, and unless `environment.sun.direction` is
|
|
@@ -78,7 +83,9 @@ neutral olive.
|
|
|
78
83
|
Buildings, trees and landmarks cast sun shadows onto everything around what the camera frames:
|
|
79
84
|
the orbit target (sized to the view), or a little ahead of the walker, car or aircraft. The
|
|
80
85
|
shadow map follows that focus in whole texels, so edges hold still as it moves. Adaptive quality
|
|
81
|
-
turns shadows off at its two lowest levels; `shadows: false` turns them off entirely.
|
|
86
|
+
turns shadows off at its two lowest levels; `shadows: false` turns them off entirely. Only layer
|
|
87
|
+
parts taller than `EARTH_SHADOW_CASTER_HEIGHT` (3.5 m) cast: shrubs, brambles and saplings stay
|
|
88
|
+
out of the shadow pass, where their shadows would mostly fall inside the canopy's.
|
|
82
89
|
|
|
83
90
|
`touchJoystickContainer` adds an on-screen movement stick while walking, driving or flying. By default it
|
|
84
91
|
appears only on touch devices; pass `touchJoystick: 'always'` to show it everywhere.
|
|
@@ -121,7 +128,9 @@ added.
|
|
|
121
128
|
`view.vehicleStatus()` describes the car or aircraft the viewer is in for a HUD: speed and
|
|
122
129
|
heading for a car; airspeed, altitude and height above ground, vertical speed, attitude, load
|
|
123
130
|
factor (g), sideslip, power, engine, gear, flaps and stall/impact flags for an aircraft (SI units,
|
|
124
|
-
compass radians).
|
|
131
|
+
compass radians). Both carry the type's `label` and, where the type declares them, its name-free
|
|
132
|
+
`genericLabel` (`Full-size pickup`) and `bodyStyle`, so a HUD that must not show a real
|
|
133
|
+
manufacturer or model name has something to show instead. An airplane started in flight is trimmed for level flight at its launch speed.
|
|
125
134
|
`view.setThrottle(power)` sets an aircraft's throttle or collective from an on-screen lever.
|
|
126
135
|
|
|
127
136
|
Listen for `modechange`. The input profile, clip planes and touch stick follow the mode
|
|
@@ -506,16 +515,25 @@ world/geographic conversion) and ticked on their sync.
|
|
|
506
515
|
|
|
507
516
|
## Geographic structures and regional styles
|
|
508
517
|
|
|
509
|
-
The Earth pack may provide a `molen/structure-
|
|
518
|
+
The Earth pack may provide a regional `molen/structure-placement-index@1` directory, or a
|
|
519
|
+
legacy flat `molen/structure-placements@1` document. Each placement binds a
|
|
510
520
|
WGS84 `[longitude, latitude]` anchor to an asset ID from the style pack, with an optional
|
|
511
521
|
heading, scale, terrain or sea-level datum, and minimum tile level. The Earth viewer loads the
|
|
512
|
-
|
|
522
|
+
regional directory with the packs, then reads compact `molen/structure-placement-data@1`
|
|
523
|
+
regions as terrain tiles need them. Flat catalogs still load eagerly. Resident placements
|
|
524
|
+
are indexed by three-character geohash, and the viewer draws each `preview` model
|
|
513
525
|
in the terrain tile containing its anchor. `draft` records remain queryable but are not drawn.
|
|
514
526
|
Long structures may supply `bounds: [west, south, east, north]`. Their extent is indexed across
|
|
515
527
|
geohash cells and geometry is clipped to each resident tile, so a bridge end stays visible when
|
|
516
528
|
its center is outside the view. Extended structures use either `datum: 'sea-level'` with an
|
|
517
529
|
absolute `elevation`, or a `terrainReference` with the host sampler described below. Every
|
|
518
530
|
tile must resolve the same model origin, avoiding inconsistent ground samples between tiles.
|
|
531
|
+
|
|
532
|
+
Models with `groundCutout` stay whole in each intersecting resident tile. Their floors and
|
|
533
|
+
openings therefore remain together while adjacent tiles load, including when the anchor tile
|
|
534
|
+
is absent. These instances share the library's geometry and textures and release with their
|
|
535
|
+
tiles. Ordinary extended bridges continue to use clipped geometry.
|
|
536
|
+
|
|
519
537
|
`replaceRoads: { length, width, deckHeight?, deckHeights? }` describes a model-local rectangle along +X:
|
|
520
538
|
mapped parallel bridge lines inside it are replaced only after the model loads successfully.
|
|
521
539
|
Outside approach fragments remain procedural. `deckHeight` joins those approaches to the
|
|
@@ -539,7 +557,45 @@ only if it shares a covered endpoint with a mapped bridge and continues outward
|
|
|
539
557
|
axis. The remaining grade fragment receives a 20 m terrain blend. Nearby roads, transverse paths
|
|
540
558
|
and tunnels remain intact. This requires the source tile to retain the shared bridge/approach
|
|
541
559
|
endpoint; disconnected or generalized map geometry is left in place.
|
|
542
|
-
Sunken structures can declare `groundCutout: { outline: [[x, z], ...], basis: 'source evidence' }` on a placement. The simple polygon uses native model metres and follows the same heading and scale as the model. It should bound the ground opening covered by the authored concourse or rim. The terrain pyramid subtracts the polygon from actual elevation and draped ground triangles across tile and LOD boundaries, preserving interpolated heights and surface attributes along its edge. The cutout becomes active only when its successfully loaded structure is visible, and the original ground returns on layer hiding or eviction. Failed or cancelled models leave the ground intact. Heights remain available for anchoring; an opening does not itself author walkable floors or collision.
|
|
560
|
+
Sunken structures can declare `groundCutout: { outline: [[x, z], ...], basis: 'source evidence' }` on a placement. The simple polygon uses native model metres and follows the same heading and scale as the model. It should bound the ground opening covered by the authored concourse or rim. The terrain pyramid subtracts the polygon from actual elevation and draped ground triangles across tile and LOD boundaries, preserving interpolated heights and surface attributes along its edge. The cutout becomes active only when its successfully loaded structure is visible, and the original ground returns on layer hiding or eviction. Failed or cancelled models leave the ground intact. Heights remain available for anchoring; an opening does not itself author walkable floors or collision. Separate excavations can add `additionalOutlines: [[[x, z], ...], ...]` to the same object (up to 64 total polygons). Ground between those outlines stays intact; every opening needs matching model geometry. Client integrations can register the same set with `setTerrainGroundCutouts(object, outlines)`. The singular `setTerrainGroundCutout` remains available for one polygon.
|
|
561
|
+
|
|
562
|
+
For separated parts, `groundCutout.outlines` supplies the complete set of up to 64 simple polygons
|
|
563
|
+
and supersedes the single `outline`. Keep `outline` as the primary boundary for compatibility.
|
|
564
|
+
Each ring follows the same model pose and lifetime; ground in the gaps stays visible. This lets
|
|
565
|
+
a structure cover a main building and a detached component without clearing the ground between them.
|
|
566
|
+
For an extended structure, each resident tile clips these openings to its own rendered model
|
|
567
|
+
piece. Terrain outside that tile stays intact until the corresponding model piece loads.
|
|
568
|
+
|
|
569
|
+
A landmark that authors a lake or basin can separately declare
|
|
570
|
+
`waterCutout: { outlines: [[[x, z], ...], ...], basis: 'source evidence' }` with geographic
|
|
571
|
+
`bounds`. Up to 16 simple native model polygons replace only the covered native water. The
|
|
572
|
+
viewer keeps other polygons from the same map feature, and clips replacement to resident model
|
|
573
|
+
tiles. Native water returns when the model is hidden or evicted; failed or cancelled loads
|
|
574
|
+
leave it intact. Ground openings and water openings are independent, so a bridge's ground
|
|
575
|
+
opening does not remove the river underneath it. Custom water adapters can register their mesh
|
|
576
|
+
with `markTerrainWaterSurface`; `TerrainGroundCutoutController` coordinates both surface kinds.
|
|
577
|
+
|
|
578
|
+
When a map merges a landmark with neighboring buildings, declare
|
|
579
|
+
`buildingCutout: { outline: [[x, z], ...], basis: 'source evidence' }` and geographic `bounds`.
|
|
580
|
+
This simple native model polygon follows the placement's heading and scale. While the model is
|
|
581
|
+
loaded, the viewer subtracts only that area from mapped buildings and preserves their remaining
|
|
582
|
+
polygons, holes, heights and other attributes. It takes precedence over `replaceFootprint` for
|
|
583
|
+
that placement. Bounds ensure every overlapping tile receives the mask. Failed loads leave the
|
|
584
|
+
mapped buildings intact; eviction restores the original source data. This affects procedural
|
|
585
|
+
building geometry; use `groundCutout` separately when the model also covers the terrain opening.
|
|
586
|
+
For separated buildings or precincts, `buildingCutout.outlines` provides up to 64 independent
|
|
587
|
+
simple masks and supersedes `outline`. Keep the primary `outline` for compatibility. Separate
|
|
588
|
+
masks preserve intervening buildings without inventing connecting structure geometry.
|
|
589
|
+
|
|
590
|
+
For a whole landmark whose source footprint slightly overlaps a neighboring building, set
|
|
591
|
+
`buildingCutout.minimumCoverage` to a fraction in `(0, 1]`, for example `0.995`. This changes
|
|
592
|
+
the mask to whole-building replacement: a mapped feature goes only when the union of that
|
|
593
|
+
placement's masks covers at least that fraction of its occupied area. The calculation includes
|
|
594
|
+
all components and subtracts holes; overlapping masks do not count twice. Lower-coverage
|
|
595
|
+
neighbors keep their original polygons and attributes intact. Separate placements make separate
|
|
596
|
+
coverage decisions. Generalized tiles fall back to area subtraction so a coarse merged block
|
|
597
|
+
can retain the surrounding complex while the landmark occupies its part. Use ordinary
|
|
598
|
+
subtraction when only part of a precise map building should go.
|
|
543
599
|
|
|
544
600
|
### Bridge elevations and terrain fit
|
|
545
601
|
|
|
@@ -619,6 +675,14 @@ each document may contain `rules` for deliberately generic assets. The shipped
|
|
|
619
675
|
`structures/map-rules.json` recognizes windmills and wind turbines from class, subclass, or
|
|
620
676
|
explicit map tags. Unique named landmarks never become arbitrary category replacements.
|
|
621
677
|
|
|
678
|
+
Regional types can set `bounds: [west, south, east, north]` in WGS84 degrees. An optional
|
|
679
|
+
`match.names` array accepts exact category labels such as “Svan tower”; it requires regional
|
|
680
|
+
bounds and a class, subclass or explicit tag match. Partial names and business names do not
|
|
681
|
+
establish a type. Bounds use half-open east/north edges. With `fit: "footprint"`, an explicitly
|
|
682
|
+
typed point can use its sole complete containing building for size and the undirected longest
|
|
683
|
+
axis; the matcher never chooses the nearest house. Generalized, clipped or ambiguous footprints
|
|
684
|
+
do not establish that fit. A footprint axis alone does not establish the entrance's facing.
|
|
685
|
+
|
|
622
686
|
```json
|
|
623
687
|
{
|
|
624
688
|
"id": "generic.windmill",
|
|
@@ -653,10 +717,33 @@ eviction. Rules require source classification evidence: a cafe with “Windmill
|
|
|
653
717
|
not a windmill. Providers that omit POIs, classifications, or structure tags cannot imply that
|
|
654
718
|
object. The semantic decoder preserves public structure tags and Wikidata IDs when supplied.
|
|
655
719
|
|
|
656
|
-
`content.worldgen.structures.query([west, south, east, north])` returns preview
|
|
657
|
-
geographic rectangle. Pass `true` as the second argument to include drafts.
|
|
658
|
-
|
|
659
|
-
|
|
720
|
+
`content.worldgen.structures.query([west, south, east, north])` returns resident preview
|
|
721
|
+
placements in a geographic rectangle. Pass `true` as the second argument to include drafts.
|
|
722
|
+
For a regional catalog, `isLoaded(bounds)` distinguishes complete coverage from an unloaded
|
|
723
|
+
region. Use `await structures.queryAsync(bounds, { signal, viewingDate, includeDraft })` to
|
|
724
|
+
load and query complete coverage; flat indexes expose only the synchronous query. Async
|
|
725
|
+
results remain valid even when a large query exceeds the retained cache budget. Terrain
|
|
726
|
+
renderers await coverage before replacing buildings, roads, water or ground. Parking avoids
|
|
727
|
+
unloaded landmark coverage until nearby terrain has loaded it.
|
|
728
|
+
|
|
729
|
+
Regional reads share in-flight requests, run at most four requests at once, and retain at most
|
|
730
|
+
32 parsed regions or 4 MiB of serialized data (JavaScript object overhead is additional).
|
|
731
|
+
Cancelling one query does not cancel another query sharing its read. `dispose()` on the
|
|
732
|
+
regional stream cancels its reads and drops the cache. Directory coverage includes complete
|
|
733
|
+
structure extents and mapped identity search neighborhoods across region boundaries and the
|
|
734
|
+
antimeridian. Regions whose minimum tile level exceeds the requested level are skipped.
|
|
735
|
+
|
|
736
|
+
In the engine repository, authoritative placements and their source notes live in individual
|
|
737
|
+
`content/earth/source/placements/<gh2>/<gh3>/<placement-id>.json` files. A deterministic build
|
|
738
|
+
produces the ignored `content/earth/structures/placements/index.json` and `cells/*.json` files.
|
|
739
|
+
Runtime data retains titles and source URLs, all placement numbers, cutouts, statuses and
|
|
740
|
+
historical dates, while omitting `note` and `basis` explanations. Detailed map evidence stays
|
|
741
|
+
in the source; only `wikidata`, `names` and `maxDistance` are runtime matching fields.
|
|
742
|
+
The compiler starts with geohash2 regions and subdivides regions over 192 KiB when possible.
|
|
743
|
+
The pack keeps these files independently readable rather than combining them in solid blocks.
|
|
744
|
+
The generated `authoring.json` aggregate supports local review fixtures and is excluded from packs.
|
|
745
|
+
|
|
746
|
+
Named model sources and previews live in
|
|
660
747
|
`content/worldgen/source/places/<gh2>/<gh3>/<source-key>/`; imported runtime bundles mirror
|
|
661
748
|
that organization under `content/worldgen/assets/places/<gh2>/<gh3>/<source-key>/`.
|
|
662
749
|
Each runtime bundle contains `asset.json`, `model.glb`, and any collision data. Reusable models
|
|
@@ -874,11 +961,15 @@ These regional forms are visual priors, not surveyed attributes of individual bu
|
|
|
874
961
|
|
|
875
962
|
## Sound
|
|
876
963
|
|
|
877
|
-
With the `molen.sounds` pack in `content`, the view plays
|
|
878
|
-
|
|
879
|
-
|
|
964
|
+
With the `molen.sounds` pack in `content`, the view plays 100 contextual sounds: 88 recorded
|
|
965
|
+
ambience beds and 12 walking surfaces, alongside vehicle engines and music. Rain and wind
|
|
966
|
+
follow weather, morning birds and warm-night crickets/frogs follow the rendered sky clock,
|
|
967
|
+
and broad regional palettes follow geographic location. Surf fades away from mapped ocean
|
|
968
|
+
shores; rivers and traffic follow nearby watercourses and streets. Enclosed cockpits smoothly
|
|
969
|
+
reduce outdoor ambience to 18%; open boats and exterior cameras retain outside sound.
|
|
970
|
+
Mapped ground materials, rain and snow select walking sounds. Birds, crickets and traffic come from
|
|
880
971
|
the ground, so they fade as the view rises above the terrain and are gone a few hundred meters
|
|
881
|
-
up. Traffic also fades with distance from the nearest street. Sound starts on the first click or
|
|
972
|
+
up. Unknown terrain height silences ground ambience. Traffic also fades with distance from the nearest street. Sound starts on the first click or
|
|
882
973
|
key press. The `audioready` event fires once it has loaded, and then `view.audio` sets volume,
|
|
883
974
|
mute and bus gains (`view.audio.setBusGain('music', 0)` turns music off).
|
|
884
975
|
|
|
@@ -888,9 +979,19 @@ view.on('audioready', () => view.audio?.setMuted(localStorage.getItem('muted') =
|
|
|
888
979
|
```
|
|
889
980
|
|
|
890
981
|
Pass `audio: false` to keep the view silent, or `audio: { environment }` to replace the rules.
|
|
891
|
-
The default rules are exported as `EARTH_AUDIO_ENVIRONMENT
|
|
892
|
-
|
|
893
|
-
|
|
982
|
+
The legacy/default rules are exported as `EARTH_AUDIO_ENVIRONMENT`; `createEarthAudio` extends
|
|
983
|
+
them using bank tags `earth:category:*` and `earth:region:*` unless given a custom environment.
|
|
984
|
+
A composing host passes `location`, `solarHour`, `terrain`, and `inVehicle` to `update`.
|
|
985
|
+
`EarthAudioTerrain.observer` can wrap water, landcover and features renderers with
|
|
986
|
+
`observeSemanticTiles`; sample it at about 4 Hz for coast/river/street distances and ground
|
|
987
|
+
material. `surface` overrides the mapped walking material, and `indoors` attenuates outdoor
|
|
988
|
+
ambience for a host that detects interiors. Missing mapped data uses conservative fallbacks;
|
|
989
|
+
lakes do not produce surf, and wildlife rendering density does not mute regional ambience.
|
|
990
|
+
A pack's `birdsong` catalog replaces broad bird palettes with curated recordings selected by
|
|
991
|
+
geography, habitat, season and sunlight; uncovered places stay quiet. The default pack includes
|
|
992
|
+
eight such recordings. Hosts pass the sky's `utcMs` and `sunAltitudeDeg` in `location`, along with
|
|
993
|
+
`regionalAmbience.habitat` and habitat levels. Curated birds fade out inside enclosed vehicles.
|
|
994
|
+
See [Sound and music](audio.md) for the rule format.
|
|
894
995
|
|
|
895
996
|
The composing pieces are exported too, for hosts that build their own view: `createEarthWorldgen`,
|
|
896
997
|
`EarthVehicles`, `EarthAmbient` with `observeSemanticTiles`, `createEarthSky`/`createEarthFog`,
|
|
@@ -57,21 +57,96 @@ sidecar, types document, project, or gallery scene is stale.
|
|
|
57
57
|
helicopter, including GLBs, flight components and pilot seats. The pack's asset provider
|
|
58
58
|
serves them like any other model. See [Aircraft](aircraft.md) for world-view controls, physics and integration.
|
|
59
59
|
|
|
60
|
-
##
|
|
60
|
+
## Bendy transit and background traffic
|
|
61
61
|
|
|
62
62
|
`molen.entities.transit.bus` is a 12 m city bus, `molen.entities.transit.lightrail` a 27 m
|
|
63
|
-
two-section light-rail car, and `molen.entities.aircraft.airliner` a narrow-body airliner.
|
|
64
|
-
|
|
65
|
-
|
|
63
|
+
two-section light-rail car, and `molen.entities.aircraft.airliner` a narrow-body airliner. Their
|
|
64
|
+
display names are **Bendy Bus**, **Bendy Light Rail** and **Bendy Small Airliner**. All three
|
|
65
|
+
are mountable: the bus uses the road solver, light rail supports traction/braking/reversing
|
|
66
|
+
on a straight track with steering locked, and the airliner uses the assisted twin-engine
|
|
67
|
+
airplane solver with gear and flap controls. The airliner's thrust is an approximation, not
|
|
68
|
+
a dedicated turbofan simulation. Player rail controls do not yet follow curved network routes;
|
|
69
|
+
ambient rail consists retain their existing network following.
|
|
70
|
+
[Ambient life](ambient-life.md) also spawns them through their `ambientRole` component.
|
|
66
71
|
In the engine repository, `content/entities/scenes/transit.scene.json` shows them side by side.
|
|
67
72
|
|
|
68
73
|
## Road, cycle and water fleets
|
|
69
74
|
|
|
70
|
-
The road fleet has eleven mountable models. Alongside compact, sedan, SUV, pickup and van,
|
|
75
|
+
The Bendy road fleet has eleven mountable models. Alongside compact, sedan, SUV, pickup and van,
|
|
71
76
|
`molen.entities.vehicle.*` includes `sports_coupe`, `station_wagon`, `electric_hatchback`,
|
|
72
77
|
`taxi`, `offroad` and `box_truck`. They expose the usual wheel pivots, paint material, driver
|
|
73
78
|
seat and vehicle tuning, and join the ambient car pool.
|
|
74
79
|
|
|
80
|
+
All generic road, cycle, water and transit display names use the **Bendy** house brand.
|
|
81
|
+
Asset/type IDs remain stable. P-51D Mustang and OH-6 retain their real identities. Models follow
|
|
82
|
+
the [close-view vehicle detail standard](medium-fi.md#controllable-vehicles-close-view-fidelity).
|
|
83
|
+
|
|
84
|
+
Forty additional U.S. market reference vehicles retain their manufacturer/model/year identities,
|
|
85
|
+
including `molen.entities.vehicle.ford_f_150_2025`, `molen.entities.vehicle.toyota_prius_2024`,
|
|
86
|
+
`molen.entities.vehicle.tesla_model_3_2025` and `molen.entities.vehicle.ford_mustang_2024`.
|
|
87
|
+
`MOLEN_US_VEHICLE_ENTITY_IDS` enumerates this collection; it is also included in
|
|
88
|
+
`MOLEN_VEHICLE_ENTITY_IDS` and `MOLEN_ENTITY_IDS`. All forty support the same boarding,
|
|
89
|
+
steering, braking, reversing and exiting API as the Bendy cars. They provide named wheel and
|
|
90
|
+
steering pivots, driving cabins and ambient car roles.
|
|
91
|
+
|
|
92
|
+
These are polygonal interpretations with rounded authoring dimensions and simplified trim,
|
|
93
|
+
not manufacturer CAD reproductions. Handling is tuned for play; digital display graphics are
|
|
94
|
+
illustrative, while the driving HUD supplies live telemetry and analog speed needles are bound
|
|
95
|
+
where present. The 2024 Model Y represents the original body, not the later refresh.
|
|
96
|
+
See the repository's [complete roster](https://github.com/bendyline/molen/blob/main/content/entities/US-VEHICLES.md).
|
|
97
|
+
`content/entities/scenes/us-vehicles.scene.json` places all forty in a showroom. Their recipes
|
|
98
|
+
live beside the Bendy recipes and use the same targeted generation/import/capture workflow.
|
|
99
|
+
|
|
100
|
+
> [!NOTE]
|
|
101
|
+
> The reference vehicles, the Winnebago View and the P-51D and OH-6 are identified by their real
|
|
102
|
+
> manufacturer, model and year names so you know what each interpretation depicts. The names are
|
|
103
|
+
> identification only: the geometry carries no maker emblem, wordmark, model lettering or
|
|
104
|
+
> logo-shaped grille (a plain chrome badge and a fictional `MLN` plate stand in), and the pack's
|
|
105
|
+
> MIT license grants no trademark rights. The names are their owners' marks, used without
|
|
106
|
+
> affiliation or endorsement; whether a descriptive use here stays descriptive in your product is
|
|
107
|
+
> your own call. Every mountable type's spec therefore carries a name-free `genericLabel`
|
|
108
|
+
> (`Full-size pickup`, `Light observation helicopter`) and, for wheeled vehicles, a generic
|
|
109
|
+
> `bodyStyle` (`pickup`, `suv`, `motorhome`, `bicycle`, …), and `view.vehicleStatus()` reports
|
|
110
|
+
> both, so a host can show, filter or relabel the fleet without any real name. The pack's
|
|
111
|
+
> `NOTICE.md` and the repository
|
|
112
|
+
> [NOTICE](https://github.com/bendyline/molen/blob/main/NOTICE.md) record the details.
|
|
113
|
+
|
|
114
|
+
A second collection adds forty varied vehicles from **2005–2024**, with two models from each
|
|
115
|
+
year: city cars, retro hatchbacks, wagons, roadsters, coupes, sedans, cargo vans, pickups and
|
|
116
|
+
off-road vehicles. `MOLEN_VARIETY_VEHICLE_ENTITY_IDS` enumerates these IDs, also present in
|
|
117
|
+
the main vehicle/entity helpers. Examples include `molen.entities.vehicle.smart_fortwo_2009`,
|
|
118
|
+
`molen.entities.vehicle.mazda_mx_5_miata_2016` and
|
|
119
|
+
`molen.entities.vehicle.mercedes_benz_sprinter_2019`. All forty use the same driving API.
|
|
120
|
+
The [variety roster](https://github.com/bendyline/molen/blob/main/content/entities/VARIETY-VEHICLES.md)
|
|
121
|
+
records each selected year and body configuration; `content/entities/scenes/variety-vehicles.scene.json`
|
|
122
|
+
is its showroom. Open-top models have fixed lowered roofs, and cargo vans have enclosed load
|
|
123
|
+
compartments. Doors and roofs do not animate. The same reference-model limitations above apply.
|
|
124
|
+
|
|
125
|
+
The regional expansion adds 24 drivable reference vehicles for China, Japan, Korea, Europe,
|
|
126
|
+
South America and Africa, exposed by `MOLEN_REGIONAL_VEHICLE_ENTITY_IDS`. Most are model year
|
|
127
|
+
2024; the four-door Wuling Hongguang MINI EV is 2025. They share the same vehicle API, and
|
|
128
|
+
`content/entities/scenes/regional-vehicles.scene.json` displays the collection. The pack provides
|
|
129
|
+
the small regional fleet catalog used by Earth traffic and parking. See
|
|
130
|
+
[Regional vehicle fleets](regional-fleets.md) for selection, downloads, memory budgets and coverage.
|
|
131
|
+
|
|
132
|
+
Two additional reference vehicles are the white **2012 MINI Cooper Countryman**
|
|
133
|
+
(`molen.entities.vehicle.mini_cooper_countryman_2012`) and dark gray **2019 Acura MDX**
|
|
134
|
+
(`molen.entities.vehicle.acura_mdx_2019`). Their default and ambient paint palettes preserve
|
|
135
|
+
those colors. They share the driving API and appear in the main vehicle/entity helpers.
|
|
136
|
+
`content/entities/scenes/mini-acura.scene.json` displays them beside the existing green
|
|
137
|
+
2013 MINI Cooper (`molen.entities.vehicle.mini_cooper_2013`). See the
|
|
138
|
+
[MINI and Acura roster](https://github.com/bendyline/molen/blob/main/content/entities/MINI-ACURA.md).
|
|
139
|
+
|
|
140
|
+
Six motorhomes add two Class Cs, three Class As and one Class B. The **2022 Winnebago View 24D**
|
|
141
|
+
uses `molen.entities.vehicle.winnebago_view_2022`; the other five are Bendy designs.
|
|
142
|
+
`MOLEN_RV_ENTITY_IDS` enumerates them, also included in the main vehicle/entity helpers.
|
|
143
|
+
They share the driving API, with longer wheelbases, driver-eye cabins, detailed coach fittings,
|
|
144
|
+
and wheel/steering/instrument bindings. The largest Class A has an additional tag axle.
|
|
145
|
+
Their low-frequency `bus` ambient role selects large road traffic and excludes ordinary
|
|
146
|
+
curbside parking. Furnishings are visual geometry; doors, awnings and slideouts stay closed
|
|
147
|
+
in a touring configuration. The [RV roster](https://github.com/bendyline/molen/blob/main/content/entities/RVS.md)
|
|
148
|
+
records IDs and dimensions; `content/entities/scenes/rvs.scene.json` is the repository showroom.
|
|
149
|
+
|
|
75
150
|
`molen.entities.cycle.*` contains `standard_motorcycle`, `cruiser_motorcycle`, `motor_scooter`,
|
|
76
151
|
`city_bicycle`, `road_bicycle` and `cargo_bicycle`. These are rideable through the same vehicle/mount API as cars, with self-balancing
|
|
77
152
|
handling, saddle poses, animated steering and bicycle pedals. See [Riding cycles](vehicles.md#riding-cycles).
|
|
@@ -95,3 +170,7 @@ ferries. Each new bundle has an editable `models/recipe.json`; the shared author
|
|
|
95
170
|
models. It preserves an artist-edited master that no longer matches its generator pin.
|
|
96
171
|
After importing, `node packages/entities/scripts/capture-fleet.mjs` renders four views of each
|
|
97
172
|
model and both demo scenes; `--ids=sports-coupe,tugboat` narrows the review to selected models.
|
|
173
|
+
Those captures stay local. `node packages/entities/scripts/preview-fleet.mjs` then composes the
|
|
174
|
+
tracked summary artifacts from them: a `preview.png` beside each source bundle (exterior and
|
|
175
|
+
operator view, linked from its README) and the per-collection contact sheets under
|
|
176
|
+
`content/entities/`, such as `us-vehicles-preview.png`.
|
|
@@ -4,9 +4,11 @@
|
|
|
4
4
|
(`/kernel`: descriptors and presets, canonical rigs and sockets, deterministic gait and pose
|
|
5
5
|
evaluation, locomotion state, attachments) and a **client half** (`/client`: the `figure`
|
|
6
6
|
renderable kind that generates a skinned body from the descriptor and poses it every frame).
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
Humans use modeled facial relief (jaw, cheeks, nose, lips, eyelids and ears), shaped palms
|
|
8
|
+
and fingers, fitted clothing with collars, pockets and buttons, and rounded shoes. The
|
|
9
|
+
target is the readable polygonal realism of early open-world games. Surfaces share one
|
|
10
|
+
vertex-color material; no external texture downloads are required. See the figure rules in
|
|
11
|
+
[3D art guidelines](3d-art-guidelines.md).
|
|
10
12
|
|
|
11
13
|
Naming note: this is **not** `@bendyline/molen-kernel/kinematics` (the 2.5D collision layer) and
|
|
12
14
|
not `/character` (the gravity/jump mover). Figures sit on top of whatever moves an entity.
|
|
@@ -94,8 +96,29 @@ figure` prints the full shape (the `molen/figure@1` file format wraps the same f
|
|
|
94
96
|
| `seed` | detail jitter only (symmetry-safe) |
|
|
95
97
|
|
|
96
98
|
Every rig stands with its feet at y = 0 and its reference point exactly at `height`, whatever
|
|
97
|
-
the overrides. Bodies come in three detail tiers
|
|
98
|
-
and
|
|
99
|
+
the overrides. Bodies come in three detail tiers. Humans use roughly 7,400 triangles near, 2,200 at medium
|
|
100
|
+
distance and 1,100 for the rigid distant tier. The six animal presets use about 4,100–6,500 near,
|
|
101
|
+
2,100–2,900 medium and 1,100–1,500 distant triangles. The client
|
|
102
|
+
picks a tier by camera distance unless `lod` pins one. Near humans include separate fingers
|
|
103
|
+
with the default `hands: "fingers"`; `hands: "mitten"` keeps a joined finger silhouette. Medium
|
|
104
|
+
and distant hands merge the fingers while retaining the thumb. Facial details and clothing
|
|
105
|
+
use the canonical joint hierarchy, so gait, IK and attachment APIs are unchanged. The biped
|
|
106
|
+
rest pose holds the arms five degrees from vertical; idle adds a slight elbow bend, leaving
|
|
107
|
+
the hands beside the thighs. Idle rotates each forearm along the elbow-to-wrist axis so the
|
|
108
|
+
back of the hand angles forward, with small wrist flexion and gently curled fingers. Walking,
|
|
109
|
+
running and sitting use smaller forearm rotations. The rigid distant mesh retains the resting
|
|
110
|
+
hand orientation; fingers remain a fixed curved shape on the hand joint. Shared shoulder vertices and blended skin weights connect the
|
|
111
|
+
torso to the sleeves without separate shoulder caps.
|
|
112
|
+
|
|
113
|
+
Quadrupeds have species-shaped ribcages, tucked or full bellies, muscular shoulders and haunches,
|
|
114
|
+
and shaped joints. Dogs and cats have rounded paws with separate near/medium toes; horses have
|
|
115
|
+
single hooves, while cows, deer and sheep have split hooves. Continuous skull/muzzle surfaces,
|
|
116
|
+
eyelids, nostrils, lips and cupped ears replace the primitive heads. Cats have forward-facing eyes
|
|
117
|
+
and near-tier whiskers; horses have a crest mane and hanging hair tail; cows have surface coat
|
|
118
|
+
patches and a tufted tail; deer have branching antlers; sheep have a lightly rippled fleece.
|
|
119
|
+
Palette and feature overrides still apply. The same 27-joint hierarchy drives all animal tiers;
|
|
120
|
+
the distant tier is rigid and removes the small facial, toe and hair details. Animal proportions
|
|
121
|
+
now give the torso more depth while keeping the withers at `height` and soles at ground level.
|
|
99
122
|
|
|
100
123
|
## Locomotion
|
|
101
124
|
|
|
@@ -165,8 +188,9 @@ interpolated render tick reaches the tick a state changed on, so poses and trans
|
|
|
165
188
|
|
|
166
189
|
## Limits
|
|
167
190
|
|
|
168
|
-
-
|
|
169
|
-
|
|
191
|
+
- Fingers share the hand joint; individual finger articulation and facial expressions are not
|
|
192
|
+
implemented. Hair is a solid modeled surface attached to the head, with no strand physics.
|
|
193
|
+
- Clothing and skin use palette colors, without scanned skin textures or cloth simulation.
|
|
170
194
|
- Foot planting on uneven ground and quadruped IK are not evaluated yet.
|
|
171
195
|
- Imported skinned glTF figures and `molen figure bake` (skinned GLB export) are later phases.
|
|
172
196
|
- Accessories follow kernel-evaluated sockets at tick rate; fast hand swings can lag a few
|
|
@@ -77,11 +77,16 @@ shared resources share pending preparation promises. A cancelled tile cannot can
|
|
|
77
77
|
tile waiting on the same resource; queued work is dropped once every tile waiting for it has
|
|
78
78
|
cancelled. Prepared static batches replace ordinary meshes only when ready; stale batch results
|
|
79
79
|
are discarded.
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
80
|
+
When `prepareObject` receives the parent the object will join, it evaluates LODs for the current
|
|
81
|
+
camera and waits only for the selected levels. The other levels prepare in the queue's background
|
|
82
|
+
lane (`priority: 'background'`), which runs only in budget that normal jobs leave, and are dropped
|
|
83
|
+
if their mesh or geometry is disposed first. A mesh that swaps its own material (an instanced
|
|
84
|
+
detail switch's opaque and shadow-free twins) lists every material in `userData.materialVariants`,
|
|
85
|
+
and the renderer sets `userData.materialReady(material)`, which the mesh's owner asks before
|
|
86
|
+
switching. Until it returns true the owner keeps what it shows; the first question queues that
|
|
87
|
+
material's build ahead of other work, so variants a mesh never switches to are never built. Shadow
|
|
88
|
+
flags are part of what a mesh's shaders are built for, so set `castShadow` and `receiveShadow`
|
|
89
|
+
before preparing (the terrain stream marks layers and surfaces first). Resident world-generation
|
|
85
90
|
quality replacements use the same preparation/publication path when supplied with
|
|
86
91
|
`WorldgenRendererOptions.prepareObject` (enabled in World Explorer).
|
|
87
92
|
|
|
@@ -135,13 +140,18 @@ by the resolved Three material, including groups with different authored referen
|
|
|
135
140
|
to the same material. Transparent group order is preserved.
|
|
136
141
|
|
|
137
142
|
World props (trees, ground cover, rocks, rooftop and street props) keep one batch per model per
|
|
138
|
-
terrain tile
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
and
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
143
|
+
coarse terrain tile, and four per finest tile, so near detail stays around the camera's own quarter.
|
|
144
|
+
On WebGPU, three.js keys an `InstancedMesh`'s node state by the mesh (about 11 ms of main thread
|
|
145
|
+
for a plant batch, per draw target and material) and declared its matrices as a uniform array sized
|
|
146
|
+
to the batch and named after its node, so every batch also compiled a GPU pipeline of its own; when a
|
|
147
|
+
frame created one, it stalled the browser's GPU process, for seconds in fast flight. The WebGPU
|
|
148
|
+
driver reads instance matrices from one named, runtime-sized storage buffer instead, so a material's
|
|
149
|
+
batches share one shader and one pipeline. `createInstancedPlacementLod` accepts any `cellSize`.
|
|
150
|
+
|
|
151
|
+
Lights are compiled into every lit shader: a light that joins or leaves the scene rebuilds every
|
|
152
|
+
object in view at once. Keep a streamed world's light set fixed. Earth hosts mount dioramas with
|
|
153
|
+
`localLights: false`, which keeps a diorama's own point and spot lights out of the world scene; a
|
|
154
|
+
football field's scoreboard glow, loading and unloading as an aircraft passed, froze its takeoff.
|
|
145
155
|
|
|
146
156
|
Terrain palettes compile once per mesh. Terrain index topology is immutable and shared in a
|
|
147
157
|
bounded CPU cache; use a copy before editing or transferring it. Grids and building cells use
|
|
@@ -202,6 +212,11 @@ with `update(root, x, z, y)` so the ground far below an airframe never enters th
|
|
|
202
212
|
flies high the tree is empty and rebuilds are free. World Explorer's aircraft use 48 m / 24 m / 40 m,
|
|
203
213
|
its cars 32 m / 12 m / 24 m; walkers keep the 24 m / 6 m default and the whole column, which their
|
|
204
214
|
placement ray needs. The kernel's own ground contact (`groundHeight`) does not depend on this tree.
|
|
215
|
+
Low over a forest an aircraft's neighborhood still held 100k triangles of crowns and shrubs; with
|
|
216
|
+
`instanceBounds: true` each instance of an instanced mesh enters the tree as its bounding box,
|
|
217
|
+
twelve triangles, which is all an airframe's probes and its chase camera need. Ground cover (plant
|
|
218
|
+
models drawn only at near detail) is never solid, and the tree splits at each level by selecting a
|
|
219
|
+
median rather than sorting, so a rebuild of that size takes milliseconds rather than most of a second.
|
|
205
220
|
|
|
206
221
|
## Measurement
|
|
207
222
|
|