threedog 0.7.0 → 0.8.0

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 (544) hide show
  1. package/CHANGELOG.md +196 -1
  2. package/README.md +6 -9
  3. package/core/{Animator.js → assets/Animator.js} +28 -18
  4. package/core/{Assets.js → assets/Assets.js} +98 -54
  5. package/core/{Baked.js → assets/Baked.js} +4 -4
  6. package/core/assets/assetEntry.js +237 -0
  7. package/core/{assetHot.js → assets/assetHot.js} +7 -6
  8. package/core/{assetLoad.js → assets/assetLoad.js} +55 -16
  9. package/core/assets/assetLod.js +113 -0
  10. package/core/{assetManifest.js → assets/assetManifest.js} +19 -11
  11. package/core/{assetReport.js → assets/assetReport.js} +6 -12
  12. package/core/{namedModel.js → assets/namedModel.js} +17 -13
  13. package/core/{Audio.js → audio/Audio.js} +26 -23
  14. package/core/{audioRules.js → audio/audioRules.js} +8 -5
  15. package/core/{audioVoice.js → audio/audioVoice.js} +17 -30
  16. package/core/{Events.js → base/Events.js} +3 -3
  17. package/core/{I18n.js → base/I18n.js} +10 -10
  18. package/core/{Random.js → base/Random.js} +5 -4
  19. package/core/{easing.js → base/easing.js} +1 -1
  20. package/core/{errorCodes.js → base/errorCodes.js} +98 -110
  21. package/core/{errorHints.js → base/errorHints.js} +5 -9
  22. package/core/{errors.js → base/errors.js} +6 -6
  23. package/core/{events.generated.js → base/events.generated.js} +1 -0
  24. package/core/{math.js → base/math.js} +15 -4
  25. package/core/{params.js → base/params.js} +3 -4
  26. package/core/base/util.js +32 -0
  27. package/core/{validate.js → base/validate.js} +28 -7
  28. package/core/{Engine.js → engine/Engine.js} +80 -77
  29. package/core/{Loading.js → engine/Loading.js} +4 -2
  30. package/core/{copies.js → engine/copies.js} +4 -4
  31. package/core/{headlessLoad.js → engine/headlessLoad.js} +4 -4
  32. package/core/{lifecycle.js → engine/lifecycle.js} +14 -12
  33. package/core/{loop.js → engine/loop.js} +68 -47
  34. package/core/{moduleSlots.js → engine/moduleSlots.js} +6 -6
  35. package/core/{moduleTypes.js → engine/moduleTypes.js} +13 -14
  36. package/core/{modules.js → engine/modules.js} +14 -11
  37. package/core/{page.js → engine/page.js} +36 -23
  38. package/core/{plugins.js → engine/plugins.js} +6 -9
  39. package/core/{services.js → engine/services.js} +47 -40
  40. package/core/{startup.js → engine/startup.js} +26 -24
  41. package/core/{Input.js → input/Input.js} +30 -22
  42. package/core/{inputContext.js → input/inputContext.js} +14 -5
  43. package/core/{inputPad.js → input/inputPad.js} +1 -1
  44. package/core/{inputPointer.js → input/inputPointer.js} +8 -2
  45. package/core/{inputTouch.js → input/inputTouch.js} +1 -1
  46. package/core/{Budget.js → inspect/Budget.js} +21 -20
  47. package/core/{DebugOverrides.js → inspect/DebugOverrides.js} +30 -16
  48. package/core/{Describe.js → inspect/Describe.js} +26 -22
  49. package/core/{Inspect.js → inspect/Inspect.js} +9 -7
  50. package/core/{InspectMaterials.js → inspect/InspectMaterials.js} +7 -8
  51. package/core/{InspectPerf.js → inspect/InspectPerf.js} +19 -13
  52. package/core/{InspectScene.js → inspect/InspectScene.js} +8 -5
  53. package/core/{MaterialInfo.js → inspect/MaterialInfo.js} +3 -2
  54. package/core/{UrlState.js → inspect/UrlState.js} +52 -20
  55. package/core/{catalog.js → inspect/catalog.js} +3 -3
  56. package/core/{checks.js → inspect/checks.js} +7 -5
  57. package/core/{debugView.js → inspect/debugView.js} +4 -4
  58. package/core/{describeRender.js → inspect/describeRender.js} +21 -20
  59. package/core/{describeText.js → inspect/describeText.js} +11 -6
  60. package/core/inspect/geometryWatch.js +38 -0
  61. package/core/{lightWatch.js → inspect/lightWatch.js} +8 -8
  62. package/core/{pictureWriters.js → inspect/pictureWriters.js} +15 -16
  63. package/core/{shaderCost.js → inspect/shaderCost.js} +1 -1
  64. package/core/{Ops.js → ops/Ops.js} +16 -11
  65. package/core/{control.js → ops/control.js} +13 -12
  66. package/core/ops/holds.js +139 -0
  67. package/core/{opsAtomic.js → ops/opsAtomic.js} +2 -1
  68. package/core/{opsCheck.js → ops/opsCheck.js} +4 -5
  69. package/core/{opsGuard.js → ops/opsGuard.js} +3 -3
  70. package/core/{opsRun.js → ops/opsRun.js} +7 -4
  71. package/core/{owned.js → ops/owned.js} +14 -17
  72. package/core/{sharedPoint.js → ops/sharedPoint.js} +8 -8
  73. package/core/{stackFrames.js → ops/stackFrames.js} +2 -2
  74. package/core/{stacks.js → ops/stacks.js} +12 -14
  75. package/core/{wrap.js → ops/wrap.js} +8 -6
  76. package/core/{SaveStore.js → saves/SaveStore.js} +1 -1
  77. package/core/{Saves.js → saves/Saves.js} +58 -36
  78. package/core/{saveApply.js → saves/saveApply.js} +13 -9
  79. package/core/{saveFiles.js → saves/saveFiles.js} +17 -15
  80. package/core/{saveValues.js → saves/saveValues.js} +20 -3
  81. package/core/{saveVersions.js → saves/saveVersions.js} +4 -17
  82. package/core/{session.js → saves/session.js} +31 -17
  83. package/core/{Rays.js → scene/Rays.js} +23 -25
  84. package/core/{Views.js → scene/Views.js} +14 -6
  85. package/core/{adaptive.js → scene/adaptive.js} +15 -8
  86. package/core/{canvasBox.js → scene/canvasBox.js} +2 -3
  87. package/core/{engineCamera.js → scene/engineCamera.js} +1 -1
  88. package/core/{gameLights.js → scene/gameLights.js} +17 -7
  89. package/core/{grayMap.js → scene/grayMap.js} +8 -2
  90. package/core/{grid.js → scene/grid.js} +4 -4
  91. package/core/{gridLoad.js → scene/gridLoad.js} +1 -1
  92. package/core/{ground.js → scene/ground.js} +9 -9
  93. package/core/{movement.js → scene/movement.js} +3 -3
  94. package/core/{pictureSlots.js → scene/pictureSlots.js} +2 -2
  95. package/core/{sceneDelta.js → scene/sceneDelta.js} +2 -2
  96. package/core/{sceneMethods.js → scene/sceneMethods.js} +36 -13
  97. package/core/scene/stepPoses.js +55 -0
  98. package/core/{targeting.js → scene/targeting.js} +4 -5
  99. package/core/{thingExplain.js → scene/thingExplain.js} +6 -5
  100. package/core/{thingOps.js → scene/thingOps.js} +4 -3
  101. package/core/{things.js → scene/things.js} +18 -5
  102. package/core/{threePatches.js → scene/threePatches.js} +1 -1
  103. package/core/{view.js → scene/view.js} +17 -16
  104. package/core/{Batching.js → stream/Batching.js} +85 -27
  105. package/core/{Stream.js → stream/Stream.js} +60 -30
  106. package/core/{batchGroups.js → stream/batchGroups.js} +10 -9
  107. package/core/{chunkStream.js → stream/chunkStream.js} +40 -0
  108. package/core/{scatter.js → stream/scatter.js} +2 -2
  109. package/core/{streamSources.js → stream/streamSources.js} +12 -7
  110. package/core/{Commits.js → threads/Commits.js} +6 -5
  111. package/core/{Jobs.js → threads/Jobs.js} +12 -10
  112. package/core/{Threads.js → threads/Threads.js} +16 -16
  113. package/core/{threadPure.js → threads/threadPure.js} +7 -5
  114. package/core/{threadServe.js → threads/threadServe.js} +3 -3
  115. package/core/{Clock.js → time/Clock.js} +17 -10
  116. package/core/{dayTime.js → time/dayTime.js} +5 -1
  117. package/core/{skip.js → time/skip.js} +18 -17
  118. package/core/{time.js → time/time.js} +18 -12
  119. package/core/{uiClock.js → time/uiClock.js} +4 -4
  120. package/docs/AI.md +22 -19
  121. package/docs/API.md +24 -23
  122. package/docs/CODEMAP.md +76 -183
  123. package/docs/COMMANDS.md +66 -58
  124. package/docs/CONVENTIONS.md +54 -14
  125. package/docs/MIGRATING-0.8.md +169 -0
  126. package/docs/THREE.md +78 -29
  127. package/docs/api/assets.md +12 -13
  128. package/docs/api/audio.md +6 -5
  129. package/docs/api/budget.md +4 -4
  130. package/docs/api/calendar.md +10 -11
  131. package/docs/api/cameraRig.md +29 -29
  132. package/docs/api/characters.md +23 -18
  133. package/docs/api/clock.md +1 -1
  134. package/docs/api/collision.md +12 -9
  135. package/docs/api/content.md +6 -6
  136. package/docs/api/dialogue.md +3 -3
  137. package/docs/api/engine.md +45 -43
  138. package/docs/api/events.md +3 -2
  139. package/docs/api/flow.md +1 -1
  140. package/docs/api/grids.md +1 -1
  141. package/docs/api/ground.md +4 -5
  142. package/docs/api/hud.md +2 -2
  143. package/docs/api/i18n.md +6 -6
  144. package/docs/api/input.md +7 -7
  145. package/docs/api/interactions.md +4 -4
  146. package/docs/api/inventory.md +9 -9
  147. package/docs/api/jobs.md +5 -5
  148. package/docs/api/level.md +7 -7
  149. package/docs/api/lightPool.md +1 -6
  150. package/docs/api/music.md +3 -3
  151. package/docs/api/nav.md +10 -10
  152. package/docs/api/openWorld.md +1 -1
  153. package/docs/api/particles.md +2 -2
  154. package/docs/api/photo.md +4 -2
  155. package/docs/api/pickups.md +2 -2
  156. package/docs/api/post.md +20 -3
  157. package/docs/api/quests.md +3 -3
  158. package/docs/api/rays.md +5 -7
  159. package/docs/api/rigid.md +27 -18
  160. package/docs/api/saves.md +8 -7
  161. package/docs/api/settings.md +9 -8
  162. package/docs/api/sky.md +8 -7
  163. package/docs/api/stream.md +7 -7
  164. package/docs/api/swarm.md +34 -0
  165. package/docs/api/terrain.md +7 -8
  166. package/docs/api/terrainDraw.md +1 -1
  167. package/docs/api/timeline.md +2 -2
  168. package/docs/api/tools.md +25 -22
  169. package/docs/api/vars.md +1 -1
  170. package/docs/api/vegetation.md +4 -3
  171. package/docs/api/vegetationDraw.md +1 -1
  172. package/docs/api/water.md +1 -1
  173. package/docs/api/weather.md +9 -9
  174. package/docs/api/weatherDraw.md +3 -3
  175. package/docs/api/world.md +5 -5
  176. package/docs/recipes/01-new-game.md +25 -40
  177. package/docs/recipes/02-npc.md +19 -20
  178. package/docs/recipes/03-items-pickups.md +27 -43
  179. package/docs/recipes/04-quests.md +3 -4
  180. package/docs/recipes/05-props-bake.md +29 -39
  181. package/docs/recipes/06-clock-events.md +27 -18
  182. package/docs/recipes/07-flow-scenes-pause.md +12 -17
  183. package/docs/recipes/08-weather-sky.md +88 -34
  184. package/docs/recipes/09-materials-lights-models.md +22 -36
  185. package/docs/recipes/10-blender-level.md +6 -7
  186. package/docs/recipes/11-vehicles.md +30 -22
  187. package/docs/recipes/12-navmesh.md +9 -8
  188. package/docs/recipes/13-animation.md +39 -17
  189. package/docs/recipes/14-custom-module.md +14 -13
  190. package/docs/recipes/15-perf.md +49 -26
  191. package/docs/recipes/16-dev-bridge.md +32 -52
  192. package/docs/recipes/18-world.md +36 -23
  193. package/docs/recipes/19-shooting-picking.md +4 -2
  194. package/docs/recipes/20-content-actions-save.md +30 -35
  195. package/docs/recipes/21-camera.md +33 -5
  196. package/docs/recipes/22-shop-gold.md +0 -4
  197. package/docs/recipes/23-ops.md +10 -10
  198. package/docs/recipes/26-ui-parts.md +22 -12
  199. package/docs/recipes/27-net.md +0 -2
  200. package/docs/recipes/28-terrain.md +117 -21
  201. package/docs/recipes/29-grid.md +2 -2
  202. package/docs/recipes/30-templates.md +55 -19
  203. package/docs/recipes/31-audio.md +5 -5
  204. package/docs/recipes/32-action-game.md +15 -6
  205. package/docs/recipes/33-stream-sources.md +2 -2
  206. package/docs/recipes/34-environment-lighting.md +67 -19
  207. package/docs/recipes/35-picture-from-reference.md +10 -17
  208. package/docs/recipes/36-ground-plants.md +105 -0
  209. package/docs/recipes/40-scene.md +7 -11
  210. package/docs/recipes/43-shader-patches-surfaces.md +20 -41
  211. package/docs/recipes/44-water-weather-hooks.md +48 -43
  212. package/docs/recipes/45-cascaded-shadows.md +39 -17
  213. package/docs/recipes/46-blender-art-route.md +7 -8
  214. package/docs/recipes/49-game-module-contract.md +5 -5
  215. package/docs/recipes/50-own-renderer.md +2 -2
  216. package/docs/recipes/52-around-the-picture.md +54 -98
  217. package/docs/recipes/53-ground-up-close.md +61 -24
  218. package/docs/recipes/55-mods-time-wrap.md +12 -16
  219. package/docs/recipes/56-webgpu-tsl.md +16 -14
  220. package/docs/recipes/57-control.md +9 -2
  221. package/docs/recipes/58-input.md +2 -2
  222. package/docs/recipes/59-depth-post-effects.md +1 -1
  223. package/docs/recipes/60-judge-the-picture.md +29 -24
  224. package/docs/recipes/62-picture-code.md +49 -17
  225. package/docs/recipes/63-third-person-start.md +17 -4
  226. package/docs/recipes/64-particles.md +1 -1
  227. package/docs/recipes/65-swarm.md +140 -0
  228. package/examples/action/.threedog/content-index.json +1 -1
  229. package/examples/action/GAMEMAP.md +2 -2
  230. package/examples/{sheepisland → perf-island}/.threedog/content-index.json +1 -1
  231. package/examples/{sheepisland → perf-island}/GAMEMAP.md +12 -11
  232. package/examples/{sheepisland → perf-island}/assets.js +1 -1
  233. package/examples/{sheepisland → perf-island}/main.js +8 -8
  234. package/examples/{sheepisland → perf-island}/models.js +1 -1
  235. package/examples/{sheepisland → perf-island}/params.js +1 -1
  236. package/examples/{sheepisland → perf-island}/picture/index.js +1 -1
  237. package/examples/{sheepisland → perf-island}/picture/palette.js +2 -2
  238. package/examples/{sheepisland → perf-island}/views.js +1 -1
  239. package/examples/plain-picture/GAMEMAP.md +1 -0
  240. package/examples/rc2d/GAMEMAP.md +3 -2
  241. package/examples/rc2d/main.js +1 -3
  242. package/examples/styletest/.threedog/content-index.json +1 -1
  243. package/examples/styletest/GAMEMAP.md +3 -2
  244. package/examples/techniques/contact-shadows/contactShadows.js +1 -1
  245. package/examples/techniques/contact-shadows/main.js +1 -1
  246. package/examples/techniques/interior-light/main.js +1 -1
  247. package/examples/techniques/modular-building/README.md +7 -6
  248. package/examples/techniques/outlines-and-rim/picture/post.js +1 -1
  249. package/examples/techniques/procedural-animation/README.md +1 -1
  250. package/examples/webgpu-tsl/GAMEMAP.md +1 -0
  251. package/examples/world/.threedog/content-index.json +1 -1
  252. package/examples/world/GAMEMAP.md +4 -3
  253. package/examples/world/picture/sky.js +1 -1
  254. package/index.d.ts +8 -7
  255. package/index.js +31 -31
  256. package/llms.txt +9 -13
  257. package/modules/ambience/Ambience.js +11 -8
  258. package/modules/calendar/Calendar.js +19 -19
  259. package/modules/calendar/index.js +13 -13
  260. package/modules/calendar/schedule.js +11 -6
  261. package/modules/calendar/seasons.js +7 -7
  262. package/modules/camera/FirstPersonCamera.js +2 -2
  263. package/modules/camera/FixedCamera.js +14 -15
  264. package/modules/camera/FollowCamera.js +4 -4
  265. package/modules/camera/RtsCamera.js +11 -11
  266. package/modules/camera/common.js +48 -24
  267. package/modules/camera/contract.js +1 -0
  268. package/modules/camera/projection.js +2 -2
  269. package/modules/characters/Character.js +33 -30
  270. package/modules/characters/NPC.js +27 -19
  271. package/modules/characters/assetModel.js +14 -10
  272. package/modules/characters/astar.js +7 -5
  273. package/modules/characters/behaviors.js +4 -5
  274. package/modules/characters/contract.js +2 -2
  275. package/modules/characters/index.js +168 -214
  276. package/modules/characters/moveHelpers.js +14 -3
  277. package/modules/characters/movers/common.js +16 -14
  278. package/modules/characters/movers/manual.js +1 -1
  279. package/modules/characters/movers/rapier.js +7 -6
  280. package/modules/characters/movers/simple.js +3 -3
  281. package/modules/characters/movers/support.js +8 -8
  282. package/modules/characters/npcAvoid.js +4 -4
  283. package/modules/characters/npcSim.js +23 -17
  284. package/modules/characters/npcView.js +6 -5
  285. package/modules/characters/pathAsync.js +12 -10
  286. package/modules/characters/pathWorker.js +1 -1
  287. package/modules/characters/player.js +108 -0
  288. package/modules/characters/playerStrings.js +2 -2
  289. package/modules/characters/proceduralRig.js +2 -2
  290. package/modules/characters/useModel.js +3 -3
  291. package/modules/characters/walkTo.js +11 -17
  292. package/modules/collision/Collision.js +26 -20
  293. package/modules/collision/contract.js +15 -0
  294. package/modules/content/explain.js +1 -2
  295. package/modules/content/fields.js +24 -3
  296. package/modules/content/ids.js +2 -2
  297. package/modules/content/index.js +61 -99
  298. package/modules/content/loader.js +14 -17
  299. package/modules/content/markers.js +25 -0
  300. package/modules/content/models.js +10 -7
  301. package/modules/content/packs.js +3 -3
  302. package/modules/content/parts.js +2 -2
  303. package/modules/content/places.js +35 -0
  304. package/modules/content/props.js +17 -14
  305. package/modules/content/rules.js +25 -21
  306. package/modules/content/stages.js +7 -7
  307. package/modules/content/templates.js +20 -20
  308. package/modules/content/words.js +34 -0
  309. package/modules/debug/DebugPanel.js +10 -43
  310. package/modules/flow/contract.js +1 -1
  311. package/modules/flow/index.js +11 -7
  312. package/modules/gameplay/Container.js +12 -11
  313. package/modules/gameplay/Containers.js +14 -5
  314. package/modules/gameplay/Dialogue.js +13 -11
  315. package/modules/gameplay/Interactions.js +37 -24
  316. package/modules/gameplay/Inventory.js +8 -9
  317. package/modules/gameplay/Quests.js +16 -9
  318. package/modules/gameplay/boxOps.js +1 -1
  319. package/modules/gameplay/dialogueBubbles.js +3 -4
  320. package/modules/gameplay/inventoryOps.js +0 -1
  321. package/modules/gameplay/pickups.js +22 -23
  322. package/modules/gameplay/questSave.js +3 -3
  323. package/modules/grid/Grid.js +1 -1
  324. package/modules/grid/Layer.js +4 -4
  325. package/modules/grid/index.js +7 -8
  326. package/modules/grid/preview.js +7 -7
  327. package/modules/grid/tiles.js +6 -6
  328. package/modules/hlod/index.js +37 -55
  329. package/modules/hud/index.js +17 -11
  330. package/modules/hud/parts.js +4 -4
  331. package/modules/level/contract.js +16 -0
  332. package/modules/level/heightfield.js +12 -10
  333. package/modules/level/index.js +47 -152
  334. package/modules/level/load.js +79 -0
  335. package/modules/level/meshes.js +65 -0
  336. package/modules/level/nodes.js +6 -7
  337. package/modules/lights/index.js +28 -181
  338. package/modules/lights/slots.js +93 -0
  339. package/modules/lights/sources.js +88 -0
  340. package/modules/music/Music.js +30 -26
  341. package/modules/music/rules.js +1 -1
  342. package/modules/nav/contract.js +14 -0
  343. package/modules/nav/index.js +11 -10
  344. package/modules/net/Client.js +7 -7
  345. package/modules/net/Host.js +7 -7
  346. package/modules/net/Net.js +1 -1
  347. package/modules/net/index.js +5 -4
  348. package/modules/net/sync.js +2 -2
  349. package/modules/net/transports.js +2 -2
  350. package/modules/particles/Particles.js +11 -8
  351. package/modules/particles/effect.js +7 -5
  352. package/modules/particles/shaders.js +2 -1
  353. package/modules/photo/Photo.js +15 -17
  354. package/modules/rigid/RigidBodies.js +66 -43
  355. package/modules/rigid/Vehicles.js +2 -3
  356. package/modules/rigid/ragdoll.js +287 -0
  357. package/modules/rigid/ragdollBones.js +159 -0
  358. package/modules/rigid/sync.js +6 -6
  359. package/modules/settings/Settings.js +108 -39
  360. package/modules/settings/apply.js +6 -6
  361. package/modules/settings/sections.js +16 -14
  362. package/modules/settings/view.js +3 -3
  363. package/modules/sky/Sky.js +29 -22
  364. package/modules/sky/clouds.js +7 -7
  365. package/modules/sky/dome.js +33 -20
  366. package/modules/sky/domeLayers.js +9 -9
  367. package/modules/sky/environment.js +6 -6
  368. package/modules/sky/frame.js +19 -10
  369. package/modules/sky/season.js +7 -1
  370. package/modules/sky/shader.js +24 -25
  371. package/modules/sky/skyModule.js +14 -27
  372. package/modules/sky/tint.js +1 -1
  373. package/modules/swarm/Swarm.js +346 -0
  374. package/modules/swarm/draw.js +68 -0
  375. package/modules/swarm/grid.js +63 -0
  376. package/modules/terrain/ChunkManager.js +70 -52
  377. package/modules/terrain/chunkQueries.js +7 -24
  378. package/modules/terrain/chunkWorker.js +1 -1
  379. package/modules/terrain/draw.js +14 -11
  380. package/modules/terrain/index.js +28 -34
  381. package/modules/terrain/terrainColorMap.js +6 -3
  382. package/modules/terrain/terrainDefaults.js +2 -1
  383. package/modules/terrain/terrainEdit.js +32 -27
  384. package/modules/terrain/terrainGen.js +17 -12
  385. package/modules/terrain/terrainIsland.js +2 -2
  386. package/modules/terrain/terrainMesh.js +7 -6
  387. package/modules/terrain/terrainShape.js +8 -10
  388. package/modules/terrain/terrainShapeMain.js +3 -3
  389. package/modules/timeline/Timeline.js +27 -19
  390. package/modules/timeline/Tween.js +6 -6
  391. package/modules/timeline/shots.js +5 -7
  392. package/modules/triggers/index.js +9 -9
  393. package/modules/vegetation/Vegetation.js +30 -23
  394. package/modules/vegetation/densityMap.js +4 -7
  395. package/modules/vegetation/draw.js +23 -18
  396. package/modules/vegetation/groundChunks.js +11 -31
  397. package/modules/vegetation/index.js +8 -6
  398. package/modules/vegetation/modelGeometry.js +3 -6
  399. package/modules/vegetation/nearFade.js +1 -1
  400. package/modules/water/Water.js +16 -16
  401. package/modules/water/surface.js +3 -3
  402. package/modules/weather/Weather.js +41 -30
  403. package/modules/weather/particles.js +8 -8
  404. package/modules/weather/weatherDraw.js +22 -18
  405. package/modules/world/World.js +8 -8
  406. package/modules/world/explain.js +1 -1
  407. package/modules/world/index.js +18 -12
  408. package/modules/world/persist.js +73 -25
  409. package/modules/world/pos.js +4 -4
  410. package/modules/world/records.js +28 -8
  411. package/modules/world/sim.js +4 -4
  412. package/modules/world/state.js +12 -5
  413. package/modules/world/thingSource.js +4 -2
  414. package/modules/world/views.js +11 -9
  415. package/package.json +42 -7
  416. package/presets.js +1 -3
  417. package/render/PostFX.js +39 -27
  418. package/render/backend.js +26 -32
  419. package/render/cascades.js +17 -12
  420. package/render/cascades.tsl.js +5 -8
  421. package/render/daylight.js +20 -3
  422. package/render/detail.js +8 -7
  423. package/render/effects.js +28 -25
  424. package/render/fuse.js +3 -3
  425. package/render/fx/cloudShadow.tsl.js +3 -3
  426. package/render/fx/detail.tsl.js +1 -1
  427. package/render/fx/index.js +5 -10
  428. package/render/fx/library.tsl.js +11 -0
  429. package/render/fx/lighting.tsl.js +2 -1
  430. package/render/fx/nodeErrors.tsl.js +2 -2
  431. package/render/fx/objectOrigin.tsl.js +1 -2
  432. package/render/fx/patchNodes.tsl.js +5 -15
  433. package/render/fx/postWebGPU.tsl.js +27 -23
  434. package/render/fx/sky.tsl.js +15 -17
  435. package/render/fx/uniforms.tsl.js +4 -4
  436. package/render/fx/wind.tsl.js +1 -1
  437. package/render/fxNumbers.js +3 -0
  438. package/render/layers.js +1 -1
  439. package/render/lighting.js +5 -3
  440. package/render/lightmap.js +20 -20
  441. package/render/lights.js +6 -6
  442. package/render/lit.js +24 -0
  443. package/render/materials.js +8 -7
  444. package/render/mergeCommon.js +22 -0
  445. package/render/modeling.js +2 -2
  446. package/render/occlusion.js +20 -4
  447. package/render/ownFrame.js +4 -4
  448. package/render/patches.js +13 -13
  449. package/render/postWebGL.js +12 -10
  450. package/render/probes.js +16 -19
  451. package/render/recordSweep.js +117 -0
  452. package/render/shaderErrors.js +10 -9
  453. package/render/shadowCache.tsl.js +107 -0
  454. package/render/shadowTypes.js +9 -0
  455. package/{core → render}/shadows.js +57 -11
  456. package/render/slots.js +7 -7
  457. package/render/terms.js +22 -24
  458. package/render/uniformDecl.js +1 -1
  459. package/types/core.d.ts +200 -153
  460. package/types/gameplay.d.ts +163 -91
  461. package/types/generated/core/{Audio.d.ts → audio/Audio.d.ts} +22 -7
  462. package/types/generated/core/{audioVoice.d.ts → audio/audioVoice.d.ts} +2 -2
  463. package/types/generated/core/{Events.d.ts → base/Events.d.ts} +4 -4
  464. package/types/generated/core/{I18n.d.ts → base/I18n.d.ts} +7 -15
  465. package/types/generated/core/{Random.d.ts → base/Random.d.ts} +4 -3
  466. package/types/generated/core/{page.d.ts → engine/page.d.ts} +8 -9
  467. package/types/generated/core/{Input.d.ts → input/Input.d.ts} +12 -8
  468. package/types/generated/core/{Budget.d.ts → inspect/Budget.d.ts} +36 -26
  469. package/types/generated/core/{DebugOverrides.d.ts → inspect/DebugOverrides.d.ts} +2 -2
  470. package/types/generated/core/{Ops.d.ts → ops/Ops.d.ts} +4 -3
  471. package/types/generated/core/{control.d.ts → ops/control.d.ts} +4 -10
  472. package/types/generated/core/{Saves.d.ts → saves/Saves.d.ts} +37 -13
  473. package/types/generated/core/{session.d.ts → saves/session.d.ts} +2 -1
  474. package/types/generated/core/{Rays.d.ts → scene/Rays.d.ts} +8 -27
  475. package/types/generated/core/{Views.d.ts → scene/Views.d.ts} +1 -1
  476. package/types/generated/core/{Batching.d.ts → stream/Batching.d.ts} +7 -7
  477. package/types/generated/core/{Stream.d.ts → stream/Stream.d.ts} +18 -16
  478. package/types/generated/core/{Commits.d.ts → threads/Commits.d.ts} +1 -1
  479. package/types/generated/core/{Jobs.d.ts → threads/Jobs.d.ts} +6 -6
  480. package/types/generated/core/{Threads.d.ts → threads/Threads.d.ts} +4 -4
  481. package/types/generated/modules/calendar/Calendar.d.ts +10 -11
  482. package/types/generated/modules/debug/DebugPanel.d.ts +1 -9
  483. package/types/generated/modules/grid/Layer.d.ts +1 -1
  484. package/types/generated/modules/grid/index.d.ts +3 -3
  485. package/types/generated/modules/music/Music.d.ts +7 -5
  486. package/types/generated/modules/particles/Particles.d.ts +1 -1
  487. package/types/generated/modules/sky/Sky.d.ts +21 -10
  488. package/types/generated/modules/swarm/Swarm.d.ts +80 -0
  489. package/types/generated/modules/timeline/Timeline.d.ts +2 -1
  490. package/types/generated/modules/water/Water.d.ts +1 -0
  491. package/types/generated/modules/weather/Weather.d.ts +16 -12
  492. package/types/generated/modules/weather/weatherDraw.d.ts +3 -3
  493. package/types/generated/modules/world/World.d.ts +5 -3
  494. package/types/generated/render/PostFX.d.ts +17 -11
  495. package/types/generated/render/materials.d.ts +1 -0
  496. package/types/generated/render/occlusion.d.ts +9 -0
  497. package/types/generated/render/patches.d.ts +1 -0
  498. package/types/generated/ui/Focus.d.ts +1 -0
  499. package/types/generated/ui/UI.d.ts +1 -0
  500. package/types/nav.d.ts +11 -11
  501. package/types/physics.d.ts +99 -70
  502. package/types/tsl.d.ts +37 -4
  503. package/types/world.d.ts +38 -71
  504. package/ui/Focus.js +10 -9
  505. package/ui/Parts.js +4 -3
  506. package/ui/UI.js +7 -7
  507. package/ui/defaults.js +3 -2
  508. package/ui/theme.js +5 -3
  509. package/core/assetEntry.js +0 -109
  510. package/core/holds.js +0 -134
  511. package/core/shadowTypes.js +0 -16
  512. package/core/util.js +0 -17
  513. package/docs/MIGRATING-0.3.md +0 -248
  514. package/docs/MIGRATING-0.4.md +0 -320
  515. package/docs/MIGRATING-0.5.md +0 -68
  516. package/docs/MIGRATING-0.6.md +0 -126
  517. package/docs/PERF.md +0 -245
  518. package/docs/recipes/36-sky-ground-plants.md +0 -158
  519. package/docs/recipes/37-terrain-hooks.md +0 -115
  520. package/docs/recipes/38-environment-hooks.md +0 -67
  521. package/docs/recipes/42-terrain-shape.md +0 -64
  522. package/docs/recipes/47-island-snow-backdrop.md +0 -43
  523. package/docs/recipes/54-three-idioms.md +0 -88
  524. package/examples/plain-picture/FINDINGS.md +0 -53
  525. /package/core/{Vars.js → base/Vars.js} +0 -0
  526. /package/core/{mulberry32.js → base/mulberry32.js} +0 -0
  527. /package/core/{inputDefaults.js → input/inputDefaults.js} +0 -0
  528. /package/core/{textureBytes.js → inspect/textureBytes.js} +0 -0
  529. /package/core/{actor.js → ops/actor.js} +0 -0
  530. /package/core/{opsFail.js → ops/opsFail.js} +0 -0
  531. /package/core/{opsHistory.js → ops/opsHistory.js} +0 -0
  532. /package/core/{saveIds.js → saves/saveIds.js} +0 -0
  533. /package/core/{screenToGround.js → scene/screenToGround.js} +0 -0
  534. /package/core/{tier.js → scene/tier.js} +0 -0
  535. /package/core/{cells.js → stream/cells.js} +0 -0
  536. /package/core/{streamCells.js → stream/streamCells.js} +0 -0
  537. /package/core/{pureWorker.js → threads/pureWorker.js} +0 -0
  538. /package/examples/{sheepisland → perf-island}/content/index.js +0 -0
  539. /package/examples/{sheepisland → perf-island}/content/props.js +0 -0
  540. /package/examples/{sheepisland → perf-island}/content/templates.js +0 -0
  541. /package/examples/{sheepisland → perf-island}/content/vegetation.js +0 -0
  542. /package/examples/{sheepisland → perf-island}/picture/lights.js +0 -0
  543. /package/examples/{sheepisland → perf-island}/picture/materials.js +0 -0
  544. /package/examples/{sheepisland → perf-island}/picture/sky.js +0 -0
