threedog 0.5.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.
- package/CHANGELOG.md +276 -1
- package/README.md +18 -13
- package/core/{Animator.js → assets/Animator.js} +28 -18
- package/core/{Assets.js → assets/Assets.js} +116 -61
- package/core/{Baked.js → assets/Baked.js} +16 -25
- package/core/assets/assetEntry.js +237 -0
- package/core/{assetHot.js → assets/assetHot.js} +7 -6
- package/core/{assetLoad.js → assets/assetLoad.js} +66 -29
- package/core/assets/assetLod.js +113 -0
- package/core/{assetManifest.js → assets/assetManifest.js} +23 -12
- package/core/{assetReport.js → assets/assetReport.js} +9 -15
- package/core/{namedModel.js → assets/namedModel.js} +24 -16
- package/core/{Audio.js → audio/Audio.js} +27 -24
- package/core/{audioRules.js → audio/audioRules.js} +8 -5
- package/core/{audioVoice.js → audio/audioVoice.js} +17 -30
- package/core/{Events.js → base/Events.js} +3 -3
- package/core/{I18n.js → base/I18n.js} +10 -10
- package/core/{Random.js → base/Random.js} +5 -4
- package/core/{easing.js → base/easing.js} +1 -1
- package/core/{errorCodes.js → base/errorCodes.js} +154 -139
- package/core/{errorHints.js → base/errorHints.js} +9 -10
- package/core/{errors.js → base/errors.js} +9 -9
- package/core/{events.generated.js → base/events.generated.js} +2 -0
- package/core/{math.js → base/math.js} +22 -4
- package/core/{params.js → base/params.js} +3 -4
- package/core/base/util.js +32 -0
- package/core/{validate.js → base/validate.js} +29 -8
- package/core/{Engine.js → engine/Engine.js} +112 -105
- package/core/{Loading.js → engine/Loading.js} +4 -2
- package/core/{copies.js → engine/copies.js} +4 -4
- package/core/{headlessLoad.js → engine/headlessLoad.js} +4 -4
- package/core/{lifecycle.js → engine/lifecycle.js} +16 -16
- package/core/{loop.js → engine/loop.js} +80 -52
- package/core/{moduleSlots.js → engine/moduleSlots.js} +35 -10
- package/core/{moduleTypes.js → engine/moduleTypes.js} +30 -18
- package/core/{modules.js → engine/modules.js} +20 -17
- package/core/engine/page.js +125 -0
- package/core/{plugins.js → engine/plugins.js} +68 -103
- package/core/{services.js → engine/services.js} +47 -40
- package/core/{startup.js → engine/startup.js} +35 -35
- package/core/{Input.js → input/Input.js} +41 -27
- package/core/{inputContext.js → input/inputContext.js} +14 -5
- package/core/{inputPad.js → input/inputPad.js} +1 -1
- package/core/{inputPointer.js → input/inputPointer.js} +8 -2
- package/core/{inputTouch.js → input/inputTouch.js} +1 -1
- package/core/{Budget.js → inspect/Budget.js} +23 -22
- package/core/{DebugOverrides.js → inspect/DebugOverrides.js} +60 -31
- package/core/{Describe.js → inspect/Describe.js} +33 -30
- package/core/{Inspect.js → inspect/Inspect.js} +14 -9
- package/core/{InspectMaterials.js → inspect/InspectMaterials.js} +8 -10
- package/core/{InspectPerf.js → inspect/InspectPerf.js} +29 -16
- package/core/{InspectScene.js → inspect/InspectScene.js} +8 -5
- package/core/{MaterialInfo.js → inspect/MaterialInfo.js} +9 -6
- package/core/inspect/UrlState.js +182 -0
- package/core/{catalog.js → inspect/catalog.js} +18 -5
- package/core/{checks.js → inspect/checks.js} +7 -5
- package/core/{debugView.js → inspect/debugView.js} +8 -8
- package/core/inspect/describeRender.js +148 -0
- package/core/{describeText.js → inspect/describeText.js} +17 -12
- package/core/inspect/geometryWatch.js +38 -0
- package/core/{lightWatch.js → inspect/lightWatch.js} +11 -9
- package/core/inspect/pictureWriters.js +342 -0
- package/core/{shaderCost.js → inspect/shaderCost.js} +1 -1
- package/core/{Ops.js → ops/Ops.js} +16 -11
- package/core/{control.js → ops/control.js} +13 -12
- package/core/ops/holds.js +139 -0
- package/core/{opsAtomic.js → ops/opsAtomic.js} +2 -1
- package/core/{opsCheck.js → ops/opsCheck.js} +4 -5
- package/core/{opsGuard.js → ops/opsGuard.js} +3 -3
- package/core/{opsRun.js → ops/opsRun.js} +7 -4
- package/core/{owned.js → ops/owned.js} +37 -37
- package/core/{sharedPoint.js → ops/sharedPoint.js} +13 -27
- package/core/{stackFrames.js → ops/stackFrames.js} +17 -6
- package/core/{stacks.js → ops/stacks.js} +18 -20
- package/core/{wrap.js → ops/wrap.js} +8 -6
- package/core/{SaveStore.js → saves/SaveStore.js} +1 -1
- package/core/{Saves.js → saves/Saves.js} +58 -36
- package/core/{saveApply.js → saves/saveApply.js} +13 -9
- package/core/{saveFiles.js → saves/saveFiles.js} +17 -15
- package/core/{saveValues.js → saves/saveValues.js} +20 -3
- package/core/{saveVersions.js → saves/saveVersions.js} +4 -17
- package/core/{session.js → saves/session.js} +31 -17
- package/core/{Rays.js → scene/Rays.js} +27 -24
- package/core/{Views.js → scene/Views.js} +15 -6
- package/core/{adaptive.js → scene/adaptive.js} +15 -8
- package/core/{canvasBox.js → scene/canvasBox.js} +2 -3
- package/core/{engineCamera.js → scene/engineCamera.js} +1 -1
- package/core/{gameLights.js → scene/gameLights.js} +24 -7
- package/core/{grayMap.js → scene/grayMap.js} +8 -2
- package/core/{grid.js → scene/grid.js} +4 -4
- package/core/{gridLoad.js → scene/gridLoad.js} +1 -1
- package/core/{ground.js → scene/ground.js} +9 -9
- package/core/{movement.js → scene/movement.js} +3 -3
- package/core/scene/pictureSlots.js +33 -0
- package/core/{sceneDelta.js → scene/sceneDelta.js} +14 -6
- package/core/{sceneMethods.js → scene/sceneMethods.js} +36 -20
- package/core/scene/stepPoses.js +55 -0
- package/core/{targeting.js → scene/targeting.js} +4 -5
- package/core/{thingExplain.js → scene/thingExplain.js} +7 -6
- package/core/{thingOps.js → scene/thingOps.js} +4 -3
- package/core/{things.js → scene/things.js} +19 -6
- package/core/{threePatches.js → scene/threePatches.js} +1 -1
- package/core/{tier.js → scene/tier.js} +1 -1
- package/core/scene/view.js +44 -0
- package/core/{Batching.js → stream/Batching.js} +85 -27
- package/core/{Stream.js → stream/Stream.js} +62 -33
- package/core/{batchGroups.js → stream/batchGroups.js} +18 -9
- package/core/{chunkStream.js → stream/chunkStream.js} +41 -1
- package/core/{scatter.js → stream/scatter.js} +2 -2
- package/core/{streamSources.js → stream/streamSources.js} +12 -7
- package/core/{Commits.js → threads/Commits.js} +6 -5
- package/core/{Jobs.js → threads/Jobs.js} +12 -10
- package/core/{Threads.js → threads/Threads.js} +16 -16
- package/core/{threadPure.js → threads/threadPure.js} +7 -5
- package/core/{threadServe.js → threads/threadServe.js} +3 -3
- package/core/{Clock.js → time/Clock.js} +17 -10
- package/core/{dayTime.js → time/dayTime.js} +5 -1
- package/core/{skip.js → time/skip.js} +18 -17
- package/core/{time.js → time/time.js} +18 -12
- package/core/{uiClock.js → time/uiClock.js} +4 -4
- package/docs/AI.md +70 -63
- package/docs/API.md +30 -29
- package/docs/CODEMAP.md +98 -223
- package/docs/COMMANDS.md +80 -69
- package/docs/CONVENTIONS.md +87 -41
- package/docs/MIGRATING-0.7.md +39 -0
- package/docs/MIGRATING-0.8.md +169 -0
- package/docs/THREE.md +100 -49
- package/docs/api/assets.md +17 -16
- package/docs/api/audio.md +8 -7
- package/docs/api/budget.md +8 -4
- package/docs/api/calendar.md +10 -11
- package/docs/api/cameraRig.md +29 -29
- package/docs/api/characters.md +26 -19
- package/docs/api/clock.md +1 -1
- package/docs/api/collision.md +14 -11
- package/docs/api/content.md +6 -6
- package/docs/api/dialogue.md +3 -3
- package/docs/api/engine.md +82 -53
- package/docs/api/events.md +5 -3
- package/docs/api/flow.md +1 -1
- package/docs/api/grids.md +9 -2
- package/docs/api/ground.md +4 -5
- package/docs/api/hud.md +4 -1
- package/docs/api/i18n.md +6 -6
- package/docs/api/input.md +10 -9
- package/docs/api/interactions.md +6 -4
- package/docs/api/inventory.md +10 -11
- package/docs/api/jobs.md +5 -5
- package/docs/api/level.md +7 -8
- package/docs/api/lightPool.md +2 -7
- package/docs/api/music.md +3 -3
- package/docs/api/nav.md +10 -10
- package/docs/api/occlusion.md +5 -0
- package/docs/api/openWorld.md +1 -1
- package/docs/api/particles.md +8 -5
- package/docs/api/photo.md +4 -2
- package/docs/api/pickups.md +7 -1
- package/docs/api/post.md +24 -5
- package/docs/api/quests.md +3 -3
- package/docs/api/rays.md +5 -7
- package/docs/api/rigid.md +27 -18
- package/docs/api/saves.md +8 -7
- package/docs/api/settings.md +9 -8
- package/docs/api/sky.md +17 -14
- package/docs/api/stream.md +7 -7
- package/docs/api/swarm.md +34 -0
- package/docs/api/terrain.md +17 -12
- package/docs/api/terrainDraw.md +12 -0
- package/docs/api/timeline.md +2 -2
- package/docs/api/tools.md +30 -26
- package/docs/api/triggers.md +2 -0
- package/docs/api/vars.md +1 -1
- package/docs/api/vegetation.md +11 -5
- package/docs/api/vegetationDraw.md +10 -0
- package/docs/api/water.md +7 -3
- package/docs/api/weather.md +11 -6
- package/docs/api/weatherDraw.md +10 -0
- package/docs/api/world.md +6 -6
- package/docs/recipes/01-new-game.md +38 -57
- package/docs/recipes/02-npc.md +19 -20
- package/docs/recipes/03-items-pickups.md +47 -42
- package/docs/recipes/04-quests.md +3 -4
- package/docs/recipes/05-props-bake.md +72 -66
- package/docs/recipes/06-clock-events.md +30 -21
- package/docs/recipes/07-flow-scenes-pause.md +21 -17
- package/docs/recipes/08-weather-sky.md +117 -75
- package/docs/recipes/09-materials-lights-models.md +171 -0
- package/docs/recipes/10-blender-level.md +6 -7
- package/docs/recipes/11-vehicles.md +33 -25
- package/docs/recipes/12-navmesh.md +9 -8
- package/docs/recipes/13-animation.md +50 -22
- package/docs/recipes/14-custom-module.md +20 -17
- package/docs/recipes/15-perf.md +52 -29
- package/docs/recipes/16-dev-bridge.md +47 -57
- package/docs/recipes/18-world.md +45 -30
- package/docs/recipes/19-shooting-picking.md +11 -7
- package/docs/recipes/20-content-actions-save.md +36 -37
- package/docs/recipes/21-camera.md +41 -8
- package/docs/recipes/22-shop-gold.md +0 -4
- package/docs/recipes/23-ops.md +11 -11
- package/docs/recipes/26-ui-parts.md +56 -22
- package/docs/recipes/27-net.md +0 -2
- package/docs/recipes/28-terrain.md +126 -30
- package/docs/recipes/29-grid.md +16 -7
- package/docs/recipes/30-templates.md +62 -21
- package/docs/recipes/31-audio.md +9 -9
- package/docs/recipes/32-action-game.md +32 -9
- package/docs/recipes/33-stream-sources.md +2 -2
- package/docs/recipes/34-environment-lighting.md +164 -52
- package/docs/recipes/35-picture-from-reference.md +140 -0
- package/docs/recipes/36-ground-plants.md +105 -0
- package/docs/recipes/40-scene.md +105 -30
- package/docs/recipes/{43-shader-patches-surface-looks.md → 43-shader-patches-surfaces.md} +74 -106
- package/docs/recipes/44-water-weather-hooks.md +196 -0
- package/docs/recipes/45-cascaded-shadows.md +145 -25
- package/docs/recipes/46-blender-art-route.md +21 -25
- package/docs/recipes/49-game-module-contract.md +5 -5
- package/docs/recipes/50-own-renderer.md +3 -3
- package/docs/recipes/52-around-the-picture.md +137 -0
- package/docs/recipes/53-ground-up-close.md +65 -28
- package/docs/recipes/55-mods-time-wrap.md +25 -17
- package/docs/recipes/56-webgpu-tsl.md +73 -28
- package/docs/recipes/57-control.md +47 -1
- package/docs/recipes/58-input.md +3 -0
- package/docs/recipes/59-depth-post-effects.md +5 -5
- package/docs/recipes/60-judge-the-picture.md +47 -27
- package/docs/recipes/61-deploy.md +27 -0
- package/docs/recipes/62-picture-code.md +276 -0
- package/docs/recipes/63-third-person-start.md +90 -0
- package/docs/recipes/64-particles.md +35 -0
- package/docs/recipes/65-swarm.md +140 -0
- package/examples/action/.threedog/content-index.json +1 -1
- package/examples/action/GAMEMAP.md +9 -7
- package/examples/action/main.js +5 -4
- package/examples/action/models.js +12 -14
- package/examples/action/picture/index.js +13 -0
- package/examples/action/picture/lights.js +35 -0
- package/examples/action/picture/materials.js +8 -0
- package/examples/action/picture/palette.js +33 -0
- package/examples/perf-island/.threedog/content-index.json +1 -0
- package/examples/{sheepisland → perf-island}/GAMEMAP.md +18 -14
- package/examples/{sheepisland → perf-island}/assets.js +2 -2
- package/examples/{sheepisland → perf-island}/content/templates.js +1 -1
- package/examples/{sheepisland → perf-island}/content/vegetation.js +3 -1
- package/examples/{sheepisland → perf-island}/main.js +22 -16
- package/examples/{sheepisland/style → perf-island}/models.js +13 -24
- package/examples/{sheepisland → perf-island}/params.js +1 -1
- package/examples/perf-island/picture/index.js +20 -0
- package/examples/perf-island/picture/lights.js +34 -0
- package/examples/perf-island/picture/materials.js +61 -0
- package/examples/perf-island/picture/palette.js +60 -0
- package/examples/perf-island/picture/sky.js +20 -0
- package/examples/{sheepisland → perf-island}/views.js +1 -1
- package/examples/plain-picture/.threedog/content-index.json +1 -0
- package/examples/plain-picture/GAMEMAP.md +91 -0
- package/examples/plain-picture/main.js +48 -0
- package/examples/plain-picture/picture/index.js +21 -0
- package/examples/plain-picture/picture/lights.js +54 -0
- package/examples/plain-picture/picture/materials.js +24 -0
- package/examples/plain-picture/picture/palette.js +16 -0
- package/examples/plain-picture/picture/sky.js +37 -0
- package/examples/pullable.json +31 -9
- package/examples/rc2d/GAMEMAP.md +10 -4
- package/examples/rc2d/README.md +11 -6
- package/examples/rc2d/main.js +26 -36
- package/examples/rc2d/picture/index.js +18 -0
- package/examples/rc2d/picture/lights.js +11 -0
- package/examples/rc2d/picture/materials.js +18 -0
- package/examples/rc2d/picture/palette.js +15 -0
- package/examples/rc2d/picture/post.js +11 -0
- package/examples/rc2d/rc2d.js +18 -28
- package/examples/styletest/.threedog/content-index.json +1 -1
- package/examples/styletest/GAMEMAP.md +15 -10
- package/examples/styletest/main.js +20 -30
- package/examples/styletest/models.js +29 -29
- package/examples/styletest/params.js +1 -4
- package/examples/styletest/picture/env.js +38 -0
- package/examples/styletest/picture/index.js +16 -0
- package/examples/styletest/picture/lights.js +9 -0
- package/examples/styletest/picture/materials.js +28 -0
- package/examples/styletest/picture/palette.js +22 -0
- package/examples/techniques/contact-shadows/README.md +22 -23
- package/examples/techniques/contact-shadows/contactShadows.js +32 -16
- package/examples/techniques/contact-shadows/main.js +20 -18
- package/examples/techniques/contact-shadows/picture/index.js +14 -0
- package/examples/techniques/contact-shadows/picture/lights.js +34 -0
- package/examples/techniques/contact-shadows/picture/materials.js +12 -0
- package/examples/techniques/contact-shadows/picture/palette.js +17 -0
- package/examples/techniques/day-night-grade/README.md +13 -16
- package/examples/techniques/day-night-grade/main.js +15 -25
- package/examples/techniques/day-night-grade/picture/index.js +20 -0
- package/examples/techniques/day-night-grade/picture/lights.js +45 -0
- package/examples/techniques/day-night-grade/picture/materials.js +15 -0
- package/examples/techniques/day-night-grade/picture/palette.js +59 -0
- package/examples/techniques/day-night-grade/picture/post.js +25 -0
- package/examples/techniques/day-night-grade/picture/sky.js +33 -0
- package/examples/techniques/interior-light/README.md +16 -13
- package/examples/techniques/interior-light/interiorLight.js +19 -17
- package/examples/techniques/interior-light/main.js +31 -68
- package/examples/techniques/interior-light/picture/index.js +24 -0
- package/examples/techniques/interior-light/picture/lights.js +52 -0
- package/examples/techniques/interior-light/picture/materials.js +13 -0
- package/examples/techniques/interior-light/picture/palette.js +32 -0
- package/examples/techniques/interior-light/picture/sky.js +40 -0
- package/examples/techniques/modular-building/README.md +8 -6
- package/examples/techniques/modular-building/kit.js +2 -2
- package/examples/techniques/modular-building/main.js +9 -17
- package/examples/techniques/modular-building/picture/index.js +17 -0
- package/examples/techniques/modular-building/picture/lights.js +26 -0
- package/examples/techniques/modular-building/picture/materials.js +13 -0
- package/examples/techniques/modular-building/picture/palette.js +23 -0
- package/examples/techniques/night-lights/README.md +15 -14
- package/examples/techniques/night-lights/main.js +20 -43
- package/examples/techniques/night-lights/nightLights.js +25 -21
- package/examples/techniques/night-lights/picture/index.js +18 -0
- package/examples/techniques/night-lights/picture/lights.js +44 -0
- package/examples/techniques/night-lights/picture/materials.js +15 -0
- package/examples/techniques/night-lights/picture/palette.js +34 -0
- package/examples/techniques/night-lights/picture/post.js +9 -0
- package/examples/techniques/night-lights/picture/sky.js +36 -0
- package/examples/techniques/outlines-and-rim/README.md +2 -2
- package/examples/techniques/outlines-and-rim/main.js +15 -38
- package/examples/techniques/outlines-and-rim/outlines.js +3 -3
- package/examples/techniques/outlines-and-rim/picture/index.js +16 -0
- package/examples/techniques/outlines-and-rim/picture/lights.js +18 -0
- package/examples/techniques/outlines-and-rim/picture/materials.js +11 -0
- package/examples/techniques/outlines-and-rim/picture/palette.js +16 -0
- package/examples/techniques/outlines-and-rim/picture/post.js +10 -0
- package/examples/techniques/procedural-animation/README.md +6 -4
- package/examples/techniques/procedural-animation/main.js +9 -7
- package/examples/techniques/procedural-animation/picture/index.js +15 -0
- package/examples/techniques/procedural-animation/picture/lights.js +35 -0
- package/examples/techniques/procedural-animation/picture/materials.js +10 -0
- package/examples/techniques/procedural-animation/picture/palette.js +16 -0
- package/examples/techniques/procedural-animation/picture/sky.js +31 -0
- package/examples/techniques/procedural-animation/proceduralAnim.js +1 -1
- package/examples/techniques/procedural-surface/README.md +2 -0
- package/examples/techniques/procedural-surface/main.js +17 -55
- package/examples/techniques/procedural-surface/picture/index.js +14 -0
- package/examples/techniques/procedural-surface/picture/lights.js +18 -0
- package/examples/techniques/procedural-surface/picture/materials.js +34 -0
- package/examples/techniques/procedural-surface/picture/palette.js +15 -0
- package/examples/techniques/stylized-shading/README.md +13 -14
- package/examples/techniques/stylized-shading/main.js +11 -42
- package/examples/techniques/stylized-shading/picture/index.js +14 -0
- package/examples/techniques/stylized-shading/picture/lights.js +23 -0
- package/examples/techniques/stylized-shading/picture/materials.js +18 -0
- package/examples/techniques/stylized-shading/picture/palette.js +19 -0
- package/examples/techniques/stylized-shading/shading.js +2 -2
- package/examples/techniques/sun-and-key-light/README.md +20 -22
- package/examples/techniques/sun-and-key-light/keyLight.js +47 -29
- package/examples/techniques/sun-and-key-light/main.js +19 -63
- package/examples/techniques/sun-and-key-light/picture/index.js +13 -0
- package/examples/techniques/sun-and-key-light/picture/lights.js +33 -0
- package/examples/techniques/sun-and-key-light/picture/materials.js +9 -0
- package/examples/techniques/sun-and-key-light/picture/palette.js +29 -0
- package/examples/techniques/sun-and-key-light/picture/sky.js +16 -0
- package/examples/techniques/three-looks/README.md +21 -0
- package/examples/techniques/three-looks/main.js +58 -0
- package/examples/techniques/three-looks/picture/cartoon.js +23 -0
- package/examples/techniques/three-looks/picture/cinematic.js +27 -0
- package/examples/techniques/three-looks/picture/comic.js +27 -0
- package/examples/techniques/three-looks/picture/index.js +14 -0
- package/examples/techniques/three-looks/picture/sun.js +23 -0
- package/examples/techniques/wet-road/README.md +7 -4
- package/examples/techniques/wet-road/main.js +18 -38
- package/examples/techniques/wet-road/picture/index.js +17 -0
- package/examples/techniques/wet-road/picture/lights.js +57 -0
- package/examples/techniques/wet-road/picture/materials.js +16 -0
- package/examples/techniques/wet-road/picture/palette.js +24 -0
- package/examples/techniques/wet-road/picture/sky.js +46 -0
- package/examples/webgpu-tsl/GAMEMAP.md +10 -4
- package/examples/webgpu-tsl/README.md +13 -10
- package/examples/webgpu-tsl/main.js +30 -7
- package/examples/webgpu-tsl/picture/index.js +18 -0
- package/examples/webgpu-tsl/picture/lights.js +25 -0
- package/examples/webgpu-tsl/picture/materials.js +36 -0
- package/examples/webgpu-tsl/picture/palette.js +23 -0
- package/examples/webgpu-tsl/picture/post.js +16 -0
- package/examples/webgpu-tsl/picture/sky.js +30 -0
- package/examples/world/.threedog/content-index.json +1 -1
- package/examples/world/GAMEMAP.md +16 -12
- package/examples/world/art/humanoid.js +9 -13
- package/examples/world/art/index.js +2 -2
- package/examples/world/art/models.js +3 -4
- package/examples/world/art/shapes.js +2 -2
- package/examples/world/assets.js +2 -2
- package/examples/world/content/audio.js +1 -1
- package/examples/world/content/items.js +1 -1
- package/examples/world/content/props.js +1 -1
- package/examples/world/content/templates.js +1 -1
- package/examples/world/content/vegetation.js +1 -1
- package/examples/world/main.js +10 -10
- package/examples/world/models.js +17 -7
- package/examples/world/picture/index.js +20 -0
- package/examples/world/picture/lights.js +41 -0
- package/examples/world/picture/materials.js +34 -0
- package/examples/world/picture/palette.js +74 -0
- package/examples/world/picture/post.js +9 -0
- package/examples/world/picture/sky.js +39 -0
- package/index.d.ts +14 -22
- package/index.js +36 -36
- package/llms.txt +19 -21
- package/modules/ambience/Ambience.js +12 -9
- package/modules/calendar/Calendar.js +20 -20
- package/modules/calendar/index.js +14 -13
- package/modules/calendar/schedule.js +11 -6
- package/modules/calendar/seasons.js +7 -7
- package/modules/camera/FirstPersonCamera.js +2 -2
- package/modules/camera/FixedCamera.js +14 -15
- package/modules/camera/FollowCamera.js +4 -4
- package/modules/camera/RtsCamera.js +11 -11
- package/modules/camera/common.js +51 -25
- package/modules/camera/contract.js +1 -0
- package/modules/camera/projection.js +2 -2
- package/modules/characters/Character.js +47 -39
- package/modules/characters/NPC.js +30 -22
- package/modules/characters/assetModel.js +18 -13
- package/modules/characters/astar.js +7 -5
- package/modules/characters/behaviors.js +4 -5
- package/modules/characters/contract.js +2 -2
- package/modules/characters/index.js +172 -193
- package/modules/characters/moveHelpers.js +14 -3
- package/modules/characters/movers/common.js +22 -15
- package/modules/characters/movers/manual.js +4 -1
- package/modules/characters/movers/rapier.js +7 -6
- package/modules/characters/movers/simple.js +3 -3
- package/modules/characters/movers/support.js +32 -18
- package/modules/characters/npcAvoid.js +4 -4
- package/modules/characters/npcSim.js +28 -18
- package/modules/characters/npcView.js +6 -5
- package/modules/characters/pathAsync.js +12 -10
- package/modules/characters/pathWorker.js +1 -1
- package/modules/characters/player.js +108 -0
- package/modules/characters/playerStrings.js +2 -2
- package/modules/characters/proceduralRig.js +19 -5
- package/modules/characters/useModel.js +5 -5
- package/modules/characters/walkTo.js +11 -17
- package/modules/collision/Collision.js +30 -22
- package/modules/collision/contract.js +15 -0
- package/modules/content/explain.js +1 -2
- package/modules/content/fields.js +24 -3
- package/modules/content/ids.js +2 -2
- package/modules/content/index.js +68 -98
- package/modules/content/loader.js +14 -17
- package/modules/content/markers.js +25 -0
- package/modules/content/models.js +66 -18
- package/modules/content/packs.js +3 -3
- package/modules/content/parts.js +2 -2
- package/modules/content/places.js +35 -0
- package/modules/content/props.js +19 -14
- package/modules/content/rules.js +34 -22
- package/modules/content/stages.js +7 -7
- package/modules/content/templates.js +24 -22
- package/modules/content/words.js +34 -0
- package/modules/debug/DebugPanel.js +10 -43
- package/modules/flow/contract.js +1 -1
- package/modules/flow/index.js +11 -7
- package/modules/gameplay/Container.js +12 -11
- package/modules/gameplay/Containers.js +14 -5
- package/modules/gameplay/Dialogue.js +13 -11
- package/modules/gameplay/Interactions.js +115 -27
- package/modules/gameplay/Inventory.js +11 -12
- package/modules/gameplay/Quests.js +16 -9
- package/modules/gameplay/boxOps.js +1 -1
- package/modules/gameplay/dialogueBox.js +1 -1
- package/modules/gameplay/dialogueBubbles.js +4 -5
- package/modules/gameplay/interactionPrompt.js +1 -1
- package/modules/gameplay/interactions.contract.js +1 -1
- package/modules/gameplay/inventoryOps.js +2 -3
- package/modules/gameplay/pickups.js +81 -44
- package/modules/gameplay/questLog.js +2 -2
- package/modules/gameplay/questSave.js +3 -3
- package/modules/grid/Grid.js +1 -1
- package/modules/grid/Layer.js +16 -3
- package/modules/grid/index.js +47 -19
- package/modules/grid/preview.js +29 -20
- package/modules/grid/tiles.js +19 -23
- package/modules/hlod/index.js +38 -55
- package/modules/hud/index.js +27 -8
- package/modules/hud/parts.js +13 -11
- package/modules/level/contract.js +16 -0
- package/modules/level/heightfield.js +12 -10
- package/modules/level/index.js +48 -152
- package/modules/level/load.js +79 -0
- package/modules/level/meshes.js +65 -0
- package/modules/level/nodes.js +6 -7
- package/modules/lights/index.js +34 -183
- package/modules/lights/slots.js +93 -0
- package/modules/lights/sources.js +88 -0
- package/modules/music/Music.js +31 -27
- package/modules/music/rules.js +1 -1
- package/modules/nav/contract.js +14 -0
- package/modules/nav/index.js +11 -10
- package/modules/net/Client.js +7 -7
- package/modules/net/Host.js +7 -7
- package/modules/net/Net.js +1 -1
- package/modules/net/index.js +5 -4
- package/modules/net/sync.js +2 -2
- package/modules/net/transports.js +2 -2
- package/modules/particles/Particles.js +49 -25
- package/modules/particles/effect.js +27 -10
- package/modules/particles/shaders.js +2 -1
- package/modules/photo/Photo.js +26 -27
- package/modules/rigid/RigidBodies.js +66 -43
- package/modules/rigid/Vehicles.js +2 -3
- package/modules/rigid/ragdoll.js +287 -0
- package/modules/rigid/ragdollBones.js +159 -0
- package/modules/rigid/sync.js +6 -6
- package/modules/settings/Settings.js +114 -45
- package/modules/settings/apply.js +10 -10
- package/modules/settings/sections.js +16 -14
- package/modules/settings/strings.js +1 -1
- package/modules/settings/view.js +3 -3
- package/modules/sky/Sky.js +125 -103
- package/modules/sky/clouds.js +22 -23
- package/modules/sky/dome.js +113 -0
- package/modules/sky/domeLayers.js +13 -13
- package/modules/sky/environment.js +47 -171
- package/modules/sky/fog.js +5 -180
- package/modules/sky/frame.js +42 -97
- package/modules/sky/season.js +9 -3
- package/modules/sky/shader.js +49 -44
- package/modules/sky/skyModule.js +25 -35
- package/modules/sky/tint.js +9 -11
- package/modules/swarm/Swarm.js +346 -0
- package/modules/swarm/draw.js +68 -0
- package/modules/swarm/grid.js +63 -0
- package/modules/terrain/ChunkManager.js +97 -62
- package/modules/terrain/chunkQueries.js +7 -24
- package/modules/terrain/chunkWorker.js +1 -1
- package/modules/terrain/draw.js +157 -0
- package/modules/terrain/index.js +60 -88
- package/modules/terrain/terrainColorMap.js +6 -3
- package/modules/terrain/terrainDefaults.js +4 -3
- package/modules/terrain/terrainEdit.js +32 -27
- package/modules/terrain/terrainGen.js +19 -14
- package/modules/terrain/terrainIsland.js +2 -2
- package/modules/terrain/terrainMesh.js +7 -6
- package/modules/terrain/terrainShape.js +8 -10
- package/modules/terrain/terrainShapeMain.js +3 -3
- package/modules/timeline/Timeline.js +27 -19
- package/modules/timeline/Tween.js +6 -6
- package/modules/timeline/shots.js +5 -7
- package/modules/triggers/index.js +19 -15
- package/modules/vegetation/Vegetation.js +87 -39
- package/modules/vegetation/densityMap.js +4 -7
- package/modules/vegetation/draw.js +196 -0
- package/modules/vegetation/groundChunks.js +11 -31
- package/modules/vegetation/index.js +18 -16
- package/modules/vegetation/modelGeometry.js +3 -6
- package/modules/vegetation/nearFade.js +1 -1
- package/modules/water/Water.js +140 -93
- package/modules/water/surface.js +56 -56
- package/modules/weather/Weather.js +84 -38
- package/modules/weather/particles.js +18 -10
- package/modules/weather/shaders.js +1 -1
- package/modules/weather/weatherDraw.js +145 -0
- package/modules/world/World.js +10 -10
- package/modules/world/explain.js +1 -1
- package/modules/world/index.js +18 -12
- package/modules/world/persist.js +73 -25
- package/modules/world/pos.js +4 -4
- package/modules/world/records.js +28 -8
- package/modules/world/sim.js +4 -4
- package/modules/world/state.js +12 -5
- package/modules/world/thingSource.js +4 -2
- package/modules/world/views.js +12 -10
- package/package.json +44 -8
- package/presets.js +3 -5
- package/render/PostFX.js +233 -63
- package/render/backend.js +72 -32
- package/render/cascades.js +200 -0
- package/render/cascades.tsl.js +93 -0
- package/render/daylight.js +56 -0
- package/render/detail.js +13 -12
- package/render/effects.js +60 -42
- package/render/fuse.js +3 -3
- package/render/fx/cel.tsl.js +42 -0
- package/render/fx/cloudShadow.tsl.js +3 -3
- package/render/fx/detail.tsl.js +1 -1
- package/render/fx/index.js +10 -13
- package/render/fx/library.tsl.js +11 -0
- package/render/fx/lighting.tsl.js +2 -1
- package/render/fx/nodeErrors.tsl.js +2 -2
- package/render/fx/objectOrigin.tsl.js +1 -2
- package/render/fx/patchNodes.tsl.js +6 -16
- package/render/fx/postWebGPU.tsl.js +55 -28
- package/render/fx/sky.tsl.js +34 -109
- package/render/fx/uniforms.tsl.js +4 -4
- package/render/fx/water.tsl.js +1 -1
- package/render/fx/wind.tsl.js +1 -1
- package/render/fxNumbers.js +3 -0
- package/render/layers.js +14 -0
- package/render/lighting.js +11 -8
- package/render/lightmap.js +142 -0
- package/render/lights.js +26 -204
- package/render/lit.js +24 -0
- package/render/materials.js +47 -162
- package/render/mergeCommon.js +22 -0
- package/render/modeling.js +2 -2
- package/render/neutral.js +23 -0
- package/render/occlusion.js +200 -0
- package/render/ownFrame.js +5 -5
- package/render/patches.js +46 -41
- package/render/postWebGL.js +19 -9
- package/render/probes.js +182 -128
- package/render/recordSweep.js +117 -0
- package/render/shaderErrors.js +10 -9
- package/render/shadowCache.tsl.js +107 -0
- package/render/shadowTypes.js +9 -0
- package/render/shadows.js +451 -0
- package/render/slots.js +11 -11
- package/render/terms.js +63 -113
- package/render/uniformDecl.js +2 -2
- package/types/core.d.ts +489 -405
- package/types/gameplay.d.ts +225 -114
- package/types/generated/core/{Audio.d.ts → audio/Audio.d.ts} +23 -8
- package/types/generated/core/{audioVoice.d.ts → audio/audioVoice.d.ts} +2 -2
- package/types/generated/core/{Events.d.ts → base/Events.d.ts} +4 -4
- package/types/generated/core/{I18n.d.ts → base/I18n.d.ts} +7 -15
- package/types/generated/core/{Random.d.ts → base/Random.d.ts} +4 -3
- package/types/generated/core/engine/page.d.ts +24 -0
- package/types/generated/core/{Input.d.ts → input/Input.d.ts} +21 -10
- package/types/generated/core/{Budget.d.ts → inspect/Budget.d.ts} +36 -26
- package/types/generated/core/{DebugOverrides.d.ts → inspect/DebugOverrides.d.ts} +16 -8
- package/types/generated/core/{Ops.d.ts → ops/Ops.d.ts} +4 -3
- package/types/generated/core/{control.d.ts → ops/control.d.ts} +4 -10
- package/types/generated/core/{Saves.d.ts → saves/Saves.d.ts} +37 -13
- package/types/generated/core/{session.d.ts → saves/session.d.ts} +2 -1
- package/types/generated/core/{Rays.d.ts → scene/Rays.d.ts} +8 -27
- package/types/generated/core/{Views.d.ts → scene/Views.d.ts} +1 -1
- package/types/generated/core/{Batching.d.ts → stream/Batching.d.ts} +7 -7
- package/types/generated/core/{Stream.d.ts → stream/Stream.d.ts} +18 -16
- package/types/generated/core/{Commits.d.ts → threads/Commits.d.ts} +1 -1
- package/types/generated/core/{Jobs.d.ts → threads/Jobs.d.ts} +6 -6
- package/types/generated/core/{Threads.d.ts → threads/Threads.d.ts} +4 -4
- package/types/generated/modules/calendar/Calendar.d.ts +10 -11
- package/types/generated/modules/debug/DebugPanel.d.ts +1 -9
- package/types/generated/modules/grid/Layer.d.ts +9 -1
- package/types/generated/modules/grid/index.d.ts +32 -8
- package/types/generated/modules/music/Music.d.ts +7 -5
- package/types/generated/modules/particles/Particles.d.ts +14 -7
- package/types/generated/modules/sky/Sky.d.ts +101 -23
- package/types/generated/modules/sky/skyModule.d.ts +1 -1
- package/types/generated/modules/swarm/Swarm.d.ts +80 -0
- package/types/generated/modules/timeline/Timeline.d.ts +2 -1
- package/types/generated/modules/water/Water.d.ts +51 -3
- package/types/generated/modules/weather/Weather.d.ts +44 -10
- package/types/generated/modules/weather/weatherDraw.d.ts +11 -0
- package/types/generated/modules/world/World.d.ts +7 -5
- package/types/generated/render/PostFX.d.ts +69 -20
- package/types/generated/render/lighting.d.ts +29 -0
- package/types/generated/render/materials.d.ts +20 -44
- package/types/generated/render/occlusion.d.ts +22 -0
- package/types/generated/render/patches.d.ts +1 -0
- package/types/generated/ui/Focus.d.ts +1 -0
- package/types/generated/ui/UI.d.ts +1 -0
- package/types/nav.d.ts +11 -11
- package/types/physics.d.ts +104 -73
- package/types/tsl.d.ts +45 -4
- package/types/world.d.ts +372 -86
- package/ui/Focus.js +21 -10
- package/ui/LoadingScreen.js +2 -2
- package/ui/Parts.js +12 -7
- package/ui/UI.js +17 -17
- package/ui/cursor.js +1 -1
- package/ui/defaults.js +3 -2
- package/ui/theme.js +36 -28
- package/ui/touchPart.js +1 -1
- package/core/UrlState.js +0 -110
- package/core/assetEntry.js +0 -106
- package/core/describeRender.js +0 -71
- package/core/holds.js +0 -134
- package/core/look/coreParts.js +0 -219
- package/core/look/part.js +0 -253
- package/core/look/points.js +0 -255
- package/core/look/report.js +0 -96
- package/core/look/shadowPart.js +0 -63
- package/core/look/state.js +0 -45
- package/core/look/write.js +0 -70
- package/core/page.js +0 -79
- package/core/shadowTypes.js +0 -16
- package/core/styleParts.js +0 -114
- package/core/util.js +0 -17
- package/docs/MIGRATING-0.3.md +0 -248
- package/docs/MIGRATING-0.4.md +0 -228
- package/docs/MIGRATING-0.5.md +0 -68
- package/docs/PERF.md +0 -245
- package/docs/api/style.md +0 -136
- package/docs/api/terrainLook.md +0 -10
- package/docs/api/vegetationLook.md +0 -10
- package/docs/api/weatherLook.md +0 -10
- package/docs/recipes/09-style.md +0 -218
- package/docs/recipes/35-style-from-reference.md +0 -153
- package/docs/recipes/36-sky-ground-plant-looks.md +0 -118
- package/docs/recipes/37-terrain-look-hooks.md +0 -119
- package/docs/recipes/38-environment-look-hooks.md +0 -99
- package/docs/recipes/41-thing-registry.md +0 -97
- package/docs/recipes/42-terrain-shape.md +0 -64
- package/docs/recipes/44-water-weather-look-hooks.md +0 -144
- package/docs/recipes/47-island-snow-backdrop.md +0 -45
- package/docs/recipes/48-make-material.md +0 -75
- package/docs/recipes/52-look.md +0 -282
- package/docs/recipes/54-three-idioms.md +0 -88
- package/examples/action/look.js +0 -5
- package/examples/sheepisland/.threedog/content-index.json +0 -1
- package/examples/sheepisland/style/index.js +0 -79
- package/examples/styletest/look.js +0 -11
- package/examples/techniques/day-night-grade/dayNightGrade.js +0 -76
- package/examples/webgpu-tsl/tslScene.js +0 -75
- package/examples/world/style/index.js +0 -61
- package/examples/world/style/plugins/10-bloom.js +0 -5
- package/modules/sky/cascades.js +0 -186
- package/modules/sky/cascades.tsl.js +0 -82
- package/modules/sky/look.js +0 -54
- package/modules/sky/lookFog.js +0 -76
- package/modules/sky/lookShadow.js +0 -62
- package/modules/sky/lookSky.js +0 -169
- package/modules/sky/shadow.js +0 -98
- package/modules/terrain/look.js +0 -83
- package/modules/terrain/lookGround.js +0 -66
- package/modules/vegetation/look.js +0 -119
- package/modules/vegetation/lookWind.js +0 -98
- package/modules/water/look.js +0 -91
- package/modules/water/surfaceDefaults.js +0 -3
- package/modules/weather/look.js +0 -74
- package/modules/weather/weatherLook.js +0 -135
- package/render/lookGlow.js +0 -139
- package/render/lookSurface.js +0 -224
- package/render/postLook.js +0 -164
- package/render/surface.js +0 -105
- package/types/generated/core/page.d.ts +0 -18
- package/types/generated/modules/weather/weatherLook.d.ts +0 -12
- package/types/style.d.ts +0 -671
- /package/core/{Vars.js → base/Vars.js} +0 -0
- /package/core/{mulberry32.js → base/mulberry32.js} +0 -0
- /package/core/{inputDefaults.js → input/inputDefaults.js} +0 -0
- /package/core/{textureBytes.js → inspect/textureBytes.js} +0 -0
- /package/core/{actor.js → ops/actor.js} +0 -0
- /package/core/{opsFail.js → ops/opsFail.js} +0 -0
- /package/core/{opsHistory.js → ops/opsHistory.js} +0 -0
- /package/core/{saveIds.js → saves/saveIds.js} +0 -0
- /package/core/{screenToGround.js → scene/screenToGround.js} +0 -0
- /package/core/{cells.js → stream/cells.js} +0 -0
- /package/core/{streamCells.js → stream/streamCells.js} +0 -0
- /package/core/{pureWorker.js → threads/pureWorker.js} +0 -0
- /package/examples/{sheepisland → perf-island}/content/index.js +0 -0
- /package/examples/{sheepisland → perf-island}/content/props.js +0 -0
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
// Stable error codes: errors the engine raises by name end their message with "[code]" and carry err.code / err.fix / err.docs (codedError in errorHints.js).
|
|
2
2
|
// Plain data with no imports (node tools load it through threedog/error-hints). A code never changes meaning once shipped: tools and tests match on it.
|
|
3
3
|
|
|
4
|
-
// Naming rule for a NEW code: `<area>-<problem>` in lowercase with hyphens (save-version,
|
|
4
|
+
// Naming rule for a NEW code: `<area>-<problem>` in lowercase with hyphens (save-version, unknown-name): the area first so the codes sort
|
|
5
5
|
// and grep by subsystem. Codes already published keep their names even where they do not follow it (renaming would break the tools and tests that match them).
|
|
6
|
+
// One code per kind of misuse per module: the message names the exact call, the value it got and the accepted values; the fix says what to change.
|
|
6
7
|
|
|
7
8
|
/**
|
|
8
9
|
* Errors the engine raises by name (the message ends with "[code]"): code -> { fix, docs }. Codes are stable: tools and tests may match on them.
|
|
@@ -35,12 +36,9 @@ export const ERROR_CODES = {
|
|
|
35
36
|
'session-early': {
|
|
36
37
|
docs: ['recipes/20-content-actions-save.md', 'api/engine.md'],
|
|
37
38
|
fix: 'engine.session needs the new-game state that start() captures: call it from a button or after `await engine.start()`.' },
|
|
38
|
-
'session-handle': {
|
|
39
|
-
docs: ['api/engine.md'],
|
|
40
|
-
fix: 'session.track(handle) takes something with remove(), such as the result of events.on / onFixed / clock.after.' },
|
|
41
39
|
'clock-interval': {
|
|
42
40
|
docs: ['recipes/06-clock-events.md', 'api/clock.md'],
|
|
43
|
-
fix: 'clock.after / every take a finite number of
|
|
41
|
+
fix: 'clock.after / every take a finite number of calendar seconds (every needs > 0). For every fixed step use engine.onFixed.' },
|
|
44
42
|
'threads-option': {
|
|
45
43
|
docs: ['recipes/15-perf.md', 'api/engine.md'],
|
|
46
44
|
fix: 'createEngine({ threads }) takes \'auto\', a worker count (0 = none) or false.' },
|
|
@@ -70,7 +68,7 @@ export const ERROR_CODES = {
|
|
|
70
68
|
'disposed one.' },
|
|
71
69
|
'skip-amount': {
|
|
72
70
|
docs: ['recipes/06-clock-events.md', 'api/engine.md'],
|
|
73
|
-
fix: 'engine.skip takes { to: \'06:00\' } (needs the
|
|
71
|
+
fix: 'engine.skip takes { to: \'06:00\' } (needs the calendar module) or { seconds: 600 } (calendar seconds, > 0).' },
|
|
74
72
|
'stream-timeout': {
|
|
75
73
|
docs: ['recipes/18-world.md', 'api/stream.md'],
|
|
76
74
|
fix: 'The teleport destination did not finish loading in time (terrain, colliders, nearby models). Read describe().loading or ' +
|
|
@@ -81,20 +79,17 @@ export const ERROR_CODES = {
|
|
|
81
79
|
'whenReady only on a source you keep.' },
|
|
82
80
|
'stream-option': {
|
|
83
81
|
docs: ['recipes/18-world.md', 'api/stream.md'],
|
|
84
|
-
fix: 'stream.source(position, { detail }) takes \'full\' or \'simple\'.' },
|
|
82
|
+
fix: 'stream.source(position, { detail }) takes \'full\' or \'simple\'; stream.radius takes a finite number of meters or null.' },
|
|
85
83
|
'op-misuse': {
|
|
86
84
|
docs: ['recipes/23-ops.md', 'api/engine.md'],
|
|
87
85
|
fix: 'Ops are defined with ops.define(name, { can, run }) and run with ops.run(name, args); args are plain data and can() only ' +
|
|
88
86
|
'reads. The message says which rule was broken.' },
|
|
89
|
-
'
|
|
90
|
-
docs: ['MIGRATING-0.4.md'],
|
|
91
|
-
fix: 'A name removed in 0.4 was read (engine.elapsed); the message names the new form (engine.time.now(\'real\') or engine.time.now(\'ambient\')). Checked in dev only.' },
|
|
92
|
-
'pause-owner': {
|
|
87
|
+
'halt-owner': {
|
|
93
88
|
docs: ['recipes/23-ops.md', 'api/engine.md'],
|
|
94
|
-
fix: 'const
|
|
89
|
+
fix: 'const h = engine.haltLoop(owner); ... h.remove() ends that owner\'s halt; the loop restarts only when every owner has removed theirs.' },
|
|
95
90
|
'mod-owner': {
|
|
96
91
|
docs: ['recipes/55-mods-time-wrap.md', 'api/engine.md'],
|
|
97
|
-
fix: "engine.mod(point, { owner, set | add | mul | clamp, layer?, for?, clock?, id? }): owner is a non-empty string, exactly one of set / add / mul / clamp for a number (set for a value point); in a module ctx.mod(point, { mul }) names the module itself.
|
|
92
|
+
fix: "engine.mod(point, { owner, set | add | mul | clamp, layer?, for?, clock?, id? }): owner is a non-empty string, exactly one of set / add / mul / clamp for a number (set for a value point); in a module ctx.mod(point, { mul }) names the module itself. haltLoop / freeze / takeCamera / debug.view name their owner the same way. Only that owner ends it, with the handle's remove()." },
|
|
98
93
|
'shared-conflict': {
|
|
99
94
|
docs: ['recipes/55-mods-time-wrap.md'],
|
|
100
95
|
fix: "Two owners set one shared value on the same layer, so nothing says which one decides (dev builds throw; release builds let the later write win and warn once). Copy one fix from the message: contribute instead (mul / add), decide on another layer ({ layer }), or take it over on purpose (manual, or a set on the system layer)." },
|
|
@@ -109,7 +104,7 @@ export const ERROR_CODES = {
|
|
|
109
104
|
fix: 'A number shared value got a value it cannot combine: set / add / mul take a finite number; clamp takes { min?, max? } with each given bound a finite number and min <= max. The same check runs on engine.mod and on handle.change, so a NaN never reaches the value.' },
|
|
110
105
|
'shared-layer': {
|
|
111
106
|
docs: ['recipes/55-mods-time-wrap.md'],
|
|
112
|
-
fix:
|
|
107
|
+
fix: "layer is one of engine < game < effect < system < settings < debug (default game); most code never passes it." },
|
|
113
108
|
'views-define': {
|
|
114
109
|
docs: ['recipes/46-blender-art-route.md', 'api/engine.md'],
|
|
115
110
|
fix: "engine.views.define(name, { position: [x, y, z], target?: [x, y, z], fov? }): position and target are 3-number arrays." },
|
|
@@ -119,16 +114,14 @@ export const ERROR_CODES = {
|
|
|
119
114
|
'engine.ops.run(...) or an onFixed / module fixed hook.' },
|
|
120
115
|
'quest-step': {
|
|
121
116
|
docs: ['recipes/04-quests.md', 'api/quests.md'],
|
|
122
|
-
fix:
|
|
123
|
-
'}]) or add a migrate step to the quests save part.' },
|
|
117
|
+
fix: "A quest step is wrong. In a definition: each step has done (a function) or all: [parts] with at least one part not optional, and step ids are unique. In a save: a step id the definition no longer has restarts the quest from its first step; keep step ids stable, or add a migrate step to the quests save part." },
|
|
124
118
|
'save-write': {
|
|
125
119
|
docs: ['recipes/20-content-actions-save.md', 'api/saves.md'],
|
|
126
120
|
fix: 'The browser refused to store the save (storage full, private mode, blocked IndexedDB); the previous save is kept. Free ' +
|
|
127
121
|
'space or export the save as a file.' },
|
|
128
122
|
'save-bad-record': {
|
|
129
123
|
docs: ['recipes/20-content-actions-save.md', 'api/saves.md'],
|
|
130
|
-
fix:
|
|
131
|
-
'load was refused and rolled back. The save was edited by hand or damaged: fix the field the message names, or load another save.' },
|
|
124
|
+
fix: "A core field of saved data is malformed (a position that is not three finite numbers, a record without kind, a swarm without its columns); the load was refused and rolled back. The save was edited by hand or damaged: fix the field the message names, or load another save." },
|
|
132
125
|
'save-value': {
|
|
133
126
|
docs: ['recipes/20-content-actions-save.md', 'api/saves.md'],
|
|
134
127
|
fix: 'A saved number was not finite or out of range (a negative clock, a count beyond any stack); it was clamped or dropped and the ' +
|
|
@@ -141,6 +134,14 @@ export const ERROR_CODES = {
|
|
|
141
134
|
docs: ['recipes/15-perf.md', 'api/budget.md'],
|
|
142
135
|
fix: 'A performance budget set with createEngine({ budget }) was exceeded; the message names the biggest costs. Measure with ' +
|
|
143
136
|
'describe().perf or npm run perf.' },
|
|
137
|
+
'webgpu-records-unread': {
|
|
138
|
+
docs: ['recipes/56-webgpu-tsl.md'],
|
|
139
|
+
fix: 'three.js changed the private list of draw records the WebGPU sweep reads (usually a three upgrade), so the sweep is off and the game runs on. ' +
|
|
140
|
+
'Until the engine is updated, send the event yourself when a mesh is gone for good: mesh.dispatchEvent({ type: \'dispose\' }).' },
|
|
141
|
+
'geometry-undisposed': {
|
|
142
|
+
docs: ['recipes/56-webgpu-tsl.md'],
|
|
143
|
+
fix: 'Meshes are leaving the scene with their geometry never disposed, so the renderer keeps counting it. Call mesh.geometry.dispose() when a mesh is gone for good, ' +
|
|
144
|
+
'or engine.remove(mesh). Geometry parked for reuse is fine; this warns only about a steady climb.' },
|
|
144
145
|
'jobs-slow': {
|
|
145
146
|
docs: ['recipes/15-perf.md', 'api/jobs.md'],
|
|
146
147
|
fix: 'A job step ran too long or a job queued too many steps. Yield more often inside the generator (engine.jobs.add(function* ' +
|
|
@@ -151,8 +152,7 @@ export const ERROR_CODES = {
|
|
|
151
152
|
'results, only slower. Fix the worker file or its imports; a lane whose tasks really take longer passes a bigger lane({ timeout }).' },
|
|
152
153
|
'input-bound-twice': {
|
|
153
154
|
docs: ['recipes/58-input.md', 'api/input.md'],
|
|
154
|
-
fix:
|
|
155
|
-
'modules). One owner binds an action: keep one of the two, or bind another action name. The same owner binding again just replaces its keys.' },
|
|
155
|
+
fix: "Two different owners bound the same action (createEngine({ bindings }) of the game and a module, or two modules). One owner binds an action: keep one of the two, or bind another action name. The same owner binding again just replaces its keys." },
|
|
156
156
|
'input-action-context': {
|
|
157
157
|
docs: ['recipes/58-input.md', 'api/input.md'],
|
|
158
158
|
fix: 'Two owners declared one action in different input contexts. An action belongs to one context: rename one of them, or declare both in ' +
|
|
@@ -161,6 +161,13 @@ export const ERROR_CODES = {
|
|
|
161
161
|
docs: ['recipes/58-input.md', 'api/input.md'],
|
|
162
162
|
fix: "An action a module needs is read but no key is bound, so it never fires. Modules bind no keys: bind it with " +
|
|
163
163
|
"engine.input.bind('action', ['KeyX']), createEngine({ bindings }) or a presets.bindings.* map." },
|
|
164
|
+
'interaction-no-key': {
|
|
165
|
+
docs: ['recipes/63-third-person-start.md', 'recipes/58-input.md', 'api/interactions.md'],
|
|
166
|
+
fix: 'Interactions were added but their action has no key, so no key press reaches them; the game keeps running. Bind it in createEngine({ bindings }) or with ' +
|
|
167
|
+
'engine.input.bind; any key works, and bind it to [] if the game reaches them another way (a click, a touch, its own button): that ends this warning.' },
|
|
168
|
+
'signal-overwritten': {
|
|
169
|
+
docs: ['recipes/62-picture-code.md'],
|
|
170
|
+
fix: 'This signal has one writer that rewrites it every frame, so a direct write lasts at most a frame. The message names the entry that changes it.' },
|
|
164
171
|
'asset-cache': {
|
|
165
172
|
docs: ['recipes/05-props-bake.md', 'api/assets.md'],
|
|
166
173
|
fix: 'The dev model cache could not be used, so code-generated models are built from code. Run the game through its vite ' +
|
|
@@ -171,8 +178,7 @@ export const ERROR_CODES = {
|
|
|
171
178
|
'unless it repeats: then lower quality or texture sizes.' },
|
|
172
179
|
'module-params': {
|
|
173
180
|
docs: ['recipes/51-capability-catalog.md'],
|
|
174
|
-
fix:
|
|
175
|
-
'The message names the option and what it should be; engine.catalog(name).params lists every option with its default.' },
|
|
181
|
+
fix: "A module option or call argument does not fit (unknown key, wrong type, out of range or not one of the allowed values). The message names it and what it should be; engine.catalog(name).params lists every option with its default." },
|
|
176
182
|
'module-dispose': {
|
|
177
183
|
docs: ['recipes/14-custom-module.md'],
|
|
178
184
|
fix: 'A module\'s dispose(e) threw; the other modules and core were still cleaned up. Fix that module\'s dispose.' },
|
|
@@ -188,9 +194,12 @@ export const ERROR_CODES = {
|
|
|
188
194
|
docs: ['recipes/14-custom-module.md', 'api/engine.md'],
|
|
189
195
|
fix: 'start() waited longer than engine.loading.timeoutMs for modules whose isReady(e) stays false. Fix what that module waits for, ' +
|
|
190
196
|
'or raise engine.loading.timeoutMs if the load is only slow. engine.loading.view().waiting names the current item.' },
|
|
197
|
+
'step-during-load': {
|
|
198
|
+
docs: ['api/engine.md'],
|
|
199
|
+
fix: 'engine.step() ran during a load nobody awaited. Await engine.start(), or the session.newGame / load / quit that is running, then step.' },
|
|
191
200
|
'step-seconds': {
|
|
192
201
|
docs: ['api/engine.md'],
|
|
193
|
-
fix: 'engine.step(seconds) takes a finite number >= 0 in
|
|
202
|
+
fix: 'engine.step(seconds) takes a finite number >= 0 in real seconds: 0 advances nothing, 0.5 is half a second, 1 / 60 is one fixed step.' },
|
|
194
203
|
'player-control': {
|
|
195
204
|
docs: ['recipes/01-new-game.md', 'api/characters.md'],
|
|
196
205
|
fix: "createPlayer() has no default feel: give control. Usually createPlayer({ ...presets.player.thirdPerson, spawn }); else control: 'camera' | " +
|
|
@@ -210,8 +219,7 @@ export const ERROR_CODES = {
|
|
|
210
219
|
"const h = engine.control.take(ch, { owner, layer: 'script', step }) (or h.move(x, z, run, dt)), then h.remove() to hand it back." },
|
|
211
220
|
'control-layer': {
|
|
212
221
|
docs: ['recipes/57-control.md'],
|
|
213
|
-
fix: "engine.control.take(character, { owner, layer?, step? }): a character (or its id), a non-empty owner name, layer 'base' | 'script' | "
|
|
214
|
-
"'cutscene' (net is the network's), step a function (dt, ch) => ({ x, z, run }) or left out." },
|
|
222
|
+
fix: "engine.control.take(character, { owner, layer?, step? }): a character (or its id), a non-empty owner name, layer 'base' | 'script' | 'cutscene' (physics and net are the engine's own), step a function (dt, ch) => ({ x, z, run }) or left out." },
|
|
215
223
|
'interaction-setup': {
|
|
216
224
|
docs: ['recipes/02-npc.md', 'api/interactions.md'],
|
|
217
225
|
fix: 'interactions() has no default pick: use interactions({ ...presets.interactions.nearest }) or interactions({ pick }); the game binds ' +
|
|
@@ -219,71 +227,62 @@ export const ERROR_CODES = {
|
|
|
219
227
|
'open-world-camera': {
|
|
220
228
|
docs: ['recipes/21-camera.md', 'api/openWorld.md'],
|
|
221
229
|
fix: "openWorld() installs no camera on its own: pass camera: 'follow' | 'firstPerson' | 'rts' | 'fixed' | a camera module | false." },
|
|
222
|
-
'
|
|
223
|
-
docs: ['recipes/
|
|
224
|
-
fix: 'A
|
|
225
|
-
'
|
|
226
|
-
docs: ['recipes/52-
|
|
227
|
-
fix: '
|
|
228
|
-
'look-verb': {
|
|
229
|
-
docs: ['recipes/52-look.md'],
|
|
230
|
-
fix: 'This look part does not support that verb (set / patch / replace), or the hook name is unknown. engine.catalog("look.<part>").verbs lists what it supports; the message names the verb to use instead.' },
|
|
230
|
+
'lightpool-dusk': {
|
|
231
|
+
docs: ['api/lightPool.md', 'recipes/09-materials-lights-models.md'],
|
|
232
|
+
fix: 'A lightPool source has a wrong dusk value, or follows daylight while nothing tells day from night: install sky() or calendar(), or register the daylight measure.' },
|
|
233
|
+
'engine-terms': {
|
|
234
|
+
docs: ['recipes/52-around-the-picture.md'],
|
|
235
|
+
fix: 'engine.shaderTerms was given a spec it cannot draw: a term is { glsl, tsl, uniforms?, pars?, slot? } with the form this renderer needs, or false for none.' },
|
|
231
236
|
'engine-two-copies': {
|
|
232
237
|
docs: ['THREE.md'],
|
|
233
|
-
fix: "vite.config.js: resolve: { dedupe: ['threedog', 'three'] }. Two copies of threedog are loaded (the message names both paths); "
|
|
234
|
-
'each hooks THREE.Mesh.prototype for shadows, so keep one: `npm ls threedog`, and packs / tools list threedog as a peerDependency.' },
|
|
238
|
+
fix: "vite.config.js: resolve: { dedupe: ['threedog', 'three'] }. Two copies of threedog are loaded (the message names both paths); each hooks THREE.Mesh.prototype for shadows, so keep one: `npm ls threedog`, and packs / tools list threedog as a peerDependency." },
|
|
235
239
|
'debug-override': {
|
|
236
|
-
docs: ['recipes/
|
|
240
|
+
docs: ['recipes/40-scene.md'],
|
|
237
241
|
fix: "engine.debug.override(owner, target, patch): owner names who sets it (engine.debug.clear(owner) removes all of them), target is a thing id or Object3D, " +
|
|
238
|
-
"patch is { visible?, material?: 'flat' | 'wire', apply? }. Overrides change only what the screen shows and are never saved." },
|
|
242
|
+
"patch is { visible?, material?: 'flat' | 'wire', apply? }; a three.js value: override(owner, object, key, value). Overrides change only what the screen shows and are never saved." },
|
|
239
243
|
'plugin-shape': {
|
|
240
244
|
docs: ['THREE.md', 'recipes/40-scene.md'],
|
|
241
245
|
fix: 'A file in the plugins folder is plugged by what it exports: an Object3D, a three.js Pass, a post effect { name, create | node | fuse }, ' +
|
|
242
|
-
'a
|
|
246
|
+
'a module { name, type, install }, or an array of these (default export, else every named export). ' +
|
|
243
247
|
'A function is never a plugin (on either renderer): export what a factory returns (export default makeIt({ ... })), a node pass as { name, node }; threedog lib pull writes that line for library code. plugins.json names only files that exist.' },
|
|
244
248
|
'thing-id': {
|
|
245
|
-
docs: ['recipes/
|
|
249
|
+
docs: ['recipes/40-scene.md'],
|
|
246
250
|
fix: "Ids given to engine.add(obj, { id }) are non-empty strings without '#', unique across engine.add objects and world records. " +
|
|
247
251
|
'engine.thing(id) takes such an id, a world record id, an object name or an Object3D; the message suggests the closest id.' },
|
|
248
252
|
'thing-owned': {
|
|
249
|
-
docs: ['recipes/
|
|
253
|
+
docs: ['recipes/40-scene.md', 'recipes/18-world.md'],
|
|
250
254
|
fix: "Two systems manage one object: a world model is placed by world every frame. Change the record (ops.run('thing.set', { id, " +
|
|
251
255
|
"position }), world.set / world.move) instead of the model, and never engine.add a model world built." },
|
|
252
256
|
'thing-unsaved': {
|
|
253
|
-
docs: ['recipes/
|
|
257
|
+
docs: ['recipes/40-scene.md'],
|
|
254
258
|
fix: 'An object you expect to keep cannot be saved: it has no stable id or was added during play. Give it an id at setup ' +
|
|
255
259
|
"(engine.add(obj, { id })), or make it a template and create it inside an op with engine.content.spawn(name, at)." },
|
|
256
260
|
'thing-orphan': {
|
|
257
|
-
docs: ['recipes/
|
|
261
|
+
docs: ['recipes/40-scene.md'],
|
|
258
262
|
fix: "The 'scene' save part names an id no engine.add object has: the code that added it changed its id or no longer runs. " +
|
|
259
263
|
'The data is kept in the save; restore the id, or ignore it if the object was deleted on purpose.' },
|
|
260
264
|
'engine-misuse': {
|
|
261
265
|
docs: ['api/engine.md'],
|
|
262
266
|
fix: 'An engine call got an argument it cannot use; the message names the call and the accepted forms.' },
|
|
263
267
|
'many-lights': {
|
|
264
|
-
docs: ['recipes/09-
|
|
265
|
-
fix:
|
|
266
|
-
'engine.lightPool.add(...) so a fixed small set of real lights follows the nearest sources.' },
|
|
268
|
+
docs: ['recipes/09-materials-lights-models.md', 'api/lightPool.md'],
|
|
269
|
+
fix: "Too many real-time lights are in the scene (the message has the count). Use engine.use(lightPool({ point: 8 })) and register torches / lamps with engine.lightPool.add(...), so a fixed small set of real lights follows the nearest sources." },
|
|
267
270
|
'light-recompile': {
|
|
268
|
-
docs: ['recipes/09-
|
|
271
|
+
docs: ['recipes/09-materials-lights-models.md', 'api/lightPool.md'],
|
|
269
272
|
fix: 'The number of lights changed during play, so three.js compiled new shader programs (a long frame). Keep the light ' +
|
|
270
273
|
'count fixed: engine.use(lightPool({ point: 8 })) before engine.start() and register torches / lamps with ' +
|
|
271
274
|
'engine.lightPool.add(...), or create your own lights before start and fade them with intensity instead of adding, ' +
|
|
272
275
|
'removing or hiding them.' },
|
|
273
|
-
// ---- W4 (one failure shape): every engine throw carries a code. One code per kind of misuse per module; the message names the exact
|
|
274
|
-
// call and the accepted values, the fix says where to look and what to change. Hint-table classes that matched engine messages moved here too
|
|
275
|
-
// (the engine tags its own errors now; errorHints.js keeps patterns only for three.js / browser messages).
|
|
276
276
|
'preset-option': {
|
|
277
277
|
docs: ['api/openWorld.md', 'api/engine.md'],
|
|
278
278
|
fix: 'An openWorld() / preset option has a wrong value or a part name it does not know. The message lists the accepted values; ' +
|
|
279
279
|
'use one of them, or leave the key out for the default.' },
|
|
280
280
|
'asset-misuse': {
|
|
281
281
|
docs: ['api/assets.md', 'recipes/05-props-bake.md'],
|
|
282
|
-
fix:
|
|
283
|
-
'(manifest or assets.define) and pass its name, or the object assets.model() returned.' },
|
|
282
|
+
fix: "An engine.assets call got a model it does not know, an object that is not an assets.model() copy, or setParams on a model with no params schema. Register the model (engine.assets.manifest) and pass its name, or the object assets.model() returned." },
|
|
284
283
|
'batching-option': {
|
|
285
284
|
docs: ['recipes/15-perf.md'],
|
|
286
|
-
fix:
|
|
285
|
+
fix: "createEngine({ batching }) takes false or an object with the keys named in the message." },
|
|
287
286
|
'debug-view': {
|
|
288
287
|
docs: ['recipes/16-dev-bridge.md', 'api/engine.md'],
|
|
289
288
|
fix: 'engine.debug.defineView(name, { what, apply }): the name must be new (not a built-in view mode) and apply(scene) returns ' +
|
|
@@ -291,11 +290,22 @@ export const ERROR_CODES = {
|
|
|
291
290
|
'probes-option': {
|
|
292
291
|
docs: ['recipes/34-environment-lighting.md', 'api/engine.md'],
|
|
293
292
|
fix: 'engine.bakeProbes / loadProbes got a wrong option: bounds must be a Box3 or { min, max }, spacing a positive number of meters ' +
|
|
294
|
-
'(raise it when the grid has too many probes)
|
|
293
|
+
'(raise it when the grid has too many probes). On a device that cannot render to float textures, bake elsewhere and ship the file.' },
|
|
294
|
+
'probes-check': {
|
|
295
|
+
docs: ['recipes/34-environment-lighting.md'],
|
|
296
|
+
fix: 'A probe grid is live and something around it will look wrong: lit objects reach outside it (widen bounds or light them another way) ' +
|
|
297
|
+
'or other light adds to what the bake saw (lower it where the probes take over). The details are in describe().render.probes.' },
|
|
295
298
|
'probes-data': {
|
|
296
299
|
docs: ['recipes/34-environment-lighting.md', 'api/engine.md'],
|
|
297
300
|
fix: 'engine.loadProbes(json) was given data that is not a probe file (or a damaged one), so nothing was added. Pass what ' +
|
|
298
301
|
'handle.toJSON() returned, or bake again with engine.bakeProbes.' },
|
|
302
|
+
'lightmap-data': {
|
|
303
|
+
docs: ['recipes/34-environment-lighting.md', 'api/engine.md'],
|
|
304
|
+
fix: 'engine.loadLightmap(file) was given something that is not a file from `threedog bake light`, or a damaged one, so nothing was changed. Bake it again.' },
|
|
305
|
+
'lightmap-check': {
|
|
306
|
+
docs: ['recipes/34-environment-lighting.md'],
|
|
307
|
+
fix: 'A lightmap is on and something around it will look wrong: a baked mesh moved or is missing, a baked material is shared with an unbaked mesh, ' +
|
|
308
|
+
'or ambient light adds to what the bake saw. The details are in describe().render.lightmap.' },
|
|
299
309
|
'grid-data': {
|
|
300
310
|
docs: ['recipes/29-grid.md', 'api/grids.md'],
|
|
301
311
|
fix: 'sampleGrid / gridFromImage / decodePng got data it cannot read: wrong width * height, an unknown interp or channel, or a PNG ' +
|
|
@@ -307,21 +317,17 @@ export const ERROR_CODES = {
|
|
|
307
317
|
'input-owner': {
|
|
308
318
|
docs: ['api/input.md'],
|
|
309
319
|
fix: 'input.push(name, { owner }) needs a non-empty owner string (who pushed the context), so pop / describe can tell owners apart.' },
|
|
310
|
-
'style-value': {
|
|
311
|
-
docs: ['recipes/09-style.md', 'recipes/52-look.md'],
|
|
312
|
-
fix: 'A style value is the wrong shape (toneMapping, exposure, a style part), or is world state put in a style. Use the form in the ' +
|
|
313
|
-
'message; world state (map size, rules) goes in the game, not in the look.' },
|
|
314
320
|
'owned-misuse': {
|
|
315
|
-
docs: ['recipes/52-
|
|
316
|
-
fix: 'defineOwned /
|
|
321
|
+
docs: ['recipes/52-around-the-picture.md', 'THREE.md'],
|
|
322
|
+
fix: 'defineOwned / engine.autoView.manual(key) was called wrongly: a module definition misses id / part / read / levels.manual, or ' +
|
|
317
323
|
'manual() named a key the part does not write. Use a key listed in the message.' },
|
|
318
|
-
'shadow-
|
|
324
|
+
'shadow-cascades': {
|
|
319
325
|
docs: ['recipes/45-cascaded-shadows.md'],
|
|
320
|
-
fix: '
|
|
326
|
+
fix: 'engine.shadows (cascades, box, budget, include, enabled) was called wrongly: the message names what to change. ' +
|
|
327
|
+
'An engine draws one set of cascades, and a light takes a box or cascades, not both.' },
|
|
321
328
|
'wrap-misuse': {
|
|
322
329
|
docs: ['recipes/55-mods-time-wrap.md'],
|
|
323
|
-
fix:
|
|
324
|
-
'(the message lists them). Wrap a public method, not a private _one.' },
|
|
330
|
+
fix: "engine.wrap(target, method, fn): target is an object, fn a function, and method the name of a method that exists on it (the message lists the public ones). A name with a leading _ is the object's inside: it can be wrapped, a dev warning says so once, and an engine update may change it without notice." },
|
|
325
331
|
'ambience-rule': {
|
|
326
332
|
docs: ['api/ambience.md', 'api/audio.md'],
|
|
327
333
|
fix: 'An ambience rule names no sound: give sound: a name registered in audio.sounds.' },
|
|
@@ -330,9 +336,8 @@ export const ERROR_CODES = {
|
|
|
330
336
|
fix: 'A camera option is wrong: projection is \'perspective\' or \'orthographic\' (orthographic needs size > 0 and engine.camera), ' +
|
|
331
337
|
'ground / shots use the values the message lists.' },
|
|
332
338
|
'character-option': {
|
|
333
|
-
docs: ['api/characters.md', 'recipes/13-animation.md'],
|
|
334
|
-
fix:
|
|
335
|
-
'the registered ones.' },
|
|
339
|
+
docs: ['api/characters.md', 'recipes/13-animation.md', 'recipes/02-npc.md'],
|
|
340
|
+
fix: "A character / NPC option or model name is wrong: the message names the option and the accepted forms, and an unknown model lists the registered ones. An NPC's interact is { op: 'name', args?, ... } or null; characters.support(object, { carry, id }) takes an Object3D with meshes, a listed carry mode and a unique id." },
|
|
336
341
|
'collision-misuse': {
|
|
337
342
|
docs: ['api/collision.md'],
|
|
338
343
|
fix: 'A collision call got a wrong argument, e.g. collision.addBlocked needs fn(x, z) => boolean.' },
|
|
@@ -354,11 +359,10 @@ export const ERROR_CODES = {
|
|
|
354
359
|
'field, a module it needs not installed). The message names the template and the field to fix.' },
|
|
355
360
|
'inventory-misuse': {
|
|
356
361
|
docs: ['recipes/03-items-pickups.md', 'api/inventory.md'],
|
|
357
|
-
fix:
|
|
358
|
-
'form in the message.' },
|
|
362
|
+
fix: "inventory.define(id): an item id may not contain '#', which marks entry keys (sword#3). Pick an id without it." },
|
|
359
363
|
'grids-misuse': {
|
|
360
364
|
docs: ['recipes/29-grid.md', 'api/grids.md'],
|
|
361
|
-
fix:
|
|
365
|
+
fix: "grids(): a grid or item name is unknown or defined twice, a mapping lacks toCell / center, or a layer / preview material is not a three.js material or has nothing to draw on. Use a listed name, or the form in the message." },
|
|
362
366
|
'level-node': {
|
|
363
367
|
docs: ['recipes/10-blender-level.md', 'api/level.md'],
|
|
364
368
|
fix: 'A level node points at content that is not defined, clashes with another record, or is used before the level loaded. Define ' +
|
|
@@ -374,7 +378,7 @@ export const ERROR_CODES = {
|
|
|
374
378
|
fix: 'net() needs role \'host\' or \'client\' and a transport; reconnect() is for clients only.' },
|
|
375
379
|
'rigid-misuse': {
|
|
376
380
|
docs: ['recipes/11-vehicles.md', 'api/rigid.md'],
|
|
377
|
-
fix:
|
|
381
|
+
fix: "The message says which: an id already used by another body or vehicle (give each its own id); joints lost when newGame / a load rebuilt the physics world (re-create them in a rigid:rebuilt listener, recipe 11 section 3 \"Joints\"); rigid.ragdoll() got something it cannot drive (a skinned character out of its vehicle, with the bones named when they cannot be read); or a moving body left the terrain colliders and froze (raise rigid({ terrainRing }) if it must keep moving there, recipe 11 section 3)." },
|
|
378
382
|
'settings-tab': {
|
|
379
383
|
docs: ['api/settings.md'],
|
|
380
384
|
fix: 'settings({ tabs }) names a built-in tab that does not exist. Use a listed built-in name, or define your own section.' },
|
|
@@ -386,44 +390,44 @@ export const ERROR_CODES = {
|
|
|
386
390
|
fix: 'A calendar option, season name or scenario season is wrong (day length not > 0, a season list entry without name / days, a season the ' +
|
|
387
391
|
'calendar does not have). Day, time, seasons and hours per day are calendar({...}) options; sky({ time }) is only the fixed time drawn without a calendar.' },
|
|
388
392
|
'sky-option': {
|
|
389
|
-
docs: ['recipes/08-weather-sky.md', '
|
|
390
|
-
fix: 'A sky
|
|
391
|
-
'engine.
|
|
393
|
+
docs: ['recipes/08-weather-sky.md', 'api/sky.md'],
|
|
394
|
+
fix: 'A sky or clouds option has a wrong value (day length, days and seasons are calendar() options). Own GLSL goes through ' +
|
|
395
|
+
'engine.sky.clouds() and engine.sky.layer(), not an option key. The message lists the accepted values.' },
|
|
392
396
|
'terrain-chunk-failed': {
|
|
393
397
|
docs: ['recipes/28-terrain.md', 'api/terrain.md'],
|
|
394
398
|
fix: 'A terrain chunk failed on every try and stays empty (no ground, no collision there). Usually the height / groundType / placement rule ' +
|
|
395
399
|
'throws at that spot: fix what it reads, then engine.terrain.retry() sends the failed chunks again (terrain:chunkFailed names each one).' },
|
|
396
400
|
'terrain-option': {
|
|
397
|
-
docs: ['recipes/28-terrain.md', '
|
|
401
|
+
docs: ['recipes/28-terrain.md', 'api/terrain.md'],
|
|
398
402
|
fix: 'A terrain option or terrain edit is wrong (shape mask missing, a brush number not a number, an unknown paint). Use the form ' +
|
|
399
403
|
'in the message.' },
|
|
400
404
|
'vegetation-option': {
|
|
401
|
-
docs: ['api/vegetation.md', 'recipes/36-
|
|
405
|
+
docs: ['api/vegetation.md', 'recipes/36-ground-plants.md'],
|
|
402
406
|
fix: 'A vegetation option is wrong: positions entries, densityMap form, fade range or a model with several materials. Fix the ' +
|
|
403
407
|
'entry the message points at.' },
|
|
404
408
|
'water-option': {
|
|
405
|
-
docs: ['api/water.md', 'recipes/44-water-weather-
|
|
406
|
-
fix: 'A water option is wrong; own GLSL goes through
|
|
409
|
+
docs: ['api/water.md', 'recipes/44-water-weather-hooks.md'],
|
|
410
|
+
fix: 'A water option is wrong; own GLSL goes through engine.water.shader({ wave, surface }) and must define the function the message names.' },
|
|
407
411
|
'weather-option': {
|
|
408
|
-
docs: ['api/weather.md', 'recipes/44-water-weather-
|
|
409
|
-
fix:
|
|
412
|
+
docs: ['api/weather.md', 'recipes/44-water-weather-hooks.md'],
|
|
413
|
+
fix: "A weather type, field, pool, particle definition or weather.set argument is wrong. The message lists the defined types and the accepted forms." },
|
|
410
414
|
'world-option': {
|
|
411
415
|
docs: ['recipes/18-world.md', 'api/world.md'],
|
|
412
416
|
fix: 'A world option is wrong (an anchor shape, a simulate channel that is not a time channel). Use the form in the message.' },
|
|
413
417
|
'material-option': {
|
|
414
|
-
docs: ['recipes/
|
|
418
|
+
docs: ['recipes/09-materials-lights-models.md', 'recipes/43-shader-patches-surfaces.md'],
|
|
415
419
|
fix: 'A material / surface / detail / lighting spec is wrong: an unknown type, texture slot or setting, or GLSL that does not define ' +
|
|
416
420
|
'the function the slot expects. The message names the key and the accepted values.' },
|
|
417
421
|
'post-effect': {
|
|
418
|
-
docs: ['api/post.md', 'recipes/52-
|
|
419
|
-
fix: 'A post effect is malformed or clashes:
|
|
420
|
-
'with a unique name and a known slot. Change an existing effect with
|
|
422
|
+
docs: ['api/post.md', 'recipes/52-around-the-picture.md'],
|
|
423
|
+
fix: 'A post effect is malformed or clashes: engine.post.add takes a three.js Pass, a node function (WebGPU) or { name, create | node | fuse }, ' +
|
|
424
|
+
'with a unique name and a known slot. Change an existing effect with its handle (engine.post.get(name).set(params), .enabled); add one with engine.post.add (the one way).' },
|
|
421
425
|
'own-frame': {
|
|
422
|
-
docs: ['THREE.md', 'recipes/52-
|
|
426
|
+
docs: ['THREE.md', 'recipes/52-around-the-picture.md'],
|
|
423
427
|
fix: 'The game draws the canvas itself (its own composer.render() / renderer.render outside engine.onRender), so the engine yielded ' +
|
|
424
|
-
'the frame. Intended: nothing to do. To get the engine frame back delete your render call; to add a pass to it use engine.
|
|
428
|
+
'the frame. Intended: nothing to do. To get the engine frame back delete your render call; to add a pass to it use engine.post.add(pass).' },
|
|
425
429
|
'shader-patch': {
|
|
426
|
-
docs: ['recipes/43-shader-patches-
|
|
430
|
+
docs: ['recipes/43-shader-patches-surfaces.md'],
|
|
427
431
|
fix: 'A shader patch is malformed: glsl goes with a slot name (a string per slot), raw anchors use vertex / fragment, and the ' +
|
|
428
432
|
'material must provide what the patch needs. The message lists the slot names.' },
|
|
429
433
|
'renderer-backend': {
|
|
@@ -435,13 +439,8 @@ export const ERROR_CODES = {
|
|
|
435
439
|
fix: 'A UI part, theme or toast call is wrong (an unknown part or verb, a value of the wrong type, the engine not passed first). ' +
|
|
436
440
|
'The message lists the defined parts and the accepted forms.' },
|
|
437
441
|
'module-needs': {
|
|
438
|
-
docs: ['recipes/14-custom-module.md', 'api/engine.md'],
|
|
439
|
-
fix:
|
|
440
|
-
'rigid bodies need engine.start() first). Install the module named in the message, or call after engine:ready.' },
|
|
441
|
-
'load-failed': {
|
|
442
|
-
docs: ['api/assets.md', 'recipes/05-props-bake.md'],
|
|
443
|
-
fix: 'A file the engine loads on the side (a particle texture, a generated vegetation model, an ambience sound, a level) failed; ' +
|
|
444
|
-
'the engine fell back (round dot, no model, silence). Check the path named in the message.' },
|
|
442
|
+
docs: ['recipes/14-custom-module.md', 'recipes/18-world.md', 'api/engine.md'],
|
|
443
|
+
fix: "A call needs a module that is not installed or not ready yet (the data of NPCs, props and pickups lives in world(), pickups need interactions(), timeline say needs dialogue(), rigid bodies need engine.start() first). Install the module named in the message before the one that needs it (openWorld() already includes world()), or call after engine:ready." },
|
|
445
444
|
'tween-property': {
|
|
446
445
|
docs: ['api/timeline.md'],
|
|
447
446
|
fix: 'A tween names a property path that does not exist or is not a number / color / vector. Check the path (a.b.c) against the object.' },
|
|
@@ -459,7 +458,6 @@ export const ERROR_CODES = {
|
|
|
459
458
|
'grid-orphan': {
|
|
460
459
|
docs: ['recipes/29-grid.md', 'api/grids.md'],
|
|
461
460
|
fix: 'A placed record names an item the content no longer defines, so it has no size and takes no cells; the record is kept. Define the item again, or remove the record with grid.remove.' },
|
|
462
|
-
// ---- classes that were patterns in errorHints.js: the engine raises these messages itself, now tagged with the code ----
|
|
463
461
|
'module-requires': {
|
|
464
462
|
docs: ['recipes/14-custom-module.md', 'api/engine.md'],
|
|
465
463
|
fix: "A module requires a capability ('world', 'inventory') no installed module provides yet. Install the engine's part of that name first (engine.use(world(), mine())), or your own module with provides: ['<name>'] (a typo is suggested in the message)." },
|
|
@@ -474,10 +472,10 @@ export const ERROR_CODES = {
|
|
|
474
472
|
fix: 'before / after constraints of two or more modules point at each other. Remove one of them or give a module a different stage.' },
|
|
475
473
|
'module-type': {
|
|
476
474
|
docs: ['recipes/14-custom-module.md'],
|
|
477
|
-
fix: "
|
|
475
|
+
fix: "A module's type names what it owns: 'rules' (game logic, the default), 'world' | 'picture' | 'actor' | 'ui' | 'net' | 'tool' (core/engine/moduleTypes.js). This one is not a type: a typo?" },
|
|
478
476
|
'module-type-rule': {
|
|
479
477
|
docs: ['recipes/14-custom-module.md'],
|
|
480
|
-
fix: 'A module did something its type does not own (a
|
|
478
|
+
fix: 'A warning, the call went through: a module did something its type does not usually own (a picture module defining an op or writing world records, a ui module binding keys or registering a save part). Move that part into a module of the right type, or change the type, as the message says, or leave it if the game means it.' },
|
|
481
479
|
'module-stage': {
|
|
482
480
|
docs: ['recipes/14-custom-module.md'],
|
|
483
481
|
fix: 'Modules sort by stage (+ before / after), not by number. Use one of the listed stage names.' },
|
|
@@ -485,59 +483,36 @@ export const ERROR_CODES = {
|
|
|
485
483
|
docs: ['recipes/14-custom-module.md'],
|
|
486
484
|
fix: 'The module name becomes engine.<name>; it must not be an existing engine property or another module name.' },
|
|
487
485
|
'module-handle': {
|
|
488
|
-
docs: ['recipes/14-custom-module.md'],
|
|
489
|
-
fix:
|
|
490
|
-
'A handle tracked after its module was unloaded (an async init resuming after replaces / unload) is removed at once: check what the init does after its await.' },
|
|
486
|
+
docs: ['recipes/14-custom-module.md', 'api/engine.md'],
|
|
487
|
+
fix: "ctx.track(handle) (the ctx install / init receive) and engine.session.track(handle) take something with remove(), such as the result of events.on / onFixed / clock.after. A handle tracked after its module was unloaded (an async init resuming after replaces / unload) is removed at once: check what the init does after its await." },
|
|
491
488
|
'module-called': {
|
|
492
489
|
docs: ['recipes/01-new-game.md', 'api/engine.md'],
|
|
493
490
|
fix: 'engine.use() takes the module object: write engine.use(sky()), not engine.use(sky).' },
|
|
494
491
|
'describe-name': {
|
|
495
492
|
docs: ['recipes/16-dev-bridge.md', 'api/engine.md'],
|
|
496
493
|
fix: 'describe.add names share one namespace with the standard fields and module names. Pick a unique name.' },
|
|
497
|
-
// (registered after the fact: these were raised before they had an entry, so err.fix was null; tests/errorCodeScan.mjs now fails on that)
|
|
498
|
-
'options-object': {
|
|
499
|
-
docs: ['CONVENTIONS.md', 'api/engine.md'],
|
|
500
|
-
fix: 'A position is one argument: a Vector3, [x, y, z] or { x, z } (a horizontal position needs finite x and z). The old (x, z) ' +
|
|
501
|
-
'number form and a 2-element [x, z] array do not work; pass { x, z }.' },
|
|
502
494
|
'input-keys': {
|
|
503
495
|
docs: ['recipes/01-new-game.md', 'api/input.md'],
|
|
504
|
-
fix: 'The engine binds no gameplay key on its own and modules take no keys option: bind the action the module declares, '
|
|
505
|
-
"createEngine({ bindings: { ...presets.bindings.<name> } }) or engine.input.bind('<action>', ['KeyX']); [] = deliberately no key." },
|
|
506
|
-
'bad-arg': {
|
|
507
|
-
docs: ['api/characters.md', 'recipes/32-action-game.md'],
|
|
508
|
-
fix: 'characters.support(object, opts): object is a three.js Object3D with meshes to stand on, carry is one of the listed modes and ' +
|
|
509
|
-
'each support id is unique. Fix the argument the message names.' },
|
|
510
|
-
'npc-option': {
|
|
511
|
-
docs: ['recipes/02-npc.md', 'api/characters.md'],
|
|
512
|
-
fix: "An NPC's interact option is { op: 'name', args?, ... } (an op the player runs on it) or null for none. Fix the value the " +
|
|
513
|
-
'message shows.' },
|
|
496
|
+
fix: "Keys are names like 'KeyE', 'Space', 'PadA', 'Mouse0'. The engine binds no gameplay key on its own and modules take no keys option: bind the action the module declares, createEngine({ bindings: { ...presets.bindings.<name> } }) or engine.input.bind('<action>', ['KeyX']); [] = deliberately no key." },
|
|
514
497
|
'interaction-option': {
|
|
515
498
|
docs: ['api/interactions.md', 'recipes/03-items-pickups.md'],
|
|
516
|
-
fix:
|
|
517
|
-
'anywhere). Fix the option the message names.' },
|
|
499
|
+
fix: "interactions.add(): hold is seconds the key stays down (a number >= 0), radius is meters > 0 (Infinity = from anywhere), counter is a HUD counter name, and a once item needs its own stable id or mesh.name. Fix the option the message names." },
|
|
518
500
|
'hud-option': {
|
|
519
501
|
docs: ['api/hud.md', 'recipes/26-ui-parts.md'],
|
|
520
|
-
fix:
|
|
521
|
-
'the option the message names.' },
|
|
502
|
+
fix: "A hud element option is wrong: anchor is one of the listed corners / edges, a counter value is a number or text, and hud.bump needs a counter that shows a number. Fix the option the message names." },
|
|
522
503
|
'describe-threw': {
|
|
523
504
|
docs: ['recipes/14-custom-module.md', 'api/engine.md'],
|
|
524
505
|
fix: "A module's describe(e, ctx) hook threw; describe() put { error, code } under that module's name and kept the rest. Fix the " +
|
|
525
506
|
'hook named in the message (it must return plain data or nothing).' },
|
|
526
|
-
'world-missing': {
|
|
527
|
-
docs: ['recipes/18-world.md', 'api/world.md'],
|
|
528
|
-
fix: 'The feature stores its data in engine.world, but the world() module is not installed or comes after it. engine.use(world(), ...) first; the openWorld() preset already includes it.' },
|
|
529
507
|
'world-plain': {
|
|
530
508
|
docs: ['recipes/18-world.md', 'api/world.md'],
|
|
531
|
-
fix:
|
|
532
|
-
'pickup-prop-id': {
|
|
533
|
-
docs: ['recipes/03-items-pickups.md', 'api/inventory.md'],
|
|
534
|
-
fix: 'A pickup / prop id collides with other data. Use distinct ids; stable ids are what saves match on.' },
|
|
509
|
+
fix: "A saved record holds a three.js object, function or class instance. World data must be JSON-like (it is saved and may go to a worker): write { x, y, z } for a vector. A model: world.present('crate', { build: rec => mesh }), then world.view(id) gets it. Nothing to save: world.add(rec, { save: false }) may hold anything." },
|
|
535
510
|
'pickup-misuse': {
|
|
536
511
|
docs: ['recipes/03-items-pickups.md', 'api/inventory.md'],
|
|
537
|
-
fix:
|
|
512
|
+
fix: "pickups.spawn() got a wrong value (give is an item id, which needs inventory(), or a function (e, { actor }) => result; radius is a positive number), or engine.pickups.material got something that is not a three.js material." },
|
|
538
513
|
'world-id': {
|
|
539
|
-
docs: ['recipes/18-world.md', 'api/world.md'],
|
|
540
|
-
fix:
|
|
514
|
+
docs: ['recipes/18-world.md', 'api/world.md', 'recipes/03-items-pickups.md'],
|
|
515
|
+
fix: "Two things claim one id: every world record (props, pickups, NPCs, template instances) shares one id space. Omit id to auto-number, give each its own id, or use world.set(id, patch) to update the existing record." },
|
|
541
516
|
'world-record': {
|
|
542
517
|
docs: ['recipes/18-world.md', 'api/world.md'],
|
|
543
518
|
fix: 'The id was never added, was removed, or is misspelled. world.query({ kind }) lists what exists.' },
|
|
@@ -549,7 +524,10 @@ export const ERROR_CODES = {
|
|
|
549
524
|
fix: 'present(kind, { build }) must return a three.js object (or use show: rec => false to hide). Errors inside build also land here.' },
|
|
550
525
|
'bad-position': {
|
|
551
526
|
docs: ['CONVENTIONS.md', 'api/world.md'],
|
|
552
|
-
fix:
|
|
527
|
+
fix: "A position was NaN, out of range or the wrong shape: a Vector3 used like an array (v[0]), a missing field, a division by zero upstream, or the old (x, z) number form. A position is one argument: a Vector3, [x, y, z] or { x, z }; a 2-element [x, z] array does not work." },
|
|
528
|
+
'state-value': {
|
|
529
|
+
docs: ['recipes/16-dev-bridge.md'],
|
|
530
|
+
fix: 'applyState got a value it cannot use: the message names the key and the accepted forms. Nothing was applied.' },
|
|
553
531
|
'content-place': {
|
|
554
532
|
docs: ['recipes/20-content-actions-save.md', 'api/content.md'],
|
|
555
533
|
fix: 'content.load references a place that has no coordinates, or needs world() for props / pickups. Give the place in content.load({ places }) or add the marker to the level.' },
|
|
@@ -567,22 +545,34 @@ export const ERROR_CODES = {
|
|
|
567
545
|
fix: 'A name (action, item, asset, weather, text key, ...) was never registered or has a typo. The message lists the registered names.' },
|
|
568
546
|
'event-typo': {
|
|
569
547
|
docs: ['api/events.md'],
|
|
570
|
-
fix:
|
|
548
|
+
fix: "This event name is one letter or so from an engine event, and nothing emits it. Use the suggested name; if this really is a new event of your own, ignore the warning." },
|
|
571
549
|
'owned-prop': {
|
|
572
|
-
docs: ['recipes/52-
|
|
550
|
+
docs: ['recipes/52-around-the-picture.md', 'THREE.md'],
|
|
573
551
|
fix: 'The engine wrote this value on its own (sky, camera, fog distance ...); your direct write took it over, so the engine no longer changes it. Intended: say so with the manual() call in the message. Not intended: give it back with manual(key, false) and adjust it with set(...).' },
|
|
552
|
+
'picture-held': {
|
|
553
|
+
docs: ['recipes/62-picture-code.md'],
|
|
554
|
+
fix: 'A picture value is held by a part (provides) and other code wrote it, so one of the two never reaches the screen. Delete the stray write; or swap the holder with engine.use(mine(), { replaces: slot }); or, when both need a say, make it a shared value the holder reads (recipes/62-picture-code.md "Picture parts").' },
|
|
555
|
+
'picture-leftover': {
|
|
556
|
+
docs: ['recipes/62-picture-code.md'],
|
|
557
|
+
fix: "A picture part was removed and what it added stayed. In its install, hand each thing to ctx.track({ remove() { ... } }) (or undo it in dispose), so it goes with the part (recipes/62-picture-code.md \"Picture parts\")." },
|
|
558
|
+
'module-unuse': {
|
|
559
|
+
docs: ['recipes/14-custom-module.md'],
|
|
560
|
+
fix: "engine.unuse(name): the module must be installed, and no other module may still require it or a slot only it provides. Unload the dependent first, or swap the provider with engine.use(mine(), { replaces: 'slot' })." },
|
|
561
|
+
'picture-conflict': {
|
|
562
|
+
docs: ['recipes/62-picture-code.md'],
|
|
563
|
+
fix: 'Two places change this picture value inside one frame, so the earlier write never shows. Pick the one that owns the value and delete the other, or turn the second into a signal the owner reads (recipes/62-picture-code.md "Wiring picture/ parts"). Both lines are in the message.' },
|
|
574
564
|
'camera-kind': {
|
|
575
565
|
docs: ['recipes/21-camera.md', 'api/cameraRig.md'],
|
|
576
566
|
fix: 'setCamera() got an unknown camera kind. Use one of the listed kinds; for a camera of your own, take it with engine.takeCamera(owner) and place engine.camera yourself (recipes/21-camera.md).' },
|
|
577
567
|
'camera-none': {
|
|
578
568
|
docs: ['recipes/21-camera.md', 'api/cameraRig.md'],
|
|
579
|
-
fix: 'setCamera() switches between camera kinds once a camera module is installed. Install one first: engine.use(fixedCamera({ position, lookAt })) (or followCamera / firstPersonCamera / rtsCamera)
|
|
569
|
+
fix: 'setCamera() switches between camera kinds once a camera module is installed. Install one first: engine.use(fixedCamera({ position, lookAt })) (or followCamera / firstPersonCamera / rtsCamera), or name one: openWorld({ camera: \'follow\' }).' },
|
|
580
570
|
'movement': {
|
|
581
571
|
docs: ['api/characters.md', 'api/engine.md'],
|
|
582
|
-
fix:
|
|
572
|
+
fix: "createEngine({ movement }): every movement value is a number > 0. A typo in a name gives undefined; the message names the key." },
|
|
583
573
|
'commit-fallback': {
|
|
584
574
|
docs: ['api/jobs.md'],
|
|
585
|
-
fix:
|
|
575
|
+
fix: "commits.request() needs fallback: () => result. Async results apply at fixed steps; when a result is late, the fallback computes it on the main thread, so the outcome never depends on machine speed." },
|
|
586
576
|
'asset-critical': {
|
|
587
577
|
docs: ['recipes/05-props-bake.md', 'api/assets.md'],
|
|
588
578
|
fix: 'An asset marked critical: true in the manifest (or an engine.loading.track step) failed, so start() stopped instead of starting a broken game. The line names the file, HTTP status and manifest. Fix the path or the file; if the game can run without it, drop critical so it falls back. engine.loading.list({ phase: "failed" }) or threedog loading shows every failure.' },
|
|
@@ -592,9 +582,16 @@ export const ERROR_CODES = {
|
|
|
592
582
|
'asset-not-loaded': {
|
|
593
583
|
docs: ['api/assets.md', 'recipes/05-props-bake.md'],
|
|
594
584
|
fix: 'assets.modelNow only hands out a model something already loaded; it never starts a load. A code-built model loads too (built, or read from the bake cache). Write `modelNow(name) ?? await model(name)`, or mark it preload: true and await assets.preload() before the code that must not wait.' },
|
|
585
|
+
'asset-lod': {
|
|
586
|
+
docs: ['recipes/15-perf.md', 'api/assets.md'],
|
|
587
|
+
fix: 'assets.lod and a prop\'s lod need level files from `threedog assets optimize --lod` (skipped models say why in its report), distances as rising meters, and levels made from the same version of the model. A LOD object is never batched, so for many copies of a light model drop lod and let engine.batching draw them.',
|
|
588
|
+
},
|
|
589
|
+
'asset-fallback-cycle': {
|
|
590
|
+
docs: ['api/assets.md'],
|
|
591
|
+
fix: 'Entries name each other as fallback (A falls back to B, B back to A), so a failed load would wait on itself forever. The line lists the chain. Give one of them no fallback, or point it at a file that loads.' },
|
|
595
592
|
'asset-load': {
|
|
596
593
|
docs: ['api/assets.md', 'recipes/05-props-bake.md'],
|
|
597
|
-
fix:
|
|
594
|
+
fix: "Read the reason in the message first. \"called before the backend is initialized\" means the load ran before engine.start() finished: await engine.start() first, or register the file in a manifest. Otherwise the file was not found (404) or is not valid. Check the path (files under public/ are served from /), the extension, and the case of the name. A file that is not critical falls back (a registered fallback, a stand-in texture, silence) and the game runs on; engine.loading.get(name) has the details." },
|
|
598
595
|
'audio-unsupported': {
|
|
599
596
|
docs: ['api/audio.md'],
|
|
600
597
|
fix: 'No AudioContext in this browser / test environment. Guard calls with typeof AudioContext, or skip audio in headless tests.' },
|
|
@@ -611,14 +608,32 @@ export const ERROR_CODES = {
|
|
|
611
608
|
docs: ['api/engine.md'],
|
|
612
609
|
fix: 'engine.dispose() takes nothing or { keepContext: true }.' },
|
|
613
610
|
'tsl-misuse': {
|
|
614
|
-
docs: ['recipes/43-shader-patches-
|
|
615
|
-
fix:
|
|
611
|
+
docs: ['recipes/43-shader-patches-surfaces.md'],
|
|
612
|
+
fix: "A threedog/tsl function cannot work here; the message says why. Usually: pass the engine, draw with the engine renderer, on a Mesh or InstancedMesh." },
|
|
616
613
|
'webgpu-needs-tsl': {
|
|
617
614
|
docs: ['recipes/56-webgpu-tsl.md'],
|
|
618
615
|
fix: "On WebGPURenderer the engine draws with node materials. Either threedog/tsl is not loaded (add import 'threedog/tsl' at the top of the entry), " +
|
|
619
616
|
'or a part is written only as GLSL text: give it a tsl form too (a patch: tsl next to glsl; sky / fog hooks: { glsl, tsl }; a weather glsl spec: ' +
|
|
620
617
|
'create(engine) returning your own node-material object). The message names the part.' },
|
|
618
|
+
'swarm-full': {
|
|
619
|
+
docs: ['recipes/65-swarm.md'],
|
|
620
|
+
fix: 'The swarm holds capacity objects and spawn returned -1, so that object does not exist. Raise capacity in engine.swarm({ capacity }), or remove objects sooner; describe().swarm.<name>.dropped counts the refused spawns.' },
|
|
621
|
+
'swarm-handle': {
|
|
622
|
+
docs: ['recipes/65-swarm.md'],
|
|
623
|
+
fix: 'free takes a handle, not a row: rows move when objects are removed. Inside onStep or near pass d.id[i]; to remove the object onStep is on, return false.' },
|
|
624
|
+
'swarm-step': {
|
|
625
|
+
docs: ['recipes/65-swarm.md'],
|
|
626
|
+
fix: "swarm.onStep(fn) sets the one function that runs every fixed step: pass a function, once at setup, not from onFixed. Do several jobs in one function, or h.remove() the old one first." },
|
|
627
|
+
'swarm-field': {
|
|
628
|
+
docs: ['recipes/65-swarm.md'],
|
|
629
|
+
fix: 'spawn() was given a name that is no column. Columns are x, y, z, the names in engine.swarm({ fields }), and with { color: true } r, g, b and the spawn key color.' },
|
|
630
|
+
'swarm-name': {
|
|
631
|
+
docs: ['recipes/65-swarm.md'],
|
|
632
|
+
fix: 'Swarm names are unique: they are the keys in describe() and in saves. Pick another name, or dispose() the old swarm first.' },
|
|
633
|
+
'swarm-disposed': {
|
|
634
|
+
docs: ['recipes/65-swarm.md'],
|
|
635
|
+
fix: 'This swarm was disposed. Make a new one with engine.swarm(options), or keep it and call clear() to empty it.' },
|
|
621
636
|
'module-disabled': {
|
|
622
637
|
docs: ['recipes/14-custom-module.md'],
|
|
623
|
-
fix: 'A
|
|
638
|
+
fix: 'A picture or ui module (particles, sky, music, a panel...) threw and was switched off; the game keeps running without it. The error printed with it is the real cause.' },
|
|
624
639
|
};
|