@bendyline/molen-tooling 0.0.2 → 0.0.4

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 (86) hide show
  1. package/README.md +4 -4
  2. package/dist/capture/harness.js +222 -222
  3. package/dist/capture/worldgen-preview.js +288 -288
  4. package/dist/cli.mjs +162 -10
  5. package/dist/docs-src/guide/3d-model-assets.md +35 -3
  6. package/dist/docs-src/guide/adaptive-performance.md +4 -0
  7. package/dist/docs-src/guide/agent-loop.md +6 -6
  8. package/dist/docs-src/guide/aircraft.md +28 -7
  9. package/dist/docs-src/guide/ambient-life.md +389 -0
  10. package/dist/docs-src/guide/audio.md +247 -0
  11. package/dist/docs-src/guide/browser-mount.md +8 -1
  12. package/dist/docs-src/guide/building-interiors.md +5 -4
  13. package/dist/docs-src/guide/capability-authoring.md +5 -0
  14. package/dist/docs-src/guide/determinism.md +35 -27
  15. package/dist/docs-src/guide/earth-view.md +492 -0
  16. package/dist/docs-src/guide/entities.md +9 -1
  17. package/dist/docs-src/guide/examples.md +6 -2
  18. package/dist/docs-src/guide/figures.md +3 -0
  19. package/dist/docs-src/guide/game-samples.md +22 -5
  20. package/dist/docs-src/guide/graphics-performance.md +40 -8
  21. package/dist/docs-src/guide/input.md +9 -0
  22. package/dist/docs-src/guide/markers.md +55 -0
  23. package/dist/docs-src/guide/materials.md +10 -3
  24. package/dist/docs-src/guide/navigation.md +150 -0
  25. package/dist/docs-src/guide/project.md +1 -1
  26. package/dist/docs-src/guide/quickstart.md +2 -2
  27. package/dist/docs-src/guide/recognizable-places.md +3 -2
  28. package/dist/docs-src/guide/scripting.md +4 -2
  29. package/dist/docs-src/guide/sky.md +16 -0
  30. package/dist/docs-src/guide/source-bundles.md +0 -1
  31. package/dist/docs-src/guide/structure-library.md +2 -2
  32. package/dist/docs-src/guide/surface-rendering.md +4 -3
  33. package/dist/docs-src/guide/terrain.md +52 -2
  34. package/dist/docs-src/guide/vehicles.md +32 -10
  35. package/dist/docs-src/guide/worldgen.md +3 -3
  36. package/dist/docs-src/llms.txt +14 -5
  37. package/dist/docs-src/schemas/README.md +4 -0
  38. package/dist/docs-src/schemas/archive-set.md +175 -0
  39. package/dist/docs-src/schemas/components.md +1634 -2
  40. package/dist/docs-src/schemas/matgraph.md +6 -0
  41. package/dist/docs-src/schemas/scene.md +105 -0
  42. package/dist/docs-src/schemas/soundbank.md +251 -0
  43. package/dist/docs-src/schemas/structure-placements.md +496 -0
  44. package/dist/docs-src/schemas/terrain-package.md +120 -0
  45. package/dist/docs-src/schemas/transport-network.md +351 -0
  46. package/dist/index.d.mts +49 -2
  47. package/dist/index.mjs +81 -4
  48. package/dist/{mcp-AOfIp89b.mjs → mcp-BtuworIW.mjs} +88 -3
  49. package/dist/{ops-C4BvDgP-.mjs → ops-DMGcWoL2.mjs} +1204 -93
  50. package/dist/templates/city-courier/README.md +14 -1
  51. package/dist/templates/city-courier/delivery-run.replay.json +151 -151
  52. package/dist/templates/city-courier/gen/molen-types.ts +223 -5
  53. package/dist/templates/city-courier/package.json +2 -0
  54. package/dist/templates/city-courier/scene.json +142 -246
  55. package/dist/templates/city-courier/scripts/game.ts +7 -15
  56. package/dist/templates/city-courier/scripts/molen-scripts.d.ts +252 -16
  57. package/dist/templates/city-courier/src/audio.ts +96 -0
  58. package/dist/templates/city-courier/src/game-shell.css +8 -0
  59. package/dist/templates/city-courier/src/main.ts +3 -0
  60. package/dist/templates/city-courier/src/worker.ts +3 -1
  61. package/dist/templates/city-courier/test/headless.test.ts +3 -2
  62. package/dist/templates/data-viz/README.md +1 -1
  63. package/dist/templates/index.json +22 -1
  64. package/dist/templates/skybound/README.md +13 -0
  65. package/dist/templates/skybound/first-leap.replay.json +152 -152
  66. package/dist/templates/skybound/gen/molen-types.ts +223 -5
  67. package/dist/templates/skybound/package.json +1 -0
  68. package/dist/templates/skybound/scene.json +40 -0
  69. package/dist/templates/skybound/scripts/game.ts +8 -5
  70. package/dist/templates/skybound/scripts/molen-scripts.d.ts +248 -5
  71. package/dist/templates/skybound/src/audio.ts +96 -0
  72. package/dist/templates/skybound/src/game-shell.css +8 -0
  73. package/dist/templates/skybound/src/main.ts +3 -0
  74. package/dist/templates/skybound/test/headless.test.ts +1 -1
  75. package/dist/templates/terrain-flyover/README.md +2 -2
  76. package/dist/templates/top-down-arena/README.md +15 -2
  77. package/dist/templates/top-down-arena/arena-skirmish.replay.json +152 -152
  78. package/dist/templates/top-down-arena/package.json +1 -0
  79. package/dist/templates/top-down-arena/scene.json +20 -0
  80. package/dist/templates/top-down-arena/scripts/combat.ts +1 -0
  81. package/dist/templates/top-down-arena/scripts/molen-scripts.d.ts +248 -5
  82. package/dist/templates/top-down-arena/src/audio.ts +96 -0
  83. package/dist/templates/top-down-arena/src/gen/molen-types.ts +223 -5
  84. package/dist/templates/top-down-arena/src/main.ts +3 -0
  85. package/dist/templates/top-down-arena/test/headless.test.ts +1 -1
  86. package/package.json +13 -12
