threedog 0.7.0 → 1.0.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 +411 -1
- package/README.md +8 -11
- package/core/{Animator.js → assets/Animator.js} +30 -18
- package/core/{Assets.js → assets/Assets.js} +131 -56
- package/core/{Baked.js → assets/Baked.js} +4 -4
- package/core/assets/assetEntry.js +302 -0
- package/core/{assetHot.js → assets/assetHot.js} +9 -7
- package/core/{assetLoad.js → assets/assetLoad.js} +55 -16
- package/core/assets/assetLod.js +113 -0
- package/core/{assetManifest.js → assets/assetManifest.js} +19 -11
- package/core/{assetReport.js → assets/assetReport.js} +7 -14
- package/core/{namedModel.js → assets/namedModel.js} +17 -13
- package/core/{Audio.js → audio/Audio.js} +47 -25
- 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} +15 -12
- package/core/{Random.js → base/Random.js} +7 -4
- package/core/{Vars.js → base/Vars.js} +14 -4
- package/core/{easing.js → base/easing.js} +1 -1
- package/core/{errorCodes.js → base/errorCodes.js} +151 -125
- package/core/{errorHints.js → base/errorHints.js} +17 -10
- package/core/{errors.js → base/errors.js} +12 -10
- package/core/{events.generated.js → base/events.generated.js} +11 -0
- package/core/base/follows.js +26 -0
- package/core/base/math.js +66 -0
- package/core/{params.js → base/params.js} +5 -6
- package/core/base/saveValues.js +81 -0
- package/core/base/sections.js +97 -0
- package/core/base/spelling.js +32 -0
- package/core/base/util.js +32 -0
- package/core/{validate.js → base/validate.js} +34 -34
- package/core/{Engine.js → engine/Engine.js} +137 -91
- package/core/{Loading.js → engine/Loading.js} +34 -5
- package/core/{copies.js → engine/copies.js} +4 -4
- package/core/{headlessLoad.js → engine/headlessLoad.js} +32 -15
- package/core/{lifecycle.js → engine/lifecycle.js} +41 -34
- package/core/{loop.js → engine/loop.js} +88 -49
- package/core/engine/moduleSlots.js +176 -0
- package/core/{moduleTypes.js → engine/moduleTypes.js} +26 -14
- package/core/engine/modules.js +503 -0
- package/core/{page.js → engine/page.js} +59 -29
- package/core/{plugins.js → engine/plugins.js} +21 -12
- package/core/{services.js → engine/services.js} +50 -40
- package/core/{startup.js → engine/startup.js} +66 -54
- package/core/{Input.js → input/Input.js} +67 -39
- package/core/{inputContext.js → input/inputContext.js} +14 -5
- package/core/input/inputKeyboard.js +39 -0
- package/core/{inputPad.js → input/inputPad.js} +24 -3
- package/core/{inputPointer.js → input/inputPointer.js} +11 -3
- package/core/input/inputSeat.js +66 -0
- package/core/{inputTouch.js → input/inputTouch.js} +24 -7
- package/core/{Budget.js → inspect/Budget.js} +21 -20
- package/core/{DebugOverrides.js → inspect/DebugOverrides.js} +43 -18
- package/core/{Describe.js → inspect/Describe.js} +34 -26
- package/core/{Inspect.js → inspect/Inspect.js} +39 -10
- package/core/{InspectMaterials.js → inspect/InspectMaterials.js} +7 -8
- package/core/{InspectPerf.js → inspect/InspectPerf.js} +19 -13
- package/core/{InspectScene.js → inspect/InspectScene.js} +8 -5
- package/core/{MaterialInfo.js → inspect/MaterialInfo.js} +3 -2
- package/core/{UrlState.js → inspect/UrlState.js} +60 -24
- package/core/{catalog.js → inspect/catalog.js} +15 -8
- package/core/{checks.js → inspect/checks.js} +7 -5
- package/core/{debugView.js → inspect/debugView.js} +4 -4
- package/core/{describeRender.js → inspect/describeRender.js} +24 -22
- package/core/{describeText.js → inspect/describeText.js} +17 -8
- package/core/inspect/geometryWatch.js +38 -0
- package/core/{lightWatch.js → inspect/lightWatch.js} +8 -8
- package/core/inspect/metadata.generated.js +4140 -0
- package/core/{pictureWriters.js → inspect/pictureWriters.js} +130 -47
- package/core/{shaderCost.js → inspect/shaderCost.js} +1 -1
- package/core/inspect/toolDoor.js +21 -0
- package/core/inspect/valueHistory.js +35 -0
- package/core/{Ops.js → ops/Ops.js} +44 -14
- package/core/{control.js → ops/control.js} +57 -31
- package/core/ops/holds.js +140 -0
- package/core/{opsAtomic.js → ops/opsAtomic.js} +18 -5
- package/core/{opsCheck.js → ops/opsCheck.js} +11 -10
- package/core/{opsFail.js → ops/opsFail.js} +5 -7
- package/core/{opsGuard.js → ops/opsGuard.js} +3 -3
- package/core/{opsRun.js → ops/opsRun.js} +9 -6
- package/core/{owned.js → ops/owned.js} +33 -19
- package/core/{sharedPoint.js → ops/sharedPoint.js} +13 -16
- package/core/{stackFrames.js → ops/stackFrames.js} +2 -2
- package/core/{stacks.js → ops/stacks.js} +34 -15
- package/core/{wrap.js → ops/wrap.js} +8 -6
- package/core/{SaveStore.js → saves/SaveStore.js} +53 -27
- package/core/{Saves.js → saves/Saves.js} +171 -54
- package/core/saves/saveApply.js +312 -0
- package/core/{saveFiles.js → saves/saveFiles.js} +45 -38
- package/core/{saveVersions.js → saves/saveVersions.js} +24 -23
- package/core/saves/session.js +231 -0
- package/core/saves/stateReplace.js +184 -0
- package/core/{Rays.js → scene/Rays.js} +44 -30
- package/core/{Views.js → scene/Views.js} +16 -8
- package/core/{adaptive.js → scene/adaptive.js} +19 -9
- package/core/{canvasBox.js → scene/canvasBox.js} +4 -3
- package/core/scene/compositeGround.js +72 -0
- package/core/scene/floor.js +17 -0
- package/core/{gameLights.js → scene/gameLights.js} +17 -7
- package/core/{grayMap.js → scene/grayMap.js} +8 -2
- package/core/{grid.js → scene/grid.js} +6 -4
- package/core/{gridLoad.js → scene/gridLoad.js} +1 -1
- package/core/scene/ground.contract.js +14 -0
- package/core/scene/ground.js +139 -0
- package/core/{movement.js → scene/movement.js} +3 -3
- package/core/{pictureSlots.js → scene/pictureSlots.js} +2 -2
- package/core/scene/pixel.js +154 -0
- package/core/scene/pixelRatio.js +167 -0
- package/core/{sceneDelta.js → scene/sceneDelta.js} +5 -5
- package/core/{sceneMethods.js → scene/sceneMethods.js} +43 -15
- package/core/scene/stepPoses.js +60 -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} +25 -16
- package/core/{things.js → scene/things.js} +18 -5
- package/core/{threePatches.js → scene/threePatches.js} +1 -1
- package/core/{tier.js → scene/tier.js} +10 -0
- package/core/scene/view.js +161 -0
- package/core/{Batching.js → stream/Batching.js} +85 -28
- package/core/{Stream.js → stream/Stream.js} +80 -38
- package/core/{batchGroups.js → stream/batchGroups.js} +11 -9
- package/core/{chunkStream.js → stream/chunkStream.js} +40 -0
- package/core/{scatter.js → stream/scatter.js} +7 -4
- package/core/{streamSources.js → stream/streamSources.js} +14 -8
- package/core/{Commits.js → threads/Commits.js} +17 -11
- package/core/{Jobs.js → threads/Jobs.js} +25 -13
- package/core/{Threads.js → threads/Threads.js} +21 -18
- 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} +20 -11
- package/core/{dayTime.js → time/dayTime.js} +5 -1
- package/core/{skip.js → time/skip.js} +28 -21
- package/core/{time.js → time/time.js} +32 -20
- package/core/{uiClock.js → time/uiClock.js} +4 -4
- package/docs/AI.md +92 -72
- package/docs/API.md +33 -28
- package/docs/CODEMAP.md +121 -200
- package/docs/COMMANDS.md +77 -70
- package/docs/CONVENTIONS.md +167 -24
- package/docs/MIGRATING-0.8.md +171 -0
- package/docs/MIGRATING-1.0.md +101 -0
- package/docs/THREE.md +140 -38
- package/docs/api/assets.md +12 -13
- package/docs/api/audio.md +6 -5
- package/docs/api/budget.md +4 -4
- package/docs/api/calendar.md +10 -11
- package/docs/api/cameraRig.md +32 -29
- package/docs/api/characters.md +35 -24
- package/docs/api/clock.md +1 -1
- package/docs/api/collider3d.md +9 -0
- package/docs/api/collision.md +12 -9
- package/docs/api/content.md +18 -17
- package/docs/api/dialogue.md +5 -4
- package/docs/api/engine.md +58 -54
- package/docs/api/events.md +17 -6
- package/docs/api/flow.md +1 -1
- package/docs/api/grids.md +1 -1
- package/docs/api/ground.md +6 -7
- package/docs/api/hud.md +2 -2
- package/docs/api/i18n.md +6 -6
- package/docs/api/input.md +9 -8
- package/docs/api/interactions.md +5 -5
- package/docs/api/inventory.md +10 -10
- package/docs/api/jobs.md +5 -5
- package/docs/api/level.md +10 -9
- package/docs/api/lightPool.md +1 -6
- package/docs/api/music.md +3 -3
- package/docs/api/nav.md +14 -12
- package/docs/api/openWorld.md +1 -1
- package/docs/api/particles.md +10 -7
- package/docs/api/photo.md +4 -2
- package/docs/api/pickups.md +3 -3
- package/docs/api/post.md +21 -5
- package/docs/api/quests.md +7 -5
- package/docs/api/rays.md +7 -7
- package/docs/api/rigid.md +29 -19
- package/docs/api/saves.md +13 -11
- package/docs/api/settings.md +9 -8
- package/docs/api/sky.md +8 -7
- package/docs/api/stream.md +8 -9
- package/docs/api/swarm.md +34 -0
- package/docs/api/terrain.md +6 -8
- package/docs/api/terrainDraw.md +2 -2
- package/docs/api/timeline.md +4 -4
- package/docs/api/tools.md +27 -22
- package/docs/api/triggers.md +2 -0
- package/docs/api/vars.md +1 -1
- package/docs/api/vegetation.md +4 -3
- package/docs/api/vegetationDraw.md +2 -2
- package/docs/api/water.md +7 -3
- package/docs/api/weather.md +27 -12
- package/docs/api/weatherDraw.md +4 -4
- package/docs/api/world.md +6 -6
- package/docs/recipes/01-new-game.md +28 -43
- package/docs/recipes/02-npc.md +21 -23
- package/docs/recipes/03-items-pickups.md +37 -53
- package/docs/recipes/04-quests.md +5 -4
- package/docs/recipes/05-props-bake.md +34 -44
- package/docs/recipes/06-clock-events.md +31 -22
- package/docs/recipes/07-flow-scenes-pause.md +30 -32
- package/docs/recipes/08-weather-sky.md +91 -37
- package/docs/recipes/09-materials-lights-models.md +25 -39
- package/docs/recipes/10-blender-level.md +22 -11
- package/docs/recipes/11-vehicles.md +44 -24
- package/docs/recipes/12-navmesh.md +60 -15
- package/docs/recipes/13-animation.md +70 -22
- package/docs/recipes/14-custom-module.md +33 -20
- package/docs/recipes/15-perf.md +51 -28
- package/docs/recipes/16-dev-bridge.md +39 -58
- package/docs/recipes/18-world.md +49 -28
- package/docs/recipes/19-shooting-picking.md +7 -4
- package/docs/recipes/20-content-actions-save.md +55 -40
- package/docs/recipes/21-camera.md +47 -25
- package/docs/recipes/22-shop-gold.md +21 -16
- package/docs/recipes/23-ops.md +28 -24
- package/docs/recipes/26-ui-parts.md +25 -14
- package/docs/recipes/27-net.md +3 -5
- package/docs/recipes/28-terrain.md +119 -23
- package/docs/recipes/29-grid.md +3 -3
- package/docs/recipes/30-templates.md +63 -30
- package/docs/recipes/31-audio.md +7 -7
- package/docs/recipes/32-action-game.md +21 -11
- package/docs/recipes/33-stream-sources.md +6 -3
- package/docs/recipes/34-environment-lighting.md +72 -25
- package/docs/recipes/35-picture-from-reference.md +20 -23
- package/docs/recipes/36-ground-plants.md +106 -0
- package/docs/recipes/40-scene.md +18 -21
- package/docs/recipes/43-shader-patches-surfaces.md +27 -48
- package/docs/recipes/44-water-weather-hooks.md +56 -50
- package/docs/recipes/45-cascaded-shadows.md +41 -20
- package/docs/recipes/46-blender-art-route.md +9 -10
- package/docs/recipes/49-game-module-contract.md +7 -6
- package/docs/recipes/50-own-renderer.md +3 -2
- package/docs/recipes/51-capability-catalog.md +14 -8
- package/docs/recipes/52-around-the-picture.md +56 -100
- package/docs/recipes/53-ground-up-close.md +61 -24
- package/docs/recipes/55-mods-time-wrap.md +17 -20
- package/docs/recipes/56-webgpu-tsl.md +28 -15
- package/docs/recipes/57-control.md +39 -12
- package/docs/recipes/58-input.md +15 -2
- package/docs/recipes/59-depth-post-effects.md +1 -1
- package/docs/recipes/60-judge-the-picture.md +30 -25
- package/docs/recipes/62-picture-code.md +129 -39
- package/docs/recipes/63-third-person-start.md +19 -5
- package/docs/recipes/64-particles.md +54 -5
- package/docs/recipes/65-swarm.md +140 -0
- package/docs/recipes/66-common-tasks.md +313 -0
- package/examples/action/.threedog/content-index.json +1 -1
- package/examples/action/GAMEMAP.md +5 -5
- package/examples/perf-island/.threedog/content-index.json +1 -0
- package/examples/{sheepisland → perf-island}/GAMEMAP.md +15 -14
- package/examples/{sheepisland → perf-island}/assets.js +1 -1
- package/examples/{sheepisland → perf-island}/main.js +8 -8
- package/examples/{sheepisland → perf-island}/models.js +1 -1
- package/examples/{sheepisland → perf-island}/params.js +1 -1
- package/examples/{sheepisland → perf-island}/picture/index.js +1 -1
- package/examples/{sheepisland → perf-island}/picture/palette.js +2 -2
- package/examples/{sheepisland → perf-island}/views.js +1 -1
- package/examples/plain-picture/GAMEMAP.md +4 -1
- package/examples/rc2d/GAMEMAP.md +4 -3
- package/examples/rc2d/main.js +1 -3
- package/examples/rc2d/rc2d.js +1 -1
- package/examples/styletest/.threedog/content-index.json +1 -1
- package/examples/styletest/GAMEMAP.md +6 -5
- package/examples/techniques/contact-shadows/contactShadows.js +1 -1
- package/examples/techniques/contact-shadows/main.js +1 -1
- package/examples/techniques/interior-light/main.js +1 -1
- package/examples/techniques/modular-building/README.md +7 -6
- package/examples/techniques/outlines-and-rim/picture/post.js +1 -1
- package/examples/techniques/procedural-animation/README.md +1 -1
- package/examples/webgpu-tsl/GAMEMAP.md +2 -1
- package/examples/world/.threedog/content-index.json +1 -1
- package/examples/world/GAMEMAP.md +9 -7
- package/examples/world/main.js +3 -3
- package/examples/world/picture/sky.js +1 -1
- package/index.d.ts +16 -12
- package/index.js +53 -32
- package/llms.txt +11 -14
- package/modules/ambience/Ambience.js +16 -11
- package/modules/calendar/Calendar.js +19 -19
- package/modules/calendar/index.js +18 -16
- package/modules/calendar/schedule.js +11 -6
- package/modules/calendar/seasons.js +7 -7
- package/modules/camera/FirstPersonCamera.js +5 -5
- package/modules/camera/FixedCamera.js +43 -30
- package/modules/camera/FollowCamera.js +24 -15
- package/modules/camera/RtsCamera.js +12 -11
- package/modules/camera/common.js +72 -37
- package/modules/camera/contract.js +1 -0
- package/modules/camera/pixelSnap.js +62 -0
- package/modules/characters/Character.js +166 -70
- package/modules/characters/NPC.js +84 -44
- package/modules/characters/assetModel.js +16 -12
- package/modules/characters/astar.js +48 -27
- package/modules/characters/behaviors.js +4 -5
- package/modules/characters/character.contract.js +21 -0
- package/modules/characters/contract.js +17 -3
- package/modules/characters/index.js +240 -226
- package/modules/characters/moveHelpers.js +88 -12
- package/modules/characters/mover.contract.js +14 -0
- package/modules/characters/movers/common.js +22 -18
- package/modules/characters/movers/manual.js +1 -1
- package/modules/characters/movers/rapier.js +18 -10
- package/modules/characters/movers/simple.js +26 -13
- package/modules/characters/movers/support.js +24 -13
- package/modules/characters/npcAvoid.js +19 -16
- package/modules/characters/npcSim.js +88 -32
- package/modules/characters/npcView.js +19 -11
- package/modules/characters/pathAsync.js +81 -29
- package/modules/characters/pathJob.js +38 -21
- package/modules/characters/pathWorker.js +1 -1
- package/modules/characters/player.js +120 -0
- package/modules/characters/playerStrings.js +2 -2
- package/modules/characters/proceduralRig.js +2 -2
- package/modules/characters/seat.js +56 -0
- package/modules/characters/useModel.js +3 -3
- package/modules/characters/vehicle.contract.js +8 -5
- package/modules/characters/walkTo.js +40 -33
- package/modules/collision/Collision.js +69 -45
- package/modules/collision/contract.js +15 -0
- package/modules/collision/grid.js +6 -1
- package/modules/content/explain.js +2 -3
- package/modules/content/fields.js +24 -3
- package/modules/content/ids.js +5 -3
- package/modules/content/index.js +132 -114
- package/modules/content/loader.js +117 -140
- package/modules/content/markers.js +25 -0
- package/modules/content/models.js +54 -17
- package/modules/content/packs.js +5 -4
- package/modules/content/parts.js +2 -2
- package/modules/content/places.js +36 -0
- package/modules/content/props.js +22 -17
- package/modules/content/rules.js +47 -61
- package/modules/content/stages.js +7 -7
- package/modules/content/templates.js +80 -49
- package/modules/content/words.js +47 -0
- package/modules/debug/DebugPanel.js +14 -45
- package/modules/flow/contract.js +2 -1
- package/modules/flow/index.js +30 -16
- package/modules/gameplay/Container.js +17 -13
- package/modules/gameplay/Containers.js +23 -6
- package/modules/gameplay/Dialogue.js +93 -34
- package/modules/gameplay/Interactions.js +93 -51
- package/modules/gameplay/Inventory.js +64 -22
- package/modules/gameplay/Quests.js +146 -30
- package/modules/gameplay/boxOps.js +8 -1
- package/modules/gameplay/dialogueBubbles.js +16 -12
- package/modules/gameplay/inventoryOps.js +11 -8
- package/modules/gameplay/pickups.js +63 -37
- package/modules/gameplay/questLog.js +4 -2
- package/modules/gameplay/questSave.js +9 -4
- package/modules/gameplay/quests.contract.js +1 -1
- package/modules/grid/Grid.js +2 -2
- package/modules/grid/Layer.js +12 -8
- package/modules/grid/index.js +28 -23
- package/modules/grid/ops.js +43 -46
- package/modules/grid/preview.js +7 -7
- package/modules/grid/tiles.js +6 -6
- package/modules/hlod/index.js +42 -57
- package/modules/hud/index.js +22 -14
- package/modules/hud/parts.js +8 -8
- package/modules/level/contract.js +16 -0
- package/modules/level/heightfield.js +29 -31
- package/modules/level/index.js +113 -161
- package/modules/level/load.js +196 -0
- package/modules/level/meshes.js +65 -0
- package/modules/level/nodes.js +40 -23
- package/modules/lights/index.js +33 -183
- package/modules/lights/slots.js +93 -0
- package/modules/lights/sources.js +90 -0
- package/modules/music/Music.js +34 -28
- package/modules/music/rules.js +1 -1
- package/modules/nav/contract.js +16 -0
- package/modules/nav/index.js +180 -49
- package/modules/nav/navPath.js +45 -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 +6 -5
- package/modules/net/sync.js +2 -2
- package/modules/net/transports.js +2 -2
- package/modules/particles/Particles.js +95 -29
- package/modules/particles/effect.js +86 -32
- package/modules/particles/shaders.js +19 -1
- package/modules/photo/Photo.js +23 -23
- package/modules/rigid/RigidBodies.js +255 -89
- package/modules/rigid/Vehicles.js +17 -8
- package/modules/rigid/collider3d.contract.js +26 -0
- package/modules/rigid/ragdoll.js +298 -0
- package/modules/rigid/ragdollBones.js +209 -0
- package/modules/rigid/refresh.js +10 -0
- package/modules/rigid/sync.js +51 -20
- package/modules/settings/Settings.js +177 -61
- package/modules/settings/apply.js +20 -13
- package/modules/settings/sections.js +19 -14
- package/modules/settings/strings.js +2 -2
- package/modules/settings/view.js +3 -3
- package/modules/sky/Sky.js +29 -22
- package/modules/sky/clouds.js +7 -7
- package/modules/sky/dome.js +33 -20
- package/modules/sky/domeLayers.js +9 -9
- package/modules/sky/environment.js +6 -6
- package/modules/sky/frame.js +19 -10
- package/modules/sky/season.js +7 -1
- package/modules/sky/shader.js +24 -25
- package/modules/sky/skyModule.js +17 -28
- package/modules/sky/tint.js +1 -1
- package/modules/swarm/Swarm.js +356 -0
- package/modules/swarm/draw.js +68 -0
- package/modules/swarm/grid.js +63 -0
- package/modules/terrain/ChunkManager.js +71 -59
- package/modules/terrain/chunkQueries.js +7 -24
- package/modules/terrain/chunkWorker.js +1 -1
- package/modules/terrain/draw.js +14 -11
- package/modules/terrain/index.js +42 -42
- package/modules/terrain/terrainColorMap.js +6 -3
- package/modules/terrain/terrainDefaults.js +2 -1
- package/modules/terrain/terrainEdit.js +45 -29
- package/modules/terrain/terrainGen.js +19 -12
- 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 +83 -43
- package/modules/timeline/Tween.js +25 -19
- package/modules/timeline/shots.js +24 -17
- package/modules/triggers/index.js +95 -28
- package/modules/vegetation/Vegetation.js +34 -26
- package/modules/vegetation/densityMap.js +4 -7
- package/modules/vegetation/draw.js +39 -18
- package/modules/vegetation/groundChunks.js +21 -38
- package/modules/vegetation/index.js +37 -12
- package/modules/vegetation/modelGeometry.js +3 -6
- package/modules/vegetation/nearFade.js +1 -1
- package/modules/water/Water.js +20 -16
- package/modules/water/surface.js +3 -3
- package/modules/weather/Weather.js +52 -40
- package/modules/weather/particles.js +8 -8
- package/modules/weather/weatherDraw.js +28 -23
- package/modules/world/World.js +28 -15
- package/modules/world/explain.js +1 -1
- package/modules/world/index.js +30 -17
- package/modules/world/persist.js +90 -27
- package/modules/world/pos.js +5 -5
- package/modules/world/records.js +37 -11
- package/modules/world/sim.js +78 -27
- package/modules/world/simFar.js +2 -2
- package/modules/world/state.js +43 -11
- package/modules/world/thingSource.js +20 -5
- package/modules/world/views.js +27 -14
- package/package.json +48 -7
- package/presets.js +1 -3
- package/render/PostFX.js +83 -53
- package/render/backend.js +31 -33
- package/render/cascades.js +17 -12
- package/render/cascades.tsl.js +5 -8
- package/render/daylight.js +20 -3
- package/render/detail.js +8 -7
- package/render/effects.js +28 -25
- package/render/fuse.js +3 -3
- package/render/fx/cloudShadow.tsl.js +3 -3
- package/render/fx/detail.tsl.js +1 -1
- package/render/fx/index.js +5 -10
- 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/particles.tsl.js +8 -6
- package/render/fx/patchNodes.tsl.js +5 -15
- package/render/fx/postWebGPU.tsl.js +30 -26
- package/render/fx/sky.tsl.js +15 -17
- package/render/fx/uniforms.tsl.js +4 -4
- package/render/fx/wind.tsl.js +1 -1
- package/render/fxNumbers.js +3 -0
- package/render/layers.js +2 -2
- package/render/lighting.js +5 -3
- package/render/lightmap.js +41 -21
- package/render/lights.js +6 -6
- package/render/lit.js +24 -0
- package/render/materials.js +8 -7
- package/render/mergeCommon.js +22 -0
- package/render/modeling.js +2 -2
- package/render/occlusion.js +62 -15
- package/render/ownFrame.js +4 -4
- package/render/patches.js +15 -15
- package/render/postWebGL.js +15 -12
- package/render/probes.js +41 -19
- 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/{core → render}/shadows.js +59 -13
- package/render/slots.js +7 -7
- package/render/terms.js +22 -24
- package/render/uniformDecl.js +1 -1
- package/types/core.d.ts +336 -202
- package/types/gameplay.d.ts +254 -130
- package/types/generated/core/{Audio.d.ts → audio/Audio.d.ts} +22 -7
- 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} +8 -16
- package/types/generated/core/{Random.d.ts → base/Random.d.ts} +4 -3
- package/types/generated/core/{page.d.ts → engine/page.d.ts} +8 -9
- package/types/generated/core/{Input.d.ts → input/Input.d.ts} +28 -10
- package/types/generated/core/input/inputSeat.d.ts +26 -0
- package/types/generated/core/{Budget.d.ts → inspect/Budget.d.ts} +36 -26
- package/types/generated/core/{DebugOverrides.d.ts → inspect/DebugOverrides.d.ts} +17 -3
- package/types/generated/core/{Ops.d.ts → ops/Ops.d.ts} +6 -4
- package/types/generated/core/{control.d.ts → ops/control.d.ts} +14 -10
- package/types/generated/core/{Saves.d.ts → saves/Saves.d.ts} +62 -18
- package/types/generated/core/{session.d.ts → saves/session.d.ts} +3 -2
- package/types/generated/core/{Rays.d.ts → scene/Rays.d.ts} +8 -27
- package/types/generated/core/{Views.d.ts → scene/Views.d.ts} +2 -2
- package/types/generated/core/{Batching.d.ts → stream/Batching.d.ts} +7 -7
- package/types/generated/core/{Stream.d.ts → stream/Stream.d.ts} +22 -18
- 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/Grid.d.ts +1 -0
- package/types/generated/modules/grid/Layer.d.ts +1 -1
- package/types/generated/modules/grid/index.d.ts +3 -3
- package/types/generated/modules/music/Music.d.ts +7 -5
- package/types/generated/modules/particles/Particles.d.ts +5 -4
- package/types/generated/modules/sky/Sky.d.ts +21 -10
- package/types/generated/modules/swarm/Swarm.d.ts +80 -0
- package/types/generated/modules/timeline/Timeline.d.ts +7 -5
- package/types/generated/modules/water/Water.d.ts +1 -0
- package/types/generated/modules/weather/Weather.d.ts +14 -16
- package/types/generated/modules/weather/weatherDraw.d.ts +3 -3
- package/types/generated/modules/world/World.d.ts +11 -7
- package/types/generated/render/PostFX.d.ts +21 -23
- package/types/generated/render/materials.d.ts +1 -0
- package/types/generated/render/occlusion.d.ts +9 -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 +47 -15
- package/types/physics.d.ts +150 -73
- package/types/pixel.d.ts +75 -0
- package/types/tsl.d.ts +37 -4
- package/types/world.d.ts +48 -75
- package/ui/Focus.js +10 -9
- package/ui/Parts.js +13 -5
- package/ui/UI.js +7 -7
- package/ui/defaults.js +3 -2
- package/ui/theme.js +7 -5
- package/core/assetEntry.js +0 -109
- package/core/engineCamera.js +0 -32
- package/core/ground.js +0 -104
- package/core/holds.js +0 -134
- package/core/math.js +0 -48
- package/core/moduleSlots.js +0 -100
- package/core/modules.js +0 -314
- package/core/saveApply.js +0 -210
- package/core/saveValues.js +0 -46
- package/core/session.js +0 -174
- package/core/shadowTypes.js +0 -16
- package/core/util.js +0 -17
- package/core/view.js +0 -43
- package/docs/MIGRATING-0.3.md +0 -248
- package/docs/MIGRATING-0.4.md +0 -320
- package/docs/MIGRATING-0.5.md +0 -68
- package/docs/MIGRATING-0.6.md +0 -126
- package/docs/PERF.md +0 -245
- package/docs/recipes/36-sky-ground-plants.md +0 -158
- package/docs/recipes/37-terrain-hooks.md +0 -115
- package/docs/recipes/38-environment-hooks.md +0 -67
- package/docs/recipes/42-terrain-shape.md +0 -64
- package/docs/recipes/47-island-snow-backdrop.md +0 -43
- package/docs/recipes/54-three-idioms.md +0 -88
- package/examples/plain-picture/FINDINGS.md +0 -53
- package/examples/sheepisland/.threedog/content-index.json +0 -1
- package/modules/camera/projection.js +0 -21
- /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/{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
- /package/examples/{sheepisland → perf-island}/content/templates.js +0 -0
- /package/examples/{sheepisland → perf-island}/content/vegetation.js +0 -0
- /package/examples/{sheepisland → perf-island}/picture/lights.js +0 -0
- /package/examples/{sheepisland → perf-island}/picture/materials.js +0 -0
- /package/examples/{sheepisland → perf-island}/picture/sky.js +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,416 @@
|
|
|
2
2
|
|
|
3
3
|
What changed in each version and how a game upgrades.
|
|
4
4
|
|
|
5
|
+
## Unreleased
|
|
6
|
+
|
|
7
|
+
- A request awaited inside a save load without its `turn` fails with `save-nested` after `engine.loading.timeoutMs` with no sign of life, and the load fails its normal way. It used to wait for good.
|
|
8
|
+
- `detach` is gone from the engine: write `obj.removeFromParent()`. `engine.remove` stays.
|
|
9
|
+
- A `turn` kept after its load ended no longer lets `content.load` jump the line: it waits behind the load before it, as `level.load` did.
|
|
10
|
+
- `applyState({ save })` and `{ play }` answer in `refused` when the load or the new game failed, so `threedog state` and a scenario stop there. The title stays open. They used to answer ok.
|
|
11
|
+
- An item's `use` that answers `{ ok: false, code }` or throws keeps the item: `inventory.use` is atomic, sends no `item:use`, and hands the failure to the caller. It used to spend the item and answer ok.
|
|
12
|
+
- `engine.i18n.locale` is read-only: `setLocale` is the one way to change the language. Writing it skipped the name lookup and `i18n:change`.
|
|
13
|
+
- A failed `content.load` no longer marks the pack's vegetation table for good: the same pack loaded again registers its plants.
|
|
14
|
+
- A pack that names an op nothing defines, loaded in a running game, leaves nothing behind. Its actions and quests used to stay, and the name then failed every later load.
|
|
15
|
+
- A world save holding a record faster than its time channel (`time.local` above 1) loads. Its debt mark goes below zero, and the load refused that as damage, the rollback of a failed load too.
|
|
16
|
+
- A tween whose write throws ends there and its promise rejects: `await engine.timeline.tween(...)` can now throw, and a `timeline.play` step with it ends `failed` and gives control and input back. It used to never answer. A tween nobody awaits is reported as an unhandled rejection, once.
|
|
17
|
+
- A cutscene writes a character or the camera only while it is the holder in charge. A path on a ragdoll or a seated rider, and a shot under a newer `takeCamera` or a newer run, keep their time and write nothing; back in charge they write where their clock is.
|
|
18
|
+
- The default physics floor follows the ground: a level installed while running takes it away, and a ground source that leaves brings it back. Terrain chunks and trunks leave with their ground source too. `ops.undo` of a failed run answers `nothingToUndo` instead of throwing.
|
|
19
|
+
- A solid prop is in a new `collision` or `collider3d` on the line after `engine.use`. It used to come back on the next frame.
|
|
20
|
+
- A save part's `load(data, turn)` and a module's `afterLoad(engine, turn)` can change level and load packs after an await: `level.load(x, { turn })` and `content.load(x, { turn })` go at once. It used to wait for itself, for ever. Without the turn a call waits in line like any outside request, and dev says so when it stalls (`save-nested`).
|
|
21
|
+
- A part registered during a load runs after it, whole, in its own turn. Its first lines used to run inside the load.
|
|
22
|
+
- A failed pack ends only when the old level and registrations are back, and saves and loads asked meanwhile wait. A restore that fails reaches the caller (`err.notRestored`). It used to reload in the background and swallow the failure.
|
|
23
|
+
- `content.load` returns a Promise for this load, not `engine.content`.
|
|
24
|
+
- One reading route in the docs: taking over a game starts at its status notes, a new feature at `AI.md` or `threedog how`, then the recipe and API page. `AI.md` calls its table a recommendation, and `API.md` no longer tells a game to write `?.` for a module it needs.
|
|
25
|
+
- MCP `check` now lists the first bypass hints with file, line, advice and how to switch them off, the same ones `threedog check` prints, one of each kind first. It used to drop them.
|
|
26
|
+
- In a game that runs, `threedog how` answers the most asked tasks with the lines to add (recipe 66 "In an existing game": where they go, what to skip, the failure to handle, the check; a test runs them). An answer shows an example only if it belongs to the chosen route.
|
|
27
|
+
- `threedog how` with no words opens a category list; `--browse <category>` lists capabilities, `--card <id>` shows one: what it solves, when it does not fit, install, dependencies, time, saves, an example and what verified it. The MCP tool takes `browse` and `card` fields. `--list` is gone.
|
|
28
|
+
- A scenario can say `{ "until": { ... }, "within": seconds }`: reach this state by the deadline, then check the end with `expect`. A win that freezes early passes; an error, a freeze before the state, a stuck load and a missed deadline each name themselves. `step` stays strict.
|
|
29
|
+
- `before` / `after` that contradict the stages through a capability are refused with `module-order`, as they are by module name. They used to warn and drop the line. `water` no longer states `after: ['sky']`: it reads the horizon color, and a frame's lag does not show.
|
|
30
|
+
- Frozen physics queries refresh through one wrapper that gives the step length back even if Rapier throws. Checked on Rapier 0.21: no narrower native route exists, and the refresh leaves velocities, sleep, contacts and a pending kinematic move alone.
|
|
31
|
+
- A swap is finished when queries can trust it: after `engine.use(collision(), { replaces: 'collision' })` the next line reads the level walls, frozen or not. A module that feeds a provider says so with `ctx.feeds(capability, fn)`; a provider that refuses what it is fed fails its `use()` and the old one comes back. A copy rebuilt through `follows` that throws is built again at the next read.
|
|
32
|
+
- An old `engine.haltLoop` or `views.show` handle no longer ends a later hold of the same name.
|
|
33
|
+
- `world.simulate` on a time channel pays the time as it passed. A far or tiered record, `engine.skip` and a saved debt no longer rewrite the past at the speed of the settlement: half a second at 1x and half at 0.5x gives 0.75, not 0.5. Each record's own `time.local` rate counts the same way. Older saves load; what they owe is read at the first speed it meets.
|
|
34
|
+
- A dialogue `do` that throws ends the conversation and answers its `say()`, on a bubble too. It used to leave a line nobody could finish.
|
|
35
|
+
- A cutscene has one ending: `finished`, `skipped`, `dropped` or `failed`. `timeline.play()` resolves with `{ ending, error? }`, `timeline:end` carries the same, and describe counts it; `{ skipped }` is gone. A dropped or failed run runs no more steps, a parallel branch included, and gives the screen back. A new game or `dispose` drops a run: its `do` steps no longer run on what came after.
|
|
36
|
+
- A failed atomic op puts `once` items, interaction counters and content markers back with everything else. Every engine save part now says whether an atomic op covers it, or why not (`notAtomic`, rule R67).
|
|
37
|
+
- A reward that cannot be given is no longer lost in silence. `content.run` answers `{ ok: true }` or a failure listing each word that failed, and `content:failed` fires; `{ give }` reports what did not fit, part of a stack too. A finished quest fires `quest:unpaid`, tells the player (`quests.notify` gets type `'unpaid'`), and owes the items until there is room (saved, shown in `quests.list()`); `onUnpaid` lets the game decide instead.
|
|
38
|
+
- An async `onUse` is judged when it settles: one that fails or throws spends no `once` item and adds no count, and it cannot be used twice while it waits.
|
|
39
|
+
- Physics queries and rays see walls, solids, bodies and moves at once, also while frozen; world boxes stand on a new level at once. `engine.remove` of a model or a parent also removes its body. Public vectors must be finite: NaN and Infinity are refused with `bad-position`.
|
|
40
|
+
- `exit()` takes the first walkable exit a vehicle offers (`exitPosition(seat, n)`; `rigid` cars offer four) and answers `false`, rider seated, when none is. `exit({ force: true })` always gets out. It used to step into the wall and shove the car
|
|
41
|
+
- A seat is one relation owned by `characters`, saved with its seat number. A load keeps who sat where; a car built after the load takes its rider; a game's own vehicle keeps its rider through a load (`characters.addVehicle`); a cutscene over a driver lets go of the pedal; a rider stays on the seat with no holder moving it. `interaction.use`'s `approaching` has `remove()`, like the walk it stands for
|
|
42
|
+
- A walk is a task of the control slot, and one list says what ends it: a load or new game, a level change, a placement, a seat, physics taking the body, the character going. It used to outlive the level, the seat and the placement, and wait for ever under a ragdoll. `character.placeAt` drops an NPC's path as `npc.placeAt` does
|
|
43
|
+
- The view has one write route. The first holder of the camera records the view it took and the last one out lands it, so a slider moved during a shot takes effect at the end and overlapping shots no longer leave a half-way fov. A rig told to move during a hold records it and lands at release. A hold from writing the camera directly ends at a new game. The first-person body hides only while that view shows.
|
|
44
|
+
- Quality presets are shares of what the game set: High lets everything through, and no preset raises anything. MSAA never changes during a run: the settings row applies at the next start, and Low no longer turns the post chain on. `engine.tier` is the one quality value: the device's tier unless the player's preset says otherwise, for particles and everything else that reads it. `settings.set` refuses a key no row owns. Terrain and vegetation offer their own settings rows.
|
|
45
|
+
- Tools: `verify` and `step` share one step result, and less time than asked is a failure in both. `check` names a local file an asset pack names that `public/` lacks. A switched-off module has the state `disabled`; `engine.disabledModules` is gone, `describe().disabledModules` is derived from the state, and the short describe names it.
|
|
46
|
+
- `applyState` takes its module keys from each module's `stateKeys`: core no longer lists them.
|
|
47
|
+
- Loads and state turns, one rule per cause. A level file that fails now fails, whatever the manifest falls back to: no gray level, no `level:loaded`, and `saves.apply` answers false. Every load has one limit, `engine.loading.timeoutMs`, measured as silence, so a file that never answers no longer freezes `start()`, `level.load` or a load, and a load everybody stopped waiting for is aborted. `flow.transition` rejects at the same limit and gives the screen back. `level.load` during a save load waits for it. Autosave waits for the end of a door trip or a cutscene. A failed load puts a code-built level back. A content pack never commits inside a state replacement. A session turn on a disposed engine answers false.
|
|
48
|
+
|
|
49
|
+
- An unloaded level takes its `world.zone` and `level.spawn` with it. `unuse('content')` takes its hud markers off the screen. Path rasters no longer outlive the collision module or the playthrough that made them
|
|
50
|
+
- A collider with no `y` stands on the ground as it is now: after `terrain.edit` the rigid copy of a `collision.addBox` moves with the ground, so a crate no longer falls through a post left at the old height
|
|
51
|
+
- `engine.skip` during a skip rejects with `skip-busy`, as its doc says. It used to resolve, and its end unfroze the game during the first one's fade
|
|
52
|
+
- `assets.release` keeps a model whose geometry was handed out, as `trim` does
|
|
53
|
+
- `saves.register` on a held key throws `save-key-taken`. It used to take the part away from its owner in silence
|
|
54
|
+
- `replaces` sees more than the one module it names. `engine.use(terrain(), { replaces: 'terrain' })` now installs the new `terrainDraw` too, where the old drawing part stayed on a terrain that had gone and the new one was dropped with a warning; weather and vegetation act alike. A hold a rig opened on the camera ends with the rig, so the next rig moves. A live ragdoll gives its character back when rigid leaves. A swap, failed or not, leaves the game on the level it stood on, and a pack's older level no longer takes it back; a newcomer with its own `url` or `scene` still opens there
|
|
55
|
+
- A module that leaves takes what it registered with it. `unuse('characters')` used to hang the world step with a near NPC; `unuse('rigid')` broke `raycast({ targets: 'all' })`; `unuse('level')` left record nodes in the scene and in rays; `unuse('inventory')` left its touch button. `input.touchButton` and `assets.onSwap` now return `{ remove() }`; a button two parties asked for stays until the last one leaves
|
|
56
|
+
- A template's physics prop comes back from a load as it was saved: turned, moving, asleep or in the air. It used to land upright on the ground. A load no longer writes a change for a crate nothing touched, and a crate that was nudged stays nudged in a save (a nudge under 5 cm used to count as settling and was lost). A body keeps the speed it fell asleep with.
|
|
57
|
+
- `engine.unuse('rigid')` or replacing it stands a limp character back up. It used to stay held by the old physics for good.
|
|
58
|
+
- Weather set with `seconds: 0` reads the same after a load.
|
|
59
|
+
- `thing.set` with no height stands a template's physics prop on the ground. It used to go half into the floor and could fall through it.
|
|
60
|
+
- `stream.teleport` belongs to the state it was asked in: a new game or load (`saves.load` too) that goes through during the trip abandons it. It rejects with `stream-removed` and the player stays. It used to land on the new state, below ground at the old door's destination. A `flow.transition` still fading out is dropped the same way, and `engine.skip` is now cancelled by `saves.load` as well.
|
|
61
|
+
- Autosave no longer overwrites a save after `session.quit()` with no title part: `session.playing` stays false until a new playthrough starts.
|
|
62
|
+
- Every load entry acts alike. `saves.apply` ends a walk and rebuilds what `saves.load` does; any save put back closes the title; a rolled-back `saves.load` or `saves.apply` fires `session:failed` with `kind: 'quick'`. A rollback keeps rigid velocities and quest markers.
|
|
63
|
+
- A new game leaves no run state behind: holds taken in play, `world.anchor`, `audio.state` (a new save part, `audio`), a level loaded after a code-built opening scene.
|
|
64
|
+
- A module's function timer follows the module at a new game: gone with it, kept when it was used after `start()`.
|
|
65
|
+
- What joins after `start()` joins the new-game state: a player where it began, a part as its `init` left it, a pack's `startItems`.
|
|
66
|
+
- The title track plays after quit whichever of `flow` and `music` was installed first. `session.load` keeps the vehicle camera and a view saved on a switched rig.
|
|
67
|
+
- `flow.transition` goes on across a load that fails, as `stream.teleport` does. An atomic op's rollback puts a `NaN` back as it was.
|
|
68
|
+
- A second `engine.skip` during one under way rejects, as its doc says; its end used to unfreeze the game during the first one's fade.
|
|
69
|
+
- Dev warns when a second `saves.register` takes a key another part holds. A dev gameplay error stays frozen until reload, a new game included: documented, and guarded by a test.
|
|
70
|
+
|
|
71
|
+
- `stream.teleport` belongs to the state it was asked in: it waits out a running load, and a new game or load (`saves.load` too) that goes through abandons it. It rejects with `stream-removed` and the player stays. It used to land on the new state, below ground at the old door's destination. A load that fails leaves the trip going, and a level change does not touch it. A `flow.transition` running or in line is dropped the same way, without bringing the old track back, and `engine.skip` is now cancelled by `saves.load` as well.
|
|
72
|
+
- `saves.apply` fires `save:loaded`, as `saves.load` does: a walk ends on it, and the HUD quest list and calendar ranges rebuild. Its `slot` argument is what the event carries.
|
|
73
|
+
- A save part named `__proto__` is refused at `saves.register`. Its data used to be lost without a word.
|
|
74
|
+
- `saves.save` refuses data with `NaN` or `Infinity` at any depth, naming the part and the path, and the slot keeps its last good save. It used to answer true and store `null`. A game with a field like `hp: Infinity` saves a finite number or leaves the field out.
|
|
75
|
+
- A longer view distance builds stream entries and world models without the player moving.
|
|
76
|
+
- A delete the store refused lists the slot again.
|
|
77
|
+
- `saves.apply(x); saves.save('s'); saves.apply(y)` stores x on a page with `afterLoad` hooks too.
|
|
78
|
+
- A save part may be named like an Object method (`constructor`, `toString`).
|
|
79
|
+
- A `commits.request` made during a failed `session` load's rollback lands.
|
|
80
|
+
- `views.current` is declared `string | null`, as it is at runtime.
|
|
81
|
+
|
|
82
|
+
- New event `level:unloaded { source }`: a level left, by `unload()` or a switch just before the new one commits. On it the navmesh goes (`nav.ready` false, no path of any size from the old level), hlod lets the level go, grid tiles and A* rasters drop what they read from it. `level.ready` stays true after `unload()` because nothing is loading; `level.root` says whether a level stands, and `level.playable` is false.
|
|
83
|
+
- `walkTo` ends with its playthrough: `session.newGame`, `session.load` and `quit` settle it as `cancelled` and give the control slot back. It used to go on walking in the new game.
|
|
84
|
+
- The level's walls reach a replaced `collision` while the engine is frozen or skipping, not only on the next fixed step.
|
|
85
|
+
- `engine.unuse('cameraRig')` puts back the perspective view and the fov it found.
|
|
86
|
+
- A replaced provider no longer leaves consumers on the old one. After `replaces` on `rigid`, a template's crates get bodies in the new module where play left them (a template reload that changes, adds or removes `body` reaches built copies too), riders leave the old module's car by the normal exit, and rapier movers build anew. NPC agents, `findPathAsync`, weather drawing, interaction entries of props, NPCs, pickups and cars, and a replaced camera rig all follow the provider installed now. Version numbers no longer decide this: they count per module, so compare the object. Game code that keeps a handle does the same (recipes/55).
|
|
87
|
+
- `replaces: 'world'` and `unuse('world')` are refused (`module-replaces`, `module-unuse`) once a module that uses the world is installed or the game has started, and nothing changes: it used to break the game. Install your world before the modules that need it.
|
|
88
|
+
- One way to an orthographic view: a real `THREE.OrthographicCamera` in `engine.camera`. A rig's `projection: 'orthographic'` now does exactly that, and the next perspective view brings the first camera back, so the camera class that acted as both is gone: `engine.camera` is a plain three.js camera, always. `camera.orthoSize` and `camera.isEngineCamera` are gone (`MIGRATING-1.0.md`).
|
|
89
|
+
- Navmesh paths fit the body that asks: a `radius` on `findPath` or `findPathAsync`, and `walkTo` and NPCs with theirs, gets a mesh of that size, built on first ask and rebuilt with the level. Small bodies take gaps a large one cannot; a body too wide for every way gets `noPath` where its `walkTo` used to end `'stuck'` at the gap. One size costs nothing extra. Recipe 12 section 5.
|
|
90
|
+
- `findPathAsync` on A* sees every floor of a level: ground under a bridge or a lower storey is walked as `findPath` walks it. It used to read only the top one, so a steep roof closed the road under it and a slope under a deck did not count.
|
|
91
|
+
- `level({ url })` with a pack that sets `level`: `content.load` before `start()` now ends as it does after `start()`, the pack whole and its level up, and the url file is not fetched. The url load used to overtake the pack and drop all of it, in silence. If the pack's level cannot load, the url is the level.
|
|
92
|
+
- A pack whose `level` is overtaken by a newer `level.load`, save load or unload is no longer lost: only its `level` gives way, and its other sections commit on the level that won, once that load has ended. A newer load that fails leaves the old level, and the pack's other sections still go in. An overtaken `level.load` now resolves when the newer load has ended.
|
|
93
|
+
- Two engines on a page: gamepads follow the keyboard, so only the engine last pressed or focused (the first one until then) reads them, seats included. An engine alone on a page reads a pad as before.
|
|
94
|
+
- The level's `col_` walls and solid props go into whichever `collision` is installed, tilted props into whichever `collider3d`: after a `replaces`, a failed one, or a module that came late or came back. They used to stay behind in the old module, so a character walked through. `module:restored` now fires after every swap, with the fresh modules, once their `init` is done, and content sections load into a newcomer that declares them, as a `content.load` on a running game would. A newcomer with its own format that refuses a pack written for the old holder gets a warning naming the pack, and the game runs on.
|
|
95
|
+
- `level({ url })` with a pack that sets `level`: `content.load` before `start()` now ends as it does after `start()`, the pack whole and its level up, and the url file is not fetched. The url load used to overtake the pack and drop all of it, in silence. If the pack's level cannot load, the url is the level. A pack overtaken by a newer `level.load` still goes, and now warns.
|
|
96
|
+
- Two engines on a page: gamepads follow the keyboard, so only the engine last pressed or focused (the first one until then) reads the pads no seat is bound to. A seat hears the pad it was given on any engine, and the owner leaves that pad alone. An engine alone on a page reads a pad as before.
|
|
97
|
+
- The level's `col_` walls and solid props go into whichever `collision` is installed, tilted props into whichever `collider3d`: after a `replaces`, a failed one, or a module that came late or came back. They used to stay behind in the old module, so a character walked through. `module:restored` now fires after every swap, with the fresh modules, once their `init` is done, and content sections load into a newcomer that declares them, as a `content.load` on a running game would.
|
|
98
|
+
- Recipe 66 has two more whole examples, both run by its test: two areas built in code that a save returns to by their manifest names, and a ladder that goes on after a load mid-climb.
|
|
99
|
+
- Rule R40 no longer calls a `subtitle` option and a canvas lookup on one `createEngine` line a dialogue box.
|
|
100
|
+
- `thing.set`, `world.set` and `world.move` on a live character (the player, an NPC with a model) are its `placeAt`: they used to answer ok and be undone by the next step.
|
|
101
|
+
- A write to a record with `positionFrom: 'view'` moves its model and any rigid body on it, instead of being overwritten at the end of the step; `rot` and `scale` on a template with a `body` build a new body.
|
|
102
|
+
- `rot` and `scale` written to a character's record (`world.set`, `thing.set`) reach the character and survive a rebuild and a load; what it cannot obey is refused by name. `thing.set` no longer drops the x and z of `rotation` and `scale` arrays.
|
|
103
|
+
- Undo of a `thing.set` that ended a ride seats the character again, or answers `ownerRefuses` if the seat is gone or taken; `ops.define` takes `canUndo` for such answers. `placeAt` on a ragdoll carries the whole body there at rest, where the next step used to put it back.
|
|
104
|
+
- `placeAt` on a seated character, and so any write to its record's position, ends the ride and puts it there: the seat used to pull it back on the next step.
|
|
105
|
+
- One entry each: `stream.setRadius`, `weather.setAuto` and `post.setAntialias` are gone; assign `stream.radius`, `weather.auto` and `post.antialias`, which do the same. The command `threedog eval` is gone; `threedog js` is the one name.
|
|
106
|
+
- `threedog test` no longer counts a check labelled `skipped:` as passed: the summary names it and says how many did not run.
|
|
107
|
+
- `engine.skip(null)` fails with `skip-amount` like `engine.skip({})`, not a TypeError. Bad arguments throw at the call, and the docs now say so.
|
|
108
|
+
- The perf island example opens again: its op name was refused by the `noun.verb` rule.
|
|
109
|
+
- `engine.camera = cam` takes a real `THREE.PerspectiveCamera` or `THREE.OrthographicCamera`: rendering, post, picking, shadows, audio, rigs and `pixelSnap` go on with it, and resize keeps its frustum. Other classes are refused with `camera-option`. The type of `engine.camera` is now the union of the two, so TypeScript code reading `.fov` narrows first.
|
|
110
|
+
- Terrain: `terrain.setViewChunks` and `terrain.setDensity` are gone; assign `terrain.viewChunks = n` and `terrain.density = d`, which do the same. Density thins plants without a collider only, so it never changes collision.
|
|
111
|
+
- Declarations: `terrain()` and `vegetation()` are declared as the two modules they return, like `weather()`; nothing changes in a game that passes them to `engine.use`. The class names `Ambience`, `Budget`, `Calendar`, `DebugPanel`, `Grid`, `Grids`, `Layer`, `Music`, `Net`, `Particles`, `PostFX`, `Sky`, `SoundHandle`, `Swarm`, `Timeline`, `Water`, `Weather`, `WeatherDraw` and `World` are types only, as they always were: nothing can import them as values. The `weather.*` names (`weather.auto`, `weather.current`, `weather.defineField`, `weather.label`, `weather.lightningBrightness`, `weather.name`, `weather.overcastColor`, `weather.particles`, `weather.set`, `weather.setAuto`, `weather.types`) are unchanged, now counted as a module's.
|
|
112
|
+
- `compositeGround` with `rigid`: terrain inside a level's region was solid but not on the ground. The hills stood as invisible collision inside the level, so a dropped box stopped in mid-air over a lake. The terrain's physics triangles now stop at the regions where another part answers.
|
|
113
|
+
- `mover: 'rapier'`: a swimmer moved to a place with no water, or whose water was removed, froze the game with a NaN position. It falls and lands now.
|
|
114
|
+
- A content pack with a `level` file now commits as a whole once the file is here: `{ place: 'npc_home' }` reads the new level's marker, and a later pack of the same load, or a later `content.load`, waits for it. If the file fails, nothing of the pack commits. Code right after `content.load` cannot read such a pack's sections yet; wait for `start()` or `level:loaded`. A pack refused by a section leaves the level as it was, a load in flight included. A section may declare `cancel(prepared, c)` to let go of what its `prepare` holds.
|
|
115
|
+
- A save that names the current level now drops a `level.load` still downloading. Before, the file landed on top of the loaded save.
|
|
116
|
+
- `engine.unuse('level')` and `{ replaces: 'ground' }` take the level with the module: its scene, `col_` walls and what `level.track` holds. Before, they stayed behind.
|
|
117
|
+
- Object contracts (`mover`, `vehicle`, `ground`, `collider3d`) list their members under `api` like every other contract; a replacement's own `contract.js` with `methods` should rename it.
|
|
118
|
+
- A content section's `fields` key is gone: nothing read it for a section. A game kind's and a template's `fields` are unchanged.
|
|
119
|
+
- A template with a `body` and a per-axis `scale` builds: the array went into its resting height and the model failed to appear. A place turned on a reload now turns a record with an `[x, y, z]` rot too, and the editor's turn handle keeps the three numbers.
|
|
120
|
+
- `compositeGround`: `terrain:void` fires for rigid bodies and ragdolls again when one part is a level. The void height comes from the parts that have one.
|
|
121
|
+
- `compositeGround` region: `(x, z) => boolean` or `{ volume }`, the shape water and trigger zones take. `{ circle }` and `{ rect }` are gone: write them as a function.
|
|
122
|
+
- `slope` and `groundType` with a `refY` pick the layer on a level, as `surface` always did, so walkability and footsteps under a bridge read the ground under the bridge.
|
|
123
|
+
- `quests.list()`: a step counts as done once the quest left it. A step `next` jumped over stays not done, and a step a loop came back to is current and not done.
|
|
124
|
+
- A* (`findPath` without `nav`): a goal on a floor the walker can't reach is `noPath`, and `walkTo` ends with that status. It used to be `ok` with a path that ended under the goal.
|
|
125
|
+
- `compositeGround({ parts })` could not be installed: its only option was refused as unknown. It works now; recipe 10 section 6 shows it.
|
|
126
|
+
- Water goes by height: a character, `describe().player.inWater` and buoyant rigid bodies now pass their own height to `waterAt`. Before, a character walking under a lake was lifted through the ceiling to swim. A game's `addWaterBody({ query })` now gets `y` from these too.
|
|
127
|
+
- `docs/MIGRATING-1.0.md`: every change an existing game can hit since 0.9.0, as what you will see and what to do. A `preventDefault` on `character:fall` and a `thing.explain()` now answer with the fix instead of a bare TypeError.
|
|
128
|
+
|
|
129
|
+
- Local players on one screen: `engine.input.seat({ pad, keys })` is one player's own keys and gamepad, read like `engine.input`; `createPlayer({ id, input })` adds a player with that seat and its own world record (no `id`: the one player, as before); `characters.moveInput` takes an optional seat (no argument: as before); `removePlayer(id)`; `engine.player` stays the first player. Interactions, footstep sounds and NPCs giving way still follow `engine.player` only. Recipe 58.
|
|
130
|
+
- Data checks that ran only in development now hold in release: a NaN or short position (`world.add`, `move`, `set`) is refused and writes nothing; an op with a missing required arg or an `id` with no record fails with `badArgs` before `run`; `world.set` cannot change a record's id or kind; two NPCs with one name and no id, a `once` interaction with no stable id, and a template state value outside its fields all throw. A game that passes its development run is unaffected.
|
|
131
|
+
- Contracts state position authority: the characters, mover and vehicle contracts have a `position` entry naming who may write a character's position, and `@threedog/tools/contract` checks any contract that has one. Nothing changes at run time.
|
|
132
|
+
- A `picture` or `ui` module disabled after an error now gives back what it borrowed with `ctx.borrow`, as unloading does: a value someone else set meanwhile stands. Before, its fog or tone mapping stayed on the screen with nothing maintaining it.
|
|
133
|
+
- Skip: a module says how `engine.skip` advances it with `skipKind`: `exact`, `approx`, `step` or `none`. Every engine module declares it (rule R57), `engine.catalog` shows it and reports a module with a `fixed` or `skip` hook that has none, and an unknown word stops `engine.use`. The `skip` hook and `noSkip` stay.
|
|
134
|
+
- Metadata: `threedog map` now writes one generated file of module, content section, contract and placement field facts (`threedog/metadata`). `catalog`, `how` (engine modules and options by name, with no page running), the editor, rules R38 and R50 and the content loader read it instead of keeping their own lists. A content section can declare `live: true`; field specs take `label` and `rare`. A pack with a `level` section and no `level()` module now gets the named error instead of being dropped. The code map, rule R51 and the content file list now read it too: a content section states what it holds in its own `desc`, and `describe().content.sections` also names `actions`, `places`, `audio`, `views`, `renames` and `rules`. Rule R6 now also fails when an option or contract name in it is missing from the types; a contract name a game should not call is marked `@internal` at its source.
|
|
135
|
+
- Asset tool chain: `npm audit` flagged `glob`/`minimatch` under `@gltf-transform/cli` (moderate, build time only). This repo overrides them to the fixed `glob` 14; a game that installs `@gltf-transform/cli` for `threedog assets optimize` adds the same `overrides` entry (recipe 46). `threedog assets optimize` itself is unchanged.
|
|
136
|
+
- Capabilities and readiness: `before` / `after` can name a capability (`after: ['ground']` follows whichever module provides it, also across a `replaces`); `engine.explain({ module })` and `{ capability }` say whether one can be called now. `engine.has(name)` now also answers for a capability a module provides. Development and test builds compare a bound provider's API with the capability's contract, on module changes only: a gap is one `module-contract` warning and a line in `engine.catalog(name).problems`, and the module still runs.
|
|
137
|
+
- `engine.explain` is the one way to ask why: `{ thing: id }` replaces `engine.thing(id).explain()` (`detail` holds the same object), `{ module }` and `{ capability }` are new, and `threedog explain thing <id> --full` replaces `threedog thing <id>` (MCP: `explain` with `about: "thing"`). The CLI word for a value is `threedog explain value fog.far`.
|
|
138
|
+
- Dev server: who writes a value now covers the values the engine writes on its own and shared points, not only picture values; `engine.debug.watch(name, object, key)` adds any value the game names (does nothing in release). `engine.explain({ value })` replaces `explain({ picture })` and also gives the value's short history; two writers taking turns across frames are reported too, in a one-line `[picture-conflict]` hint whose fix moved to `explain`; a yield warning and `describe().owned` name the line that took the value. Only watched values are seen, so no conflict seen is not proof of none.
|
|
139
|
+
- Water asked at a height: characters, rigid bodies, `describe().player.inWater` and spawn search now pass their height to `waterAt`, so a game's `addWaterBody({ query })` or `{ volume }` that depends on `y` (a pool upstairs, a waterfall) works for them. Before, they asked with no height and saw no water.
|
|
140
|
+
- `collider3d.sweep`: a ball that starts touching a solid and moves out of it is clear, so a flying mover can take off from the ground it stands on.
|
|
141
|
+
- `walkTo`: a vertical leg of a path (a path source for a flyer) is progress and goes straight; before, it drifted sideways and ended `stuck`.
|
|
142
|
+
- `mover: 'rapier'` NPC: while another mover has it, its capsule leaves the world and comes back at the character. Before, it stayed at the take-off spot as an invisible wall and blocked the new mover's own sweeps. A mover may give an optional `leave()` for this (`mover.contract.js`).
|
|
143
|
+
- Types: `player.move` and `player.mover` now show the `y` a control step passes (the code already took it); nothing to change in a game.
|
|
144
|
+
- A failed `replaces` leaves the game as it was: the old modules come back in their old places, also when one requires another, and content sections load into them again, so definitions and progress are back. Game code that defined things by hand does so again on the new event `module:restored` `{ modules }`.
|
|
145
|
+
- `session.newGame` / `quit` could be refused for good after a late `replaces` by a part of a lower version: the new-game state now takes the new part's data when the part cannot read what is there.
|
|
146
|
+
- A failed load also rolls back a part whose `save()` gave nothing just before it: it goes to its new-game state. Without one, a soft error names the part.
|
|
147
|
+
- A load taken over by a newer one on the next line can no longer roll back over it, and a taken-over `saves.load` no longer emits `save:loaded`.
|
|
148
|
+
- A content section may say `once: true`: its commit gives state, not definitions (`startItems`), so it is not replayed.
|
|
149
|
+
- `engine.use(x(), { replaces: 'slot' })` with a module named `x` already installed that does not hold the slot is now `[module-replaces]`. Before, the newcomer was ignored and the slot's holder unloaded for nothing.
|
|
150
|
+
- `engine.setPixelSize(null)` leaves a ratio the game took with `renderer.setPixelRatio`; before, it was overwritten.
|
|
151
|
+
- `ctx.borrow`: a module's handles now end newest first when it leaves, so two borrows of one property give back the original value (before: the first borrow's value stayed).
|
|
152
|
+
- Control: two owners taking one character on one layer now throw `[control-conflict]` in release builds too (was: warn once, the later owner won), and the first keeps the character.
|
|
153
|
+
- Shared values: two owners `set` one point on one layer, or a second provider of an exclusive slot, now throw `[shared-conflict]` / `[shared-taken]` in release builds too (was: warn once, the later write won). Development and release behave the same and the earlier value stays.
|
|
154
|
+
- Placement: a prop's `rot` and `scale` also take `[x, y, z]` (numbers act as before), `ground: false` keeps the written `y` instead of snapping to the ground, and `collide` on a model turned about x or z is held by `engine.collider3d` (a named error without one). `triggers.add({ volume: { contains(p), bounds? } })` takes the same plain volume as water.
|
|
155
|
+
- Ground: `slope`, `groundType` and `waterAt` (and a provider's `ground.slope` / `ground.type`) take `refY` like `surface` (existing calls unchanged); `core/scene/ground.contract.js` states what a ground provider gives; `compositeGround({ parts: [{ of, region, priority }] })` holds the ground slot over `terrain({ part: true })` / `level({ part: true })` so both can run; `engine.addWaterBody({ query(x, z, y), bounds, mesh })` or `{ volume, level }` is water you draw yourself; `describe().spatial` shows the ground holder and water.
|
|
156
|
+
- `engine.collider3d`, a new slot with a contract (`modules/rigid/collider3d.contract.js`): `addSolid`, `overlap`, `sweep` on all three axes. `rigid` is the first holder. Nothing changes for a game that does not call it. A module of yours that `provides: ['collider3d']` now needs `{ replaces: 'collider3d' }` next to `rigid`.
|
|
157
|
+
- Ragdolls take any body: the rule `ragdoll.graph` is `'humanoid'` (default, unchanged), a graph `{ part: { bone, parent, limits, mass } }` for four legs or a tail, or `false` (then `rigid.ragdoll` returns null). Recipe 11. A hit without `position` lands on the root part, hips on a human. `rigid.ragdoll({ mass })` is now the exact total (a human came out 1% over).
|
|
158
|
+
- Falling is one rule, `fall`, covering characters and rigid bodies; the default is unchanged (`'rescue'`). `engine.mod('fall', { owner, id?, set: false })` leaves it to the game, and a function `(facts, engine) => 'rescue' | false` decides per fall (`facts.kind`: `'character'` or `'body'`). It is asked once per fall.
|
|
159
|
+
- Migration: `preventDefault` on `character:fall` is gone (calling it now throws `not a function`). Replace `events.on('character:fall', e => e.preventDefault())` with `engine.mod('fall', { owner: 'game', id: 'player', set: false })`, or a function for a decision per fall. `character:fall` still fires first, with `{ character, safe }`.
|
|
160
|
+
- `rigid({ fallbackFloor: false })` removes the flat plane at y = 0 that a ground without collision of its own got; default unchanged.
|
|
161
|
+
- Assets: a model copy now holds its asset's data: `release`, `trim` and a replaced build wait for the last copy, and `describe().assets` lists `leases` and `waiting`. Nothing to do in a game.
|
|
162
|
+
- New games and starter pictures: `picture/index.js` is now a `type: 'picture'` module. Write `engine.use(createPicture()); const { picture } = engine;` and switch looks at run time with `engine.use(next(), { replaces: 'picture' })`; meshes holding old materials must take the new ones. A hand-written `createPicture(engine)` keeps working; a newly pulled starter picture needs the new line.
|
|
163
|
+
- Modules: `ctx.borrow(obj, values)` writes properties on an object the module does not own and restores them when it goes, unless something else wrote them meanwhile. Replace a hand-written save and restore with it; nothing else changes.
|
|
164
|
+
- Vegetation: at low quality, plants with `collider` are drawn thinned again, as many as before they were placed in full. Plants not drawn still block. Nothing to do in a game.
|
|
165
|
+
- `characters.path` rule: `engine.mod('characters.path', { owner, id?, set: ({ from, to, o }, engine) => points | null | 'walk' })` is where `findPath`, `findPathAsync`, `walkTo` and NPCs get paths (default `'walk'`, `false` for none), for flight or anything off the ground; `findPath(a, b, { id })` picks a character's entry.
|
|
166
|
+
- `character.mover` rule: `engine.mod('character.mover', { owner, id, set })` swaps how a character moves until the handle goes, and `mover` (`player.mover` too) takes `(character, engine) => ({ name, move(x, z, run, dt, y) })` (`mover.contract.js`, `engine.characters.kit`, recipe 57). `control.take` steps and `handle.move(x, z, run, dt, y)` gain `y`, default 0. A mover name that does not exist now throws `character-option` instead of warning and walking with `'simple'`: fix the name.
|
|
167
|
+
- XYZ: paths from `findPath` / `findPathAsync` / `engine.nav` are `{ x, y, z }`; schedule stops keep a `y` you give (`{ x, z }` still means the ground) and it picks the floor, also for where the NPC starts; `walkTo` and NPC stops arrive only at the height asked for. A height near no walkable surface at that spot (a stop written `[x, 0, z]` on ground at 8) goes to the nearest surface and warns once `[nav-height]`, so nothing needs rewriting; a height near a surface picks that floor. `collision.addBox({ y })` stops only a body overlapping `y .. y + height`, so a wall upstairs leaves the floor below free (`y` omitted: as before). `collision.walkable` with a `y` and `walkableAt(x, z, radius, y)` read boxes the same way, and so does A*, on the walker's floor; a wall on a level file's upper floor no longer blocks A* paths below it. A navmesh path that only gets under a goal cut off upstairs is now `noPath`, not a path ending a floor below. NPCs on different floors no longer push each other, or yield to a player on another floor.
|
|
168
|
+
- World stays the same at any quality or position: scattered plants with `collider` are placed identically at every `density` (only collider-free species thin); terrain edit, height and shape keys no longer alias far from the origin; `engine.nav` / `findPathAsync` / NPC crowd goals go to the floor the height you pass picks (the ground answers only when none is given); rigid bodies under a moved or rotated parent register at the world pose and write back through the parent (a parent scaled differently per axis throws `rigid-misuse`); standing at the exact centre of a circle or box collider is pushed out towards +x; buoyancy no longer clears forces the game adds to the same body.
|
|
169
|
+
- Containers: `add`, `remove`, `setData`, `transfer` and `trade` throw `[container]` for a quantity that is not a whole number >= 1 (before, `remove("apple", -2)` added stock). `{ op }` and `{ can }` content words run as the actor given to `content.run` / `content.test`, like `give` / `take`. A swarm `capacity` must be a whole number, and a damaged swarm save part is refused whole instead of half-loaded. Weather fields that are not finite numbers, terrain paint types that are not strings and grid layer payloads that are not objects are no longer loaded from a save.
|
|
170
|
+
- `threedog new-game name --pixel` (and `init --pixel`): a sprite-character starting point (`pixelSize`, `pixelSprite`, a `pixelSnap` camera, input, interactions, dialogue, autosave and start screen), gray placeholders; not together with `--open-world`. Recipe 13 gains 3d (which modules need an engine character, run on a sprite) and its `c.facing < 0` mirror test is replaced: `facing` is an angle, not a left/right sign.
|
|
171
|
+
- Release and recovery: a trigger zone's `remove()` inside its own `onExit` no longer deletes a neighbouring zone, and a second `remove()` does nothing. A water normal map swapped for another frees the old texture. A throwing particle depth pass puts the scene back. Unloading the light pool puts back the glow of the stand-ins it borrowed. Unloading `timeline` ends running cutscenes (camera and actors go back) and `flow` stops a transition that has not swapped the scene yet. Modules get `ctx.signal`, which aborts when their install ends, for async work started in `install`.
|
|
172
|
+
- Branching quests: a step can have `next` (a step id, `e => id`, or `false` to finish), and `quests.state(id).visited` lists the steps passed. Save version 3 adds `visited`; older saves load as before.
|
|
173
|
+
- `dialogue({ bubbleChoice: 'ask' })`: a bubble line with choices stays up and waits for `dialogue.choose { index, run }` (run is in `dialogue.bubbles()`); the default still warns and ends the script.
|
|
174
|
+
- `triggers.add({ occupancy: 'each' })`: an enter, stay and exit per actor instead of one for the whole zone (default `'zone'`).
|
|
175
|
+
- Modules own their content sections: a module field `content: { section: { fields, references, validate, prepare, commit, effects } }` decides a section's format, so replacing a module replaces its format. A replacement quests, dialogue or inventory module must declare its own section to read content data. A pack is checked and prepared whole before anything commits. Data for a module that is not installed is a `module-needs` error naming it.
|
|
176
|
+
- `level.load` builds the new level first: on failure the old level stays, `level:failed` fires instead of `level:loaded`, and the Promise rejects, so a save that names a broken level rolls back. Catch the rejection if you called it without `await`. New events `level:loading` and `level:playable`, new field `level.playable`; `level:loaded` means the state is committed.
|
|
177
|
+
- `saves.save` during a load waits for it to end; `saves.collect` during a load throws `save-busy`.
|
|
178
|
+
|
|
179
|
+
- `threedog check`: the bypass hints (rule R40) now show without `--verbose` (the first 5; `--rule R40` lists all) and the last line counts them ("check passed, 3 bypasses"). R40 also catches `new Promise(r => setTimeout(r, ms))` (use `engine.clock.after`), every `localStorage.setItem` that is not an obvious preference, raw `keydown` / `keyup` listeners, `AudioContext` / `new Audio`, hand-made dialogue boxes, interact-distance checks and box-overlap collision. The game template's CLAUDE.md starts with "name the engine system before writing a new system file".
|
|
180
|
+
- Pixel games: `threedog/pixel` adds `pixelGrid`, `pixelSprite` and `spriteFrame`, and `followCamera` and `fixedCamera` take `pixelSnap: { pixelsPerMeter, bounds }`. Camera and sprites round on one grid along the screen's axes, so a turned view moves by whole art pixels, also along a level's edge. Recipe 62 section 4b.
|
|
181
|
+
- With `pixelSize`, the pointer's `ndcX` / `ndcY` ran across the padding at the right and bottom as well, up to k real pixels off; they now run across the picture.
|
|
182
|
+
|
|
183
|
+
- Replacing the game state is now one transaction. `saves.apply`, `saves.load` and `session.newGame` / `load` / `quit` take turns in the order asked, so two overlapping loads end as one whole save instead of a mix of both, and a load that fails rolls back to the whole state before it. Idle, a save with only synchronous parts still applies before `apply` returns. What a game may notice:
|
|
184
|
+
- A second `apply` / `load` asked while one runs now waits for it (async parts or a running `afterLoad`). Do not await one inside a part's `load()` or an `afterLoad`: it cannot start until they return, so it would wait forever (dev warns, `save-nested`). Start it from a `save:loaded` or `session:start` listener.
|
|
185
|
+
- `ops.run`, `ops.can` and `ops.undo` now answer `'loading'` and change nothing for the whole replacement: also during a synchronous part's `load()`, a `world:load` listener, a running `afterLoad` and a rollback (before, only while an async part loaded). An `afterLoad` or `load()` that ran an op to rebuild should write directly, inside `engine.ops.allow(...)`. A game's own `engine.freeze` (a menu) keeps allowing ops.
|
|
186
|
+
- During a failed load in dev, ops answer `'loading'` until the rollback ended, then `'halted'` (before, `'halted'` at once).
|
|
187
|
+
- `session.load` of a missing or unreadable slot asked during a replacement now answers after its turn, not at once.
|
|
188
|
+
- The load's freeze owners `threedog:load` and `threedog:load-parts` are one owner, `threedog:state-replace`. Code that looked for those names reads the new `engine.saves.replacing`.
|
|
189
|
+
- A module's registrations now leave with it. `ctx.ops.define`, `ctx.saves.register`, `ctx.ui.define`, `ctx.stream.addReadyCheck`, `ctx.budget.metric`, `ctx.things.addSource` / `explainWith` and `ctx.ground.provide` / `addColliders` take the same arguments as the engine calls; `engine.unuse`, a `use()` batch that throws and a failed `init` all remove them, so `use(inventory())`, `unuse('inventory')`, `use(inventory())` works. Your own modules keep working unchanged; move their registrations to `ctx` to get this. `engine.catalog(name).resources` lists what a module owns.
|
|
190
|
+
- A save part that leaves keeps its data: it rides in later saves and goes back to a part registered under that key. So `engine.use(mine(), { replaces })` where `mine` registers the same part key now receives the old module's data through `load`; give `mine` its own key if it uses another format. `saves.register` and `ui.define` now return a handle (they returned nothing, so no code changes).
|
|
191
|
+
- A module whose `init` failed loses its ops, save parts and UI parts with its other handles. Calling one of its ops now answers that the op is unknown.
|
|
192
|
+
- `ground` is one exclusive capability, held by `terrain` and `level`. Installing both now fails at `use()` with `shared-taken` instead of the later `setGround` winning: keep one, or swap with `engine.use(terrain(), { replaces: 'ground' })`. `level` no longer sorts after `terrain`. A module of your own giving the ground declares `provides: ['ground']` and calls `ctx.ground.provide(...)` instead of `engine.setGround`. When a provider leaves, the flat ground comes back. `engine.setGround` from game code still works over a module's ground, with a dev warning.
|
|
193
|
+
- `use`, `unuse`, `replaces` and `engine.plugins.on` / `off` now go through one check: the module list after the change is worked out and every module in it must still find what it `requires`, before anything is touched. A `replaces` that drops a capability another module needs now throws `module-replaces` instead of leaving that module broken: add the capability to `provides` of the module that takes over. `engine.plugins.off` throws `module-unuse` and stays on when a module outside the plugin needs it; a plugin owning both provider and consumer goes off as a set.
|
|
194
|
+
- `requires` now means the provider works. Until a required provider runs (still initializing, failed, or blocked), a module is `'blocked'`: its `init` waits and its hooks do not run, and `engine.catalog(name).blockedBy` and `describe().moduleStates` say why. If a provider fails, a `critical` module requiring it stops `start()` with `module-critical`, and others stay blocked; modules that do not depend on it go on. A later `engine.use(mine(), { replaces })` of the failed provider starts them. A module that can live without the provider lists it in `optional`. Inits of one late `use()` batch now run provider first instead of side by side.
|
|
195
|
+
- A second provider of an exclusive slot is now refused in every build, before anything is touched. A release build used to warn and let the later one win.
|
|
196
|
+
|
|
197
|
+
- `threedog check` and the runtime error for a guessed pause (`engine.time.pause()`, `engine.pause()`, `engine.time.stop()`, `resume`) now point to `engine.freeze(owner)`.
|
|
198
|
+
- A game in `games/` of a clone no longer breaks `npm install` after an engine upgrade. `threedog new-game` now writes `"*"` for `threedog` and `@threedog/*` (the workspace copies), and `threedog doctor` reports a game whose range does not accept the current engine, or that has its own copy of the engine in `node_modules`; `threedog doctor --fix` rewrites the ranges. `threedog init` outside a clone keeps `^version`.
|
|
199
|
+
- Test tools: a spec file that cannot be imported (for example its top level touches `document` or `window`) is now named with the file that threw, the cause and the fix; the other spec files still run and the round ends failed, instead of one bare "document is not defined" stopping everything. New warning rule R56: a test item that fails on a measured time (`ms < 100`) without `serial: true`.
|
|
200
|
+
- `createEngine({ pixelSize: k })` and `engine.setPixelSize(k)`: one art pixel is k real screen pixels, every one the same width at any display scale, on WebGL and WebGPU, through page zoom and moves to another display. Replaces working out `devicePixelRatio / k` by hand (recipe 62 section 4b). Every engine write of the pixel ratio now goes through one place, so settings that clash are an error naming which to keep (`pixel-conflict`).
|
|
201
|
+
|
|
202
|
+
## 0.9.0 (2026-11-06)
|
|
203
|
+
|
|
204
|
+
A game on 0.8.0 upgrades with no code changes, apart from the three points below: a particle list of three or more stops now uses every stop, `engine.start()` after `dispose()` rejects, and a save damaged in the listed ways is refused. Run `threedog doctor --fix` to move the `threedog` and `@threedog/*` pins in `package.json` (a `^0.8.0` range does not reach 0.9, so a game in `games/` of a clone would get a second engine from npm).
|
|
205
|
+
|
|
206
|
+
- Picture check, checked against what seven games really show. `shadow-jag` now moves the shadow map's pixel grid by half a pixel and reads what follows it, in place of counting corners, which stayed the same with a map four times finer. `shadow-stripes` needs at least two bands, and glowing lines through a shadow no longer split it. Moving film grain is no longer read as shadow.
|
|
207
|
+
- `nav({ crowd: true })` NPCs walk to a link's end before crossing, as other walkers do: they started about 1 m short, so a climb cut through the deck. One whose goal lay just past the landing no longer stops short of it.
|
|
208
|
+
- Docs from a real trial: recipe 12 gives where a hatch's ends really sit, in place of the unchecked 0.4 m, a `linkPose` for a hatch, and says a link has no queue; recipe 02 says crowd NPCs walk through the player; recipe 57's ladder read an action that does not exist (`moveBack`), so it could not go down; recipe 64 shows a flipbook on both routes.
|
|
209
|
+
- Tools: a headless browser is closed after 2 idle minutes (was 10), and every tool that opens one first stops what a dead browser left behind, such as a stuck page whose tool was killed.
|
|
210
|
+
- `engine.start()` always answers after `dispose()`: it rejects at once with `engine-disposed`. It used to stay pending for good when `dispose()` ran while it waited on a model, the preload or a module's `init`, and a `start()` after the `dispose()` of a running engine answered as if the engine were alive.
|
|
211
|
+
- `whenReady` of the built-in stream sources, and any `stream.source` or `stream.teleport` asked for after `dispose()`, reject with `stream-removed` instead of waiting for a frame. Waits in game code (`assets.model`, `jobs.add`, `nextFixed`) stay pending after `dispose()`, as before.
|
|
212
|
+
- A damaged save is refused in more cases: a `containers`, `inventory`, `quests`, `terrain` or `grids` part of the wrong shape, and a world `step` that is not a whole number. Each is `save-bad-record` at load (load false, game rolled back) instead of a code error, a game frozen one step later, or a bag emptied without a word. Found by the long fuzz runs.
|
|
213
|
+
- New games' `CLAUDE.md` and recipes 16 and 32 ask for a scenario for every end state (lose, die and respawn, retry, reload mid-run) and a read of `threedog verify`'s "ops never run" list.
|
|
214
|
+
- Recipe 56 lists what draws wrong on WebGPU without a thrown error (`Points` size, `LineLoop`, `linewidth`, `customDepthMaterial`, `MeshDepthMaterial`, `toneMapped`, `dithering`, `texture(map, uv)` and `map.repeat`).
|
|
215
|
+
- The docs no longer say the navigation library can be swapped: a module in the `nav` slot is Recast underneath (CONVENTIONS.md "What can be replaced"). Recipe 12 gives Recast's real download size.
|
|
216
|
+
- `nav({ links: [{ id, from, to, oneWay, radius }] })` (experimental): NPCs path across jumps and ladders. These are Recast off-mesh connections: a path point that starts one has `link: { id, from, to }`, tiles rebuilt by obstacles keep them, and `findPathAsync` sees the same ones. A link that attaches nowhere warns `nav-link` at the build.
|
|
217
|
+
- NPCs, `character.walkTo` and `nav({ crowd: true })` NPCs cross links in a straight line at walking speed unless the game says otherwise: `link:enter` and `link:exit` tell it when (`crossing.seconds` sets how long), `engine.characters.linkPose` bends the line. No default animation. An NPC saved mid-link goes on from the same spot after a load. Recipe 12, section 6.
|
|
218
|
+
- `characters.findPath`, `characters.findPathAsync` and `nav.findPath` now type their points as `NavPathPoint`: `{ x, z }` plus `link` on a point that starts a link. A game without links gets the same points as before and changes nothing; code that walks a path by hand past a link should stop at that point, or use `character.walkTo`.
|
|
219
|
+
- Particles: `size`, `color` and `opacity` take more than two stops, evenly spaced `[a, b, c]` or timed `[[0, a], [0.2, b], [1, c]]`, so a fade-in is possible. The two-point form reads as before; a list of three or more used to drop the rest and now uses them. A bad list throws `[module-params]` at `define`, `emit`, `attach` or `particles()`.
|
|
220
|
+
- Particles: the geometry attribute `aLife` holds each particle's life fraction (0 birth, 1 death) for a game's own material.
|
|
221
|
+
- Particles: `ratePerMeter` (effect option, option of `particles.attach`, live on the handle) emits per meter the emitter moves, spread along the path of the step, on top of `rate`. Default 0.
|
|
222
|
+
- Particles: `soft` fades a particle where it meets what writes depth, default 0, off. On WebGLRenderer it costs a depth-only draw of the scene per render while a soft effect is on screen; on WebGPURenderer's WebGL2 backend it works only with post and antialias on, and warns otherwise.
|
|
223
|
+
|
|
224
|
+
## 0.8.0 (2026-11-06)
|
|
225
|
+
|
|
226
|
+
npm never had 0.7.1: coming from 0.7.0, read this section and the 0.7.1 section below it, and follow `docs/MIGRATING-0.8.md`, which goes from 0.7.0 straight to 0.8.0.
|
|
227
|
+
|
|
228
|
+
- Decoded sounds no longer pile up: they are assets now, so `assets.release` takes a sound (name or path), `assets.trim()` and level changes free long ones, and long sounds over a memory budget go by themselves, the longest unused first. Playing sounds play on, a freed one loads again when played, effects under 10 s stay cached, `preload: true` keeps a track. A failed file by path now reads `Asset failed to load`, same code `asset-load`.
|
|
229
|
+
- Characters, vehicles and rigid bodies draw between fixed steps (`engine.stepBlend`), and the camera rigs follow that drawn place, so motion stays smooth on a screen faster than 60 Hz or when a frame runs no step or two. `root.position` and `mesh.position` stay the step's truth: gameplay reads what it read before, and the drawn pose is one step behind it, as swarms already were.
|
|
230
|
+
- `jumpBuffer: 0` means "this step only" instead of never jumping, a press now gets its whole `jumpBuffer` (one step more than before), and with `coyoteTime: 0` walking off an edge spends the ground jump instead of leaving a free air jump.
|
|
231
|
+
- `character.walkTo` no longer counts a long leg after a corner as being stuck: a path of several long legs used to replan at each one and ended `'stuck'` after `maxRepaths`.
|
|
232
|
+
- `session.load` asked while a new game is still running (right after a page opened with `?play`) waits and then loads; it used to join the new game, answer `true` and load nothing.
|
|
233
|
+
- `threedog types`: a name declared and never read is a hint in a game's code and an error in `packages/`. `shot <url>` on a built page keeps its fog, shadow, key and light facts and names what it could not read there (no three.js for the tools on a built page).
|
|
234
|
+
- `quests.define` refuses a quest without a `steps` list when it is defined; it used to throw on every check after `start`.
|
|
235
|
+
- The engine gives no help for this version's old names: a stale uniform name in shader text reads 0 with no warning, and an old `sky()` or `water()` option is an ordinary unknown option. See `docs/MIGRATING-0.8.md`.
|
|
236
|
+
- `saves.register({ movedFrom })` is removed; only the calendar used it. The time and day of a 0.2 save under the old `sky` part are no longer read. Every released sample save from 0.7.0 on still loads.
|
|
237
|
+
- `engine.sky.uniforms` is public, like `engine.water.uniforms`: the live handle for the uniforms given to `engine.sky.clouds()` and `engine.sky.layer()`, on both renderers (`engine.sky.dome.material.uniforms` only ever worked on WebGL).
|
|
238
|
+
- The field `calendar.daysPerSeason` is removed: nothing read it and writing it did nothing. The `calendar({ daysPerSeason })` option stays.
|
|
239
|
+
- `engine.THREE` is removed: `import { THREE } from 'threedog'`. Holding the whole of three.js on the engine kept every class in every game's bundle, and the package now has a `sideEffects` list: a bare `createEngine()` page went from 1561 KB to 1336 KB (470 KB to 397 KB gzipped). A dev page holds three.js under a private name for the engine's own tools (the picture check), a production build does not.
|
|
240
|
+
- The contract files are importable from an install: `import contract from 'threedog/modules/gameplay/inventory.contract.js'`, as `@threedog/tools/contract` says. They are plain data for checking a replacement.
|
|
241
|
+
- A model's clips moved from `model.userData.animations` to `model.animations`, three's own place. A game that cloned a model and then animated the clone crashed: three copies `userData` through JSON, which breaks the clips. A model with clips is now never batched, as the batching rule always said.
|
|
242
|
+
- `phase` on the engine has one more value, `'starting'`, while modules run their `init`; `'loading'` now starts after them.
|
|
243
|
+
- `uiFocus` is marked experimental: its shape may still change. `engine.input.push` is the stable route.
|
|
244
|
+
|
|
245
|
+
- 249 public names are now `@experimental`, so 1.0 does not freeze them: the ones no game, recipe, example or template uses, and the coordination features no test game has used (`engine.stacks`, `engine.wrap`, `engine.mod`, `time.channel`). None is removed; `docs/api-surface.txt` lists each one. They sit in: `adaptive`, `assets`, `audio`, `batching`, `budget`, `calendar`, `characters`, `checkOptions`, `collision`, `control`, `decoders`, `dialogue`, `error`, `firstPersonCamera`, `fixedCamera`, `flow`, `followCamera`, `ground`, `i18n`, `inRange`, `input`, `interactions`, `inventory`, `jobs`, `level`, `materialPatches`, `mod`, `music`, `nav`, `ops`, `page`, `particles`, `photo`, `pickups`, `player`, `post`, `quests`, `random`, `rays`, `rigid`, `rtsCamera`, `runState`, `saves`, `session`, `settings`, `sky`, `stacks`, `startup`, `stateApplied`, `stateRefused`, `stream`, `terrain`, `terrainMaterial`, `time`, `timeline`, `toggleOnKey`, `ui`, `uniforms`, `urlState`, `validate`, `vars`, `vegetation`, `water`, `weather`, `world`, `wrap`.
|
|
246
|
+
- NPCs and `character.walkTo` follow a path by one rule: an NPC skips points it has passed and no longer stands still for a step at each point, so it runs a few centimetres ahead of where it was mid-walk.
|
|
247
|
+
- `inventory.slotsUsed` is gone: read `inventory.of().slotsUsed`.
|
|
248
|
+
- `settings({ sections })` takes an entry `{ id: 'graphics', omit: [...] }` that leaves graphics rows out; an omitted row stays the game's value, and no preset or stored value moves it. A fixed pixel look omits `pixelRatio`, `antialias`, `adaptive` (recipe 62 section 4b).
|
|
249
|
+
- The WebGPU renderer no longer asks for `powerPreference` on Windows, where Chrome ignores it and warned on every page load.
|
|
250
|
+
- A damaged save is refused in more cases: an NPC `nav` that is not an object or a path that is not a list of points, a character speed that is not a sane number, a record with no `position`, content marks or an interactions part of the wrong shape, a physics body past ±1e7 (it hung the page for good). Each is `save-bad-record` at load (load false, game rolled back) instead of freezing the game. Found by the long fuzz runs.
|
|
251
|
+
- Docs: recipe 28 section 4b, a road laid on terrain: the road and the height function read the same data.
|
|
252
|
+
- A KTX2 model or texture asked for before `engine.start()` loads on WebGPU: the engine waits for the renderer's init itself, and `await engine.renderer.init()` is no longer needed.
|
|
253
|
+
- `engine.setCamera(kind, options)` before play (boot code, or with the title up) keeps its options when play starts.
|
|
254
|
+
- A moving physics body that freezes outside `rigid({ terrainRing })` warns once in dev, by name (`rigid-misuse`); recipe 11 explains the freeze.
|
|
255
|
+
- `hud.counter` with no label shows the value alone; it used to show the id.
|
|
256
|
+
- `inspect.perf()` on a halted page: `cpuMs` and `fps` are null and the text says they are not measured (they read 0). Its `lights` line says it counts point and spot lights.
|
|
257
|
+
- `input.holders` and `runState.blockedBy` count pushes and removes that wait for the next fixed step, so the status line of a halted page no longer names a closed window.
|
|
258
|
+
- Saves now hold the camera view: a new save part `cameraRig` (yaw, pitch), so Continue no longer loses a first-person view. Old saves load as before. `session.load` / `newGame` rebuild the installed rig on the same object, so a `const rig = engine.cameraRig` kept at boot stays the camera and a save part's `load()` that writes the rig keeps its write.
|
|
259
|
+
- Error codes merged before 1.0, one code per failure: `options-object` is now `bad-position`; `npc-option` is `character-option`; `pickup-prop-id` is `world-id`; `session-handle` is `module-handle`; `world-missing` is `module-needs`; `load-failed` is `asset-load`. `bad-arg` is gone: `input.bind` raises `input-keys`, `characters.support` raises `character-option`, `settings({ presets })` raises `module-params`.
|
|
260
|
+
- Some raises moved to the code that says what went wrong: `engine.stacks.define` of a known name raises `engine-misuse` (was `mod-owner`), `swarm.onStep` with no function raises `swarm-step`, `weather.set` with bad seconds raises `weather-option` (both were `module-params`), a damaged saved swarm raises `save-bad-record` (was `save-refused`).
|
|
261
|
+
- Four throws that protected nothing are now one dev warning: `engine.wrap` on a `_private` method works, `createEngine({ fallback })` without WebGPU starts, a vegetation `rule` beside `positions` plants the listed spots, `ui.theme.promptHeight` starts.
|
|
262
|
+
- Error text follows the current names: `shared-layer` no longer lists a `style` layer, `input-bound-twice` no longer mentions a module keys option, `rigid-misuse` covers the ragdoll cases, `quest-step` covers definitions, and other fixes that named the wrong call.
|
|
263
|
+
- Editor test fixes: the test pickup sat under the editor panel and could not be clicked (moved), the grid-item test model now turns with its record, and a drag where the outer turn ring would stand is checked to move the camera and write nothing (the turn handle shows the yaw ring only).
|
|
264
|
+
- Editor, first walked through by hand on a new game: opening it closes the title screen, Esc no longer opens the game's menu over the scene, the buttons stay in one place, a save says "Saved", a refusal is colored, a second Add lands beside the first, yes/no fields are lists (an unset `static` no longer looks like "no"), and a value the game cannot load (a `place` that does not exist) is taken back from the file at once instead of breaking the next start. `threedog content add` to a list written on one line opens it, one entry per line.
|
|
265
|
+
- `threePatches.off('lod-view-camera')` now works: LOD objects made after it keep three's own `update` and `clone`.
|
|
266
|
+
- `threedog how`: a sentence that only points at a recipe no longer ranks its row, and a text line joins the ranking only if it holds the typed word itself, so "webgpu", "node material" and "climb" reach their recipes again.
|
|
267
|
+
- A module's `type` is optional: without one it is `'rules'`. A module going against its type (a `ui` module binding keys, a `picture` module defining an op) now warns once in dev and the call goes through; it used to throw. An unknown type name still throws.
|
|
268
|
+
- `threedog state` and `threedog snap` (also `snap --play`) move no game time: they used to add a tick or two.
|
|
269
|
+
- Animators update in a core step right after the `onFrame` list, so an `anim.sync` / `go` / `set` from any `onFrame` shows the same frame.
|
|
270
|
+
- `engine.step()` during an unawaited `start()` or session change warns once in dev (`step-during-load`).
|
|
271
|
+
- `views.show` writes the fov through the engine's owner, so `autoView.manual('fov')` keeps the game's value, and `release()` gives the fov back.
|
|
272
|
+
- `assets.report` and `inspect.materials` share one texture slot table: `specularMap` is data in both, and a `lightMap` may be linear or sRGB in both.
|
|
273
|
+
- `createEngine({ audio: { music } })` key spelling is checked by `music()` when it installs, not in core.
|
|
274
|
+
- Removed: the error messages for names gone since 0.4 and earlier (`createEngine({ post })`, `createEngine({ style })`, `engine.elapsed`, a fourth `clock.after` argument): the first two are now plain unknown options. Error codes `renamed-field` and `shadow-type`, and `withHint` from `threedog/error-hints` (`hintText` stays).
|
|
275
|
+
- Removed before 1.0, nothing implemented it: the ground API's optional `ground.navGeometry`. The navmesh comes from `staticTrimeshes()`.
|
|
276
|
+
- `content.load` reads a pack's own `places` file; the `places` option goes on top, and `{ places: data.places }` is no longer needed.
|
|
277
|
+
- `weather()` no longer needs `sky()`: rain and snow fall without it, or under a game's own sky, which reads `weather.current.grey` and `weatherDraw.flash`.
|
|
278
|
+
- A low-tier device changes only defaults. `particles.define` `max`, `weather({ particles })`, a weather `count` and `sky.environment({ interval })` stand as the game gave them, as `colorResolution` already did.
|
|
279
|
+
- `sky.replace(false)` is in the type: it draws no sky. A skybox now reaches full brightness at the brightest row of the game's keyframes, not at ambient 1.2.
|
|
280
|
+
- `hlod` puts everything back when the module unloads. The shadows switch reaches near-only plants and plants on vegetation's own ground. `terrain({ viewFog })` keeps working under a replaced `terrain-draw`.
|
|
281
|
+
- `music.play`, `music.stinger`, `hud.counter`, `hud.bar`, `calendar.at`, `calendar.daily`, `calendar.between` and `vegetation.removeInstance` check their option keys.
|
|
282
|
+
- Removed, no reader anywhere: `settings.saved`.
|
|
283
|
+
- New in `threedog/tsl`: `noise`, `hash` (the engine's value noise, until now only in sky hooks) and `instanceOffset` (an offset through the instance's rotation and scale). `ctx.fx` in patches, sky hooks and post effect nodes now holds the same full list.
|
|
284
|
+
- `#include <threedog_uniforms>` declares every name on `engine.uniforms`, `uNight` and the sky values included. A shader that also declares one of them itself drops its own line.
|
|
285
|
+
- `engine.shadows.cache`: a batch now answers for its originals, so `{ static: cityRoot }` covers batched copies, and an InstancedMesh whose instances change, or that leaves the scene, redraws the kept map by itself.
|
|
286
|
+
- New: `adaptive.base`, the ratio this device or game starts at. A settings preset's `pixelRatio` is a share of it.
|
|
287
|
+
- Removed before 1.0, no game used them (`MIGRATING-0.8.md`): `adaptive.paused`, `settings.removeSection`.
|
|
288
|
+
- `hlod` hides a far original on the batch layer, the way `engine.batching` does. The `hlod-visible` patch and `userData.rayVisible` are gone: `mesh.visible` on a registered mesh is plain three.js again, and reads the game's value near and far. The full model of a far `assets.lod` waits on the same layer, so read `getCurrentLevel()` to see what is drawn.
|
|
289
|
+
- Occlusion culling keeps a game's `mesh.layers` write made while the mesh was hidden; showing it used to put the old mask back.
|
|
290
|
+
- Settings store only what the player changed, like `input.rebound()` for keys: one volume change no longer pins the render scale and every graphics value for later launches, and a preset is stored by name. A preset's `pixelRatio` is a share of the device's default ratio, so `medium` is no longer blurry on a 2x screen and `high` no longer renders 1.5x on a 1x one. `settings.values` is read only and `settings.get('pixelRatio')` is the real ratio. Stored files of version 1 are read: a value equal to the default lets go.
|
|
291
|
+
- `engine.setPixelRatio(p)` is now the top adaptive resolution climbs back to: it was undone within two minutes while the raw three.js call stayed. Adaptive may still lower it under load.
|
|
292
|
+
- New, off unless called, `@experimental`: `engine.rigid.ragdoll(character, { impulse, position, bones, limits, mass })` turns a skinned character limp and `rd.remove()` returns it to animation (recipe 11, section 3b). Reads common skeletons by itself, names what it cannot read; the mover, animator, capsule and camera yield and come back; the pose goes to the plain three.js bones in fixed steps; not saved. Partial or blended ragdoll is left out. `control.take` has a new layer, `physics`, between `cutscene` and `net`.
|
|
293
|
+
- Swarm: a handle kept in a field now stays good. Handles pass 2^24 after 16 births, and a Float32 column rounded them, so `row()` answered -1 as if the target had died. A game's own `fields` are `Float64Array` now (twice the memory per field); `x`, `y`, `z` and `r`, `g`, `b` stay `Float32Array`.
|
|
294
|
+
- `audio.buses.master` exists, as recipe 31 always said. A name that is no bus warns once with `[unknown-name]` and gives `master`, so `node.connect(audio.buses.wrong)` no longer throws and freezes gameplay in dev.
|
|
295
|
+
- Pure functions: a number such as `1e9` or `0xff` is no longer read as an outer variable named `e9` or `xff`, so `terrain({ height })` accepts them.
|
|
296
|
+
- `content.load`'s `unknown content` error now says `rules` must be listed in `content/index.js` too, and recipe 20 says the same.
|
|
297
|
+
- Docs: `n.fbm`, `noise` and `hash` run 0 to 1 (recipe 28); every `bloom` option with its default (52); pool lights and walls (09); `onBeforeCompile` on WebGPU and a node-material sky (54, 08); where the canvas is (01); `vegetation.define` order and keeping plants off a line (36); how `describe` nests a part (19). Recipes 02 and 04 no longer send a game to engine source or engine tests.
|
|
298
|
+
- Tools tell the truth, from four AI-built games. `check` reads `content/index.js`, what the page really loads: a kind listed there without `rules` is now an error instead of a green check and a dead page, and a file left out is a warning. A kind's `load` is optional: a game that imports its own file no longer writes an empty function. Valid TSL (`p.xy`, `.mul` on a `uniformArray` element) is a hint, not "engine API misused", and the worker check no longer reads `1e9` as a variable `e9`.
|
|
299
|
+
- `applyState({ fresh, play, pos })` keeps `pos` (a new run used to undo it while `state` printed Set). A view moves `engine.focus` to its target and waits for the world there, so `shot --view` no longer needs a `--pos` beside it. `threedog perf -w game` measures a game's page, as its usage line always said.
|
|
300
|
+
- `threedog test` says before the run, and again on a timeout, that a spec with `page.screenshot` left the GPU for software rendering; `software: false` keeps it on the GPU for a real picture. COMMANDS.md: a steering test holds the loop and advances with `engine.step`, so machine load cannot change its path.
|
|
301
|
+
- Picture check: edges are not read when the picture changes by itself between two identical renders (moving film grain read as "shadow stripes on 92%"); a line over a default budget says why the number exists and that nothing is cut at it. `threedog how` no longer prints a GLSL sample under a row in a WebGPU game. New games: CLAUDE.md names `threedog play`, STATUS.md no longer asks for three versions against "build it".
|
|
302
|
+
|
|
303
|
+
- Physics follows the `world` time channel: `engine.mod('time.world', { mul: 0.2 })` slows rigid bodies and vehicles with everything else, and a hit-stop at speed 0 holds them. To keep bodies at full speed, slow a channel of your own instead of `world`.
|
|
304
|
+
- The press that opens a window or dialogue from a fixed step no longer also acts on it. `h.fresh` counts input frames, ended by `input.endFrame()`, so it holds at any frame rate and no longer depends on who called `uiFocus` first.
|
|
305
|
+
- Renamed before 1.0 (`MIGRATING-0.8.md`): `engine.pause` is `engine.haltLoop` and `engine.paused` is `engine.halted`, because it stops rendering and an AI asked to pause a game reached for it and got a dead screen; a game freezes (`engine.freeze`, flow `'paused'`). The `pause` stack is `halt` and the error code `pause-owner` is `halt-owner`. `runState.state` is `'loading' | 'title-frozen' | 'halted' | 'frozen' | 'running'`: `'test-paused'` and `'paused'` go, and so does the `kind: 'test'` option.
|
|
306
|
+
- `engine.freeze(owner, { ambient: true })` is now a real still: skeletal animation, character animation and particles stop with `uTime`. A plain freeze, as behind a pause menu, keeps them moving as before. `engine.still` is true during one, for a game's own frame code.
|
|
307
|
+
- A page hold is a freeze (`MIGRATING-0.8.md`): a window in the background or a lost graphics device freezes gameplay by owner `'page'`, a full still. Cutscene tweens and camera moves used to run on over a stopped world, and `runState` said `running`. `page.held` is removed (`engine.frozen`, `runState.owners`), and `describe().page.held` goes with it. `step()` obeys it like any freeze; a page with the loop stopped has no hold, so tools still step a background window.
|
|
308
|
+
- Removed: error code `character-hook`. Nothing raises it: assigning `player.onStep` or `player.onLand` gets no warning; use the events `character:step` and `character:land`.
|
|
309
|
+
- Marked experimental, no promise at 1.0: `nav.crowd`. It hands out the raw Recast object, like `nav.navMesh`, `query` and `tileCache`.
|
|
310
|
+
- New, off unless called: `engine.shadows.cache(light, { static })` draws what does not move once and redraws only the rest, by copying a kept depth map into the light's shadow map on WebGPU (recipe 45). One plain map only, no cascades; other renderers draw everything, with a warning. Marked `@experimental`: no frame time has been measured yet.
|
|
311
|
+
- `threedog assets optimize --lod` writes lower-detail levels of each model (meshoptimizer simplification, geometry only) and reports triangles per level; skinned, morphing, animated and small models are skipped with the reason. `engine.assets.lod(name)` (experimental) or `lod: true` on a prop or template draws them as a plain `THREE.LOD`; off by default, and rays, collision and saves keep the full model. A LOD object is never batched.
|
|
312
|
+
- `threedog assets optimize` no longer needs the external `ktx` program: when it is not on PATH the textures are encoded by `ktx2-encoder` (npm, MIT, Basis Universal as WebAssembly), still by slot (normal / occlusion / roughness as linear UASTC, color as sRGB ETC1S). `ktx` on PATH stays the first choice; the output names the encoder and the encoding time. The "`ktx` is required" error is gone; with no encoder at all it says `npm i -D ktx2-encoder`. Field page `docs/testing/field/2026-11-05-ktx/`.
|
|
313
|
+
- Saves survive upgrades, now guarded: fixed sample saves from 0.7.0 and from 0.7.1 (`packages/engine/tests/save-compat/samples/`, every save part plus the stored settings) are loaded by a test on every run, and a save from a newer engine is checked to be refused with a message and no change. Nothing in the engine needed fixing. Every release now adds a sample and old ones are never edited (`docs/plans/release-checklist.md`).
|
|
314
|
+
- `engine.batching.tint` on a batch that had already drawn did nothing on real WebGPU: three built the batch's shader before the batch had any instance color, so the first tint never reached the GPU. The first tint now rebuilds the batch material once. Guard in bundles.mjs reads pixels on real WebGPU.
|
|
315
|
+
- `engine.batching` batches are no longer `DynamicDrawUsage`: on `WebGPURenderer` that refreshed every batch in full, every pass, every frame. City flight on a real GPU: frame median about 10.6 to 8.7 ms (one pair). Writes to a batch reach the screen as before.
|
|
316
|
+
- Three's `BundleGroup` works beside the engine, no new API: `engine.batching` leaves a mesh under a `BundleGroup` alone, `hlod.add` skips it with a warning, `describe().render.bundles` and the `inspect.scene()` reason `in-bundle` report it. It gained nothing on the city scene; recipe 05 says when it may pay.
|
|
317
|
+
- `engine.stream` unloads through `engine.jobs`, behind every build, so a row of blocks no longer leaves in one frame. An entry out of range can stay a few frames longer in the real-time loop; `engine.step` still finishes in the same frame.
|
|
318
|
+
- `engine.remove` counts the scene only when a part is held by neither `assets.shared` nor `batching.held`. Batching relists only the parents that changed.
|
|
319
|
+
- A damaged world save record whose `motion` is not an object (e.g. the number 25) is now refused at load as `save-bad-record` (load false, game rolled back) instead of throwing `Cannot create property 'vx' on number` in the fixed step and freezing the game; `motion: null` and game-own fields stay allowed.
|
|
320
|
+
- A hang the fuzz found: a position far past float precision (`applyState({ pos })` with z = -3.6e178, or any `placeAt` / ground call) froze the page for good, because the chunk loops (`cx = floor(x / size); ...; cx++`) stop advancing once `x / size` passes 2^53. Positions with |x| or |z| above 1e9 are now refused with the `bad-position` code and the position in the message (`xzOf`), so `applyState` reports `pos` as refused and the game goes on. Each fuzz case also has a time limit now (`FC_CASE_MS`; 60 s in the browser items, 30 s in the writer item): a case over it is a failure that prints its input, seed and path. Dev warning, once: a world record whose `jump` or `safe` is the wrong kind of value (a damaged or hand-edited save) is still repaired when the character writes its motion, but the warning `character motion: the world record's 'jump' is ...` now names the field.
|
|
321
|
+
- Fuzz tests (fast-check, fixed seed, short in the normal suite): the content writer now refuses values that are not data (NaN, Infinity, undefined, functions, bigints) by name instead of writing them as code, and writes a carriage return and -0 correctly; a damaged `scene` save part is refused as `save-bad-record` (load false, game rolled back, no frozen gameplay) instead of throwing a code error. Long run for a release: `FC_RUNS=300 threedog test Fuzz` (see `docs/plans/release-checklist.md`).
|
|
322
|
+
- Editor (dev server only): pickups get a height handle and can be added from the panel (items the game defines); a grid item turns in quarter turns and writes `rotation`; undo of a cleared field puts it back in front of the property that followed it (the content write takes an optional `spot`); an entry with computed values can be deleted and the delete undone; the turn handle's outer rings no longer tip the anchor. NPC facing is not content data, so NPCs get no turn handle, and schedules are still edited by hand.
|
|
323
|
+
- Dev warning, once: the game added its own light while the engine's placeholder lights (`engine.lights.sun`, `engine.lights.hemi`) are still in the scene, so the two add up. It names the fix, `createEngine({ lights: false })`; nothing is refused or changed, and there is no warning with `lights: false`, with the placeholders removed, or for a module's or pool's lights. New field page `docs/testing/field/2026-11-05-many-lights/` (frame time vs light count, lightPool, shadows, adding a light mid-play).
|
|
324
|
+
- Fewer freezes from hooks: a quest reward that throws (`content-place`, `ground-missing`) no longer leaves the quest half finished. `content.run` runs every effect of a list and rethrows the first error, the quest still finishes (`quest:done`, toast) and the failure is reported softly. A job that fails inside its commit tick no longer freezes the fixed step a second time; its promise rejects once. `ground-missing` (a prop, spawn or `snapToGround` beyond `terrain({ shape })`) and `swarm-disposed` (`spawn()` after `dispose()`, returns -1) are warnings now: the fallback was already safe.
|
|
325
|
+
- Surface names these changes touch, as the API lock lists them: `decoders`, `openWindows`, `uniforms.uCloud`, `uniforms.uCloudScale`, `uniforms.uCloudSpeed`, `uniforms.uCover`, `uniforms.uCurve`, `uniforms.uMoonPower`, `uniforms.uSunPower`, `sky.gradientCurve`, `sky.moonSize`, `sky.orbitSway`, `sky.orbitTilt`, `sky.starScale`. See `MIGRATING-0.8.md`.
|
|
326
|
+
- Removed before 1.0 (`MIGRATING-0.8.md`): `rays.cast`, `rays.pick`, `i18n.t`, `engine.openWindows`, `engine.decoders`, `EASINGS`, `assets.reportText` and `assets.users`.
|
|
327
|
+
- Removed and renamed before 1.0 (`MIGRATING-0.8.md`): `player.object` is `player.root`, `player.addTo` is `engine.add(player.root)`, `hud.add` is `hud.bump`, `dialogue.cps` is `dialogue.charsPerSecond`, `rtsCamera({ angle })` is `pitch`, `weather.define` is `weather.defineField`, `terrain.T` is `terrain.generator`, `terrain.CHUNK` is `terrain.chunkSize`.
|
|
328
|
+
- Marked experimental, no promise at 1.0: `player.saveMotion`, `player.loadMotion`, `engine.terrainDraw`, `engine.vegetationDraw`, `engine.weatherDraw`.
|
|
329
|
+
- Removed or renamed before 1.0 (`MIGRATING-0.8.md`): `rigid.R` is `rigid.rapier`; `collision.circles` and `collision.boxes` go (use `collision.forEachStatic`); `stream.readyCheck` is `stream.addReadyCheck`; `music.addTracks` is `music.define(name, track)`; `debug.startBench`, `debug.benchmarking` and the panel's stress button go (use `threedog stress`); the types `Object3D`, `Vector3`, `Vector2`, `Color`, `Quaternion`, `Material`, `BufferGeometry` and `Texture` are no longer exported from `threedog` (import them from `three`). `threedog assets` needs a verb (`optimize` or `check`). `doctor --json` prints `{ ok, summary, items }`.
|
|
330
|
+
- One meaning for `@experimental`: the name may change or go with no migration note. `api-count` reads the tag, a tag on a module or an engine member covers what hangs off it, and `docs/api-surface.txt` ends the line with it, so rule R55 lets it move and requires a note when a stable name gets marked. Newly marked: `net`, `Net`, `fakeNetwork`, `webSocket`, `threads`, `grids`, `Grids`, `Grid`, `Layer`, `hlod`, `ops.guard`, `ops.allow`, `terrain.edit`, `stream.source`, `stream.sources`, `stream.teleport`, `post.get`, `post.list`, `post.own`, `post.setAntialias` (tagged before, read by the lock only now), `rigid.rapier`, `rigid.world`, `rigid.playerBody`, `rigid.playerCollider`, `nav.navMesh`, `nav.query`, `nav.tileCache`, `nav.helper`, `assets.gltf`, `assets.draco`, `assets.ktx2`, `post.object`, `post.targets`, `shadows.csm`, `commits`, `swarm`, `terrainDraw`, `vegetationDraw`, `weatherDraw`, `bakeProbes`, `loadProbes`, `loadLightmap`, `moduleOrder`, `moduleStates`, `disabledModules`, `player.saveMotion`, `player.loadMotion`, `jobs.loadingMs`, `jobs.maxSteps`, `jobs.slowStepMs`, `stream.unloadFactor`, `batching.held`, `world.steps`, `level.heightfield`, all of `threedog/tsl` (`wind`, `cloudShadow`, `season`, `objectOrigin`, `uniforms`, `celLighting`, `detailBump`, `detailNoise`, `rim`, `shadowTint`, `waterFresnel`, `waterSurface`, `waterWave`, `wrapDiffuse`), `voxelGI`, `temporalAA`, `sunShafts`, `lightVolumes`. Only `--json` and MCP shapes are an interface; printed text may change.
|
|
331
|
+
- Uniforms renamed (`MIGRATING-0.8.md`): `uCloudScale` to `uCloudShadowScale`, `uCloudSpeed` to `uCloudShadowSpeed`, `uCloud` to `uWeatherCloud`, `uCurve` to `uSkyCurve`, `uCover` to `uGroundCover`, `uSunPower` to `uSunBrightness`, `uMoonPower` to `uMoonBrightness`. The dome's own `uCloudScale` and `uCloudSpeed` are now `uSkyCloudScale` and `uSkyCloudSpeed`, on `engine.sky.uniforms` and in sky hooks.
|
|
332
|
+
- `engine.batching`: the default cell is now four stream cells (256 m), not one (64 m). A cell no wider than a streamed block could not batch across blocks, so a model used a few times per block drew every copy alone. The city field run on WebGPU went from 19.8 ms to 9.4 ms a frame (real GPU, 14.4 km flight). Culling is coarser: 13-25% more triangles drawn there. A game with heavy props can set `createEngine({ batching: { cell: 64 } })`.
|
|
333
|
+
- Removed or renamed before 1.0 (`MIGRATING-0.8.md`): `engine.tick` is `engine.time.tick`; `engine.cpuMs`, `cpuMs`, `engine.cpuPhases`, `cpuPhases`, `cpuPhases.fixed`, `cpuPhases.frame`, `cpuPhases.render`, `cpuPhases.afterRender` are read through `engine.inspect.perf()`; `engine.terms`, `terms`, `terms.cloudShadow`, `terms.season` are `engine.shaderTerms`; `engine.view`, `view`, `view.manual` are `engine.autoView`; `terrain.isReadyAround` and `rigid.groundReady` are gone (`engine.stream.addReadyCheck` already waits on them); `lightPool.usage` is `engine.describe().lightPool`; `saves.queue` and `saves.prefix` are private (new `saves.putAttachment`, `saves.removeAttachment`, `saves.attachments`, `saves.storageKey`).
|
|
334
|
+
- Failure and "not found" have one shape (`MIGRATING-0.8.md`): `inventory.add` returns `{ ok: true, key, added }`, or `{ ok: false, code: 'full', facts }`, also on containers. `grids.get`, `inventory.get`, `interactions.get` give `undefined` when there is none, and `interactions.get` and `interactions.items` are typed.
|
|
335
|
+
- `clock.after(seconds, fnOrEvent, { data, channel })`: the third argument is options, as in `clock.every`; the old form throws.
|
|
336
|
+
- `player.onStep` and `player.onLand` were one-slot properties, and a second system silently took the slot: they are gone. Listen to the new `character:step` and to `character:land`.
|
|
337
|
+
- Writing `stream.radius`, `terrain.viewChunks`, `terrain.density`, `post.antialias` or `weather.auto` now takes effect like its `setXxx`.
|
|
338
|
+
- `engine.moduleOrder`, `moduleStates`, `disabledModules`, `bakeProbes`, `loadProbes` and `loadLightmap` are marked experimental.
|
|
339
|
+
- Tools: a second `tune write` always takes effect: a line with a hand comment or a Windows line ending used to run after the new value and win while the tool said "Written". The file keeps its line endings, and code in a material literal (`side: THREE.DoubleSide`) stays.
|
|
340
|
+
- Editor: steps run one at a time, each from the file as the last step left it, so an overlapping save, drag or Ctrl+Z no longer corrupts the undo history or gets refused as a conflict. A drag or a row being typed in survives a save landing under it; a dead dev server is a refused step. A file put back to the editor's last text now reloads the page. Add skips an id only the file has; a broken list in a json row is refused; a field written as `null` can be edited; key order no longer counts as a conflict; a failed check leaves a hand save alone; removing an NPC reloads the page.
|
|
341
|
+
- Tools: `threedog stress` stops on a lost WebGPU device or an uncaptured GPU error (it read as spare capacity), frees each step's instanced mesh, and keeps the load inside the view. Both stress pages now share `@threedog/tools/stress-load`, so a game on WebGL gets gpu ms too.
|
|
342
|
+
- `engine.stateRefused`: what the URL parameters or the latest `applyState` could not do. `shot` and `capture` fail on a value you named that the page refused (`--weather rian`). A weather refused early and accepted late is no longer reported, and a hook refusing `at` is a refusal, not a position error.
|
|
343
|
+
- `describe().world.changed` leaves out where a record with motion stands (a walking NPC), so the Changed line keeps what a command did; runtime rows hold a copy of the position.
|
|
344
|
+
- `check` in a game: file size (R1), copied passages in game docs (R22), paths, commands and links in game docs (R18), a module with no key (R51) and setup-time creation (R33) are warnings now. R33 stays an error only for `{ initial: true }`, and its fix names `// runtime: <reason>`. A stale GAMEMAP warns in a game and still fails for the engine's examples. `lib` no longer reads `createEngine(cfg)` as WebGL.
|
|
345
|
+
- No key is not an error: `interaction-no-key` is a dev warning and play goes on. `interaction.use` runs when code asks, `ops` does not offer it, and the `noKey` code is gone. `engine.input.bind('interact', [])` says no key on purpose.
|
|
346
|
+
- Sky: a second `engine.sky.environment()` replaces the first. `engine.sky.replace(false)` means no drawn sky. `sky({ time })` with a calendar warns once in either install order. `engine.sky.layer` takes any non-empty name. `engine.sky.sunDir` is the same vector as `uSunDir`, and a game's write stays (`engine.autoView.manual('sunDir', false)` gives it back). `camera.aspect` is the owned value `view.aspect`. A direct write to `uSkyTop`, `uSkyHorizon`, `uDaylight` or `uTimeOfDay` warns once (`signal-overwritten`) with the entry to use.
|
|
347
|
+
- `applyState`: `season` with no calendar and an `at` nothing knows go into `refused` instead of throwing after a partial apply. The `state-at` code is gone.
|
|
348
|
+
- `world`: `{ save: false }` records may hold anything, unless the kind is simulated with `worker: true`. A class instance in a saved record (`Vector3`, `Color`) is refused at once instead of failing after a load, and the error gives the line to copy.
|
|
349
|
+
- Fewer freezes from the loop: an `approach` interaction on a held character is refused with `cannotWalk`, an NPC yields when a game holds it on the base layer, a WebGL-only material added after start is reported without stopping play.
|
|
350
|
+
- New games: the template colors the engine's background instead of assigning one, so `sky()` shows and `palette.background` still works. Style advice in the template reads as defaults, with plain three.js named as equally valid.
|
|
351
|
+
|
|
352
|
+
- Loading: a model whose textures failed to decode (KTX2 transcoder, bad image) now counts as loaded with missing references: `describe().loading.ok` is false, `warnings` names the file, and `threedog loading` says "N partial" instead of "N/N ok". Before, GLTFLoader swallowed the failure and everything read ok.
|
|
353
|
+
- Audio: `describe().audio` (present while a bus is ducked or a voice plays) and `engine.audio.info` (now documented) report the duck level the active ducks ask for, not the gain node's value mid-fade, so a fade reads right on a headless page where the audio clock stands still.
|
|
354
|
+
- Errors: the `asset-load` hint tells "called before the backend is initialized" (a load before `engine.start()`) from a real 404; the `not-installed` hint says it is a plain TypeError and when engine.<module> is the cause. The error log names an Event or an empty-message rejection instead of `{"isTrusted":true}`.
|
|
355
|
+
- Tools: `shot --keep --out name.png` writes exactly `name.png` (the timestamp is only for generated names); the scenario line uses ground and weather ids, not the translated names. Recipes 16, 26 and 34 note the position formats, that `bloom` / `ao` rows already exist, and that occlusion culling hides nothing in step mode.
|
|
356
|
+
- Pathfinding: without a navmesh, `characters.findPath` returns `null` (`noPath` when detailed) for a target inside a wall or water, and its straight legs are sampled every 0.12 m, so a route no longer clips wall corners (up to 0.3 m before).
|
|
357
|
+
- Describe: records without a name (props, template instances) now appear in `nearby` by id with their kind, the nearest 8 only.
|
|
358
|
+
- Describe: `ambience` carries `audioLocked` while its rules wait for a click or key press, so an empty `on` on a bridge page is not read as "no rule matches here".
|
|
359
|
+
- Tools: `play --stop` asks the server up to three times and stops a stuck one named in dev.json, instead of removing the record and leaving the process alive.
|
|
360
|
+
- Docs: recipe 26 covers hiding the interface for a photo mode (engine ui and plain three.js), custom title items closing the title, and the HUD unit following the engine locale.
|
|
361
|
+
|
|
362
|
+
- Library: `lib pull` refuses an entry that cannot draw on the game's renderer, with nothing copied, and `lib check` fails on such a copy (GLSL in a WebGPU game, a node material in a WebGL game). `--force` copies it to port by hand; the check reads the copy, so a port clears it. Node materials and TSL now count as WebGPU only when an entry's `backends` are read from its code, and an entry without `backends` gets them from its files.
|
|
363
|
+
- Library: `lib pull` prints the import path where the file landed, not the path stored from the game the entry came from.
|
|
364
|
+
- Assets: `assets.texture()` and models with textures before `start()` work on the WebGPU route. The upload waits for the first frame instead of throwing "initTexture() called before the backend is initialized".
|
|
365
|
+
- Docs: COMMANDS.md says where each kind of library entry lands; the `modular-building` README says what `examples pull` copies and that the demo page stays in the engine repository.
|
|
366
|
+
- `threedog capture` works on WebGPU games: it hooks the draws of WebGPURenderer, prints the renderer it measured, skips Spector on real WebGPU and says so, and fails on a frame with no draws. It now prefers the hardware GPU.
|
|
367
|
+
- `threedog stress` measures the game: from a game folder or with `-w` the load goes on top of the game's scene on its own renderer. A WebGPU game without real WebGPU is refused. The neutral page stays for the engine repo and is named as such.
|
|
368
|
+
- `engine.inspect.perf()` says "nothing measured yet" before any draw is counted: new field `measured`, `ok` is false, no tick on frame metrics.
|
|
369
|
+
- `threedog bake light` traces rays through a BVH instead of a probe grid: sky no longer leaks into rooms through walls, and pillars shade the floor. `--spacing` is gone, `--samples` now means rays per texel (default 128). The sky now matches the strength of the hemisphere light it stands for, so bake again and compare. A map with no light fails and writes nothing; a failed shader is printed.
|
|
370
|
+
- `threedog tune write` merges into the earlier block instead of replacing it; the block passes `threedog types`; `tune` takes `-w`; with no file it names the values that need one.
|
|
371
|
+
- Docs: tuning without a mouse (COMMANDS), turning the ambient off after a bake and the `?bake=1` flag (recipe 34).
|
|
372
|
+
|
|
373
|
+
- Input: pressing the interact key with nothing to use is no longer silent. The press lands in the op history as a refused `interaction.use` (`inputLocked` with the context holding the input, or `nothingNear`), and `threedog test` prints it, the input lock and the open dialogue under a failed spec. `describe().ui.dialogue.advance` names the keys that advance a dialogue.
|
|
374
|
+
- `threedog init`: leaves a game that passes its first `threedog check` (it writes GAMEMAP.md; the extra `map` step is gone from the READMEs and recipe 01); a package already in `devDependencies` is not also added to `dependencies`; files the template layers wrote are no longer reported as "existing files kept".
|
|
375
|
+
- `threedog check -w <game>` reads that game alone: tsc and R18 no longer go through every game, example, spec and engine doc only to throw the results away, the generated-doc checks of the engine stay in the root check, and the other parts run beside the rules instead of after them. The line that counted other workspaces' type errors is gone with it.
|
|
376
|
+
- Characters and NPCs take `model: [name, ...args]` like props (it crashed inside `Object3D.add` and `check` could not see it); arguments on a file or async model stop with `character-option`. The open-world template declares `home` in `content/places.js`, so `{ place: 'home' }` passes `check`. `art board` and `lib` run in a repository root stop and ask for `-w <game>`. Recipe 02 says `humanoid` is your own asset, and the game template says how to set `locale`.
|
|
377
|
+
- Editor (dev server only, F2): first version done. Edit the selected entry's properties from its field table, add an entry from the game's templates and named models, delete one, undo and redo (Ctrl+Z, Ctrl+Y; the file comes back byte for byte, a hand edit in between refuses it). Moves now cover height and rotation, the real model follows the drag, and `static: false` entries, physics bodies, grid items (`cell`) and NPCs (`start`) can be picked and moved. `threedog content` write-back gained `unset` and `restore` in `contentWrite` for this; the CLI is unchanged.
|
|
378
|
+
- `engine.applyState` resolves to `{ ok, refused: [{ key, value, reason }] }`: a weather name the game lacks or a key no module handles is reported, not dropped. A module hook refuses with `{ refused: { key: reason } }` and lists its keys in `stateKeys`. `fresh: 1` now means yes; a `fresh`, `wait` or `pos` value it cannot read throws `state-value`.
|
|
379
|
+
- `describe()` has `vars` (story flags and counters) and `world.changed` / `world.removed` (what play changed, capped at 50 with the rest counted), so a snapshot and `expectDescribe` see them. Snapshots drop `picture.writers` (frame counters), compare story counters exactly, and an `--only` path found nowhere fails instead of matching nothing.
|
|
380
|
+
- A bad position is refused, not an engine error: `thing.set` answers `badPosition` in `can`, and an op whose argument is that position fails with that code, so gameplay no longer freezes on it. A NaN an op worked out itself is still an engine error, where it happened.
|
|
381
|
+
- Bridge commands report what took effect: `state` fails with the reason and exit 1, `step` and `hold` say how many seconds really passed and fail when short, `press` fails when the engine stopped, scenarios stop on a refused state or a stopped engine. `op` refuses a value that does not fit its shape, and accepts `position=3,0,4` for an untyped argument. `press` and `op` print a `Changed:` line.
|
|
382
|
+
- Bridge output: every cut says so and how to see the rest; `ops` no longer prints `[object Object]`; `log()` shows in `js` checks scripts and when a script throws; `status` counts only errors since `threedog reload`; `catalog --find` searches the library and says when nothing is found; `threedog --help` and `<bridge command> --help` exit 0.
|
|
383
|
+
- A page that died at start answers in seconds, not over 100: the wait counts errors from before the command, and the bridge's headless page records them from its first line.
|
|
384
|
+
- `new-game --open-world` games start with `presets.weather.temperate`, so `state weather=rain` works in them.
|
|
385
|
+
- `threedog how`: searches the api pages and every docs line, not only the AI.md rows and recipe headings; handles word forms (`pixelate`, `arrangement`); orders GLSL or TSL answers by the game's renderer (from `main.js`); says "the docs never use" a word only after a search of every docs line.
|
|
386
|
+
- Calls that did nothing and said nothing now warn or leave a record, none is refused: container start items that do not fit (warn, names the container), `quests.start` on a done quest (warn), a swarm spawned before the first new game or load and cleared by it (warn), `music.stinger` with audio not running (the `music:stinger` event still fires, with `played: false`; it also gets `played: true` when it sounded).
|
|
387
|
+
- Settings: `settings.reset(key?)` puts one value (or all) back to the engine's or the game's default; `resetBindings()` still does keys.
|
|
388
|
+
- Docs: `readParams` throws on a wrong type in every build (only an unknown key is dev-only); `heightScale` wording; recipe 11 sample car drives 20 m in 3 s; swarm in the new game's CLAUDE.md and GAMEMAP "Not used yet".
|
|
389
|
+
|
|
390
|
+
- Assets: manifest entries whose `fallback` names loop back (a to b to a) now fail once with `asset-fallback-cycle` naming the chain, instead of waiting on each other forever.
|
|
391
|
+
- Sky: removed the options `moonSize`, `starScale`, `gradientCurve`, `orbitTilt`, `orbitSway`. They only set the start value of a uniform or field that stays writable (`engine.uniforms.uMoonSize` etc.), so the engine keeps one entry, not two; using one throws `sky-option` naming the entry. Notes in `docs/MIGRATING-0.8.md`.
|
|
392
|
+
- `engine.remove` keeps a geometry or material another object in the scene still uses, and disposes it with its last user. `stream.add`'s default unload goes through it, so unloading one block no longer makes the renderer rebuild every block that shares its models. Code that relied on `remove` disposing a shared geometry at once should dispose it itself. On WebGPU the records of loaded objects now stay until those objects leave the scene, so peak GPU memory is higher (about 110 MB in the city stress run) and levels off.
|
|
393
|
+
- Batching: its per-frame check is bounded in meshes instead of roots, and batched originals stay out of three's walks during the engine's draw (`describe().threePatches`: `batching-draw-walk`). A district of streamed blocks went from about 60-70 ms to about 22 ms a frame.
|
|
394
|
+
- API lock for 1.0: `docs/api-surface.txt` lists every public name with its signature (engine repository only). `threedog check` rule R55 fails when the surface differs from it; a removed or retyped name also needs a line naming it under this heading. `threedog api-count --lock` rewrites the snapshot. The old `api count` total guard is gone (the snapshot covers it).
|
|
395
|
+
|
|
396
|
+
## 0.7.1 (2026-11-05)
|
|
397
|
+
|
|
398
|
+
Never on npm: it reaches users inside 0.8.0. Bug fixes for asset lifetime, WebGPU memory and `assets optimize`, plus new optional tools; nothing public was removed. Upgrade notes are in `docs/MIGRATING-0.8.md`.
|
|
399
|
+
|
|
400
|
+
- Asset lifetime: a load now owns its data. Copies of a model that fell back count on the entry that really has the data, so `assets.trim()` and `release` no longer free what those copies use, and `modelNow` works for such a name. `users('shrub')` is the copies asked for by that name; `users('rock')`, the name it fell back to, counts them too. When the fallback's data is freed, the name loads again on its next use.
|
|
401
|
+
- A load ended while it runs (`release`, `trim`, a palette write, a name registered again, `dispose`) is freed when it arrives and never written back; a download is aborted, and a font never reaches `document.fonts`. Code awaiting it: after `release` and the like it gets a fresh load, never freed data; after `dispose` the promise stays pending for good, and so does any later `model()` / `texture()` / `font()`, so nothing rejects during teardown or resumes against a dead engine.
|
|
402
|
+
- A palette write no longer leaves a generated model's old build behind: it is freed with its last copy, or at once with none. Registering a name again does the same. Generated textures and internal `cached()` builds stay as they were, because nothing counts who uses them.
|
|
403
|
+
- Recipe 18 §4b follows one object from creation to removal and says who owns what at each step.
|
|
404
|
+
- New `--json` on `threedog check` and `threedog test`: one result on stdout, `{ ok, summary, items: [{ code, level, file, line, message, fix }] }` (fields only when known); the text goes to stderr and the exit code is unchanged. Items carry the rule id, the TS code, `content` or `test`, and the rule's fix. The MCP `check` tool reads this shape instead of parsing text.
|
|
405
|
+
- `new-game` and `init` write `AGENTS.md` beside `CLAUDE.md` (the same text) for tools that do not read CLAUDE.md; an existing `AGENTS.md` is kept.
|
|
406
|
+
- New optional module `swarm()`: many same-kind gameplay objects (bullets, enemy crowds, pickups, debris) in typed arrays, one `InstancedMesh` each. `engine.swarm({ name, capacity, geometry, material, fields })`, then `spawn`, `free`, `row`, `onStep`, `near`, `clear`, `dispose`. Stable handles, fixed-step update on a time channel, drawing smoothed between fixed steps, opt-in saves. Recipe 65. Nothing changes for a game that does not install it.
|
|
407
|
+
- New `engine.stepBlend`: how far the drawn frame is between two fixed steps, for drawing fixed-step state smoothly.
|
|
408
|
+
- New `threedog content stamp`, `content set --source` and `content capture`: copy an arrangement (`content/arrangements/<name>.js`, read by tools only) into plain entries, batch-edit every copy explicitly, and capture a named group from the running game into an arrangement. Rule R52 warns while a captured and stamped group is still named in code.
|
|
409
|
+
- Recipe 65 shows pure-picture bulk with TSL compute on WebGPU (plain three.js, no engine API).
|
|
410
|
+
- WebGPU memory: a mesh dropped while its material stayed in use kept its render record, geometry arrays and GPU buffers until the renderer died. The engine now sweeps these records every few seconds, for engine paths and plain `scene.remove` alike, so a game has nothing to do (recipe 56): a plain three.js scene dropping 60,000 meshes went from 1.1 GB of heap to a flat 200-260 MB, and a 7.8 km terrain flight from +72 MB to +25 MB, flat to 15.6 km. It reads a private three.js list; if an upgrade moves it, the sweep turns off with the warning `webgpu-records-unread`. `threePatches.off('webgpu-record-sweep')` switches it off.
|
|
411
|
+
- Dev warning `geometry-undisposed`: geometries nothing in the scene uses keep piling up on the renderer. The fix is `geometry.dispose()` when a mesh is gone for good.
|
|
412
|
+
- `threedog check` rule R53 fails on merge conflict markers committed in any tracked text file.
|
|
413
|
+
- `threedog assets optimize`: the optimized pack now comes last in `assets.js` (a game rewritten by the old command is moved over), so `/optimized/x.glb` wins over an original of the same name, and that override no longer prints the "replaced by manifest" warning. A cached model is no longer skipped from the problem count: `--strict` and a lower `--budget` judge it like a fresh run. `module-cycle` no longer fails with an internal TypeError when the first module in the list only waits behind a cycle.
|
|
414
|
+
|
|
5
415
|
## 0.7.0 (2026-11-05)
|
|
6
416
|
|
|
7
417
|
- Public surface audit (`threedog api-count --unused`): removed `engine.level.object` (same as `level.root`); dropped from the public types (code stays, engine-internal) `engine.triggers.action`, `engine.settings.action`, `engine.interactions.action` (copies of the module option), `engine.inventory.defs`, `engine.quests.defs` (use `inventory.item(id)` and `quests.list()`). 98 more unused names are kept on purpose, each with a reason in `packages/tools/api-count.mjs`
|
|
@@ -26,7 +436,7 @@ What changed in each version and how a game upgrades.
|
|
|
26
436
|
- New: picture parts. `PICTURE_SLOTS` and the type `PictureSlot` name the picture values only one writer may hold (sky, fog, tone, environment, background, sun); `describe('picture').picture.slots` shows the holders; `engine.unuse(name)` removes a module. On the dev server a write to a value another part holds warns `picture-held`, and a removed picture part's leftovers warn `picture-leftover` (recipes/62-picture-code.md 3e).
|
|
27
437
|
- Fixed: the sky dome stayed in the scene after `engine.use(mySky(), { replaces: 'sky' })`.
|
|
28
438
|
- Breaking: `look` no longer names picture things. The game folder is `picture/` and `createPicture(engine)`, gameplay calls `picture.lamp(id)`; the module type is `'picture'`; the drawing parts are `terrainDraw`, `vegetationDraw`, `weatherDraw` with slots `terrain-draw`, `vegetation-draw`.
|
|
29
|
-
- Breaking: the look check is the picture check: `--no-picture`, `picture` and `pictureMs` in `shot --json`, the `Picture intent:` line in DESIGN.md, `lib add --kind picture`, `@threedog/tools/picture-check`. Seven recipes and the `plain-picture` example are renamed.
|
|
439
|
+
- Breaking: the look check is the picture check: `--no-picture`, `picture` and `pictureMs` in `shot --json`, the `Picture intent:` line in DESIGN.md, `lib add --kind picture`, `@threedog/tools/picture-check`. Seven recipes and the `plain-picture` example are renamed.
|
|
30
440
|
- New (dev server only): `describe('picture').writers` and `engine.explain({ picture: 'fog.far' })` (`threedog explain picture fog.far`) name the file:line that last changed a light, fog, tone, environment, background or material value; a value not tracked says so. Two places writing one value in one frame with different results give one warning (`picture-conflict`) naming both. The look check adds measured facts: a `ShaderMaterial` that ignores fog or tone, a light layout changed during play, transparent meshes whose pixels depend on draw order. Recipe 62 "Wiring `picture/` parts".
|
|
31
441
|
- Breaking: `makeMaterial`, `engine.makeMaterial`, `look.materials`, `look.surface` and the glow verb are gone, and so are the material and patch plugin slots: materials are plain three.js. New: `applyEffects(mat, { lighting })`, `rampTexture`, the `uNight` signal.
|
|
32
442
|
- Breaking: `createEngine({ style })` is gone and throws with the fix: the look is plain three.js in the game's `picture/` code, UI colors go in `createEngine({ ui })`, season tints are `engine.sky.seasonTints`; `types/style.d.ts` and `core/styleParts.js` are deleted.
|