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/docs/api/characters.md
CHANGED
|
@@ -4,69 +4,78 @@ Characters: createPlayer() (characters() module)
|
|
|
4
4
|
|
|
5
5
|
- Options `CharactersOptions`:
|
|
6
6
|
- `npcs?: boolean` Whether to enable NPCs (engine.npcs), default true
|
|
7
|
-
- `npcTiers?: { fullRadius: number; nearEvery: number }` Near tiers for large NPC crowds, off by default (every near NPC walks every fixed step); same as engine.npcs.tiers(opts)
|
|
7
|
+
- `npcTiers?: { fullRadius: number; nearEvery: number }` (experimental) Near tiers for large NPC crowds, off by default (every near NPC walks every fixed step); same as engine.npcs.tiers(opts)
|
|
8
|
+
- `fall?: 'rescue' | false | ((facts, engine) => 'rescue' | false)` The rule 'fall' for everyone: 'rescue' brings what falls out of the world back; left out, the engine rescues nothing. engine.mod('fall', ...) from the game sits above it
|
|
8
9
|
- `animation?: AnimatorOptions` What every character's Animator starts from, e.g. { fade: 0.15 }; a model's manifest mapping and the character's own animation win over it
|
|
9
10
|
|
|
10
11
|
## Methods and properties
|
|
11
12
|
- `characters.findSpawn(position?: PositionLike, opts?: FindSpawnOptions) → Vector3` — Find a spawn point: searches outward from position (default origin) for walkable (not steep, no obstacle), non-water ground, without assuming terrain height; e.g. findSpawn(v, { minH: 3, maxH: 20 }). Returns a Vector3 (y is the ground height)
|
|
12
13
|
- `characters.createPlayer(opts: PlayerOptions) → Character` — Create the player and set engine.player; control is required (no default feel), e.g. createPlayer({ ...presets.player.thirdPerson, spawn }). An existing player is deleted first
|
|
13
|
-
- `characters.moveInput() → { x, z, run }` — The 'camera' player control as a value: keys / stick relative to the camera, the 'run' action if bound, input.autopilot. Reused object; call it inside your own control function to wrap it
|
|
14
|
+
- `characters.moveInput(seat?: Seat) → { x, z, run }` — The 'camera' player control as a value: keys / stick relative to the camera, the 'run' action if bound, input.autopilot. Reused object; call it inside your own control function to wrap it
|
|
15
|
+
- `characters.addVehicle(vehicle: any) → { remove(): void }` — Join the vehicles a saved rider can be seated in again, before or after the load
|
|
14
16
|
- `characters.support(object: any, opts?: { id?, safe?, carry?, inherit? }) → { id: string; remove(): void }` — Something characters stand on and ride (moving platform, lift, raft). Move the object any way (onFixed before or after the player, a timeline, physics): riders follow how its matrix changed, so the order does not matter. safe: false = never a respawn spot; carry 'position+yaw' turns riders with it; inherit: false = jumping off keeps none of its speed. With mover 'rapier' give it a collider too. Example: `const lift = engine.characters.support(liftMesh); engine.onFixed(() => { liftMesh.position.y = 2 + Math.sin(engine.time.now('real')); });`
|
|
15
|
-
- `characters.removePlayer()` — Delete the current player (exits the vehicle first, stops responding to keys, fully deletes the model). The player save (key player) carries the position and the vehicle; loading an on-foot save exits the vehicle first
|
|
16
|
-
- `characters.findPath(from: PositionLike, to: PositionLike, opts?: FindPathOptions & { detailed?: false }) →
|
|
17
|
+
- `characters.removePlayer(id?: string)` — (experimental) Delete the current player (exits the vehicle first, stops responding to keys, fully deletes the model). The player save (key player) carries the position and the vehicle; loading an on-foot save exits the vehicle first
|
|
18
|
+
- `characters.findPath(from: PositionLike, to: PositionLike, opts?: FindPathOptions & { detailed?: false }) → NavPathPoint[] | null` / `findPath(from: PositionLike, to: PositionLike, opts: FindPathOptions & { detailed: true }) → PathResult` — Pathfinding (the single entry point): uses the navmesh when nav is installed and ready, otherwise the A* fallback. Returns a path [{ x, y, z }...], or null if unreachable
|
|
17
19
|
- `characters.findPathAsync(from: PositionLike, to: PositionLike, done: (path, status) => void, opts?: { radius?, step?, maxNodes? }) → { remove(): void }` — findPath for many callers (NPC crowds, AI squads): solved in engine.threads workers; done(path, status) runs on a fixed step a few steps later (same paths with threads on or off). Recipe 12 section 4
|
|
18
20
|
- Properties:
|
|
19
21
|
- `material: Material` The three.js material of every placeholder capsule. Set it to swap the look of all of them at once; used as given, with no patches added. A character with colors.body draws with a copy of it in that color. A model's own materials are the model's. Example: `engine.characters.material = new THREE.MeshToonMaterial({ color: 0xd9a066 });`
|
|
22
|
+
- `kit: { beginMove, groundAt, endMove, ownState }` What a game's mover calls to take part in contact, each optional (recipe 57): a mover calling none owns contact itself (beginMove() groundAt() endMove() ownState())
|
|
20
23
|
- `pathsPerStep: number` How many findPathAsync requests leave per fixed step (default 32); the rest wait for the next steps
|
|
24
|
+
- `linkPose: ((t, position, crossing, character) => void) | null` (experimental) Bends a link crossing away from its straight line: t 0-1, called each step after position is set on the line, write to position. Depends only on its arguments, so a crossing saved halfway resumes on the same curve. null = the straight line
|
|
21
25
|
|
|
22
26
|
## Character (engine.player / NPC are both Character)
|
|
23
27
|
- `player.push(vx: number, vz: number, seconds: number)` — Move at a fixed velocity (m/s) for seconds, ignoring move()'s direction and without turning (knockback, dodge roll); gravity and collision still apply
|
|
24
28
|
- `player.stat(name: 'speed' | 'runSpeed' | 'gravity' | …) → number` — A movement stat as the mover uses it now: the base field with every engine.mod('move.<name>') entry applied (canJump reads 1 / 0). Example: `engine.mod('move.speed', { owner: 'haste', id: 'player', mul: 1.2, for: 5 }); player.stat('speed') // 1.2 x player.speed`
|
|
25
|
-
- `player.addJumps(n?: number)` — Give back n jumps for this airtime (pickup, wall touch)
|
|
26
|
-
- `player.resetJumps()` — All jumps back, as if it had landed
|
|
29
|
+
- `player.addJumps(n?: number)` — (experimental) Give back n jumps for this airtime (pickup, wall touch)
|
|
30
|
+
- `player.resetJumps()` — (experimental) All jumps back, as if it had landed
|
|
27
31
|
- `player.launch(speed: number, opts?: { owner?: string })` — Throw it upward at speed m/s (jump pad, spring): leaves the ground, ends coyote time, the ground jump counts as used (air jumps stay); emits character:launch. Example: `player.launch(19, { owner: 'pad' })`
|
|
28
|
-
- `player.jumpState() → { grounded, coyoteLeft, bufferLeft, jumpsUsed, jumpsLeft, vy }` — Jump state now, read-only
|
|
32
|
+
- `player.jumpState() → { grounded, coyoteLeft, bufferLeft, jumpsUsed, jumpsLeft, vy }` — (experimental) Jump state now, read-only
|
|
29
33
|
- `player.enter(vehicle: Rideable)` — Board a vehicle (rigid.addWheeled's, or any object with the vehicle contract): the driver seat when free, else a free passenger seat; no-op when full
|
|
30
34
|
- `player.exit()` — Exit the vehicle
|
|
31
35
|
- `player.playAction(name: string)` — Play a one-shot action (e.g. 'wave'); skipped if the model has no such clip
|
|
32
36
|
- `player.onPose(fn: (character, dt) => void) → { remove(): void }` — Run fn(character, dt) every frame right after the animation pose is applied (model clips or procedural rig): attach things to bones or adjust bones. h.remove() stops it. Presentation only. Example: `const h = player.onPose(() => sword.position.copy(hand.getWorldPosition(v)));`
|
|
33
37
|
- `player.dispose()` — Fully delete this character: exits the vehicle first, releases animation and movement, removes it from the scene and releases geometry and materials (used by npcs.remove / removePlayer)
|
|
34
38
|
- `player.jump(opts?: { air?: boolean })` — Request a jump (buffered for jumpBuffer s): the ground jump on the ground or in coyote time, else an air jump while maxJumps allows; air: false = ground only. Example: `createPlayer({ ...presets.player.thirdPerson, maxJumps: 2 }) // double jump`
|
|
35
|
-
- `player.addTo(scene?: any)` — Add to the scene
|
|
36
39
|
- `player.placeAt(position: PositionLike)` — Put it on the ground at position (Vector3 / object / [x, y, z] / { x, z })
|
|
37
40
|
- `player.syncRecord()` — After moving root yourself (a cutscene path, a scripted pose): write position and motion back to its world record (the player's), so a save right after has it
|
|
38
41
|
- `player.walkTo(target: Vector3 | { x: number; z: number } | [number, number, number] | …, opts?: { speed?, arrive?, turnRate?, stuckSeconds?, maxRepaths?, run? }) → Promise<{ status: 'arri… & { remove(): void }` — Walk to a point along characters.findPath on fixed steps; never rejects. One walk per character: a new walkTo, dispose() or a save load ends the old one with 'cancelled'. Transient: not saved, not fast-forwarded by engine.skip. Holds the character's control on layer 'script' (owner 'walkTo'): the player's keys / an NPC's schedule pause meanwhile, a cutscene pauses the walk, and another script owner on it is control-conflict
|
|
39
|
-
- `player.move(dirX: number, dirZ: number, run: boolean, dt: number)` — Move in a direction (called once per fixed step): dirX/dirZ is the world direction (length 0–1 scales the speed), run to run, dt in seconds (used as given). Speed comes from the stats: engine.mod('move.speed', { owner, id: character.id, ... }) (the player: id 'player'), the one way to change speed. A character someone controls (engine.control.of(ch)) moves only through its holder: called from anywhere else it is control-bypass in dev; take control and use handle.move() / step instead
|
|
42
|
+
- `player.move(dirX: number, dirZ: number, run: boolean, dt: number, dirY?: number)` — Move in a direction (called once per fixed step): dirX/dirZ is the world direction (length 0–1 scales the speed), run to run, dt in seconds (used as given). Speed comes from the stats: engine.mod('move.speed', { owner, id: character.id, ... }) (the player: id 'player'), the one way to change speed. A character someone controls (engine.control.of(ch)) moves only through its holder: called from anywhere else it is control-bypass in dev; take control and use handle.move() / step instead
|
|
40
43
|
- `player.groundType() → string` — Ground type underfoot ('water' while swimming)
|
|
41
44
|
- `player.face(target: PositionLike | number)` — Turn at once to a position, or to an angle in radians (0 = +Z)
|
|
42
|
-
- `player.saveMotion(out?: CharacterMotion) → CharacterMotion` — Copy the motion state into a plain object (velocity, vertical velocity, heading, movement amount, grounded, swimming) to store in world data; after the model is rebuilt or a save is loaded, loadMotion continues from it with identical results
|
|
43
|
-
- `player.loadMotion(m: CharacterMotion | null | undefined)` — Restore the motion state from the plain object of saveMotion
|
|
45
|
+
- `player.saveMotion(out?: CharacterMotion) → CharacterMotion` — (experimental) Copy the motion state into a plain object (velocity, vertical velocity, heading, movement amount, grounded, swimming) to store in world data; after the model is rebuilt or a save is loaded, loadMotion continues from it with identical results
|
|
46
|
+
- `player.loadMotion(m: CharacterMotion | null | undefined)` — (experimental) Restore the motion state from the plain object of saveMotion
|
|
44
47
|
- Properties:
|
|
45
|
-
- `root: Object3D` Root node
|
|
46
|
-
- `object: Object3D` Same as root: add children, change visible and scale on it
|
|
48
|
+
- `root: Object3D` Root node: add it to the scene with engine.add(character.root) when you built the Character yourself; add children, change visible and scale on it
|
|
47
49
|
- `position: Vector3` Position (= root.position)
|
|
48
50
|
- `velocity: Vector2` Horizontal velocity (x, y map to world x, z). Writable: a write is an impulse the mover steers back toward the input (lasting knockback: push(); full control: mover 'manual')
|
|
49
51
|
- `facing: number` Heading (radians): 0 faces +Z, forward = (sin facing, cos facing); increasing turns toward +X (rotation about the Y axis, consistent with root.rotation.y)
|
|
50
|
-
- `vy: number` Vertical velocity (m/s). Writable: setting it is an impulse (launch() does the same and also leaves the ground cleanly)
|
|
52
|
+
- `vy: number` Vertical velocity (m/s), kept apart from velocity, which is horizontal only (velocity.y is world z, not this). Writable: setting it is an impulse (launch() does the same and also leaves the ground cleanly)
|
|
51
53
|
- `grounded: boolean` Whether standing on the ground
|
|
52
|
-
- `swimming: boolean` Whether swimming
|
|
54
|
+
- `swimming: boolean` (experimental) Whether swimming
|
|
53
55
|
- `state: CharacterState` Current action state
|
|
54
56
|
- `moveAmount: number` Current movement speed (m/s)
|
|
55
57
|
- `faceMode: FaceMode` Facing mode, change at any time; see CharacterOptions.faceMode
|
|
56
58
|
- `faceTarget: PositionLike | null` What faceMode 'target' faces
|
|
57
|
-
- `cameraFollow?: boolean` Player only: whether the camera module follows it (see PlayerOptions.cameraFollow)
|
|
58
|
-
- `
|
|
59
|
-
- `
|
|
59
|
+
- `cameraFollow?: boolean` (experimental) Player only: whether the camera module follows it (see PlayerOptions.cameraFollow)
|
|
60
|
+
- `swimDepth: number` (experimental)
|
|
61
|
+
- `swimSpeedFactor: number` (experimental)
|
|
62
|
+
- `turnSpeed: number` (experimental)
|
|
63
|
+
- `acceleration: number` (experimental)
|
|
64
|
+
- `stepHeight: number` (experimental)
|
|
65
|
+
- `airControl: number` (experimental)
|
|
66
|
+
- `coyoteTime: number` (experimental)
|
|
67
|
+
- `maxJumps: number` (experimental) Base jump values (the game's; modifiers go through engine.mod('move.jumpSpeed'))
|
|
68
|
+
- `airJumpSpeed: number | null` (experimental)
|
|
69
|
+
- `jumpBuffer: number` (experimental)
|
|
70
|
+
- `fall: false | { belowY }` (experimental) Fall check (see CharacterOptions.fall); a plain property
|
|
60
71
|
- `channel: string` Time channel the engine drives it on (see CharacterOptions.channel)
|
|
61
72
|
- `id: string` The character's id, the one form engine.mod / time.local take: its world record id ('player', an NPC's record id), else the id option, else a generated one
|
|
62
73
|
- `support: { kind, object, id, safe, velocity }` What it stands on, read-only (reused object); 'platform' = a registered support (characters.support), which carries it
|
|
63
74
|
- `safeGround: Vector3 | null` Last spot it stood still on safe ground (where a fall returns it); null until it first stands. Saved with the motion
|
|
64
|
-
- `
|
|
65
|
-
- `onLand: ((impact: number) => void) | null` Called on landing (the argument is the landing speed)
|
|
66
|
-
- `mover: { name, controller?, body?, collider?, move, dispose? }` How it walks now; name is 'simple' / 'rapier' / 'manual', controller is the native Rapier character controller (when rapier). Assign a name to switch: c.mover = 'manual'
|
|
75
|
+
- `mover: { name, controller?, body?, collider?, move, dispose?, … }` How it walks now; name is 'simple' / 'rapier' / 'manual', controller is the native Rapier character controller (when rapier). Assign a name to switch: c.mover = 'manual'
|
|
67
76
|
- `anim: Animator | null` Skeletal animation state machine (when there is a glTF model; null while a model named by asset is still loading)
|
|
68
77
|
- `ready: boolean` false while a model named by asset is loading (the placeholder body shows); true otherwise, also after a failed load (placeholder kept)
|
|
69
|
-
- `whenReady: Promise<void>` Settles (never rejects) when a model named by asset is swapped in or has failed; already settled otherwise. Example: `const npc = new Character(engine, { model: 'villager' }).
|
|
78
|
+
- `whenReady: Promise<void>` Settles (never rejects) when a model named by asset is swapped in or has failed; already settled otherwise. Example: `const npc = new Character(engine, { model: 'villager' }); engine.add(npc.root); // import { Character } from 'threedog' await npc.whenReady; npc.playAction('Wave');`
|
|
70
79
|
- `vehicle: Rideable | null` The vehicle it sits in (null on foot)
|
|
71
80
|
- `seat: number | null` Its seat in the vehicle: 0 drives, others ride; null on foot
|
|
72
81
|
|
|
@@ -111,6 +120,8 @@ Characters: createPlayer() (characters() module)
|
|
|
111
120
|
- `x: number`
|
|
112
121
|
- `z: number`
|
|
113
122
|
- **PlayerOptions** (extends CharacterOptions) Parameters of createPlayer()
|
|
123
|
+
- `id?: string` A further local player's id and world record; left out, the one player (engine.player)
|
|
124
|
+
- `input?: Seat` The seat that drives this player (engine.input.seat); default engine.input
|
|
114
125
|
- `spawn?: PositionLike` Spawn point (meters, { x, z } / Vector3 / object); flat ground is found automatically if omitted
|
|
115
126
|
- `control: PlayerControl` Required, no default: 'camera' (keys relative to the camera) / (player, input, dt) => ({ x, z, run? }) (null stands still). presets.player.* fill it. Given once: a game that steers the player for a while takes control (engine.control.take(player, { owner, layer: 'script', step }))
|
|
116
127
|
- `cameraFollow?: boolean` true: the camera module follows the player (and back after a vehicle, and on a new session). Omitted with a camera installed warns in dev
|
|
@@ -134,14 +145,14 @@ Characters: createPlayer() (characters() module)
|
|
|
134
145
|
- `maxJumps?: number` Jumps before landing again, default 1; 2 = double jump (jump() again in the air)
|
|
135
146
|
- `airJumpSpeed?: number` Takeoff speed of an air jump (m/s), default jumpSpeed
|
|
136
147
|
- `jumpBuffer?: number` How long a jump() pressed early waits for the ground (seconds), default 0.12
|
|
137
|
-
- `fall?: false | { belowY }` Falling out of the level: below belowY (or when belowY(character) is true) character:fall fires and
|
|
148
|
+
- `fall?: false | { belowY }` Falling out of the level: below belowY (or when belowY(character) is true) character:fall fires and the rule 'fall' decides: back to safeGround by default, engine.mod('fall', { owner, id, set: false }) leaves it to the game. false (default) = off
|
|
138
149
|
- `channel?: string` Time channel its movement and animation follow when the engine drives it (player default 'player', others 'world')
|
|
139
150
|
- `model?: Object3D | string | null` The body, one path for every kind: the name of a registered model asset, or what engine.assets.model() returned. A procedural builder name (from an asset pack) is built at once; a file model name shows a gray capsule and swaps in a copy when it loads (Character.ready / whenReady, event 'character:model'). Example: `engine.assets.manifest(yourAssets); engine.characters.createPlayer({ model: 'yourBody' }) // a generator or GLB name from an asset pack`
|
|
140
151
|
- `rig?: CharacterRig | null` A ready procedural body (CharacterRig), used instead of model (a hand-built guard / pet)
|
|
141
152
|
- `id?: string` Id for engine.mod / time.local entries of a character without a world record (read it back as character.id); the player is 'player', an NPC its record id
|
|
142
153
|
- `clips?: { idle?, walk?, run?, swim?, jump?, fall?, … } | null` Action name mapping { idle, walk, run, swim, jump, fall } (shorthand for animation)
|
|
143
154
|
- `animation?: AnimatorOptions | null` Skeletal animation state machine config (states, blend trees, one-shot actions), see AnimatorOptions
|
|
144
|
-
- `mover?: 'simple' | 'rapier' | 'manual'
|
|
155
|
+
- `mover?: 'simple' | 'rapier' | 'manual' | …` Movement method: 'simple' built into the engine (default) / 'rapier' Rapier character controller (needs the rigid module) / 'manual' the game writes the position, move() only updates grounded / support / safeGround / fall
|
|
145
156
|
- `faceMode?: FaceMode` Which way it turns each move: 'move' (default, toward its velocity) / 'camera' (along cameraRig.forward()) / 'target' (toward faceTarget) / 'manual' (only face() turns it)
|
|
146
157
|
- `faceTarget?: PositionLike | null` What faceMode 'target' faces (lock-on)
|
|
147
158
|
- **FindSpawnOptions** Parameters of findSpawn(): minH/maxH height range (meters, default unlimited), maxSlope maximum slope (default 0.3), waterMargin minimum meters above the water (default 0.5)
|
package/docs/api/clock.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# engine.clock (Clock) — engine.clock: calendar seconds and "after how long / every how long"
|
|
2
2
|
|
|
3
|
-
- `clock.after(seconds: number, fnOrEvent: (() => void) | string,
|
|
3
|
+
- `clock.after(seconds: number, fnOrEvent: (() => void) | string, opts?: { data?: any; channel?: string }) → Handle` — Call fn after seconds calendar seconds; if an event name is passed, the event is emitted when due (with data, can be saved). { channel } counts that time channel's seconds instead (a poison tick that slows down in bullet time)
|
|
4
4
|
- `clock.every(seconds: number, fn: () => void, opts?: { channel?: string }) → Handle` — Call once every seconds calendar seconds ({ channel }: 'real' or a time channel's seconds instead)
|
|
5
5
|
- Properties:
|
|
6
6
|
- `now: number` Calendar seconds = world-channel seconds x clock.rate, does not advance while paused / frozen, saved with the game; one calendar day = calendar.dayLength calendar seconds
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
# engine.collider3d — collider3d()
|
|
2
|
+
|
|
3
|
+
(experimental) Collision on all three axes (the collider3d slot, held by rigid() unless replaced)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
## Methods and properties
|
|
7
|
+
- `collider3d.addSolid(opts: { position, size?, radius?, rotation?, friction? }) → Handle` — A fixed solid turned any way. size [x, y, z] for a box or radius for a ball; rotation [x, y, z] radians or a quaternion. Callable before start(); newGame and a load keep it. engine.collision does not know it
|
|
8
|
+
- `collider3d.overlap(position: PositionLike, radius?: number) → boolean` — Is a ball here inside something solid. Skips the player's capsule
|
|
9
|
+
- `collider3d.sweep(from: PositionLike, to: PositionLike, radius?: number) → SweepHit | null` — Move a ball from there to there: null when clear, else the first hit. Skips the player's capsule
|
package/docs/api/collision.md
CHANGED
|
@@ -5,9 +5,9 @@ Lightweight collision (collision() module): no clipping while walking, the camer
|
|
|
5
5
|
- Options `CollisionOptions`:
|
|
6
6
|
- `maxClimb?: number` Max walkable slope (height difference / horizontal distance), default 1.1
|
|
7
7
|
- `canopyHeight?: number` A camera above this height (meters) is not considered blocked by trees, default 5
|
|
8
|
-
- `cameraPad?: number` Margin between the camera and obstacles (meters), default 0.5
|
|
8
|
+
- `cameraPad?: number` (experimental) Margin between the camera and obstacles (meters), default 0.5
|
|
9
9
|
- `cameraMin?: number` Nearest camera distance (meters), default 1.5
|
|
10
|
-
- `walkableWaterMargin?: number` Height above the water surface (meters) at which it counts as walkable, default 0.2
|
|
10
|
+
- `walkableWaterMargin?: number` (experimental) Height above the water surface (meters) at which it counts as walkable, default 0.2
|
|
11
11
|
- `cameraOcclusion?: 'colliders' | 'meshes' | 'both'` What camera occlusion checks: 'both' (default) / 'colliders' / 'meshes' = static meshes registered with engine.rays.addStatic(mesh, { occluder: true })
|
|
12
12
|
|
|
13
13
|
## Methods and properties
|
|
@@ -15,18 +15,21 @@ Lightweight collision (collision() module): no clipping while walking, the camer
|
|
|
15
15
|
- `collision.addBox(position: PositionLike, opts?: BoxColliderOptions) → Handle` — Add a box collider (house, fence): position is the center, e.g. addBox(house, { halfWidth: 3, halfDepth: 2, rotation: 0.3 }). Returns a handle { remove() }
|
|
16
16
|
- `collision.addSegment(a: PositionLike, b: PositionLike, opts?: { thickness?, height?, y?, occluder? }) → Handle` — Add a thin wall along a -> b (fence). Options: thickness (default 0.3), height, y, occluder (as in addBox). A gap between segments is a gate. Returns a handle { remove() }
|
|
17
17
|
- `collision.addBlocked(fn: (x: number, z: number) => boolean, opts?: { bounds? }) → Handle` — Mark ground impassable where fn(x, z) is true (river, lava); fn must be pure (no side effects, same answer for the same (x, z)); reading engine.ground in it is fine. findPathAsync caches the answers, so after the ground or your own state changes, remove() and add the field again. bounds { minX, maxX, minZ, maxZ } (world metres, the field's x / z extent) skips fn outside it; give it to keep findPathAsync's ground sampling cheap. Returns a handle { remove() }
|
|
18
|
-
- `collision.blockedAt(x: number, z: number, radius?: number) → boolean` — Is a character of this radius touching addBlocked ground at (x, z)
|
|
18
|
+
- `collision.blockedAt(x: number, z: number, radius?: number) → boolean` — (experimental) Is a character of this radius touching addBlocked ground at (x, z)
|
|
19
19
|
- `collision.addObject(obj: Object3D, opts?: { pad?: number; occluder?: boolean }) → Handle` — Add a collider from an object's bounding box, pad expands outward (meters), occluder as in addBox. Returns a handle { remove() }
|
|
20
|
-
- `collision.forEachStatic(fn: (type, data) => void)` — Iterate all static colliders added by hand
|
|
21
|
-
- `collision.mirror(fns: { add, remove }) → { sync, clear, size }` — Keep an outside copy of the static colliders in step (physics colliders, navmesh obstacles): add builds one piece, remove drops one; sync() diffs only when colliders changed and returns whether it compared; clear() forgets every piece without remove (the outside world was thrown away)
|
|
20
|
+
- `collision.forEachStatic(fn: (type, data) => void)` — (experimental) Iterate all static colliders added by hand
|
|
21
|
+
- `collision.mirror(fns: { add, remove }) → { sync, clear, size }` — (experimental) Keep an outside copy of the static colliders in step (physics colliders, navmesh obstacles): add builds one piece, remove drops one; sync() diffs only when colliders changed and returns whether it compared; clear() forgets every piece without remove (the outside world was thrown away)
|
|
22
22
|
- `collision.walkable(position: PositionLike, opts?: { radius?: number }) → boolean` — Whether someone can stand at this position (for pathfinding): not in water, not too steep, not inside an obstacle. radius is the character radius (meters, default engine.movement.radius)
|
|
23
23
|
- `collision.walkableAt(x: number, z: number, radius?: number) → boolean` — walkable with plain numbers, allocating nothing (A* inner loops); radius defaults to engine.movement.radius
|
|
24
24
|
- `collision.lineClear(a: PositionLike, b: PositionLike, opts?: { radius?, who? }) → boolean` — Line of sight with height: is the 3D segment a -> b free of boxes, circles and terrain trees? radius fattens the line; addBlocked water is ignored. Give eye heights in a / b
|
|
25
25
|
- Properties:
|
|
26
|
-
- `
|
|
27
|
-
- `
|
|
28
|
-
- `
|
|
29
|
-
- `
|
|
26
|
+
- `maxClimb: number` (experimental)
|
|
27
|
+
- `canopyHeight: number` (experimental)
|
|
28
|
+
- `cameraPad: number` (experimental)
|
|
29
|
+
- `cameraMin: number` (experimental)
|
|
30
|
+
- `walkableWaterMargin: number` (experimental)
|
|
31
|
+
- `cameraOcclusion: 'colliders' | 'meshes' | 'both'` (experimental) What camera occlusion checks (see CollisionOptions.cameraOcclusion)
|
|
32
|
+
- `version: number` (experimental) +1 each time a static collider is added or removed
|
|
30
33
|
|
|
31
34
|
## Data structures
|
|
32
35
|
- **CircleColliderOptions** Parameters of addCircle() (meters)
|
package/docs/api/content.md
CHANGED
|
@@ -4,14 +4,14 @@ Content loading (content() module)
|
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
## Methods and properties
|
|
7
|
-
- `content.load(data: ContentPack | ContentPack[], opts?: ContentLoadOptions)
|
|
7
|
+
- `content.load(data: ContentPack | ContentPack[], opts?: ContentLoadOptions) → Promise<void>` — Load content (items, pickups, vegetation, NPCs, dialogue, quests, keys, trigger zones, props, the game vocabulary rules): one pack, or a list of packs loaded together in order; an id defined by two packs of one call is an error naming both (a later separate load overrides by name instead). Bad data throws on the line. The Promise answers for this load: it resolves when the pack committed, and rejects when it failed, after the old level and registrations are back (err.notRestored lists what could not be). A load nobody awaits is reported all the same. Example: `await engine.content.load([baseContent, forestDlc], { places: { home } })`
|
|
8
8
|
- `content.condition(name: string, def: ContentConditionDef)` — Register a custom condition, e.g. condition('timeAfter', { ref: 'clock', test: (e, t) => e.calendar.timeOfDay >= t })
|
|
9
9
|
- `content.test(cond: any, opts?: { actor?: string }) → boolean` — Whether a condition holds (object, array or function (e, { actor })); actor = whose bag has / lacks look in (default the running op's actor, else engine.actor)
|
|
10
|
-
- `content.run(effect: any, opts?: { actor?: string }) →
|
|
10
|
+
- `content.run(effect: any, opts?: { actor?: string }) → { ok: true } | { ok, code, facts, nextActions }` — Run an effect (object, array or function (e, { actor })); actor = whose bag give / take change (default the running op's actor, else engine.actor)
|
|
11
11
|
- `content.place(name: string) → XZ | null` — Place name -> position (load's places first, then level markers), null if none
|
|
12
12
|
- `content.where(p: { place?, x?, z? }) → XZ` — Position form in content { place?, x?, z? } -> world coordinates
|
|
13
13
|
- `content.template(name: string) → Readonly<ContentTemplate>` — The shared, frozen definition of a content template (content/templates.js); instance state lives on the world record. e.g. template('chest').container.capacity
|
|
14
|
-
- `content.fields(name: string) → Record<string, ContentField>` — The fields one content entry may have (core/params.js spec format): what an editor panel lists and what content-check validates against. name: a template name (placement fields plus its state fields, default = the value in state), an engine entry shape ('props', 'props.template', 'props.grid', 'pickups', 'views'), a game kind that declares fields (content/rules.js kinds), or a world record id. Unknown names throw. Example: `engine.content.fields('crop').stage // { type: 'int', optional: true, default: 0, min: 0, max: 4 }`
|
|
14
|
+
- `content.fields(name: string) → Record<string, ContentField>` — The fields one content entry may have (core/base/params.js spec format): what an editor panel lists and what content-check validates against. name: a template name (placement fields plus its state fields, default = the value in state), an engine entry shape ('props', 'props.template', 'props.grid', 'pickups', 'views'), a game kind that declares fields (content/rules.js kinds), or a world record id. Unknown names throw. Example: `engine.content.fields('crop').stage // { type: 'int', optional: true, default: 0, min: 0, max: 4 }`
|
|
15
15
|
- `content.spawn(name: string, at: any, fields?: { id?, rot?, scale?, y?, items?, … }) → WorldRecord` — Place a new runtime instance of a content template (inside an op or a fixed step), saved whole; returns the world record (kind = template name, id `<template>#<n>` unless fields.id is given). fields: id, rot, scale, y (height above ground), items (container start goods), state fields (stage too, for a template with stages). Example: `engine.ops.define('chest.build', { run: (e, { x, z }) => e.content.spawn('chest', { x, z }, { items: { stick: 3 } }).id })`
|
|
16
16
|
- Properties:
|
|
17
17
|
- `ready: boolean` All vegetation models are fetched and the models of world data such as nearby props are built (world.ready)
|
|
@@ -38,29 +38,30 @@ Conditions are used in quest step done, dialogue option if and line variant if;
|
|
|
38
38
|
- `give` value is { itemId: count }, e.g. { berry: 3 }: give items
|
|
39
39
|
- `take` value is { itemId: count }, e.g. { berry: 3 }: take items
|
|
40
40
|
- `bump` value is a counter name, e.g. 'sunsetPhotos': counter +1
|
|
41
|
-
- `startQuest` value is a quest id: start a quest
|
|
42
41
|
- `toast` value is text: show a toast
|
|
43
42
|
- `particles` value is { name, at: [x, y, z], count }: play particles
|
|
44
43
|
- `marker` value is a place name, or { place, x, z } / { x, z }: add an objective marker (hud module)
|
|
45
44
|
- `clearMarker` value is a place name, or { place, x, z } / { x, z }: remove an objective marker
|
|
46
45
|
- `op` value is ['noun.verb', { args }], e.g. ['shop.buy', { shop: 'bakery', item: 'bread' }]: run a game op (engine.ops.run); the game's own actions are ops
|
|
46
|
+
- `startQuest` value is a quest id: start a quest
|
|
47
47
|
- Files content/ recognizes:
|
|
48
|
-
- `
|
|
49
|
-
- `
|
|
48
|
+
- `actions.js` own key actions of the game (action name -> default key, label)
|
|
49
|
+
- `audio.js` sounds by asset name, ambience and music rules as data, footsteps (sounds, ambience, music: { tracks, rules }, footsteps)
|
|
50
50
|
- `containers.js` chests / shelves (container id -> { capacity, items: starting goods }; starting goods are placed only the first time, then saved)
|
|
51
|
-
- `npcs.js` NPCs (id -> name, schedule, dialogue)
|
|
52
51
|
- `dialogues.js` dialogues (id -> speaker, nodes)
|
|
52
|
+
- `grids.js` placement grids (name -> { cell, origin, size, zone?, flat? }); layout rules, not saved
|
|
53
|
+
- `items.js` items (id -> name, icon, description); also export startItems for starting items
|
|
54
|
+
- `level.js` level markers (spawn point, NPCs, trigger zones) of a code-built level: for the tools (content checks, GAMEMAP); load() reads no markers from it. A file or asset name here switches level, as engine.level.load does
|
|
55
|
+
- `npcs.js` NPCs (id -> name, schedule, interact)
|
|
56
|
+
- `pickups.js` pickups on the ground (list)
|
|
57
|
+
- `places.js` place names (name -> { x, z, y?, rot? }; rot turns everything placed there about Y; coordinates may be computed at runtime in main.js)
|
|
58
|
+
- `props.js` props (list: model, position, facing, collision; or { template, x, z } = an instance of a template; or { id, grid, item, cell } = a grid item), streamed in on demand
|
|
53
59
|
- `quests.js` quests (id -> title, steps, reward; a step can have a target position)
|
|
54
|
-
- `
|
|
55
|
-
- `
|
|
60
|
+
- `renames.js` renamed or deleted authored ids (old id -> new id, or null = deleted on purpose): the player's saved changes follow the new id
|
|
61
|
+
- `rules.js` condition words and data kinds added by the game ({ conditions, kinds }); actions are ops, not effect words
|
|
62
|
+
- `startItems.js` starting items (exported from items.js)
|
|
63
|
+
- `templates.js` reusable objects (name -> model, collide, interact, container, sound, animate, state defaults, physics body); shared read-only definitions
|
|
56
64
|
- `triggers.js` trigger zones (tag -> position / from level, enter/exit effects)
|
|
57
|
-
- `level.js` level markers (spawn point, NPCs, trigger zones)
|
|
58
65
|
- `vegetation.js` vegetation (name -> model, growth rule)
|
|
59
|
-
- `props.js` props (list: model, position, facing, collision; or { template, x, z } = an instance of a template; or { id, grid, item, cell } = a grid item), streamed in on demand
|
|
60
|
-
- `templates.js` reusable objects (name -> model, collide, interact, container, sound, animate, state defaults, physics body); shared read-only definitions
|
|
61
|
-
- `audio.js` sounds by asset name, ambience and music rules as data, footsteps (sounds, ambience, music: { tracks, rules }, footsteps)
|
|
62
66
|
- `views.js` named fixed camera views (name -> { position: [x, y, z], target?: [x, y, z], fov? }); engine.views.show(name), ?view=name, npm run shot -- -w game --view name
|
|
63
|
-
- `
|
|
64
|
-
- `renames.js` renamed or deleted authored ids (old id -> new id, or null = deleted on purpose): the player's saved changes follow the new id
|
|
65
|
-
- `rules.js` condition words added by the game ({ conditions }); actions are ops, not effect words
|
|
66
|
-
- any other `<name>.js` the game registers in content/rules.js as kinds: { name: { desc, load(e, data), check?, map? } } (enemies, recipes, loot tables…)
|
|
67
|
+
- any other `<name>.js` the game registers in content/rules.js as kinds: { name: { desc, load?(e, data), check?, map? } } (enemies, recipes, loot tables…)
|
package/docs/api/dialogue.md
CHANGED
|
@@ -6,19 +6,20 @@ Dialogue (dialogue() module). Ops: `dialogue.advance` (finish typing the line, e
|
|
|
6
6
|
- `charsPerSecond?: number` Typing speed (characters/second, game time: advanced by engine.step), default 40
|
|
7
7
|
- `advanceActions?: string[]` Actions that advance the dialogue, default ['confirm'] (a basic key); e.g. ['confirm', 'interact'] to also advance on the game's interact key. Choices: the cursor, clicks, and the actions choice1..choice9 (context 'dialog', no keys of their own: presets.bindings.dialogNumbers binds 1-9)
|
|
8
8
|
- `holdSeconds?: number` A bubble line stays this many seconds plus its reading time (about 15 characters a second) unless say() gives seconds, default 2
|
|
9
|
+
- `bubbleChoice?: 'end' | 'ask'` A bubble script reaching a node with choices: 'end' (default: warn, the script ends there) or 'ask' (the line stays with its choices until engine.ops.run('dialogue.choose', { index, run }); run is in dialogue.bubbles())
|
|
9
10
|
|
|
10
11
|
## Methods and properties
|
|
11
12
|
- `dialogue.define(speaker: string, nodes: DialogueScript)` — Define a dialogue (the name is usually the speaker)
|
|
12
13
|
- `dialogue.start(speaker: string, nodeId?: string, onEnd?: (() => void) | null, opts?: { channel?, at?, onCancel? })` — Start a dialogue: from node nodeId (default 'start'), onEnd is called when it ends. Main channel (default): locks game input and takes Esc; its choices take the UI choice cursor. onCancel: what the back key (Esc) does while it is on top of the UI focus stack (default: nothing). channel: 'bubble' plays the script as bubble lines over at (no lock, no choices; a running conversation is untouched). Ending the playthrough (engine.session newGame / load / quit) closes it without calling onEnd. Example: `engine.dialogue.start('guard', 'start', null, { channel: 'bubble', at: guard.root })`
|
|
13
14
|
- `dialogue.say(text: string | DialogueScript, opts?: { speaker?, node?, channel?, onCancel? } & BubbleOptions) → SayPromise` — Say a one-off line (no need to define first); the Promise resolves when it is done. channel: 'bubble' = over at while the player keeps playing (barks, shop chatter, radio); several speakers at once, queued per speaker. When the playthrough ends (engine.session) the line is dropped and the Promise never resolves, so code awaiting it does not run in the next playthrough. Example: `await engine.dialogue.say('Reloading!', { speaker: 'Mira', channel: 'bubble', at: mira.root })`
|
|
14
|
-
- `dialogue.bubbles() → { speaker, text, queued }[]` — Lines on the bubble channel now
|
|
15
|
+
- `dialogue.bubbles() → { speaker, text, queued, run?, choices? }[]` — Lines on the bubble channel now
|
|
15
16
|
- `dialogue.end()` — End the main dialogue
|
|
16
17
|
- Properties:
|
|
17
18
|
- `state: DialogueState` Story state: state.flags is engine.vars.flags (autosaved)
|
|
18
|
-
- `scripts: Map<string, DialogueScript>` All scripts
|
|
19
|
+
- `scripts: Map<string, DialogueScript>` (experimental) All scripts
|
|
19
20
|
- `active: { speaker, nodes, node?, id?, onEnd } | null` The dialogue in progress (null when none). speaker: the script name; node: the current node OBJECT (its fields: text, choices, data...); id: that node's id string ('start', 'ask'); both are set once the first line shows. Read-only: drive it with start / end / the dialogue ops. Example: `const atAsk = engine.dialogue.active?.id === 'ask'; // the node id; active.node.data holds the node's own fields`
|
|
20
|
-
- `speaking: string | null` The script the main dialogue is playing
|
|
21
|
-
- `
|
|
21
|
+
- `speaking: string | null` (experimental) The script the main dialogue is playing
|
|
22
|
+
- `charsPerSecond: number` (experimental) Typing speed (characters/second)
|
|
22
23
|
|
|
23
24
|
## Data structures
|
|
24
25
|
- **DialogueScript** = `Record<string, DialogueNode>` — Dialogue script: node name -> node, starting from 'start'
|