@@ -62,6 +62,12 @@ A small node graph (noise, gradients, ramps, blends) CPU-rasterized to textures.
62
62
  "const": "molen/matgraph@1",
63
63
  "description": "Format envelope; always 'molen/matgraph@1'."
64
64
  },
65
+ "alphaTest": {
66
+ "description": "Optional alpha cutout threshold for baseColor RGBA. Omit for opaque materials; this does not enable blended transparency.",
67
+ "type": "number",
68
+ "minimum": 0,
69
+ "maximum": 1
70
+ },
65
71
  "size": {
66
72
  "default": [
67
73
  512,
@@ -1108,6 +1108,111 @@ Root document an experience boots from; instantiates into ECS state at tick 0.
1108
1108
  ],
1109
1109
  "additionalProperties": false,
1110
1110
  "description": "Physics engine selection and settings."
1111
+ },
1112
+ "ambient": {
1113
+ "type": "object",
1114
+ "properties": {
1115
+ "network": {
1116
+ "anyOf": [
1117
+ {
1118
+ "type": "string",
1119
+ "minLength": 1,
1120
+ "pattern": "^(?![A-Za-z]:|[/\\\\])(?!.*\\\\)(?!.*(?:^|\\/)\\.\\.(?:\\/|$)).+$"
1121
+ },
1122
+ {
1123
+ "type": "object",
1124
+ "properties": {
1125
+ "format": {
1126
+ "type": "string",
1127
+ "const": "molen/transport-network@1",
1128
+ "description": "Format envelope; always 'molen/transport-network@1'."
1129
+ }
1130
+ },
1131
+ "required": [
1132
+ "format"
1133
+ ],
1134
+ "additionalProperties": {}
1135
+ }
1136
+ ],
1137
+ "description": "The road, rail and path network NPCs move on: a scene-relative path to a molen/transport-network@1 document, or the document inline."
1138
+ },
1139
+ "observer": {
1140
+ "type": "string",
1141
+ "minLength": 1,
1142
+ "description": "Entity whose position drives the spawn ring (default: the entity carrying ambientObserver, else the ambient.observer command)."
1143
+ },
1144
+ "classes": {
1145
+ "type": "array",
1146
+ "items": {
1147
+ "type": "string",
1148
+ "enum": [
1149
+ "car",
1150
+ "pedestrian",
1151
+ "train",
1152
+ "aircraft"
1153
+ ]
1154
+ },
1155
+ "description": "Which NPC classes run (default ['car'])."
1156
+ },
1157
+ "density": {
1158
+ "type": "object",
1159
+ "propertyNames": {
1160
+ "type": "string",
1161
+ "enum": [
1162
+ "car",
1163
+ "pedestrian",
1164
+ "train",
1165
+ "aircraft"
1166
+ ]
1167
+ },
1168
+ "additionalProperties": {
1169
+ "type": "number",
1170
+ "minimum": 0
1171
+ },
1172
+ "description": "Target agents per kilometre of lane near the observer, per class."
1173
+ },
1174
+ "drivingSide": {
1175
+ "type": "string",
1176
+ "enum": [
1177
+ "right",
1178
+ "left"
1179
+ ],
1180
+ "description": "Which side of the road traffic keeps to (default 'right')."
1181
+ },
1182
+ "radius": {
1183
+ "type": "number",
1184
+ "exclusiveMinimum": 0,
1185
+ "description": "Outer spawn radius in metres for cars (other classes scale from it)."
1186
+ },
1187
+ "despawnRadius": {
1188
+ "type": "number",
1189
+ "exclusiveMinimum": 0,
1190
+ "description": "Distance in metres beyond which cars are removed (must exceed radius)."
1191
+ },
1192
+ "templates": {
1193
+ "type": "object",
1194
+ "propertyNames": {
1195
+ "type": "string",
1196
+ "enum": [
1197
+ "car",
1198
+ "pedestrian",
1199
+ "train",
1200
+ "aircraft"
1201
+ ]
1202
+ },
1203
+ "additionalProperties": {
1204
+ "type": "string",
1205
+ "minLength": 1
1206
+ },
1207
+ "description": "Prefab name per class whose components every spawned agent receives."
1208
+ },
1209
+ "seedSalt": {
1210
+ "type": "string",
1211
+ "description": "Mixed into the scene seed for ambient draws, to vary traffic without reseeding."
1212
+ }
1213
+ },
1214
+ "additionalProperties": false,
1215
+ "description": "Ambient life: NPC cars, pedestrians, trains and aircraft that spawn around an observer on a transport network (needs @bendyline/molen-ambient)."
1111
1216
  }