@@ -1 +1 @@
1
- {"version":1,"files":{"content/actions.js":{"kind":"actions","mtime":1793829782000,"from":0,"count":4,"indexIds":0,"positional":[]},"content/audio.js":{"kind":"audio","mtime":1793829782000,"from":0,"count":1,"indexIds":0,"positional":[]},"content/items.js":{"kind":"items","mtime":1793829782000,"from":0,"count":1,"indexIds":0,"positional":[]},"content/places.js":{"kind":"places","mtime":1793829782000,"from":0,"count":1,"indexIds":0,"positional":[]},"content/props.js":{"kind":"props","mtime":1793829782000,"from":0,"count":8,"indexIds":0,"positional":[]},"content/templates.js":{"kind":"templates","mtime":1793829782000,"from":0,"count":4,"indexIds":0,"positional":[]},"content/views.js":{"kind":"views","mtime":1793829782000,"from":0,"count":2,"indexIds":0,"positional":[]}},"ids":{"attack":[{"file":"content/actions.js","kind":"actions","line":4,"placed":false}],"retry":[{"file":"content/actions.js","kind":"actions","line":5,"placed":false}],"save":[{"file":"content/actions.js","kind":"actions","line":6,"placed":false}],"load":[{"file":"content/actions.js","kind":"actions","line":7,"placed":false}],"sounds":[{"file":"content/audio.js","kind":"audio","line":4,"placed":false}],"gem":[{"file":"content/items.js","kind":"items","line":3,"placed":false}],"room":[{"file":"content/places.js","kind":"places","line":3,"placed":false}],"floor":[{"file":"content/props.js","kind":"props","line":3,"placed":true},{"file":"content/templates.js","kind":"templates","line":4,"placed":false}],"wall-n":[{"file":"content/props.js","kind":"props","line":4,"placed":true}],"wall-s":[{"file":"content/props.js","kind":"props","line":5,"placed":true}],"wall-w":[{"file":"content/props.js","kind":"props","line":6,"placed":true}],"wall-e":[{"file":"content/props.js","kind":"props","line":7,"placed":true}],"pillar-1":[{"file":"content/props.js","kind":"props","line":8,"placed":true}],"pillar-2":[{"file":"content/props.js","kind":"props","line":9,"placed":true}],"slime-1":[{"file":"content/props.js","kind":"props","line":10,"placed":true}],"wall":[{"file":"content/templates.js","kind":"templates","line":5,"placed":false}],"pillar":[{"file":"content/templates.js","kind":"templates","line":6,"placed":false}],"slime":[{"file":"content/templates.js","kind":"templates","line":9,"placed":false}],"corner":[{"file":"content/views.js","kind":"views","line":4,"placed":false}],"door":[{"file":"content/views.js","kind":"views","line":5,"placed":false}]}}
1
+ {"version":1,"files":{"content/actions.js":{"kind":"actions","mtime":1793906610000,"from":0,"count":4,"indexIds":0,"positional":[]},"content/audio.js":{"kind":"audio","mtime":1793906610000,"from":0,"count":1,"indexIds":0,"positional":[]},"content/items.js":{"kind":"items","mtime":1793906610000,"from":0,"count":1,"indexIds":0,"positional":[]},"content/places.js":{"kind":"places","mtime":1793906610000,"from":0,"count":1,"indexIds":0,"positional":[]},"content/props.js":{"kind":"props","mtime":1793906610000,"from":0,"count":8,"indexIds":0,"positional":[]},"content/templates.js":{"kind":"templates","mtime":1793906610000,"from":0,"count":4,"indexIds":0,"positional":[]},"content/views.js":{"kind":"views","mtime":1793906610000,"from":0,"count":2,"indexIds":0,"positional":[]}},"ids":{"attack":[{"file":"content/actions.js","kind":"actions","line":4,"placed":false}],"retry":[{"file":"content/actions.js","kind":"actions","line":5,"placed":false}],"save":[{"file":"content/actions.js","kind":"actions","line":6,"placed":false}],"load":[{"file":"content/actions.js","kind":"actions","line":7,"placed":false}],"sounds":[{"file":"content/audio.js","kind":"audio","line":4,"placed":false}],"gem":[{"file":"content/items.js","kind":"items","line":3,"placed":false}],"room":[{"file":"content/places.js","kind":"places","line":3,"placed":false}],"floor":[{"file":"content/props.js","kind":"props","line":3,"placed":true},{"file":"content/templates.js","kind":"templates","line":4,"placed":false}],"wall-n":[{"file":"content/props.js","kind":"props","line":4,"placed":true}],"wall-s":[{"file":"content/props.js","kind":"props","line":5,"placed":true}],"wall-w":[{"file":"content/props.js","kind":"props","line":6,"placed":true}],"wall-e":[{"file":"content/props.js","kind":"props","line":7,"placed":true}],"pillar-1":[{"file":"content/props.js","kind":"props","line":8,"placed":true}],"pillar-2":[{"file":"content/props.js","kind":"props","line":9,"placed":true}],"slime-1":[{"file":"content/props.js","kind":"props","line":10,"placed":true}],"wall":[{"file":"content/templates.js","kind":"templates","line":5,"placed":false}],"pillar":[{"file":"content/templates.js","kind":"templates","line":6,"placed":false}],"slime":[{"file":"content/templates.js","kind":"templates","line":9,"placed":false}],"corner":[{"file":"content/views.js","kind":"views","line":4,"placed":false}],"door":[{"file":"content/views.js","kind":"views","line":5,"placed":false}]}}
@@ -38,6 +38,7 @@ Content: actions 4 · audio 1 · items 1 · places 1 · props 8 (from templates
38
38
  Not used yet (check these before writing the system yourself):
39
39
 
40
40
  - quests: goals with steps, conditions and rewards: `quests()` + key map presets.bindings.quests, content/quests.js (node_modules/threedog/docs/recipes/04-quests.md)
41
+ - swarm: many same-kind moving things (shots, crowds, flocks, debris) in typed arrays, drawn as one mesh: `swarm()` (node_modules/threedog/docs/recipes/65-swarm.md)
41
42
  - grids: cell placement for farming and building: `grids()` (node_modules/threedog/docs/recipes/29-grid.md)
42
43
 
43
44
  ## Files
@@ -124,8 +125,7 @@ Code that breaks saves or manages world models: none (rule R33).
124
125
 
125
126
  - Save prefix saveKey: threedog-action
126
127
  - Save slots: slot1
127
- - Save entries the game registers itself: ' +
128
- 'action
128
+ - Save entries the game registers itself: action
129
129
  - Saved parts of the engine modules (vars, inventory, quests, timers, world...): `threedog catalog` (saves per module)
130
130
 
131
131
  ## Style keys
@@ -1 +1 @@
1
- {"version":1,"files":{"content/props.js":{"kind":"props","mtime":1793829782000,"from":0,"count":15,"indexIds":0,"positional":[]},"content/templates.js":{"kind":"templates","mtime":1793829782000,"from":0,"count":2,"indexIds":0,"positional":[]},"content/vegetation.js":{"kind":"vegetation","mtime":1793829782000,"from":0,"count":1,"indexIds":0,"positional":[]}},"ids":{"tree-1":[{"file":"content/props.js","kind":"props","line":4,"placed":true}],"tree-2":[{"file":"content/props.js","kind":"props","line":5,"placed":true}],"tree-3":[{"file":"content/props.js","kind":"props","line":6,"placed":true}],"tree-4":[{"file":"content/props.js","kind":"props","line":7,"placed":true}],"tree-5":[{"file":"content/props.js","kind":"props","line":8,"placed":true}],"tree-6":[{"file":"content/props.js","kind":"props","line":9,"placed":true}],"tree-7":[{"file":"content/props.js","kind":"props","line":10,"placed":true}],"sheep-1":[{"file":"content/props.js","kind":"props","line":11,"placed":true}],"sheep-2":[{"file":"content/props.js","kind":"props","line":12,"placed":true}],"sheep-3":[{"file":"content/props.js","kind":"props","line":13,"placed":true}],"sheep-4":[{"file":"content/props.js","kind":"props","line":14,"placed":true}],"sheep-5":[{"file":"content/props.js","kind":"props","line":15,"placed":true}],"sheep-6":[{"file":"content/props.js","kind":"props","line":16,"placed":true}],"sheep-7":[{"file":"content/props.js","kind":"props","line":17,"placed":true}],"sheep-8":[{"file":"content/props.js","kind":"props","line":18,"placed":true}],"tree":[{"file":"content/templates.js","kind":"templates","line":3,"placed":false}],"sheep":[{"file":"content/templates.js","kind":"templates","line":4,"placed":false}],"wheat":[{"file":"content/vegetation.js","kind":"vegetation","line":6,"placed":false}]}}
1
+ {"version":1,"files":{"content/props.js":{"kind":"props","mtime":1793906610000,"from":0,"count":15,"indexIds":0,"positional":[]},"content/templates.js":{"kind":"templates","mtime":1793906610000,"from":0,"count":2,"indexIds":0,"positional":[]},"content/vegetation.js":{"kind":"vegetation","mtime":1793906610000,"from":0,"count":1,"indexIds":0,"positional":[]}},"ids":{"tree-1":[{"file":"content/props.js","kind":"props","line":4,"placed":true}],"tree-2":[{"file":"content/props.js","kind":"props","line":5,"placed":true}],"tree-3":[{"file":"content/props.js","kind":"props","line":6,"placed":true}],"tree-4":[{"file":"content/props.js","kind":"props","line":7,"placed":true}],"tree-5":[{"file":"content/props.js","kind":"props","line":8,"placed":true}],"tree-6":[{"file":"content/props.js","kind":"props","line":9,"placed":true}],"tree-7":[{"file":"content/props.js","kind":"props","line":10,"placed":true}],"sheep-1":[{"file":"content/props.js","kind":"props","line":11,"placed":true}],"sheep-2":[{"file":"content/props.js","kind":"props","line":12,"placed":true}],"sheep-3":[{"file":"content/props.js","kind":"props","line":13,"placed":true}],"sheep-4":[{"file":"content/props.js","kind":"props","line":14,"placed":true}],"sheep-5":[{"file":"content/props.js","kind":"props","line":15,"placed":true}],"sheep-6":[{"file":"content/props.js","kind":"props","line":16,"placed":true}],"sheep-7":[{"file":"content/props.js","kind":"props","line":17,"placed":true}],"sheep-8":[{"file":"content/props.js","kind":"props","line":18,"placed":true}],"tree":[{"file":"content/templates.js","kind":"templates","line":3,"placed":false}],"sheep":[{"file":"content/templates.js","kind":"templates","line":4,"placed":false}],"wheat":[{"file":"content/vegetation.js","kind":"vegetation","line":6,"placed":false}]}}
@@ -1,6 +1,6 @@
1
- # Game map: sheepisland (generated, do not edit by hand)
1
+ # Game map: perf-island (generated, do not edit by hand)
2
2
 
3
- > Generated by `npm run map` by scanning this folder; paths are relative to it. Pages: /sheepisland.html, entry `main.js`.
3
+ > Generated by `npm run map` by scanning this folder; paths are relative to it. Pages: /perf-island.html, entry `main.js`.
4
4
  > Content data is in `content/*.js` (condition/effect syntax: `node_modules/threedog/docs/recipes/20-content-actions-save.md`), which main.js hands to the engine with `engine.content.load()`; for the engine API read `node_modules/threedog/docs/API.md` (index) first, then only the module pages listed below.
5
5
 
6
6
  Content: props 15 (from templates 15) · templates 2 · vegetation 1
@@ -11,15 +11,15 @@ None yet, write them in `DESIGN.md` (why it is designed this way, what not to ch
11
11
 
12
12
  ## Engine modules (engine.use)
13
13
 
14
- - createEngine: { bindings: { ...presets.bindings.debug }, lights: false, saveKey: 'threedog-sheepisland', ui: { loading: { t…
14
+ - createEngine: { bindings: { ...presets.bindings.debug }, lights: false, saveKey: 'threedog-perf-island', ui: { loading: { t…
15
15
  - openWorld preset ({ camera: fixedCamera(), terrain: island, water: false, rigid: false, ambience: false, calendar: { …) → world, terrain, vegetation, calendar, sky, weather, collision, characters, settings, debug
16
16
  - content
17
17
 
18
18
  ## Read for this game (per installed module: recipe · api page; core API: `node_modules/threedog/docs/api/engine.md`)
19
19
 
20
20
  - world: `node_modules/threedog/docs/recipes/18-world.md` · `node_modules/threedog/docs/api/world.md`
21
- - terrain: `node_modules/threedog/docs/recipes/36-sky-ground-plants.md` · `node_modules/threedog/docs/api/terrain.md`
22
- - vegetation: `node_modules/threedog/docs/recipes/36-sky-ground-plants.md` · `node_modules/threedog/docs/api/vegetation.md`
21
+ - terrain: `node_modules/threedog/docs/recipes/28-terrain.md` · `node_modules/threedog/docs/api/terrain.md`
22
+ - vegetation: `node_modules/threedog/docs/recipes/36-ground-plants.md` · `node_modules/threedog/docs/api/vegetation.md`
23
23
  - calendar: `node_modules/threedog/docs/recipes/06-clock-events.md` · `node_modules/threedog/docs/api/calendar.md`
24
24
  - sky: `node_modules/threedog/docs/recipes/08-weather-sky.md` · `node_modules/threedog/docs/api/sky.md`
25
25
  - weather: `node_modules/threedog/docs/recipes/44-water-weather-hooks.md` · `node_modules/threedog/docs/api/weather.md`
@@ -34,6 +34,7 @@ Not used yet (check these before writing the system yourself):
34
34
  - saves: save your own state: `engine.saves.register(key, { version, save, load })` (node_modules/threedog/docs/recipes/20-content-actions-save.md)
35
35
  - interactions: press a key near a thing: `interactions({ ...presets.interactions.nearest })` (E, nearest; the game picks the pick mode and keys), template `interact: { label, op }` (node_modules/threedog/docs/recipes/30-templates.md)
36
36
  - quests: goals with steps, conditions and rewards: `quests()` + key map presets.bindings.quests, content/quests.js (node_modules/threedog/docs/recipes/04-quests.md)
37
+ - swarm: many same-kind moving things (shots, crowds, flocks, debris) in typed arrays, drawn as one mesh: `swarm()` (node_modules/threedog/docs/recipes/65-swarm.md)
37
38
  - grids: cell placement for farming and building: `grids()` (node_modules/threedog/docs/recipes/29-grid.md)
38
39
 
39
40
  ## Files
@@ -48,14 +49,14 @@ content/*.js is content data: how to write it in `node_modules/threedog/docs/rec
48
49
  | content/templates.js | 6 | |
49
50
  | content/vegetation.js | 11 | |
50
51
  | main.js | 83 | @ts-check This example is written in GLSL: it is the WebGL route (`threedog new-game --webgl`). On … |
51
- | models.js | 49 | sheepisland procedural models: a round tree, a sheep, a wheat tuft. Built in code, no files; regist… |
52
- | params.js | 26 | URL parameters of the sheep island page. Import this file first in main.js: it rewrites word values… |
53
- | picture/index.js | 21 | @ts-check The picture of sheep island: wiring only. Each part writes plain three.js from the signal… |
52
+ | models.js | 49 | perf-island procedural models: a round tree, a sheep, a wheat tuft. Built in code, no files; regist… |
53
+ | params.js | 26 | URL parameters of the perf island page. Import this file first in main.js: it rewrites word values … |
54
+ | picture/index.js | 21 | @ts-check The picture of perf island: wiring only. Each part writes plain three.js from the signals… |
54
55
  | picture/lights.js | 35 | @ts-check Sun or moon and ambient, both from the day table in palette.js. |
55
56
  | picture/materials.js | 62 | @ts-check Materials by name. All matte Lambert with two shader additions: soft light (the wrap and … |
56
- | picture/palette.js | 61 | @ts-check Sheep island palette: every color and key value of the picture, one copy. A soft painted … |
57
+ | picture/palette.js | 61 | @ts-check Perf island palette: every color and key value of the picture, one copy. A soft painted d… |
57
58
  | picture/sky.js | 21 | @ts-check A flat painted backdrop: one color at every height, the same as the fog, so the island fl… |
58
- | views.js | 10 | Named camera positions of the sheep island. Same name = same framing every time, so two screenshots… |
59
+ | views.js | 10 | Named camera positions of the perf island. Same name = same framing every time, so two screenshots … |
59
60
 
60
61
  ## NPCs (content/npcs.js)
61
62
 
@@ -103,7 +104,7 @@ Code that breaks saves or manages world models: none (rule R33).
103
104
 
104
105
  ## Saves
105
106
 
106
- - Save prefix saveKey: threedog-sheepisland
107
+ - Save prefix saveKey: threedog-perf-island
107
108
  - Saved parts of the engine modules (vars, inventory, quests, timers, world...): `threedog catalog` (saves per module)
108
109
 
109
110
  ## Style keys
@@ -2,4 +2,4 @@
2
2
  // objects and checks the model / sound names content uses against them (one source, no scanning of main.js).
3
3
  import { models } from './models.js'; // roundTree, sheep, wheatTuft
4
4
 
5
- export default [{ name: 'sheepisland', models }];
5
+ export default [{ name: 'perf-island', models }];
@@ -1,6 +1,6 @@
1
1
  // @ts-check
2
2
  // This example is written in GLSL: it is the WebGL route (`threedog new-game --webgl`). On the default WebGPU route the same ideas are written in TSL (recipe 56).
3
- // Sheep island: a small floating island built only from the engine's public entry points (the acceptance scene of docs/plans/done/acceptance-sheepisland.md).
3
+ // Perf island: a small floating island built only from the engine's public entry points.
4
4
  // A meadow with a river, round trees, a wheat field and a flock of sheep on an island with a ragged rim, over a pale backdrop with no horizon.
5
5
  // Parameters (params.js): time day | dusk | night, weather clear | snow, view overview | flock | field | river | rim.
6
6
  // main.js holds wiring only: modules, the island's terrain functions, view switching and the snow-to-winter link. Objects are content (rule R33),
@@ -19,7 +19,7 @@ import { VIEWS } from './views.js';
19
19
  const island = {
20
20
  ...GROUND,
21
21
  material: mat.ground, effects: /** @type {const} */ (false), // drawn as given: picture/materials.js brings its own snow, and this island has no cloud shadow
22
- resolution: 48, // 64 m chunk / 48 = 1.33 m cells: the rim is cut along cells, so finer cells give a finer brushed edge (recipe 42 §4)
22
+ resolution: 48, // 64 m chunk / 48 = 1.33 m cells: the rim is cut along cells, so finer cells give a finer brushed edge (recipe 28 §5)
23
23
  // the river's centre line z = amp * sin(x * freq) + shift: one set of numbers both functions read (n.params), so the dip and the river
24
24
  // ground type cannot drift apart
25
25
  params: { river: { amp: 6, freq: 0.09, shift: 2, dip: 3.2, wet: 2.4 } },
@@ -45,8 +45,8 @@ const island = {
45
45
 
46
46
  // ---------- 2. Engine: no placeholder lights, open-world preset with a fixed sky; a two-season calendar so snow can turn the island white ----------
47
47
  const WINTER_DAY = 1001; // seasons last 1000 days each, so the season never blends towards the next one (it does over the last 20%)
48
- const engine = createEngine({ bindings: { ...presets.bindings.debug }, canvas: /** @type {HTMLCanvasElement} */ (document.getElementById('view')), lights: false, saveKey: 'threedog-sheepisland',
49
- ui: { loading: { title: 'sheep island' } } });
48
+ const engine = createEngine({ bindings: { ...presets.bindings.debug }, canvas: /** @type {HTMLCanvasElement} */ (document.getElementById('view')), lights: false, saveKey: 'threedog-perf-island',
49
+ ui: { loading: { title: 'perf island' } } });
50
50
  engine.use(openWorld({ camera: fixedCamera(), terrain: island, water: false, rigid: false, ambience: false,
51
51
  calendar: { ...presets.calendar.fixedTime, time: 0.5, seasons: ['summer', 'winter'], daysPerSeason: 1000 },
52
52
  weather: { ...presets.weather.temperate, start: 'clear' }, autoWeather: false }), content());
@@ -63,7 +63,7 @@ engine.onFrame(() => {
63
63
 
64
64
  // ---------- 4. Views: an op, so the URL, the dev bridge and tests switch the same way ----------
65
65
  const state = { view: params.view };
66
- engine.ops.define('sheepisland.view', {
66
+ engine.ops.define('perf-island.view', {
67
67
  desc: 'Move the camera to a named view: overview, flock, field, river, rim', args: { name: 'string' },
68
68
  can: (e, { name }) => VIEW_NAMES.includes(name) ? true : 'unknownView',
69
69
  run: (e, { name }) => {
@@ -74,9 +74,9 @@ engine.ops.define('sheepisland.view', {
74
74
  },
75
75
  reasons: { unknownView: 'View names: overview, flock, field, river, rim' },
76
76
  });
77
- engine.describe.add('sheepisland', () => ({ view: state.view, season: engine.calendar.season, weather: engine.weather?.name }));
78
- engine.events.on('engine:ready', () => engine.ops.run('sheepisland.view', { name: params.view }));
79
- if (params.badView) console.warn(`sheepisland: unknown view '${params.badView}', showing overview. Views: ${VIEW_NAMES.join(', ')}`);
77
+ engine.describe.add('perf-island', () => ({ view: state.view, season: engine.calendar.season, weather: engine.weather?.name }));
78
+ engine.events.on('engine:ready', () => engine.ops.run('perf-island.view', { name: params.view }));
79
+ if (params.badView) console.warn(`perf-island: unknown view '${params.badView}', showing overview. Views: ${VIEW_NAMES.join(', ')}`);
80
80
 
81
81
  engine.start();
82
82
  Object.assign(window, { engine, picture }); // handy for debugging in the browser console
@@ -1,4 +1,4 @@
1
- // sheepisland procedural models: a round tree, a sheep, a wheat tuft. Built in code, no files; registered as an asset pack (assets.js).
1
+ // perf-island procedural models: a round tree, a sheep, a wheat tuft. Built in code, no files; registered as an asset pack (assets.js).
2
2
  // Colors and materials come by name from picture/, so a picture change never touches this file.
3
3
  // Shapes are clusters of smooth spheres: the reference reads as soft blobs, not facets. Shadow flags are set here (the engine does not guess them).
4
4
  import { THREE, mergeColored } from '../../index.js';
@@ -1,4 +1,4 @@
1
- // URL parameters of the sheep island page. Import this file first in main.js: it rewrites word values into the forms the engine's own
1
+ // URL parameters of the perf island page. Import this file first in main.js: it rewrites word values into the forms the engine's own
2
2
  // URL state understands (time=dusk -> 18:30, weather=雪 -> snow) before createEngine reads the URL. Same words as the style test page.
3
3
  // time day | dusk | night (白天 黄昏 夜晚), or HH:MM weather clear | snow (晴 雪), or any engine weather name
4
4
  // view overview | flock | field | river | rim (总览 羊群 麦田 河 边缘)
@@ -1,5 +1,5 @@
1
1
  // @ts-check
2
- // The picture of sheep island: wiring only. Each part writes plain three.js from the signals; one onRender drives them all.
2
+ // The picture of perf island: wiring only. Each part writes plain three.js from the signals; one onRender drives them all.
3
3
  import { EXPOSURE, TONE_MAPPING } from './palette.js';
4
4
  import { createLights } from './lights.js';
5
5
  import { createMaterials } from './materials.js';
@@ -1,5 +1,5 @@
1
1
  // @ts-check
2
- // Sheep island palette: every color and key value of the picture, one copy. A soft painted diorama: few flat colors, soft shadows, a pale warm
2
+ // Perf island palette: every color and key value of the picture, one copy. A soft painted diorama: few flat colors, soft shadows, a pale warm
3
3
  // backdrop with no horizon. The other files here read these; the island's shape is the game's terrain() in ../main.js, never here.
4
4
  import { THREE } from '../../../index.js';
5
5
 
@@ -8,7 +8,7 @@ export const COLORS = { leaf: 0x6fa64a, leafLight: 0x8fbf5c, bark: 0x8a6448, woo
8
8
 
9
9
  /** How the ground is colored, spread into terrain({...}) in main.js: the workers bake these into the chunks, so they go in at the start */
10
10
  export const GROUND = {
11
- shading: /** @type {const} */ ('texture'), colorResolution: 256, // crisp river bank and field edge without more triangles (recipe 37); 128 (0.5 m pixels) shows stairs up close
11
+ shading: /** @type {const} */ ('texture'), colorResolution: 256, // crisp river bank and field edge without more triangles (recipe 53); 128 (0.5 m pixels) shows stairs up close
12
12
  colors: { grassA: 0x92c062, grassB: 0x86b658, river: 0x6aa6d6, riverDeep: 0x5b97ca, wheatA: 0xdcae48, wheatB: 0xd2a442, earth: 0xb98d64, rock: 0x94705a },
13
13
  biomeColors: { grass: ['grassA', 'grassB'], river: ['river', 'riverDeep'], wheat: ['wheatA', 'wheatB'], cliff: ['earth'], rock: ['rock'] },
14
14
  };
@@ -1,4 +1,4 @@
1
- // Named camera positions of the sheep island. Same name = same framing every time, so two screenshots differ only by time or weather.
1
+ // Named camera positions of the perf island. Same name = same framing every time, so two screenshots differ only by time or weather.
2
2
  // The island is centred on (0, 0) and is about 60 m across; positions are [x, y, z] in world space.
3
3
  export const VIEWS = {
4
4
  overview: { pos: [0, 36, 48], look: [0, -1, 0] }, // the whole island floating on the backdrop, from the south, a little above
@@ -30,6 +30,7 @@ Not used yet (check these before writing the system yourself):
30
30
  - saves: save your own state: `engine.saves.register(key, { version, save, load })` (node_modules/threedog/docs/recipes/20-content-actions-save.md)
31
31
  - interactions: press a key near a thing: `interactions({ ...presets.interactions.nearest })` (E, nearest; the game picks the pick mode and keys), template `interact: { label, op }` (node_modules/threedog/docs/recipes/30-templates.md)
32
32
  - quests: goals with steps, conditions and rewards: `quests()` + key map presets.bindings.quests, content/quests.js (node_modules/threedog/docs/recipes/04-quests.md)
33
+ - swarm: many same-kind moving things (shots, crowds, flocks, debris) in typed arrays, drawn as one mesh: `swarm()` (node_modules/threedog/docs/recipes/65-swarm.md)
33
34
  - grids: cell placement for farming and building: `grids()` (node_modules/threedog/docs/recipes/29-grid.md)
34
35
  - templates: reusable objects placed from content: content/templates.js + props { template } (node_modules/threedog/docs/recipes/30-templates.md)
35
36
 
@@ -12,7 +12,7 @@ None yet, write them in `DESIGN.md` (why it is designed this way, what not to ch
12
12
  ## Engine modules (engine.use)
13
13
 
14
14
  - createEngine: { lights: false, ui: { loading: false }, saveKey: 'threedog-rc2d' }
15
- - fixedCamera ({ shots: { top }, start: 'top' })
15
+ - fixedCamera ({ shots: { top: { position: [0, 40, 0.001], lookAt: [0, 0, 0], projection: 'orthographic', size: 30…)
16
16
 
17
17
  ## Read for this game (per installed module: recipe · api page; core API: `node_modules/threedog/docs/api/engine.md`)
18
18
 
@@ -26,6 +26,7 @@ Not used yet (check these before writing the system yourself):
26
26
  - saves: save your own state: `engine.saves.register(key, { version, save, load })` (node_modules/threedog/docs/recipes/20-content-actions-save.md)
27
27
  - interactions: press a key near a thing: `interactions({ ...presets.interactions.nearest })` (E, nearest; the game picks the pick mode and keys), template `interact: { label, op }` (node_modules/threedog/docs/recipes/30-templates.md)
28
28
  - quests: goals with steps, conditions and rewards: `quests()` + key map presets.bindings.quests, content/quests.js (node_modules/threedog/docs/recipes/04-quests.md)
29
+ - swarm: many same-kind moving things (shots, crowds, flocks, debris) in typed arrays, drawn as one mesh: `swarm()` (node_modules/threedog/docs/recipes/65-swarm.md)
29
30
  - grids: cell placement for farming and building: `grids()` (node_modules/threedog/docs/recipes/29-grid.md)
30
31
  - templates: reusable objects placed from content: content/templates.js + props { template } (node_modules/threedog/docs/recipes/30-templates.md)
31
32
 
@@ -35,7 +36,7 @@ content/*.js is content data: how to write it in `node_modules/threedog/docs/rec
35
36
 
36
37
  | File | Lines | Description |
37
38
  |---|---|---|
38
- | main.js | 56 | @ts-check 2D radiance cascades demo (page /rc2d.html): a top-down street at night. Street lamps, li… |
39
+ | main.js | 54 | @ts-check 2D radiance cascades demo (page /rc2d.html): a top-down street at night. Street lamps, li… |
39
40
  | picture/index.js | 19 | @ts-check The picture of the rc2d demo: wiring only. |
40
41
  | picture/lights.js | 12 | @ts-check The scene's own light is one dim ambient; everything else on the street is lit by the cas… |
41
42
  | picture/materials.js | 19 | @ts-check Materials by name. An emitter is a black surface with an emissive: rc2d.js reads emissive… |
@@ -9,9 +9,7 @@ import { createPicture } from './picture/index.js';
9
9
 
10
10
  const url = new URLSearchParams(location.search);
11
11
  const engine = createEngine({ canvas: /** @type {HTMLCanvasElement} */ (document.getElementById('view')), lights: false, ui: { loading: false }, saveKey: 'threedog-rc2d' });
12
- // projection / size per shot work at run time (recipes/21-camera.md) but CameraShot does not declare them yet, hence the cast
13
- const top = /** @type {any} */ ({ position: [0, 40, 0.001], lookAt: [0, 0, 0], projection: 'orthographic', size: 30 });
14
- engine.use(fixedCamera({ shots: { top }, start: 'top' }));
12
+ engine.use(fixedCamera({ shots: { top: { position: [0, 40, 0.001], lookAt: [0, 0, 0], projection: 'orthographic', size: 30 } }, start: 'top' }));
15
13
 
16
14
  const cascades = url.get('cascades');
17
15
  const picture = createPicture(engine, {
@@ -1 +1 @@
1
- {"version":1,"files":{"content/items.js":{"kind":"items","mtime":1793829782000,"from":0,"count":3,"indexIds":0,"positional":[]},"content/npcs.js":{"kind":"npcs","mtime":1793829782000,"from":0,"count":1,"indexIds":0,"positional":[]},"content/places.js":{"kind":"places","mtime":1793829782000,"from":0,"count":2,"indexIds":0,"positional":[]},"content/props.js":{"kind":"props","mtime":1793829782000,"from":0,"count":12,"indexIds":0,"positional":[]},"content/templates.js":{"kind":"templates","mtime":1793829782000,"from":0,"count":6,"indexIds":0,"positional":[]},"content/vegetation.js":{"kind":"vegetation","mtime":1793829782000,"from":0,"count":5,"indexIds":0,"positional":[]}},"ids":{"apple":[{"file":"content/items.js","kind":"items","line":3,"placed":false}],"key":[{"file":"content/items.js","kind":"items","line":4,"placed":false}],"wood":[{"file":"content/items.js","kind":"items","line":5,"placed":false},{"file":"content/props.js","kind":"props","line":10,"placed":true}],"guide":[{"file":"content/npcs.js","kind":"npcs","line":3,"placed":false}],"stage":[{"file":"content/places.js","kind":"places","line":3,"placed":false}],"water":[{"file":"content/places.js","kind":"places","line":4,"placed":false}],"pine":[{"file":"content/props.js","kind":"props","line":4,"placed":true}],"round-tree":[{"file":"content/props.js","kind":"props","line":5,"placed":true}],"rock":[{"file":"content/props.js","kind":"props","line":6,"placed":true}],"flower-a":[{"file":"content/props.js","kind":"props","line":7,"placed":true}],"flower-b":[{"file":"content/props.js","kind":"props","line":8,"placed":true}],"flower-c":[{"file":"content/props.js","kind":"props","line":9,"placed":true}],"stone":[{"file":"content/props.js","kind":"props","line":11,"placed":true}],"metal":[{"file":"content/props.js","kind":"props","line":12,"placed":true}],"glass":[{"file":"content/props.js","kind":"props","line":13,"placed":true}],"shadow-stage":[{"file":"content/props.js","kind":"props","line":14,"placed":true}],"room":[{"file":"content/props.js","kind":"props","line":15,"placed":true},{"file":"content/templates.js","kind":"templates","line":8,"placed":false}],"woodBlock":[{"file":"content/templates.js","kind":"templates","line":3,"placed":false}],"stoneBlock":[{"file":"content/templates.js","kind":"templates","line":4,"placed":false}],"metalBall":[{"file":"content/templates.js","kind":"templates","line":5,"placed":false}],"glassPanes":[{"file":"content/templates.js","kind":"templates","line":6,"placed":false}],"shadowStage":[{"file":"content/templates.js","kind":"templates","line":7,"placed":false}],"松树":[{"file":"content/vegetation.js","kind":"vegetation","line":4,"placed":false}],"圆树":[{"file":"content/vegetation.js","kind":"vegetation","line":10,"placed":false}],"石头":[{"file":"content/vegetation.js","kind":"vegetation","line":16,"placed":false}],"草":[{"file":"content/vegetation.js","kind":"vegetation","line":20,"placed":false}],"野花":[{"file":"content/vegetation.js","kind":"vegetation","line":25,"placed":false}]}}
1
+ {"version":1,"files":{"content/items.js":{"kind":"items","mtime":1793906610000,"from":0,"count":3,"indexIds":0,"positional":[]},"content/npcs.js":{"kind":"npcs","mtime":1793906610000,"from":0,"count":1,"indexIds":0,"positional":[]},"content/places.js":{"kind":"places","mtime":1793906610000,"from":0,"count":2,"indexIds":0,"positional":[]},"content/props.js":{"kind":"props","mtime":1793906610000,"from":0,"count":12,"indexIds":0,"positional":[]},"content/templates.js":{"kind":"templates","mtime":1793906610000,"from":0,"count":6,"indexIds":0,"positional":[]},"content/vegetation.js":{"kind":"vegetation","mtime":1793906610000,"from":0,"count":5,"indexIds":0,"positional":[]}},"ids":{"apple":[{"file":"content/items.js","kind":"items","line":3,"placed":false}],"key":[{"file":"content/items.js","kind":"items","line":4,"placed":false}],"wood":[{"file":"content/items.js","kind":"items","line":5,"placed":false},{"file":"content/props.js","kind":"props","line":10,"placed":true}],"guide":[{"file":"content/npcs.js","kind":"npcs","line":3,"placed":false}],"stage":[{"file":"content/places.js","kind":"places","line":3,"placed":false}],"water":[{"file":"content/places.js","kind":"places","line":4,"placed":false}],"pine":[{"file":"content/props.js","kind":"props","line":4,"placed":true}],"round-tree":[{"file":"content/props.js","kind":"props","line":5,"placed":true}],"rock":[{"file":"content/props.js","kind":"props","line":6,"placed":true}],"flower-a":[{"file":"content/props.js","kind":"props","line":7,"placed":true}],"flower-b":[{"file":"content/props.js","kind":"props","line":8,"placed":true}],"flower-c":[{"file":"content/props.js","kind":"props","line":9,"placed":true}],"stone":[{"file":"content/props.js","kind":"props","line":11,"placed":true}],"metal":[{"file":"content/props.js","kind":"props","line":12,"placed":true}],"glass":[{"file":"content/props.js","kind":"props","line":13,"placed":true}],"shadow-stage":[{"file":"content/props.js","kind":"props","line":14,"placed":true}],"room":[{"file":"content/props.js","kind":"props","line":15,"placed":true},{"file":"content/templates.js","kind":"templates","line":8,"placed":false}],"woodBlock":[{"file":"content/templates.js","kind":"templates","line":3,"placed":false}],"stoneBlock":[{"file":"content/templates.js","kind":"templates","line":4,"placed":false}],"metalBall":[{"file":"content/templates.js","kind":"templates","line":5,"placed":false}],"glassPanes":[{"file":"content/templates.js","kind":"templates","line":6,"placed":false}],"shadowStage":[{"file":"content/templates.js","kind":"templates","line":7,"placed":false}],"松树":[{"file":"content/vegetation.js","kind":"vegetation","line":4,"placed":false}],"圆树":[{"file":"content/vegetation.js","kind":"vegetation","line":10,"placed":false}],"石头":[{"file":"content/vegetation.js","kind":"vegetation","line":16,"placed":false}],"草":[{"file":"content/vegetation.js","kind":"vegetation","line":20,"placed":false}],"野花":[{"file":"content/vegetation.js","kind":"vegetation","line":25,"placed":false}]}}
@@ -24,8 +24,8 @@ None yet, write them in `DESIGN.md` (why it is designed this way, what not to ch
24
24
  ## Read for this game (per installed module: recipe · api page; core API: `node_modules/threedog/docs/api/engine.md`)
25
25
 
26
26
  - world: `node_modules/threedog/docs/recipes/18-world.md` · `node_modules/threedog/docs/api/world.md`
27
- - terrain: `node_modules/threedog/docs/recipes/36-sky-ground-plants.md` · `node_modules/threedog/docs/api/terrain.md`
28
- - vegetation: `node_modules/threedog/docs/recipes/36-sky-ground-plants.md` · `node_modules/threedog/docs/api/vegetation.md`
27
+ - terrain: `node_modules/threedog/docs/recipes/28-terrain.md` · `node_modules/threedog/docs/api/terrain.md`
28
+ - vegetation: `node_modules/threedog/docs/recipes/36-ground-plants.md` · `node_modules/threedog/docs/api/vegetation.md`
29
29
  - calendar: `node_modules/threedog/docs/recipes/06-clock-events.md` · `node_modules/threedog/docs/api/calendar.md`
30
30
  - sky: `node_modules/threedog/docs/recipes/08-weather-sky.md` · `node_modules/threedog/docs/api/sky.md`
31
31
  - weather: `node_modules/threedog/docs/recipes/44-water-weather-hooks.md` · `node_modules/threedog/docs/api/weather.md`
@@ -39,6 +39,7 @@ Not used yet (check these before writing the system yourself):
39
39
 
40
40
  - saves: save your own state: `engine.saves.register(key, { version, save, load })` (node_modules/threedog/docs/recipes/20-content-actions-save.md)
41
41
  - quests: goals with steps, conditions and rewards: `quests()` + key map presets.bindings.quests, content/quests.js (node_modules/threedog/docs/recipes/04-quests.md)
42
+ - swarm: many same-kind moving things (shots, crowds, flocks, debris) in typed arrays, drawn as one mesh: `swarm()` (node_modules/threedog/docs/recipes/65-swarm.md)
42
43
  - grids: cell placement for farming and building: `grids()` (node_modules/threedog/docs/recipes/29-grid.md)
43
44
 
44
45
  ## Files
@@ -43,7 +43,7 @@ export function applyContactShadows(engine, { sun, hemi, ...opts }) {
43
43
  };
44
44
  shadow([-p.extent, p.extent, p.extent, -p.extent], p.mapSize, p.normalBias, p.bias);
45
45
  if (hemi) hemi.intensity *= p.fill;
46
- const aoPass = p.ao ? engine.post.add(ao({ enabled: true, radius: p.aoRadius, intensity: p.aoIntensity }), { name: 'ao' }) : null;
46
+ const aoPass = p.ao ? engine.post.add(ao({ radius: p.aoRadius, intensity: p.aoIntensity }), { name: 'ao' }) : null;
47
47
  return {
48
48
  remove() {
49
49
  shadow(saved.box, saved.mapSize, saved.normalBias, saved.bias);
@@ -34,7 +34,7 @@ for (const [x, z] of [[-0.55, -0.35], [0.55, -0.35], [-0.55, 0.35], [0.55, 0.35]
34
34
  const cup = add(new THREE.CylinderGeometry(0.04, 0.035, 0.1, 24), mat.cup, 0.2, 0.75 + 0.05, 0.1);
35
35
  add(new THREE.SphereGeometry(0.07, 24, 16), mat.ball, -0.25, 0.75 + 0.07, -0.1);
36
36
  // a small object on the ground, where floating is easiest to see
37
- const block = add(new THREE.BoxGeometry(0.12, 0.12, 0.12), mat.block, 1.1, 0.06, 0.6);
37
+ add(new THREE.BoxGeometry(0.12, 0.12, 0.12), mat.block, 1.1, 0.06, 0.6);
38
38
  // the crate stack: one static merged geometry with baked vertex AO (darker at the floor and between crates). Tessellated boxes: AO is per vertex
39
39
  const crate = (/** @type {number} */ s, /** @type {number} */ x, /** @type {number} */ y, /** @type {number} */ z) => new THREE.BoxGeometry(s, s, s, 6, 6, 6).translate(x, y + s / 2, z);
40
40
  const stack = mergeGeometries([crate(0.6, 0, 0, 0), crate(0.6, 0.62, 0, 0.05), crate(0.45, 0.3, 0.6, 0)]);
@@ -2,7 +2,7 @@
2
2
  // Technique example: interior light (page /interior-light.html, README.md next to this file). A neutral gray room (8 x 6 m, 3 m high) with a
3
3
  // window in the west wall and a door in the south wall. One skill: lighting a room from outside (sun through the opening, sky light through the
4
4
  // window), filling the shadowed side with bounce, the exposure change between outside and inside, and lamps at night.
5
- // (time and view are the engine's own URL scenario keys, see core/UrlState.js: page params use other names)
5
+ // (time and view are the engine's own URL scenario keys, see core/inspect/UrlState.js: page params use other names)
6
6
  // URL: ?night=1 ?cam=inside|doorway|outside ?fill=probes|light|none ?area=0 (no window area light) ?leak=1 (keep outdoor ambient indoors)
7
7
  // Test page for tests/specs/techniques-light.mjs: window.interiorTest = { THREE, ready, points, picture }. Shapes only here; the whole picture is picture/.
8
8
  import { createEngine, sky, fixedCamera, THREE } from 'threedog';
@@ -4,8 +4,10 @@ Modular buildings on a grid: parameterized wall / window / door / roof / trim mo
4
4
 
5
5
  A kit of building pieces made in code, snapped to a grid and assembled into buildings and whole streets, with the colours and materials left to
6
6
  the game. The pieces are plain on purpose: the same kit draws a cozy town, a gray block-out or a cold sci-fi row by swapping one set of
7
- materials and one set of trim profiles. Run it with `npm run dev` and open `/modular-building.html` (`?set=gray|warm|cool`, `seed=1`,
8
- `count=10`, `view=street|close`, `batch=0|merge`). The engine never imports this folder; copy it and change anything.
7
+ materials and one set of trim profiles. `threedog examples pull modular-building` copies this README and `kit.js`, the whole technique: import `kit.js` from your game
8
+ and give it your materials (the code below shows how). The engine never imports this folder; change anything. The engine repository also has a demo page next to them,
9
+ which a pull does not copy: `main.js` and `picture/`, opened at `/modular-building.html` with `npm run dev` (`?set=gray|warm|cool`, `seed=1`, `count=10`,
10
+ `view=street|close`, `batch=0|merge`). Nothing in a game depends on it.
9
11
 
10
12
  ## The principle
11
13
  A town reads from far to near: skyline first, then the rhythm of openings, then trim, then small detail. A grid makes every piece fit every
@@ -53,9 +55,8 @@ vanish at that distance? Does anything flicker at seams when the camera moves?
53
55
  - **Merged hero block**: a fixed set piece merged once for the fewest draws, when it never changes.
54
56
 
55
57
  ## The engine helper (optional convenience)
56
- `kit.js` is the kit: modules, assembler, manifest entries; it imports only `three` and `three/addons`. `main.js` is the demo page and `picture/` its
57
- picture in plain three.js (lights, tone curve, one Lambert material per slot, every value in `picture/palette.js`). The page builds the same seed
58
- three ways (gray block-out, warm with soft cove trims, cool with hard stepped trims and faintly emissive frames; the two coloured
58
+ `kit.js` is the kit: modules, assembler, manifest entries; it imports only `three` and `three/addons`. The demo page in the engine repository (not in a pull)
59
+ has its picture in plain three.js (lights, tone curve, one Lambert material per slot) and builds the same seed three ways (gray block-out, warm with soft cove trims, cool with hard stepped trims and faintly emissive frames; the two coloured
59
60
  sets are demo values, not advice). In the kit, the block-out stage is `facade` strings of `.` (blank walls) and `roof`. A style is the slot
60
61
  materials (`wall`, `trim`, `roof`, `frame`, `glass`, `accent`, `awning`, `sign`) plus `profiles` plus `windows`. The only textures are gray
61
62
  masks (awning stripes, sign text) tinted by the slot material's colour, so a material swap recolours them too. `street` mirrors upper floors
@@ -119,7 +120,7 @@ Limits:
119
120
  - Footprints are rectangles of cells (`width` x `depth`); an L-shaped building needs `building` extended to take a cell list (two buildings
120
121
  with `gap: 0` meet wall to wall, and their corner pilasters then overlap).
121
122
  - Gable ridges run along the building's width; hip roofs, dormers and balconies are not in the kit (each is one more module).
122
- - The test is `npm test -- "modular building"` (tests/specs/modular-building.mjs): determinism per seed, grid snapping without gaps,
123
+ - The test is `threedog test "modular building"` (tests/specs/modular-building.mjs): determinism per seed, grid snapping without gaps,
123
124
  shared geometry, batching under 400 draw calls, params changing shape, the optional AO pass.
124
125
 
125
126
  Sources: written for this example; no code copied. Background: the grid-snapped kit of reusable pieces is common modular level design practice
@@ -5,6 +5,6 @@ import { LINE, OUTLINE } from './palette.js';
5
5
 
6
6
  /** @param {any} engine */
7
7
  export function createPost(engine) {
8
- engine.post.add(outline({ enabled: true, color: LINE, ...OUTLINE, offLayer: OUTLINE_OFF_LAYER }), { name: 'outline', slot: 'hdr' });
8
+ engine.post.add(outline({ color: LINE, ...OUTLINE, offLayer: OUTLINE_OFF_LAYER }), { name: 'outline', slot: 'hdr' });
9
9
  return { offLayer: OUTLINE_OFF_LAYER };
10
10
  }
@@ -69,7 +69,7 @@ Rules (correctness):
69
69
  - **Leave the character root alone.** The engine owns `ch.root` position and facing; the animator moves only parts under it.
70
70
  - The engine's own rig code still bobs `rig.body` before `onPose` runs; writing `body.position.y` and `rotation.x` in `onPose` replaces that.
71
71
 
72
- Verify: `npm test -- "procedural animation"` (tests/specs/procedural-animation.mjs): legs swing while moving and cycle faster at a higher
72
+ Verify: `threedog test "procedural animation"` (tests/specs/procedural-animation.mjs): legs swing while moving and cycle faster at a higher
73
73
  speed, they return to rest at idle, the body returns to its rest height, the character does not creep, and the `states` hook's `sit` reaches the pose.
74
74
 
75
75
  Sources: written for this example; no code copied. Background: distance-driven gait cycles, springs for secondary motion and squash and
@@ -28,6 +28,7 @@ Not used yet (check these before writing the system yourself):
28
28
  - saves: save your own state: `engine.saves.register(key, { version, save, load })` (node_modules/threedog/docs/recipes/20-content-actions-save.md)
29
29
  - interactions: press a key near a thing: `interactions({ ...presets.interactions.nearest })` (E, nearest; the game picks the pick mode and keys), template `interact: { label, op }` (node_modules/threedog/docs/recipes/30-templates.md)
30
30
  - quests: goals with steps, conditions and rewards: `quests()` + key map presets.bindings.quests, content/quests.js (node_modules/threedog/docs/recipes/04-quests.md)
31
+ - swarm: many same-kind moving things (shots, crowds, flocks, debris) in typed arrays, drawn as one mesh: `swarm()` (node_modules/threedog/docs/recipes/65-swarm.md)
31
32
  - grids: cell placement for farming and building: `grids()` (node_modules/threedog/docs/recipes/29-grid.md)
32
33
  - templates: reusable objects placed from content: content/templates.js + props { template } (node_modules/threedog/docs/recipes/30-templates.md)
33
34
 
@@ -1 +1 @@
1
- {"version":1,"files":{"content/actions.js":{"kind":"actions","mtime":1793829782000,"from":0,"count":4,"indexIds":0,"positional":[]},"content/audio.js":{"kind":"audio","mtime":1793829782000,"from":0,"count":3,"indexIds":0,"positional":[]},"content/bodies.js":{"kind":"bodies","mtime":1793829782000,"from":0,"count":8,"indexIds":0,"positional":[]},"content/containers.js":{"kind":"containers","mtime":1793829782000,"from":0,"count":1,"indexIds":0,"positional":[]},"content/dialogues.js":{"kind":"dialogues","mtime":1793829782000,"from":0,"count":1,"indexIds":0,"positional":[]},"content/items.js":{"kind":"items","mtime":1793829782000,"from":0,"count":4,"indexIds":0,"positional":[]},"content/npcs.js":{"kind":"npcs","mtime":1793829782000,"from":0,"count":1,"indexIds":0,"positional":[]},"content/pickups.js":{"kind":"pickups","mtime":1793829782000,"from":0,"count":8,"indexIds":8,"positional":[0,1,2,3,4,5,6,7]},"content/places.js":{"kind":"places","mtime":1793829782000,"from":0,"count":3,"indexIds":0,"positional":[]},"content/props.js":{"kind":"props","mtime":1793829782000,"from":0,"count":8,"indexIds":0,"positional":[]},"content/quests.js":{"kind":"quests","mtime":1793829782000,"from":0,"count":1,"indexIds":0,"positional":[]},"content/templates.js":{"kind":"templates","mtime":1793829782000,"from":0,"count":1,"indexIds":0,"positional":[]},"content/vegetation.js":{"kind":"vegetation","mtime":1793829782000,"from":0,"count":5,"indexIds":0,"positional":[]}},"ids":{"save":[{"file":"content/actions.js","kind":"actions","line":4,"placed":false}],"load":[{"file":"content/actions.js","kind":"actions","line":5,"placed":false}],"kick":[{"file":"content/actions.js","kind":"actions","line":6,"placed":false}],"chop":[{"file":"content/actions.js","kind":"actions","line":7,"placed":false}],"sounds":[{"file":"content/audio.js","kind":"audio","line":7,"placed":false}],"ambience":[{"file":"content/audio.js","kind":"audio","line":14,"placed":false}],"footsteps":[{"file":"content/audio.js","kind":"audio","line":23,"placed":false}],"crate-0":[{"file":"content/bodies.js","kind":"bodies","line":4,"placed":false}],"crate-1":[{"file":"content/bodies.js","kind":"bodies","line":5,"placed":false}],"crate-2":[{"file":"content/bodies.js","kind":"bodies","line":6,"placed":false}],"crate-3":[{"file":"content/bodies.js","kind":"bodies","line":7,"placed":false}],"crate-4":[{"file":"content/bodies.js","kind":"bodies","line":8,"placed":false}],"crate-5":[{"file":"content/bodies.js","kind":"bodies","line":9,"placed":false}],"ball":[{"file":"content/bodies.js","kind":"bodies","line":10,"placed":false}],"barrel":[{"file":"content/bodies.js","kind":"bodies","line":11,"placed":false}],"fisher-basket":[{"file":"content/containers.js","kind":"containers","line":3,"placed":false}],"fisher":[{"file":"content/dialogues.js","kind":"dialogues","line":4,"placed":false},{"file":"content/npcs.js","kind":"npcs","line":3,"placed":false}],"film":[{"file":"content/items.js","kind":"items","line":3,"placed":false}],"berry":[{"file":"content/items.js","kind":"items","line":4,"placed":false}],"feather":[{"file":"content/items.js","kind":"items","line":5,"placed":false}],"wood":[{"file":"content/items.js","kind":"items","line":6,"placed":false}],"pickup:feather:0":[{"file":"content/pickups.js","kind":"pickups","line":3,"placed":true}],"pickup:berry:1":[{"file":"content/pickups.js","kind":"pickups","line":4,"placed":true}],"pickup:berry:2":[{"file":"content/pickups.js","kind":"pickups","line":5,"placed":true}],"pickup:feather:3":[{"file":"content/pickups.js","kind":"pickups","line":6,"placed":true}],"pickup:berry:4":[{"file":"content/pickups.js","kind":"pickups","line":7,"placed":true}],"pickup:berry:5":[{"file":"content/pickups.js","kind":"pickups","line":8,"placed":true}],"pickup:feather:6":[{"file":"content/pickups.js","kind":"pickups","line":9,"placed":true}],"pickup:berry:7":[{"file":"content/pickups.js","kind":"pickups","line":10,"placed":true}],"home":[{"file":"content/places.js","kind":"places","line":3,"placed":false}],"river":[{"file":"content/places.js","kind":"places","line":4,"placed":false}],"water":[{"file":"content/places.js","kind":"places","line":5,"placed":false}],"prop:pine:0":[{"file":"content/props.js","kind":"props","line":4,"placed":true}],"prop:pine:1":[{"file":"content/props.js","kind":"props","line":5,"placed":true}],"prop:roundTree:2":[{"file":"content/props.js","kind":"props","line":6,"placed":true}],"prop:rock:3":[{"file":"content/props.js","kind":"props","line":7,"placed":true}],"prop:rock:4":[{"file":"content/props.js","kind":"props","line":8,"placed":true}],"prop:flower:5":[{"file":"content/props.js","kind":"props","line":9,"placed":true}],"prop:flower:6":[{"file":"content/props.js","kind":"props","line":10,"placed":true}],"cabin":[{"file":"content/props.js","kind":"props","line":11,"placed":true},{"file":"content/templates.js","kind":"templates","line":4,"placed":false}],"first-light":[{"file":"content/quests.js","kind":"quests","line":4,"placed":false}],"松树":[{"file":"content/vegetation.js","kind":"vegetation","line":5,"placed":false}],"圆树":[{"file":"content/vegetation.js","kind":"vegetation","line":11,"placed":false}],"石头":[{"file":"content/vegetation.js","kind":"vegetation","line":17,"placed":false}],"草":[{"file":"content/vegetation.js","kind":"vegetation","line":21,"placed":false}],"野花":[{"file":"content/vegetation.js","kind":"vegetation","line":26,"placed":false}]}}
1
+ {"version":1,"files":{"content/actions.js":{"kind":"actions","mtime":1793906610000,"from":0,"count":4,"indexIds":0,"positional":[]},"content/audio.js":{"kind":"audio","mtime":1793906610000,"from":0,"count":3,"indexIds":0,"positional":[]},"content/bodies.js":{"kind":"bodies","mtime":1793906610000,"from":0,"count":8,"indexIds":0,"positional":[]},"content/containers.js":{"kind":"containers","mtime":1793906610000,"from":0,"count":1,"indexIds":0,"positional":[]},"content/dialogues.js":{"kind":"dialogues","mtime":1793906610000,"from":0,"count":1,"indexIds":0,"positional":[]},"content/items.js":{"kind":"items","mtime":1793906610000,"from":0,"count":4,"indexIds":0,"positional":[]},"content/npcs.js":{"kind":"npcs","mtime":1793906610000,"from":0,"count":1,"indexIds":0,"positional":[]},"content/pickups.js":{"kind":"pickups","mtime":1793906610000,"from":0,"count":8,"indexIds":8,"positional":[0,1,2,3,4,5,6,7]},"content/places.js":{"kind":"places","mtime":1793906610000,"from":0,"count":3,"indexIds":0,"positional":[]},"content/props.js":{"kind":"props","mtime":1793906610000,"from":0,"count":8,"indexIds":0,"positional":[]},"content/quests.js":{"kind":"quests","mtime":1793906610000,"from":0,"count":1,"indexIds":0,"positional":[]},"content/templates.js":{"kind":"templates","mtime":1793906610000,"from":0,"count":1,"indexIds":0,"positional":[]},"content/vegetation.js":{"kind":"vegetation","mtime":1793906610000,"from":0,"count":5,"indexIds":0,"positional":[]}},"ids":{"save":[{"file":"content/actions.js","kind":"actions","line":4,"placed":false}],"load":[{"file":"content/actions.js","kind":"actions","line":5,"placed":false}],"kick":[{"file":"content/actions.js","kind":"actions","line":6,"placed":false}],"chop":[{"file":"content/actions.js","kind":"actions","line":7,"placed":false}],"sounds":[{"file":"content/audio.js","kind":"audio","line":7,"placed":false}],"ambience":[{"file":"content/audio.js","kind":"audio","line":14,"placed":false}],"footsteps":[{"file":"content/audio.js","kind":"audio","line":23,"placed":false}],"crate-0":[{"file":"content/bodies.js","kind":"bodies","line":4,"placed":false}],"crate-1":[{"file":"content/bodies.js","kind":"bodies","line":5,"placed":false}],"crate-2":[{"file":"content/bodies.js","kind":"bodies","line":6,"placed":false}],"crate-3":[{"file":"content/bodies.js","kind":"bodies","line":7,"placed":false}],"crate-4":[{"file":"content/bodies.js","kind":"bodies","line":8,"placed":false}],"crate-5":[{"file":"content/bodies.js","kind":"bodies","line":9,"placed":false}],"ball":[{"file":"content/bodies.js","kind":"bodies","line":10,"placed":false}],"barrel":[{"file":"content/bodies.js","kind":"bodies","line":11,"placed":false}],"fisher-basket":[{"file":"content/containers.js","kind":"containers","line":3,"placed":false}],"fisher":[{"file":"content/dialogues.js","kind":"dialogues","line":4,"placed":false},{"file":"content/npcs.js","kind":"npcs","line":3,"placed":false}],"film":[{"file":"content/items.js","kind":"items","line":3,"placed":false}],"berry":[{"file":"content/items.js","kind":"items","line":4,"placed":false}],"feather":[{"file":"content/items.js","kind":"items","line":5,"placed":false}],"wood":[{"file":"content/items.js","kind":"items","line":6,"placed":false}],"pickup:feather:0":[{"file":"content/pickups.js","kind":"pickups","line":3,"placed":true}],"pickup:berry:1":[{"file":"content/pickups.js","kind":"pickups","line":4,"placed":true}],"pickup:berry:2":[{"file":"content/pickups.js","kind":"pickups","line":5,"placed":true}],"pickup:feather:3":[{"file":"content/pickups.js","kind":"pickups","line":6,"placed":true}],"pickup:berry:4":[{"file":"content/pickups.js","kind":"pickups","line":7,"placed":true}],"pickup:berry:5":[{"file":"content/pickups.js","kind":"pickups","line":8,"placed":true}],"pickup:feather:6":[{"file":"content/pickups.js","kind":"pickups","line":9,"placed":true}],"pickup:berry:7":[{"file":"content/pickups.js","kind":"pickups","line":10,"placed":true}],"home":[{"file":"content/places.js","kind":"places","line":3,"placed":false}],"river":[{"file":"content/places.js","kind":"places","line":4,"placed":false}],"water":[{"file":"content/places.js","kind":"places","line":5,"placed":false}],"prop:pine:0":[{"file":"content/props.js","kind":"props","line":4,"placed":true}],"prop:pine:1":[{"file":"content/props.js","kind":"props","line":5,"placed":true}],"prop:roundTree:2":[{"file":"content/props.js","kind":"props","line":6,"placed":true}],"prop:rock:3":[{"file":"content/props.js","kind":"props","line":7,"placed":true}],"prop:rock:4":[{"file":"content/props.js","kind":"props","line":8,"placed":true}],"prop:flower:5":[{"file":"content/props.js","kind":"props","line":9,"placed":true}],"prop:flower:6":[{"file":"content/props.js","kind":"props","line":10,"placed":true}],"cabin":[{"file":"content/props.js","kind":"props","line":11,"placed":true},{"file":"content/templates.js","kind":"templates","line":4,"placed":false}],"first-light":[{"file":"content/quests.js","kind":"quests","line":4,"placed":false}],"松树":[{"file":"content/vegetation.js","kind":"vegetation","line":5,"placed":false}],"圆树":[{"file":"content/vegetation.js","kind":"vegetation","line":11,"placed":false}],"石头":[{"file":"content/vegetation.js","kind":"vegetation","line":17,"placed":false}],"草":[{"file":"content/vegetation.js","kind":"vegetation","line":21,"placed":false}],"野花":[{"file":"content/vegetation.js","kind":"vegetation","line":26,"placed":false}]}}
@@ -30,8 +30,8 @@ Content: actions 4 · audio 3 · containers 1 · dialogues 1 · items 4 · npcs
30
30
  ## Read for this game (per installed module: recipe · api page; core API: `node_modules/threedog/docs/api/engine.md`)
31
31
 
32
32
  - world: `node_modules/threedog/docs/recipes/18-world.md` · `node_modules/threedog/docs/api/world.md`
33
- - terrain: `node_modules/threedog/docs/recipes/36-sky-ground-plants.md` · `node_modules/threedog/docs/api/terrain.md`
34
- - vegetation: `node_modules/threedog/docs/recipes/36-sky-ground-plants.md` · `node_modules/threedog/docs/api/vegetation.md`
33
+ - terrain: `node_modules/threedog/docs/recipes/28-terrain.md` · `node_modules/threedog/docs/api/terrain.md`
34
+ - vegetation: `node_modules/threedog/docs/recipes/36-ground-plants.md` · `node_modules/threedog/docs/api/vegetation.md`
35
35
  - calendar: `node_modules/threedog/docs/recipes/06-clock-events.md` · `node_modules/threedog/docs/api/calendar.md`
36
36
  - sky: `node_modules/threedog/docs/recipes/08-weather-sky.md` · `node_modules/threedog/docs/api/sky.md`
37
37
  - weather: `node_modules/threedog/docs/recipes/44-water-weather-hooks.md` · `node_modules/threedog/docs/api/weather.md`
@@ -43,6 +43,7 @@ Content: actions 4 · audio 3 · containers 1 · dialogues 1 · items 4 · npcs
43
43
 
44
44
  Not used yet (check these before writing the system yourself):
45
45
 
46
+ - swarm: many same-kind moving things (shots, crowds, flocks, debris) in typed arrays, drawn as one mesh: `swarm()` (node_modules/threedog/docs/recipes/65-swarm.md)
46
47
  - grids: cell placement for farming and building: `grids()` (node_modules/threedog/docs/recipes/29-grid.md)
47
48
 
48
49
  ## Files
@@ -119,7 +120,7 @@ Starting inventory: film×12. Pickups: 8: feather×3, berry×5 (respawn after 12
119
120
  - Place river: nearest riverside to the cabin (found at startup; the old fisherman goes here in the morning)
120
121
  - Place water: the water just past that riverside (found at startup; the barrel floats here)
121
122
 
122
- ## Conditions/effects the game adds (content/rules.js)
123
+ ## Conditions the game adds (content/rules.js)
123
124
 
124
125
  - Condition **timeAfter** (clock): the day has passed this clock time
125
126
 
@@ -9,7 +9,7 @@ import { AMBIENT_PEAK, CLOUDS, FOG_NEAR, OVERCAST, sampleSky, skyNow } from './p
9
9
  export function createSky(engine) {
10
10
  const { scene, uniforms: E } = engine, U = engine.sky.uniforms, weather = engine.weather;
11
11
  const fog = scene.fog = new THREE.Fog(0x000000, 70, 240);
12
- U.uCloudCover.value = CLOUDS.coverage; U.uCloudScale.value = CLOUDS.scale; U.uCloudSpeed.value.set(...CLOUDS.speed);
12
+ U.uCloudCover.value = CLOUDS.coverage; U.uSkyCloudScale.value = CLOUDS.scale; U.uSkyCloudSpeed.value.set(...CLOUDS.speed);
13
13
  U.uCloudColor.value.set(CLOUDS.color); U.uCloudShade.value.set(CLOUDS.shade);
14
14
  E.uCloudShadow.value = CLOUDS.groundShadow;
15
15
 
package/index.d.ts CHANGED
@@ -46,7 +46,7 @@ import type { ambience } from './types/generated/modules/ambience/Ambience';
46
46
  import type { debug } from './types/generated/modules/debug/DebugPanel';
47
47
 
48
48
  // Types are exported too, so game code can write JSDoc: /** @type {import('threedog').DialogueScript} */
49
- export * from './types/common';
49
+ export type { ColorLike, Vec3Like, PositionLike, XZ, DirXZ, Range, EaseName, Ease, Loose, Handle } from './types/common'; // a list, not *: three.js's own types come from 'three'
50
50
  export * from './types/core';
51
51
  export * from './types/world';
52
52
  export * from './types/physics';
@@ -60,7 +60,7 @@ export * from './types/nav';
60
60
  /** three.js itself (the same instance the engine uses; typed by @types/three) */
61
61
  export * as THREE from 'three';
62
62
 
63
- /** Create an engine (core only). canvas is required; style is the game's style (see recipes/09-materials-lights-models.md) */
63
+ /** Create an engine (core only). canvas is required */
64
64
  export function createEngine(opts: EngineOptions): Engine;
65
65
  /** The picture slots: what each one is and which describe('picture').picture.writers names it covers (a name ending in '.' covers everything under it) */
66
66
  export const PICTURE_SLOTS: Readonly<Record<PictureSlot, { readonly what: string; readonly values: readonly string[] }>>;
@@ -82,7 +82,7 @@ export interface OpenWorldOptions {
82
82
  flatten?: FlattenZone[];
83
83
  /** Start time 0-1 */
84
84
  time?: number;
85
- /** Game seconds per day (default 360) */
85
+ /** Calendar seconds per day (default 360) */
86
86
  dayLength?: number;
87
87
  /** Starting weather name, false (no weather module) or weather() options */
88
88
  weather?: WeatherName | (string & {}) | Part<typeof weather>;
@@ -186,6 +186,8 @@ export function level(opts?: LevelOptions): ModuleDef<Level>;
186
186
  export function triggers(opts?: TriggersOptions): ModuleDef<Triggers>;
187
187
  // Migrated: particles() is generated from the JSDoc in modules/particles/Particles.js
188
188
  export { particles } from './types/generated/modules/particles/Particles';
189
+ // swarm() and the Swarm class are generated from the JSDoc in modules/swarm/Swarm.js
190
+ export { swarm } from './types/generated/modules/swarm/Swarm';
189
191
  /** Settings menu -> engine.settings */
190
192
  export function settings(opts?: SettingsOptions): ModuleDef<Settings>;
191
193
  // Migrated: music() is generated from the JSDoc in modules/music/Music.js
@@ -209,8 +211,6 @@ export { hud } from './types/generated/modules/hud/index';
209
211
 
210
212
  /** Screen coordinates (-1..1) -> point on the ground; null if the ray misses the ground */
211
213
  export function screenToGround(engine: Engine, ndcX: number, ndcY: number, opts?: { maxDistance?: number }): Vector3 | null;
212
- /** All easing functions: name -> function */
213
- export const EASINGS: Record<EaseName, (t: number) => number>;
214
214
  /**
215
215
  * A grid of numbers (height, moisture, density, walkable...) as a function (x, z) -> value. data[j * width + i] sits at origin + (i, j) * cell.
216
216
  * interp 'nearest' = flat steps, 'linear' (default) = bilinear, 'cubic' = smooth (clamp: true avoids overshoot). Outside: edge value, or `outside`.
@@ -223,6 +223,7 @@ export function ease(e: Ease): (t: number) => number;
223
223
  * Warn once about unknown keys in extensible data (your item / record definitions where players or mods add their own fields), with a
224
224
  * "did you mean" hint. Options bags go through readParams instead (an unknown key throws in dev). loose only warns on near-misses.
225
225
  * @example checkOptions('crops.define()', def, ['grow', 'yield', 'season'], { loose: true });
226
+ * @experimental
226
227
  */
227
228
  export function checkOptions(where: string, opts: object | null | undefined, known: string[], flags?: { loose?: boolean }): void;
228
229
  /**
@@ -272,10 +273,10 @@ export type { UIPart, UIPartFactory, UIPartValue, UIPartDef, UIParts, UITitleIte
272
273
  export function parseClock(clock: string | number, hoursPerDay?: number): number;
273
274
  /** Fraction of the day -> 'HH:MM': formatClock(0.75) = '18:00' */
274
275
  export function formatClock(t: number, hoursPerDay?: number): string;
275
- /** Is time t (0-1, e.g. calendar.timeOfDay) inside the range [from, to)? from and to are 'HH:MM' or 0-1; from > to wraps past midnight. Used by calendar.between and the audio rule condition { time: [from, to] } */
276
+ /** Is time t (0-1, e.g. calendar.timeOfDay) inside the range [from, to)? from and to are 'HH:MM' or 0-1; from > to wraps past midnight. Used by calendar.between and the audio rule condition { time: [from, to] } @experimental */
276
277
  export function inRange(t: number, from: string | number, to: string | number, hoursPerDay?: number): boolean;
277
278
 
278
- // ---------- Target selection (core/targeting.js, pure functions) ----------
279
+ // ---------- Target selection (core/scene/targeting.js, pure functions) ----------
279
280
  /**
280
281
  * Options of pickTarget / switchTarget: radius meters (15); cone half-angle in radians (1.4); close meters inside which angle is ignored (2.5);
281
282
  * angleWeight meters per radian off the view (6); blocked(c) true skips c (occlusion); at(c) reads a candidate's position (default c.position ?? c)