@bendyline/molen-tooling 0.0.1 → 0.0.3
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/README.md +22 -4
- package/dist/capture/harness.js +216 -216
- package/dist/capture/worldgen-preview.js +288 -288
- package/dist/cli.mjs +134 -12
- package/dist/docs-src/guide/3d-art-guidelines.md +2 -2
- package/dist/docs-src/guide/3d-model-assets.md +49 -13
- package/dist/docs-src/guide/adaptive-performance.md +4 -0
- package/dist/docs-src/guide/agent-loop.md +6 -6
- package/dist/docs-src/guide/aircraft.md +25 -17
- package/dist/docs-src/guide/audio.md +247 -0
- package/dist/docs-src/guide/browser-mount.md +17 -1
- package/dist/docs-src/guide/building-interiors.md +7 -5
- package/dist/docs-src/guide/determinism.md +27 -22
- package/dist/docs-src/guide/earth-view.md +444 -0
- package/dist/docs-src/guide/entities.md +17 -6
- package/dist/docs-src/guide/examples.md +39 -23
- package/dist/docs-src/guide/experience-playback.md +2 -3
- package/dist/docs-src/guide/game-samples.md +50 -21
- package/dist/docs-src/guide/graphics-performance.md +40 -8
- package/dist/docs-src/guide/input.md +9 -0
- package/dist/docs-src/guide/markers.md +52 -0
- package/dist/docs-src/guide/materials.md +10 -3
- package/dist/docs-src/guide/navigation.md +144 -0
- package/dist/docs-src/guide/project.md +23 -3
- package/dist/docs-src/guide/quickstart.md +39 -30
- package/dist/docs-src/guide/recognizable-places.md +24 -17
- package/dist/docs-src/guide/rendering-backends.md +5 -4
- package/dist/docs-src/guide/scripting.md +8 -4
- package/dist/docs-src/guide/sky.md +26 -9
- package/dist/docs-src/guide/source-bundles.md +0 -1
- package/dist/docs-src/guide/structure-library.md +20 -10
- package/dist/docs-src/guide/terrain.md +51 -6
- package/dist/docs-src/guide/vehicles.md +27 -14
- package/dist/docs-src/guide/worldgen.md +34 -24
- package/dist/docs-src/llms.txt +35 -18
- package/dist/docs-src/schemas/README.md +4 -1
- package/dist/docs-src/schemas/archive-set.md +175 -0
- package/dist/docs-src/schemas/components.md +1104 -1
- package/dist/docs-src/schemas/matgraph.md +6 -0
- package/dist/docs-src/schemas/soundbank.md +251 -0
- package/dist/docs-src/schemas/structure-placements.md +496 -0
- package/dist/docs-src/schemas/terrain-package.md +120 -0
- package/dist/index.d.mts +31 -3
- package/dist/index.mjs +2 -2
- package/dist/{mcp-BFnCWrg0.mjs → mcp-BTVwVKFb.mjs} +78 -4
- package/dist/{ops-BGxhSP6w.mjs → ops-BPdHodFR.mjs} +1181 -61
- package/dist/templates/city-courier/README.md +66 -0
- package/dist/templates/city-courier/checks.json +20 -0
- package/dist/templates/city-courier/commands.json +32 -0
- package/dist/templates/city-courier/delivery-run.replay.json +214 -0
- package/dist/templates/city-courier/gen/molen-types.ts +1016 -0
- package/dist/templates/city-courier/index.html +2 -0
- package/dist/templates/city-courier/package.json +26 -0
- package/dist/templates/city-courier/project.json +8 -0
- package/dist/templates/city-courier/scene.json +3474 -0
- package/dist/templates/city-courier/scripts/game.ts +131 -0
- package/dist/templates/city-courier/scripts/molen-scripts.d.ts +1288 -0
- package/dist/templates/city-courier/scripts/tsconfig.json +16 -0
- package/dist/templates/city-courier/src/audio.ts +96 -0
- package/dist/templates/city-courier/src/game-shell.css +317 -0
- package/dist/templates/city-courier/src/main.ts +84 -0
- package/dist/templates/city-courier/src/scene.ts +17 -0
- package/dist/templates/city-courier/src/vite-env.d.ts +1 -0
- package/dist/templates/city-courier/src/worker.ts +5 -0
- package/dist/templates/city-courier/test/headless.test.ts +95 -0
- package/dist/templates/city-courier/test/playthrough.test.js +52 -0
- package/dist/templates/city-courier/test/replay.test.ts +22 -0
- package/dist/templates/city-courier/tsconfig.json +17 -0
- package/dist/templates/city-courier/vite.config.ts +19 -0
- package/dist/templates/cubes/README.md +51 -0
- package/dist/templates/cubes/index.html +16 -0
- package/dist/templates/cubes/package.json +24 -0
- package/dist/templates/cubes/scene.json +15 -0
- package/dist/templates/cubes/src/cubes.ts +100 -0
- package/dist/templates/cubes/src/main.ts +21 -0
- package/dist/templates/cubes/src/worker.ts +15 -0
- package/dist/templates/cubes/test/headless.test.ts +98 -0
- package/dist/templates/cubes/tsconfig.json +17 -0
- package/dist/templates/cubes/vite.config.ts +17 -0
- package/dist/templates/data-viz/README.md +47 -0
- package/dist/templates/data-viz/camera-track.json +12 -0
- package/dist/templates/data-viz/data.json +9 -0
- package/dist/templates/data-viz/index.html +16 -0
- package/dist/templates/data-viz/package.json +25 -0
- package/dist/templates/data-viz/scene.json +7 -0
- package/dist/templates/data-viz/src/main.ts +39 -0
- package/dist/templates/data-viz/src/viz.ts +91 -0
- package/dist/templates/data-viz/src/worker.ts +12 -0
- package/dist/templates/data-viz/test/headless.test.ts +75 -0
- package/dist/templates/data-viz/tsconfig.json +17 -0
- package/dist/templates/data-viz/vite.config.ts +16 -0
- package/dist/templates/figures-gallery/README.md +46 -0
- package/dist/templates/figures-gallery/index.html +16 -0
- package/dist/templates/figures-gallery/package.json +25 -0
- package/dist/templates/figures-gallery/scene.json +276 -0
- package/dist/templates/figures-gallery/src/main.ts +44 -0
- package/dist/templates/figures-gallery/src/worker.ts +17 -0
- package/dist/templates/figures-gallery/test/headless.test.ts +90 -0
- package/dist/templates/figures-gallery/tsconfig.json +17 -0
- package/dist/templates/figures-gallery/vite.config.ts +17 -0
- package/dist/templates/index.json +191 -0
- package/dist/templates/skybound/README.md +66 -0
- package/dist/templates/skybound/checks.json +24 -0
- package/dist/templates/skybound/commands.json +32 -0
- package/dist/templates/skybound/first-leap.replay.json +224 -0
- package/dist/templates/skybound/gen/molen-types.ts +1016 -0
- package/dist/templates/skybound/index.html +2 -0
- package/dist/templates/skybound/package.json +26 -0
- package/dist/templates/skybound/project.json +8 -0
- package/dist/templates/skybound/scene.json +1777 -0
- package/dist/templates/skybound/scripts/game.ts +122 -0
- package/dist/templates/skybound/scripts/molen-scripts.d.ts +1288 -0
- package/dist/templates/skybound/scripts/tsconfig.json +16 -0
- package/dist/templates/skybound/src/audio.ts +96 -0
- package/dist/templates/skybound/src/game-shell.css +317 -0
- package/dist/templates/skybound/src/main.ts +63 -0
- package/dist/templates/skybound/src/scene.ts +17 -0
- package/dist/templates/skybound/src/vite-env.d.ts +1 -0
- package/dist/templates/skybound/src/worker.ts +5 -0
- package/dist/templates/skybound/test/headless.test.ts +124 -0
- package/dist/templates/skybound/test/playthrough.test.js +38 -0
- package/dist/templates/skybound/test/replay.test.ts +22 -0
- package/dist/templates/skybound/tsconfig.json +17 -0
- package/dist/templates/skybound/vite.config.ts +19 -0
- package/dist/templates/terrain-flyover/README.md +46 -0
- package/dist/templates/terrain-flyover/index.html +16 -0
- package/dist/templates/terrain-flyover/package.json +26 -0
- package/dist/templates/terrain-flyover/src/flyover.ts +23 -0
- package/dist/templates/terrain-flyover/src/main.ts +93 -0
- package/dist/templates/terrain-flyover/terrain.json +15 -0
- package/dist/templates/terrain-flyover/test/headless.test.ts +72 -0
- package/dist/templates/terrain-flyover/tsconfig.json +17 -0
- package/dist/templates/terrain-flyover/vite.config.ts +15 -0
- package/dist/templates/top-down-arena/README.md +65 -0
- package/dist/templates/top-down-arena/arena-skirmish.replay.json +204 -0
- package/dist/templates/top-down-arena/index.html +16 -0
- package/dist/templates/top-down-arena/package.json +26 -0
- package/dist/templates/top-down-arena/project.json +10 -0
- package/dist/templates/top-down-arena/scene.json +182 -0
- package/dist/templates/top-down-arena/scripts/chase.ts +17 -0
- package/dist/templates/top-down-arena/scripts/combat.ts +13 -0
- package/dist/templates/top-down-arena/scripts/control.ts +8 -0
- package/dist/templates/top-down-arena/scripts/molen-scripts.d.ts +1258 -0
- package/dist/templates/top-down-arena/scripts/spawner.ts +11 -0
- package/dist/templates/top-down-arena/scripts/tsconfig.json +16 -0
- package/dist/templates/top-down-arena/src/arena.ts +8 -0
- package/dist/templates/top-down-arena/src/audio.ts +96 -0
- package/dist/templates/top-down-arena/src/gen/molen-types.ts +1020 -0
- package/dist/templates/top-down-arena/src/main.ts +34 -0
- package/dist/templates/top-down-arena/src/scene.ts +24 -0
- package/dist/templates/top-down-arena/src/vite-env.d.ts +1 -0
- package/dist/templates/top-down-arena/src/worker.ts +7 -0
- package/dist/templates/top-down-arena/test/headless.test.ts +87 -0
- package/dist/templates/top-down-arena/test/replay.test.ts +22 -0
- package/dist/templates/top-down-arena/tsconfig.json +17 -0
- package/dist/templates/top-down-arena/types/arena.types.json +54 -0
- package/dist/templates/top-down-arena/vite.config.ts +21 -0
- package/package.json +14 -14
|
@@ -1,20 +1,33 @@
|
|
|
1
1
|
# Three complete games, one authoring path
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
CLI. Each is JSON data + scene scripts,
|
|
5
|
-
bindings, semantic prefabs, durable state, a HUD,
|
|
3
|
+
City Courier, The Lantern Vault and Skybound are complete games that exercise the same scene →
|
|
4
|
+
`buildWorld` → Worker → `mountExperience` path as the CLI. Each is JSON data + scene scripts,
|
|
5
|
+
with declared command/component schemas, input bindings, semantic prefabs, durable state, a HUD,
|
|
6
|
+
restart, and a tested win condition.
|
|
6
7
|
|
|
7
|
-
| Sample | Play
|
|
8
|
+
| Sample | Play | Loop | Engine services |
|
|
8
9
|
|---|---|---|---|
|
|
9
|
-
| City Courier |
|
|
10
|
-
| The Lantern Vault |
|
|
11
|
-
| Skybound |
|
|
10
|
+
| City Courier | [molen.dev/play/city-courier](https://molen.dev/play/city-courier/) | Five deliveries, traffic, damage and a time limit | XZ kinematics, hierarchy, follow camera |
|
|
11
|
+
| The Lantern Vault | [molen.dev/play/lantern-dungeon](https://molen.dev/play/lantern-dungeon/) | Key, melee combat, healing, gate and relic | XZ kinematics/raycast, seeded RNG, hierarchy, tween, local follow camera |
|
|
12
|
+
| Skybound | [molen.dev/play/skybound](https://molen.dev/play/skybound/) | Islands, seeds, stomps, hazards, checkpoint and finish | XY platform controller, hierarchy, world follow camera |
|
|
13
|
+
|
|
14
|
+
To take one apart, copy it into your own npm project:
|
|
15
|
+
|
|
16
|
+
```sh
|
|
17
|
+
npx @bendyline/molen-tooling new my-courier --template city-courier # or skybound
|
|
18
|
+
cd my-courier && npm install
|
|
19
|
+
npx molen sim run scene.json --ticks 90 --commands commands.json --assert checks.json --hash
|
|
20
|
+
npm test # includes the playthrough
|
|
21
|
+
npm run dev
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
The Lantern Vault is not a template, because its 28 GLB models are content and npm packages never
|
|
25
|
+
include content. Play it at molen.dev and read it
|
|
26
|
+
[on GitHub](https://github.com/bendyline/molen/tree/main/examples/lantern-dungeon).
|
|
12
27
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
in each sample proves its objective is reachable using player commands alone. Headless tests
|
|
17
|
-
also verify checkpoint continuation; browser tests exercise the actual Worker and DOM inputs.
|
|
28
|
+
Each sample's README documents controls and the exact validate/simulate/assert/screenshot
|
|
29
|
+
commands. `test/playthrough.test.js` in each sample proves its objective is reachable using player
|
|
30
|
+
commands alone. Headless tests also verify checkpoint continuation.
|
|
18
31
|
|
|
19
32
|
## Follow cameras
|
|
20
33
|
|
|
@@ -77,6 +90,22 @@ simulation. Validation, headless play, replay/checkpoints, browser play, and scr
|
|
|
77
90
|
the same scene and scripts. The new camera and platform services remove duplicated host logic
|
|
78
91
|
and sample-specific collision solvers from ordinary game authoring.
|
|
79
92
|
|
|
93
|
+
## Sound
|
|
94
|
+
|
|
95
|
+
Each game annotates its scene for sound, and `src/audio.ts` plays it from the `molen.sounds` pack:
|
|
96
|
+
|
|
97
|
+
| Sample | Scene data | Script calls |
|
|
98
|
+
| --- | --- | --- |
|
|
99
|
+
| City Courier | City traffic ambience, racing music; an engine on the player pitched by `self.speed` and quieter engines on the traffic cars; `crash` and `delivery` events mapped to sounds | `molen.audio.play('sting.win')` when the route is complete, `'ui.error'` on a loss |
|
|
100
|
+
| The Lantern Vault | Dungeon ambience and music, stone footsteps, a draft `audioZone` by the vault; `strike`, `hurt`, `heal`, `key-found`, `gate-opened` and `victory` mapped to sounds | `molen.audio.play('weapon.slash')` on every swing |
|
|
101
|
+
| Skybound | Wind that rises with the camera (`listener.y`), heroic music; pickups, stomps, checkpoint, respawn and victory mapped to sounds | `molen.audio.play('game.jump')` on a jump that can happen |
|
|
102
|
+
| Top-down arena | Arena music; `player-hit` mapped to a hit sound | `molen.emit('player-hit', …)` on contact |
|
|
103
|
+
|
|
104
|
+
`npx molen audio plan scene.json --ticks 300 --commands commands.json` prints what each one plays.
|
|
105
|
+
In a copy made with `--template`, fetch the sounds first with
|
|
106
|
+
`npx molen pack fetch https://molen.dev/packs/index.json molen.sounds --out-dir public/packs`.
|
|
107
|
+
See [Sound and music](audio.md).
|
|
108
|
+
|
|
80
109
|
These are compact single-player examples, not demonstrations of authoritative remote servers,
|
|
81
110
|
network prediction, vehicle suspension, full tabletop rules, or large-world streaming. The
|
|
82
111
|
world-explorer and terrain-flyover samples remain the terrain starting points.
|
|
@@ -89,12 +118,12 @@ asset/component APIs as the headless tools. Three creatures participate in comba
|
|
|
89
118
|
ambient dressing. The project index maps every model to a sidecar under `public/assets/`, so Vite
|
|
90
119
|
serves the same files that CLI captures verify.
|
|
91
120
|
|
|
92
|
-
See the [illustrated catalog](
|
|
93
|
-
[editable sources and regeneration guide](
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
121
|
+
See the [illustrated catalog](https://github.com/bendyline/molen/blob/main/examples/lantern-dungeon/asset-src/CATALOG.md)
|
|
122
|
+
and the [editable sources and regeneration guide](https://github.com/bendyline/molen/blob/main/examples/lantern-dungeon/asset-src/README.md).
|
|
123
|
+
The [example asset contract](https://github.com/bendyline/molen/blob/main/examples/ASSETS.md)
|
|
124
|
+
keeps editable masters and optimized runtime copies separately. The dungeon supports hand-edited
|
|
125
|
+
GLBs, protects them from accidental regeneration, and checks source/runtime freshness with a
|
|
126
|
+
Node-only verification script. [3D model assets](3d-model-assets.md) describes the same workflow
|
|
127
|
+
for your own project with the published CLI (`molen asset import`, `asset inspect --verify`,
|
|
128
|
+
`asset shot`). All three game builds use relative URLs, so each one can be hosted beneath a
|
|
129
|
+
subdirectory, as molen.dev/play does.
|
|
@@ -57,7 +57,7 @@ const viewer = await createViewer({
|
|
|
57
57
|
maxMilliseconds: 2, // explicit low-latency budget; WebGPU default is 8
|
|
58
58
|
maxBytes: 2 * 1024 * 1024,
|
|
59
59
|
maxJobs: 32,
|
|
60
|
-
onSample(sample) { /* label, workMs, queueMs, bytes, overBudget */ },
|
|
60
|
+
onSample(sample) { /* label, workMs, queueMs, bytes, overBudget, background */ },
|
|
61
61
|
},
|
|
62
62
|
});
|
|
63
63
|
```
|
|
@@ -66,19 +66,25 @@ The queue limits synchronous work started per animation frame. One oversized ind
|
|
|
66
66
|
runs alone and is reported as over budget. This is not a hard GPU/driver time bound. Texture
|
|
67
67
|
initialization, geometry preparation and async shader compilation use public Three facilities;
|
|
68
68
|
shared resources share pending preparation promises. A cancelled tile cannot cancel another
|
|
69
|
-
tile waiting on the same resource
|
|
70
|
-
ready; stale batch results
|
|
69
|
+
tile waiting on the same resource; queued work is dropped once every tile waiting for it has
|
|
70
|
+
cancelled. Prepared static batches replace ordinary meshes only when ready; stale batch results
|
|
71
|
+
are discarded.
|
|
71
72
|
Instanced LOD meshes each prepare their own WebGPU node builder even when every buffer is
|
|
72
|
-
shared.
|
|
73
|
-
|
|
73
|
+
shared. When `prepareObject` receives the parent the object will join, it evaluates LODs for
|
|
74
|
+
the current camera and waits only for the selected levels. The other levels prepare in the
|
|
75
|
+
queue's background lane (`priority: 'background'`), which runs only in budget that normal jobs
|
|
76
|
+
leave, and are dropped if their mesh or geometry is disposed first. Resident world-generation
|
|
77
|
+
quality replacements use the same preparation/publication path when supplied with
|
|
78
|
+
`WorldgenRendererOptions.prepareObject` (enabled in World Explorer).
|
|
74
79
|
|
|
75
|
-
For custom streamed geometry, call `await renderer.prepareObject(object, signal)` before
|
|
76
|
-
publication. Connect the same queue to terrain
|
|
80
|
+
For custom streamed geometry, call `await renderer.prepareObject(object, signal, parent)` before
|
|
81
|
+
publication. Connect the same queue to terrain, which passes each layer's tile group as `parent`:
|
|
77
82
|
|
|
78
83
|
```ts
|
|
79
84
|
const terrain = await createTerrainPackagePyramidStream(packageDescriptor, {
|
|
80
85
|
admission: viewer.renderer.admission,
|
|
81
|
-
prepareObject: (object, signal) =>
|
|
86
|
+
prepareObject: (object, signal, parent) =>
|
|
87
|
+
viewer.renderer.prepareObject(object, signal, parent),
|
|
82
88
|
elevationWorker: new Worker(new URL('./elevation-worker.ts', import.meta.url), { type: 'module' }),
|
|
83
89
|
onElevationTiming: sample => { /* decode, resample, mesh; milliseconds */ },
|
|
84
90
|
});
|
|
@@ -99,6 +105,14 @@ return the synchronous baker's exact pixels through transferables. World Explore
|
|
|
99
105
|
startup workers and releases them when its style pack is baked; `materialWorker=0` retains
|
|
100
106
|
synchronous baking for comparisons. Its `material-bake` timing reports worker CPU time.
|
|
101
107
|
|
|
108
|
+
`withBakedMaterialStore(baker, store)` serves bakes from a persistent `BakedMaterialStore`, such as
|
|
109
|
+
`createIndexedDbMaterialStore()` from `@bendyline/molen-client`, so a later visit reads textures
|
|
110
|
+
instead of rasterizing them. Keys combine the document's content with a fingerprint of the
|
|
111
|
+
rasterizers (a tiny bake that exercises every node type), so a changed baker never serves stale
|
|
112
|
+
pixels and its old entries are pruned. Store failures fall back to baking. `createEarthWorldgen`
|
|
113
|
+
and `mountEarthView` accept the store as `materialStore`; World Explorer passes the IndexedDB store
|
|
114
|
+
unless `materialCache=0`.
|
|
115
|
+
|
|
102
116
|
World-generation workers also prepare building spatial cells and full/structural LOD indices.
|
|
103
117
|
The renderer requests `renderCellsOnly` when using cell LODs so it does not retain a redundant
|
|
104
118
|
canonical building mesh. Per-cell Three object assembly is a separate queue job. Generation
|
|
@@ -152,6 +166,24 @@ semantic layers use coverage-preserving atomic replacement and hysteresis instea
|
|
|
152
166
|
one finishes any surface morph before layer publication. Coarsening does not height-morph.
|
|
153
167
|
World Explorer uses 180 ms for bare terrain; deterministic `freeze` captures disable morphing.
|
|
154
168
|
|
|
169
|
+
## Collision neighborhoods
|
|
170
|
+
|
|
171
|
+
`WalkCollision` from `@bendyline/molen-client/navigation` gives walkers, driven cars and piloted
|
|
172
|
+
aircraft a triangle tree of the visible geometry around them. Two costs matter. The **scan** visits
|
|
173
|
+
every visible mesh under the root to notice streamed changes; it runs on `update` only when the
|
|
174
|
+
subject has left the neighborhood, when `rescanIntervalMs` has passed (the Earth hosts use 200 ms)
|
|
175
|
+
or after `invalidate()`. The **rebuild** transforms the nearby triangles into the tree; geometries
|
|
176
|
+
of 4096 triangles or more are walked through a per-geometry XZ index, built on first use and kept
|
|
177
|
+
with the geometry, so a terrain tile or building cell contributes only the triangles that can reach
|
|
178
|
+
the neighborhood instead of every triangle it holds.
|
|
179
|
+
|
|
180
|
+
A subject that moves tens of meters a second would otherwise recenter the tree every few frames.
|
|
181
|
+
Vehicles and aircraft use a wider `radius` with a larger `rebuildDistance`, and a `verticalRadius`
|
|
182
|
+
with `update(root, x, z, y)` so the ground far below an airframe never enters the tree; while it
|
|
183
|
+
flies high the tree is empty and rebuilds are free. World Explorer's aircraft use 48 m / 24 m / 40 m,
|
|
184
|
+
its cars 32 m / 12 m / 24 m; walkers keep the 24 m / 6 m default and the whole column, which their
|
|
185
|
+
placement ray needs. The kernel's own ground contact (`groundHeight`) does not depend on this tree.
|
|
186
|
+
|
|
155
187
|
## Measurement
|
|
156
188
|
|
|
157
189
|
World Explorer enables elevation workers, shared admission and shader warmup by default.
|
|
@@ -35,6 +35,15 @@ A custom `getGamepads` callback can supply the same structural snapshots, so a h
|
|
|
35
35
|
another facility, such as a device-specific WebHID integration, without changing profiles or UI.
|
|
36
36
|
Molen does not itself request WebHID permission or implement device-specific HID reports.
|
|
37
37
|
|
|
38
|
+
## Software controls
|
|
39
|
+
|
|
40
|
+
On-screen controls feed the same actions as physical devices. `input.setVirtual(source, action,
|
|
41
|
+
value)` sets a named control's contribution, for example a touch stick pushing `move-forward` to
|
|
42
|
+
0.6, and `input.clearVirtual(source)` releases everything it drives. As with other devices, the
|
|
43
|
+
strongest contribution to an action wins. Software values persist until changed, and a reset
|
|
44
|
+
(focus loss, suspension, profile switch) releases them. `createTouchJoystick` in
|
|
45
|
+
[`@bendyline/molen-client/navigation`](navigation.md) is a ready-made stick built on this.
|
|
46
|
+
|
|
38
47
|
## Define and switch profiles
|
|
39
48
|
|
|
40
49
|
```ts
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
# World markers
|
|
2
|
+
|
|
3
|
+
`@bendyline/molen-client/markers` draws screen-sized billboards pinned to world positions: photo
|
|
4
|
+
pins, labels you render to images, waypoints. A marker keeps a constant on-screen size. It sits on
|
|
5
|
+
the ground, re-snapping as finer terrain streams in, hides behind hills and buildings through the
|
|
6
|
+
depth test, and can fade with distance. Markers are budgeted so the nearest or most important ones
|
|
7
|
+
draw, and `pick(x, y)` resolves a click or tap to a marker id.
|
|
8
|
+
|
|
9
|
+
```ts
|
|
10
|
+
import { composeMarkerImage, createMarkerLayer } from '@bendyline/molen-client/markers';
|
|
11
|
+
import { wgs84ToWorld } from '@bendyline/molen-terrain/kernel';
|
|
12
|
+
|
|
13
|
+
const markers = createMarkerLayer(viewer.renderer, {
|
|
14
|
+
groundHeight: (x, z) => stream.sampleHeight(x, z),
|
|
15
|
+
maxVisible: 200,
|
|
16
|
+
fade: { near: 15_000, far: 40_000 },
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
const photo = await createImageBitmap(await (await fetch(thumbnailUrl)).blob());
|
|
20
|
+
const [x, z] = wgs84ToWorld(metersPerUnit, longitude, latitude);
|
|
21
|
+
markers.set([
|
|
22
|
+
{
|
|
23
|
+
id: 'space-needle',
|
|
24
|
+
x,
|
|
25
|
+
z,
|
|
26
|
+
elevation: 2,
|
|
27
|
+
image: composeMarkerImage(photo, { borderColor: '#c4a265' }),
|
|
28
|
+
size: 64,
|
|
29
|
+
},
|
|
30
|
+
]);
|
|
31
|
+
|
|
32
|
+
// each frame, after posing the camera:
|
|
33
|
+
markers.update(cameraPosition);
|
|
34
|
+
|
|
35
|
+
// on a tap (element-relative CSS pixels, e.g. NavigationInput.taps):
|
|
36
|
+
const id = markers.pick(tap.x, tap.y);
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
- **Coordinates** are absolute world meters, the same ones you give `setCamera`. The layer lives
|
|
40
|
+
under `renderer.worldRoot`, so floating-origin rebasing moves it with everything else. Omit `y`
|
|
41
|
+
to sit on the ground (`groundHeight` + `elevation`). Ground-snapped markers stay hidden until
|
|
42
|
+
their ground height is known (`hideUntilGrounded`), so pins never jump from sea level.
|
|
43
|
+
- **Images** are canvases, bitmaps, image elements, or URLs. Markers that share an image share one
|
|
44
|
+
texture, and `set` matches markers by id, so re-calling it with the same list costs nothing.
|
|
45
|
+
`composeMarkerImage` cover-crops a photo into a rounded, bordered frame with a shadow and a
|
|
46
|
+
pointer tail. The canvas's bottom-center is the pin point, which suits the default
|
|
47
|
+
`anchor: 'bottom'`.
|
|
48
|
+
- **Budget:** `maxVisible` keeps the highest `priority`, then nearest, markers.
|
|
49
|
+
- `screenPosition(id)` places DOM callouts next to a marker. `projectWorldToScreen(renderer,
|
|
50
|
+
position)` projects any world point the same way.
|
|
51
|
+
|
|
52
|
+
The layer never fetches anything you did not pass it, and it adds no draw calls when it is empty.
|
|
@@ -39,7 +39,7 @@ every char is in the palette — with row/column pinpointed. Bake: `molen materi
|
|
|
39
39
|
|
|
40
40
|
Author vector art and rasterize it deterministically (resvg, identical bytes in Node/browser/CI):
|
|
41
41
|
|
|
42
|
-
```
|
|
42
|
+
```sh
|
|
43
43
|
molen material bake badge.svg -o badge.png
|
|
44
44
|
```
|
|
45
45
|
|
|
@@ -83,10 +83,11 @@ evidence across environments rather than a proof across JS engines; see
|
|
|
83
83
|
- Each node has an optional `input` (single upstream node) or `inputs` (named, e.g. blend's `b`).
|
|
84
84
|
- `outputs` maps PBR slots (baseColor, roughness, metalness, normal, emissive, ao) to node ids.
|
|
85
85
|
- Cycles are a validation error naming the path.
|
|
86
|
+
- Optional `alphaTest: 0.5` renders base-color RGBA alpha as cutout holes; ramps accept `#rrggbbaa`. Omitted graphs remain opaque. Cutouts write depth normally and do not use blended transparency.
|
|
86
87
|
|
|
87
88
|
Bake and inspect:
|
|
88
89
|
|
|
89
|
-
```
|
|
90
|
+
```sh
|
|
90
91
|
molen material bake rock.matgraph.json -o rock.png
|
|
91
92
|
```
|
|
92
93
|
|
|
@@ -101,7 +102,7 @@ Full node vocabulary and per-field schema: [schemas/matgraph.md](../schemas/matg
|
|
|
101
102
|
For textured models: a sidecar pairs a model with island annotations and a painted template, so a
|
|
102
103
|
flat color/paint pass re-imports into the right UV islands (masked + gutter-dilated).
|
|
103
104
|
|
|
104
|
-
```
|
|
105
|
+
```sh
|
|
105
106
|
molen validate scout.uvpaint.json
|
|
106
107
|
molen uvpaint apply scout-painted.png --islands scout-islands.png -o scout-tex.png
|
|
107
108
|
# (same op over MCP: apply_uv_paint)
|
|
@@ -119,6 +120,12 @@ The client resolves materialRefs at load time:
|
|
|
119
120
|
`MeshStandardMaterial`. Works in the live client and in `molen shot` (the capture server
|
|
120
121
|
serves the doc). A bad ref falls back to grey with a warning — it never blanks the scene.
|
|
121
122
|
|
|
123
|
+
The client stores a constant roughness or metalness channel as an exact numeric factor
|
|
124
|
+
instead of allocating a map. It checks the sampled channel (roughness G, metalness B),
|
|
125
|
+
preserves its quantized `byte / 255` value and multiplies the existing factor. Other channels
|
|
126
|
+
keep their textures. A rendered material may therefore have a null `roughnessMap` or
|
|
127
|
+
`metalnessMap` even when the baked document contains that channel.
|
|
128
|
+
|
|
122
129
|
`molen material bake` (or `rasterize_material`) still bakes to PNG when you want a static
|
|
123
130
|
texture asset or a golden comparison. SVG (rung 3) runs anywhere once `initSvg` has its WASM;
|
|
124
131
|
Node is simply the environment that finds it automatically.
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
# Camera navigation
|
|
2
|
+
|
|
3
|
+
`@bendyline/molen-client/navigation` moves a camera through a world you render yourself with
|
|
4
|
+
`createViewer`: an orbit camera for map-style views, free flight, first-person walking with
|
|
5
|
+
collision against whatever geometry you stream, and a chase camera for vehicles or avatars. Input
|
|
6
|
+
comes from one model that spans keyboard, gamepad, mouse and touch gestures, and an on-screen
|
|
7
|
+
stick. Nothing here attaches to `window`; every listener goes on the element you pass, so the
|
|
8
|
+
controls embed cleanly in a larger page.
|
|
9
|
+
|
|
10
|
+
Controllers are plain objects. Each frame you read an input, call `update(dt, input, environment)`
|
|
11
|
+
and render the returned pose:
|
|
12
|
+
|
|
13
|
+
```ts
|
|
14
|
+
import { createViewer } from '@bendyline/molen-client';
|
|
15
|
+
import { NavigationInputSource, OrbitController } from '@bendyline/molen-client/navigation';
|
|
16
|
+
|
|
17
|
+
canvas.tabIndex = 0; // key events arrive once the canvas has focus; presses focus it
|
|
18
|
+
const viewer = await createViewer({ canvas, cameraFar: 500_000 });
|
|
19
|
+
const input = new NavigationInputSource({ element: canvas, profile: 'orbit' });
|
|
20
|
+
const orbit = new OrbitController({ target: [0, 0, 0], range: 3000, heading: 0, pitch: 0.6 });
|
|
21
|
+
const environment = { groundHeight: (x: number, z: number) => stream.sampleHeight(x, z) };
|
|
22
|
+
|
|
23
|
+
let last = performance.now();
|
|
24
|
+
function frame(now: number) {
|
|
25
|
+
const dt = (now - last) / 1000;
|
|
26
|
+
last = now;
|
|
27
|
+
const pose = orbit.update(dt, input.read(dt), environment);
|
|
28
|
+
stream.update({ position: pose.position, direction: pose.direction, verticalFov, viewportHeight });
|
|
29
|
+
viewer.setCamera({ position: pose.position, lookAt: pose.lookAt });
|
|
30
|
+
viewer.renderFrame();
|
|
31
|
+
requestAnimationFrame(frame);
|
|
32
|
+
}
|
|
33
|
+
requestAnimationFrame(frame);
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
`environment.groundHeight(x, z)` returns the ground height at a world position, or `undefined`
|
|
37
|
+
while that terrain has not streamed in. Terrain streams provide it as `sampleHeight`. Controllers
|
|
38
|
+
use it to settle onto ground as it loads and to keep the camera above it.
|
|
39
|
+
|
|
40
|
+
## Orbit
|
|
41
|
+
|
|
42
|
+
`OrbitController` frames a ground `target` from `range` meters away, looking along a compass
|
|
43
|
+
`heading` (0 north, `PI/2` east) and tilted `pitch` radians below the horizon. Drag to rotate and
|
|
44
|
+
tilt (the scene follows the pointer), use the wheel or a pinch to zoom, twist two fingers to
|
|
45
|
+
rotate, and pan with the secondary mouse button, shift-drag, two fingers, or WASD/arrow keys (Q/E
|
|
46
|
+
zoom). Motion eases toward a goal, so every change feels smooth.
|
|
47
|
+
|
|
48
|
+
`flyTo({ target, range, heading, pitch }, { durationMs })` animates to a framing. It rises
|
|
49
|
+
mid-flight on long hops so the camera clears the scenery, and any direct input cancels it.
|
|
50
|
+
`set(state)` jumps immediately, and `state` reads the current framing. The target settles onto the
|
|
51
|
+
ground as finer terrain arrives, and the camera never dips below `minClearance`.
|
|
52
|
+
|
|
53
|
+
## Fly
|
|
54
|
+
|
|
55
|
+
`FlyController` moves along the view with WASD or the left stick, changes altitude with Q/E, and
|
|
56
|
+
looks by dragging or with the right stick. Its speed scales with height above ground, from
|
|
57
|
+
`minSpeed` near the surface to continental speeds high up, so one control scheme works at every
|
|
58
|
+
scale. Shift sprints.
|
|
59
|
+
|
|
60
|
+
## Walk
|
|
61
|
+
|
|
62
|
+
`WalkController` is a 1.8 m capsule with gravity, jumping, wall sliding and a 50° walkable-slope
|
|
63
|
+
limit. It integrates at a fixed 120 Hz, so the same input produces the same path at any frame rate.
|
|
64
|
+
Its world position is `feet`; render the camera `WALK_EYE_HEIGHT` above it. Collision comes from
|
|
65
|
+
`WalkCollision`, which builds a small bounding-volume tree from the **visible** meshes under a root
|
|
66
|
+
(usually your terrain stream's object) within a neighborhood of the walker: 24 m by default,
|
|
67
|
+
rebuilt once the walker has moved 6 m from its center or the geometry inside it changed. It stays
|
|
68
|
+
correct across floating-origin rebasing.
|
|
69
|
+
|
|
70
|
+
```ts
|
|
71
|
+
const walker = new WalkController();
|
|
72
|
+
// Each scan visits every visible mesh under the root; 5 Hz still catches streamed changes.
|
|
73
|
+
const collision = new WalkCollision({ rescanIntervalMs: 200 });
|
|
74
|
+
walker.reset(x, z);
|
|
75
|
+
// each frame:
|
|
76
|
+
if (!walker.ready) collision.invalidate(); // placement must see geometry published this frame
|
|
77
|
+
collision.update(stream.object, walker.feet.x, walker.feet.z);
|
|
78
|
+
if (!walker.ready) walker.place(collision, sampleHeight); // finds open ground, not a roof
|
|
79
|
+
walker.update(dt, { forward, right, yaw, sprint, jump }, collision, sampleHeight);
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
`update` scans the scene when the subject leaves the neighborhood, when `rescanIntervalMs` has
|
|
83
|
+
passed (default 0: every call), or after `invalidate()`, and rebuilds the tree only when the nearby
|
|
84
|
+
meshes changed. Terrain tiles and building cells are walked through a per-geometry spatial index,
|
|
85
|
+
so a rebuild costs the triangles near the subject, not the whole tile. Faster subjects widen the
|
|
86
|
+
neighborhood and bound it vertically: `new WalkCollision({ radius: 48, rebuildDistance: 24,
|
|
87
|
+
verticalRadius: 40 })` with `update(root, x, z, y)` keeps ground far below an aircraft out of the
|
|
88
|
+
tree entirely. Queries reach at most `radius - rebuildDistance` from the subject. Leave
|
|
89
|
+
`verticalRadius` unset for a walker, whose placement ray scans the whole column.
|
|
90
|
+
|
|
91
|
+
Meshes opt out with `userData.walkIgnore = true`. Water materials and landcover overlays are never
|
|
92
|
+
solid. A missing terrain tile pauses movement until it arrives, rather than dropping the walker.
|
|
93
|
+
|
|
94
|
+
## Follow
|
|
95
|
+
|
|
96
|
+
`FollowController` trails a subject, given its position and compass heading, at a set distance
|
|
97
|
+
and height. It eases after turns and bumps instead of welding to them. Look input swings the camera
|
|
98
|
+
around the subject, and it drifts back behind the subject after the input stops. Call `reset()`
|
|
99
|
+
after a teleport. For the cockpit and chase views of a mounted vehicle, see
|
|
100
|
+
[vehicles](vehicles.md) (`vehicleCameraPose`).
|
|
101
|
+
|
|
102
|
+
## Input
|
|
103
|
+
|
|
104
|
+
`NavigationInputSource` combines an `InputMap` (keyboard, gamepad, software controls) with
|
|
105
|
+
`NavigationPointer` gestures into one `NavigationInput` per frame: `move` (forward/right/up,
|
|
106
|
+
-1..1), `look`, `pan`, `zoom`, `twist`, `sprint`, `jump`, edge-triggered `interact`/`view` press
|
|
107
|
+
counts, and element-relative `taps` for picking. You can also build a `NavigationInput` yourself,
|
|
108
|
+
which is useful in tests, replays and agent-driven cameras (`idleNavigationInput()` is the neutral
|
|
109
|
+
value).
|
|
110
|
+
|
|
111
|
+
Default profiles come from `navigationInputProfiles()`:
|
|
112
|
+
|
|
113
|
+
| Profile | Keys | Gamepad (standard mapping) |
|
|
114
|
+
|---|---|---|
|
|
115
|
+
| `orbit`, `fly` | WASD/arrows move, Q/E down/up, Shift sprint | left stick move, right stick look, bumpers up/down |
|
|
116
|
+
| `walk`, `drive` | WASD/arrows move, Space jump/brake, E or F interact, V view, Shift sprint | left stick move, right stick look, A jump, X interact, Y view |
|
|
117
|
+
|
|
118
|
+
Call `input.setProfile(mode)` when navigation changes. The walk profile also turns on pointer lock
|
|
119
|
+
for mouse-look, with drag-look as the fallback when pointer lock is declined. Replace any profile
|
|
120
|
+
with `input.map.defineProfile(name, profile)`. The action names are exported as
|
|
121
|
+
`NAVIGATION_ACTIONS`.
|
|
122
|
+
|
|
123
|
+
### Touch
|
|
124
|
+
|
|
125
|
+
One finger drags to look, two fingers pinch, twist and pan, and a quick tap is reported in `taps`.
|
|
126
|
+
For movement on phones, add the on-screen stick:
|
|
127
|
+
|
|
128
|
+
```ts
|
|
129
|
+
import { createTouchJoystick } from '@bendyline/molen-client/navigation';
|
|
130
|
+
|
|
131
|
+
const stick = createTouchJoystick(container, input.map); // bottom-left, style with className
|
|
132
|
+
stick.setVisible(matchMedia('(pointer: coarse)').matches);
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
The stick drives the same `nav-forward`/`nav-back`/`nav-left`/`nav-right` actions through
|
|
136
|
+
`InputMap.setVirtual`, so a phone moves exactly like a keyboard or gamepad. `TouchStick` is its
|
|
137
|
+
DOM-free geometry, if you want to draw your own.
|
|
138
|
+
|
|
139
|
+
## Streaming alongside the camera
|
|
140
|
+
|
|
141
|
+
Terrain selection is usually throttled (for example to 10 Hz). `viewNeedsImmediateUpdate(previous
|
|
142
|
+
position, previous direction, position, direction, moveThreshold, turnRadians)` reports when a
|
|
143
|
+
move or turn is large enough to outrun the selector's guard band, so you can update the stream
|
|
144
|
+
before rendering that frame.
|
|
@@ -48,8 +48,28 @@ the same trust and determinism rules as scene scripts apply.
|
|
|
48
48
|
## Content packs (`packs`)
|
|
49
49
|
|
|
50
50
|
Shared content (entity types and models, style packs, catalogs) is not in any npm package; it
|
|
51
|
-
comes in content packs, `molen/pack@1` zip files built with `molen pack build`.
|
|
52
|
-
|
|
51
|
+
comes in content packs, `molen/pack@1` zip files built with `molen pack build`. Molen's own packs
|
|
52
|
+
are published with each release at `https://molen.dev/packs/`, listed by a `molen/pack-index@1`
|
|
53
|
+
index:
|
|
54
|
+
|
|
55
|
+
| Pack | What it carries |
|
|
56
|
+
| --- | --- |
|
|
57
|
+
| `molen.entities` | Entity types and models: trees, a shrub, a boulder, aircraft and road vehicles ([entities](entities.md)) |
|
|
58
|
+
| `molen.worldgen.default` | The default style pack: archstyles, materials, scatter rules, landmarks, 120 structures ([worldgen](worldgen.md)) |
|
|
59
|
+
| `molen.earth` | The region atlas and the business identity catalog ([recognizable places](recognizable-places.md)) |
|
|
60
|
+
| `molen.sky` | The Bright Star Catalogue as `molen/stars@1` columns ([sky](sky.md)) |
|
|
61
|
+
|
|
62
|
+
```sh
|
|
63
|
+
npx molen pack fetch https://molen.dev/packs/index.json # all of them
|
|
64
|
+
npx molen pack fetch https://molen.dev/packs/index.json molen.entities # just one
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
`pack fetch` downloads into `packs/` beside project.json and pins each pack's `contentHash` in
|
|
68
|
+
the project's `packs`, so the project keeps working offline and a later re-publish never changes
|
|
69
|
+
it underneath you. A browser app serves the same zips from wherever it hosts its static files.
|
|
70
|
+
|
|
71
|
+
A project lists the packs it uses, in order, and their types join the registry like the
|
|
72
|
+
project's own:
|
|
53
73
|
|
|
54
74
|
```json
|
|
55
75
|
{
|
|
@@ -79,7 +99,7 @@ recorded replay keeps that identity (see [determinism](determinism.md)). A proje
|
|
|
79
99
|
namespace and everything under it on dot boundaries (`train` covers `train.car`, not
|
|
80
100
|
`trainer.x`), for **both type ids and asset ids**. Reserve before you author:
|
|
81
101
|
|
|
82
|
-
```
|
|
102
|
+
```sh
|
|
83
103
|
molen types reserve train --owner agent:layout
|
|
84
104
|
```
|
|
85
105
|
|
|
@@ -1,10 +1,18 @@
|
|
|
1
1
|
# Quickstart
|
|
2
2
|
|
|
3
|
+
Everything here runs from the published npm packages. You never need a clone of the engine
|
|
4
|
+
repository to build on Molen. Node ≥ 22.13.
|
|
5
|
+
|
|
6
|
+
## See it running
|
|
7
|
+
|
|
8
|
+
Every sample plays in the browser at [molen.dev/play](https://molen.dev/play/), with nothing to
|
|
9
|
+
install: three complete games, the capability demos and the small starters.
|
|
10
|
+
|
|
3
11
|
## Start your own project
|
|
4
12
|
|
|
5
|
-
|
|
13
|
+
Scaffold a project from npm and install it:
|
|
6
14
|
|
|
7
|
-
```
|
|
15
|
+
```sh
|
|
8
16
|
npx @bendyline/molen-tooling new my-experience
|
|
9
17
|
cd my-experience
|
|
10
18
|
npm install # the engine, the molen CLI, TypeScript and Vite
|
|
@@ -15,39 +23,34 @@ npm run dev # the same scene in the browser
|
|
|
15
23
|
|
|
16
24
|
`my-experience/` is a runnable project (project.json + scene + type registry + setup + commands +
|
|
17
25
|
checks), and `new` prints the exact headless-loop commands. Use the scoped package name for the
|
|
18
|
-
first command: the unscoped `molen` on npm is unrelated.
|
|
26
|
+
first command: the unscoped `molen` on npm is unrelated. Inside the project, `npx molen` runs the
|
|
27
|
+
CLI the project installed. See the [agent loop](agent-loop.md) and
|
|
19
28
|
[projects & types](project.md).
|
|
20
29
|
|
|
21
|
-
##
|
|
22
|
-
|
|
23
|
-
With pnpm, clone the repository and build it:
|
|
24
|
-
|
|
25
|
-
```
|
|
26
|
-
pnpm install
|
|
27
|
-
pnpm build
|
|
28
|
-
```
|
|
29
|
-
|
|
30
|
-
### The cubes demo in the browser
|
|
30
|
+
## Start from a sample instead
|
|
31
31
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
```
|
|
32
|
+
The smaller samples ship inside `@bendyline/molen-tooling` as templates, locked to the engine
|
|
33
|
+
version you install. `--template` copies one into a standalone npm project that you own:
|
|
35
34
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
pnpm --filter @bendyline/molen-examples-cubes test:unit
|
|
35
|
+
```sh
|
|
36
|
+
npx @bendyline/molen-tooling templates # list them
|
|
37
|
+
npx @bendyline/molen-tooling new my-game --template skybound
|
|
38
|
+
cd my-game
|
|
39
|
+
npm install
|
|
40
|
+
npm test # the sample's headless tests, in Node
|
|
41
|
+
npm run dev
|
|
44
42
|
```
|
|
45
43
|
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
44
|
+
The cubes template is the whole architecture at minimum size. About 50 cubes spin and drift,
|
|
45
|
+
simulated at 30 Hz in a Web Worker kernel and rendered with interpolation. Press **Space** to
|
|
46
|
+
spawn a cube: the keypress emits a command that the kernel validates and adjudicates, and the
|
|
47
|
+
client never mutates simulation state directly. Its `npm test` runs the same scene in Node for 300
|
|
48
|
+
ticks, asserts on world state, and checks the state hash is identical across runs. That is the
|
|
49
|
+
determinism the browser relies on for smooth interpolation and replay.
|
|
49
50
|
|
|
50
|
-
|
|
51
|
+
The [samples gallery](examples.md) lists every template and what each one teaches. The largest
|
|
52
|
+
samples (World Explorer and The Lantern Vault) carry content that npm packages never include, so
|
|
53
|
+
you play them at molen.dev and read their source on GitHub instead.
|
|
51
54
|
|
|
52
55
|
## The shape of things
|
|
53
56
|
|
|
@@ -57,7 +60,13 @@ From a clone, the CLI is `node packages/tooling/dist/cli.mjs`.
|
|
|
57
60
|
only through messages (commands in; keyframes/deltas out).
|
|
58
61
|
- **Schema** (`@bendyline/molen-schema`): every wire and file format, with a validator that produces
|
|
59
62
|
fixable error messages.
|
|
60
|
-
- **Tooling** (`@bendyline/molen-tooling`): the `molen` CLI and MCP server
|
|
61
|
-
|
|
63
|
+
- **Tooling** (`@bendyline/molen-tooling`): the `molen` CLI and MCP server. It validates,
|
|
64
|
+
simulates, screenshots, replays and scaffolds, and answers schema, component and docs questions.
|
|
65
|
+
It also carries this documentation, version-locked, at `dist/docs-src/`.
|
|
66
|
+
|
|
67
|
+
Shared content (entity models, the default building style pack, the Earth catalogs, the star
|
|
68
|
+
table) is not in any npm package. It comes as content packs:
|
|
69
|
+
`npx molen pack fetch https://molen.dev/packs/index.json` downloads them into your project and pins
|
|
70
|
+
them in project.json. See [content packs](project.md#content-packs-packs).
|
|
62
71
|
|
|
63
72
|
Next: the [agent loop](agent-loop.md).
|