1112
1217
  },
1113
1218
  "required": [
@@ -0,0 +1,251 @@
1
+ # Sound bank (`molen/soundbank@1`)
2
+
3
+ Named sounds for the audio director: clip files (relative to the bank), loop points, gain, pitch range, bus, spatial defaults and required provenance. Content packs expose banks under provides.soundbank.
4
+
5
+ ## Example
6
+
7
+ ```json
8
+ {
9
+ "format": "molen/soundbank@1",
10
+ "id": "my.sounds",
11
+ "license": "CC0-1.0",
12
+ "sounds": {
13
+ "ambience.rain.medium": {
14
+ "clips": [
15
+ "ambience/rain-medium.mp3"
16
+ ],
17
+ "description": "Steady medium rain on foliage and pavement.",
18
+ "loop": true,
19
+ "loopStart": 0.05,
20
+ "loopEnd": 29.9,
21
+ "gain": 0.8,
22
+ "bus": "ambience",
23
+ "spatial": false,
24
+ "durationS": 30,
25
+ "source": {
26
+ "license": "CC0-1.0",
27
+ "site": "freesound",
28
+ "url": "https://freesound.org/s/000000/"
29
+ }
30
+ },
31
+ "footstep.grass": {
32
+ "clips": [
33
+ "footsteps/grass-1.mp3",
34
+ "footsteps/grass-2.mp3",
35
+ "footsteps/grass-3.mp3"
36
+ ],
37
+ "description": "Single footstep on short grass.",
38
+ "pitch": [
39
+ 0.94,
40
+ 1.06
41
+ ],
42
+ "gain": 0.6,
43
+ "bus": "sfx",
44
+ "source": {
45
+ "license": "CC0-1.0",
46
+ "site": "kenney",
47
+ "notes": "trimmed, normalized to -16 LUFS"
48
+ }
49
+ }
50
+ }
51
+ }
52
+ ```
53
+
54
+ ## JSON Schema
55
+
56
+ ```json
57
+ {
58
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
59
+ "type": "object",
60
+ "properties": {
61
+ "format": {
62
+ "type": "string",
63
+ "const": "molen/soundbank@1",
64
+ "description": "Format envelope; always 'molen/soundbank@1'."
65
+ },
66
+ "id": {
67
+ "type": "string",
68
+ "minLength": 1,
69
+ "description": "Bank id, usually the content pack id, e.g. \"molen.sounds\"."
70
+ },
71
+ "title": {
72
+ "description": "Human title.",
73
+ "type": "string"
74
+ },
75
+ "license": {
76
+ "description": "Bank-wide license policy. When set, every sound must carry exactly this source.license.",
77
+ "type": "string"
78
+ },
79
+ "sounds": {
80
+ "type": "object",
81
+ "propertyNames": {
82
+ "type": "string",
83
+ "pattern": "^[a-z0-9][a-z0-9_-]*(\\.[a-z0-9][a-z0-9_-]*)*$"
84
+ },
85
+ "additionalProperties": {
86
+ "type": "object",
87
+ "properties": {
88
+ "clips": {
89
+ "minItems": 1,
90
+ "type": "array",
91
+ "items": {
92
+ "type": "string",
93
+ "minLength": 1
94
+ },
95
+ "description": "Audio files relative to the bank document (MP3 plays in every browser). Several clips = variations picked per play."
96
+ },
97
+ "description": {
98
+ "description": "What it sounds like, for agents choosing sounds (\"steady medium rain on leaves\").",
99
+ "type": "string"
100
+ },
101
+ "tags": {
102
+ "description": "Search tags.",
103
+ "type": "array",
104
+ "items": {
105
+ "type": "string"
106
+ }
107
+ },
108
+ "loop": {
109
+ "description": "Loop the clip (ambience, engines); default false.",
110
+ "type": "boolean"
111
+ },
112
+ "loopStart": {
113
+ "description": "Loop start in seconds (trims encoder padding).",
114
+ "type": "number",
115
+ "minimum": 0
116
+ },
117
+ "loopEnd": {
118
+ "description": "Loop end in seconds; must exceed loopStart.",
119
+ "type": "number",
120
+ "minimum": 0
121
+ },
122
+ "gain": {
123
+ "description": "Linear base gain; default 1.",
124
+ "type": "number",
125
+ "minimum": 0,
126
+ "maximum": 4
127
+ },
128
+ "pitch": {
129
+ "description": "[min, max] playback-rate range; each play picks a value in it. Default [1, 1].",
130
+ "minItems": 2,
131
+ "maxItems": 2,
132
+ "type": "array",
133
+ "items": {
134
+ "type": "number",
135
+ "exclusiveMinimum": 0
136
+ }
137
+ },
138
+ "bus": {
139
+ "description": "Default bus; default sfx.",
140
+ "type": "string",
141
+ "pattern": "^[a-z][a-z0-9-]*$"
142
+ },
143
+ "spatial": {
144
+ "anyOf": [
145
+ {
146
+ "type": "boolean",
147
+ "const": false
148
+ },
149
+ {
150
+ "type": "object",
151
+ "properties": {
152
+ "refDistance": {
153
+ "description": "Distance in meters at which the sound plays at full gain; default 1.",
154
+ "type": "number",
155
+ "exclusiveMinimum": 0
156
+ },
157
+ "maxDistance": {
158
+ "description": "Distance in meters beyond which the sound is culled; default 60.",
159
+ "type": "number",
160
+ "exclusiveMinimum": 0
161
+ },
162
+ "rolloff": {
163
+ "description": "How fast gain falls off past refDistance; default 1.",
164
+ "type": "number",
165
+ "minimum": 0
166
+ },
167
+ "model": {
168
+ "description": "Distance attenuation model (Web Audio PannerNode.distanceModel); default inverse.",
169
+ "type": "string",
170
+ "enum": [
171
+ "linear",
172
+ "inverse",
173
+ "exponential"
174
+ ]
175
+ }
176
+ },
177
+ "additionalProperties": false
178
+ }
179
+ ],
180
+ "description": "false = non-positional (2D); an object = positional with these distance settings."
181
+ },
182
+ "durationS": {
183
+ "description": "Clip duration in seconds (written by molen audio import).",
184
+ "type": "number",
185
+ "minimum": 0
186
+ },
187
+ "hash": {
188
+ "description": "sha256 of the first clip, \"sha256:<hex>\".",
189
+ "type": "string"
190
+ },
191
+ "source": {
192
+ "type": "object",
193
+ "properties": {
194
+ "license": {
195
+ "type": "string",
196
+ "minLength": 1,
197
+ "description": "SPDX-style license of this recording, e.g. \"CC0-1.0\". Required provenance."
198
+ },
199
+ "site": {
200
+ "description": "Where it came from: freesound, kenney, opengameart, …",
201
+ "type": "string"
202
+ },
203
+ "url": {
204
+ "description": "Page of the original recording.",
205
+ "type": "string"
206
+ },
207
+ "author": {
208
+ "description": "Recordist or creator.",
209
+ "type": "string"
210
+ },
211
+ "title": {
212
+ "description": "Original title.",
213
+ "type": "string"
214
+ },
215
+ "prompt": {
216
+ "description": "Prompt text, when the clip was generated.",
217
+ "type": "string"
218
+ },
219
+ "generator": {
220
+ "description": "Generator/model name, when the clip was generated.",
221
+ "type": "string"
222
+ },
223
+ "notes": {
224
+ "description": "Edits made: trims, loudness normalization, loop points.",
225
+ "type": "string"
226
+ }
227
+ },
228
+ "required": [
229
+ "license"
230
+ ],
231
+ "additionalProperties": false,
232
+ "description": "Provenance: license plus origin or generation prompt."
233
+ }
234
+ },
235
+ "required": [
236
+ "clips",
237
+ "source"
238
+ ],
239
+ "additionalProperties": false
240
+ },
241
+ "description": "Sound id → entry. Later banks override earlier ones with the same id."
242
+ }
243
+ },
244
+ "required": [
245
+ "format",
246
+ "id",
247
+ "sounds"
248
+ ],
249
+ "additionalProperties": false
250
+ }
251
+ ```