threedog 0.0.0-stage → 0.2.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 +5 -0
- package/LICENSE +21 -0
- package/README.md +39 -2
- package/core/Animator.js +268 -0
- package/core/Assets.js +256 -0
- package/core/Audio.js +267 -0
- package/core/Baked.js +72 -0
- package/core/Batching.js +247 -0
- package/core/Budget.js +221 -0
- package/core/Clock.js +94 -0
- package/core/Commits.js +77 -0
- package/core/DebugOverrides.js +143 -0
- package/core/Describe.js +145 -0
- package/core/Engine.js +184 -0
- package/core/Events.js +153 -0
- package/core/I18n.js +94 -0
- package/core/Input.js +245 -0
- package/core/Inspect.js +77 -0
- package/core/InspectScene.js +191 -0
- package/core/Jobs.js +146 -0
- package/core/Loading.js +149 -0
- package/core/MaterialInfo.js +32 -0
- package/core/Ops.js +256 -0
- package/core/Random.js +52 -0
- package/core/Rays.js +160 -0
- package/core/SaveStore.js +85 -0
- package/core/Saves.js +254 -0
- package/core/Stream.js +279 -0
- package/core/Threads.js +158 -0
- package/core/UrlState.js +94 -0
- package/core/Vars.js +35 -0
- package/core/Views.js +49 -0
- package/core/actor.js +23 -0
- package/core/assetEntry.js +89 -0
- package/core/assetLoad.js +190 -0
- package/core/assetManifest.js +35 -0
- package/core/assetReport.js +83 -0
- package/core/audioRules.js +121 -0
- package/core/audioVoice.js +225 -0
- package/core/batchGroups.js +116 -0
- package/core/canvasBox.js +63 -0
- package/core/catalog.js +169 -0
- package/core/checks.js +67 -0
- package/core/claims.js +51 -0
- package/core/dayTime.js +15 -0
- package/core/debugView.js +76 -0
- package/core/describeRender.js +45 -0
- package/core/describeText.js +143 -0
- package/core/easing.js +34 -0
- package/core/errorCodes.js +205 -0
- package/core/errorHints.js +208 -0
- package/core/errors.js +40 -0
- package/core/events.generated.js +84 -0
- package/core/ground.js +102 -0
- package/core/holds.js +106 -0
- package/core/inputContext.js +69 -0
- package/core/inputDefaults.js +22 -0
- package/core/inputPad.js +35 -0
- package/core/inputPointer.js +48 -0
- package/core/inputTouch.js +48 -0
- package/core/lifecycle.js +69 -0
- package/core/lightWatch.js +56 -0
- package/core/look/coreParts.js +112 -0
- package/core/look/layers.js +136 -0
- package/core/look/part.js +173 -0
- package/core/look/report.js +79 -0
- package/core/look/write.js +86 -0
- package/core/loop.js +200 -0
- package/core/math.js +33 -0
- package/core/modules.js +196 -0
- package/core/movement.js +19 -0
- package/core/mulberry32.js +14 -0
- package/core/opsAtomic.js +31 -0
- package/core/opsCheck.js +97 -0
- package/core/opsFail.js +20 -0
- package/core/opsGuard.js +26 -0
- package/core/opsHistory.js +27 -0
- package/core/opsRun.js +77 -0
- package/core/page.js +78 -0
- package/core/params.js +132 -0
- package/core/pureWorker.js +5 -0
- package/core/renamed.js +21 -0
- package/core/saveApply.js +128 -0
- package/core/saveFiles.js +139 -0
- package/core/saveIds.js +53 -0
- package/core/saveVersions.js +97 -0
- package/core/scatter.js +92 -0
- package/core/sceneMethods.js +100 -0
- package/core/screenToGround.js +39 -0
- package/core/services.js +73 -0
- package/core/session.js +171 -0
- package/core/shadowTypes.js +15 -0
- package/core/skip.js +104 -0
- package/core/startup.js +135 -0
- package/core/streamCells.js +24 -0
- package/core/streamSources.js +73 -0
- package/core/styleParts.js +96 -0
- package/core/targeting.js +64 -0
- package/core/thingExplain.js +68 -0
- package/core/thingOps.js +168 -0
- package/core/things.js +212 -0
- package/core/threadPure.js +120 -0
- package/core/threadServe.js +25 -0
- package/core/tier.js +11 -0
- package/core/util.js +11 -0
- package/core/validate.js +204 -0
- package/docs/AI.md +123 -0
- package/docs/API.md +83 -0
- package/docs/CODEMAP.md +347 -0
- package/docs/COMMANDS.md +108 -0
- package/docs/CONVENTIONS.md +145 -0
- package/docs/PERF.md +217 -0
- package/docs/THREE.md +86 -0
- package/docs/api/ambience.md +15 -0
- package/docs/api/assets.md +62 -0
- package/docs/api/audio.md +53 -0
- package/docs/api/budget.md +40 -0
- package/docs/api/cameraRig.md +120 -0
- package/docs/api/characters.md +144 -0
- package/docs/api/clock.md +7 -0
- package/docs/api/collision.md +39 -0
- package/docs/api/content.md +64 -0
- package/docs/api/dialogue.md +39 -0
- package/docs/api/engine.md +199 -0
- package/docs/api/entities.md +61 -0
- package/docs/api/events.md +95 -0
- package/docs/api/flow.md +27 -0
- package/docs/api/grids.md +11 -0
- package/docs/api/ground.md +16 -0
- package/docs/api/hlod.md +34 -0
- package/docs/api/hud.md +31 -0
- package/docs/api/i18n.md +10 -0
- package/docs/api/input.md +24 -0
- package/docs/api/interactions.md +31 -0
- package/docs/api/inventory.md +66 -0
- package/docs/api/jobs.md +10 -0
- package/docs/api/level.md +41 -0
- package/docs/api/lightPool.md +56 -0
- package/docs/api/music.md +34 -0
- package/docs/api/nav.md +26 -0
- package/docs/api/net.md +14 -0
- package/docs/api/openWorld.md +24 -0
- package/docs/api/particles.md +41 -0
- package/docs/api/photo.md +15 -0
- package/docs/api/post.md +10 -0
- package/docs/api/quests.md +36 -0
- package/docs/api/rays.md +26 -0
- package/docs/api/rigid.md +84 -0
- package/docs/api/saves.md +32 -0
- package/docs/api/settings.md +36 -0
- package/docs/api/sky.md +58 -0
- package/docs/api/stream.md +31 -0
- package/docs/api/style.md +134 -0
- package/docs/api/terrain.md +34 -0
- package/docs/api/timeline.md +39 -0
- package/docs/api/tools.md +57 -0
- package/docs/api/triggers.md +56 -0
- package/docs/api/vars.md +9 -0
- package/docs/api/vegetation.md +52 -0
- package/docs/api/water.md +48 -0
- package/docs/api/weather.md +29 -0
- package/docs/api/world.md +30 -0
- package/docs/recipes/01-new-game.md +148 -0
- package/docs/recipes/02-npc.md +167 -0
- package/docs/recipes/03-items-pickups.md +158 -0
- package/docs/recipes/04-quests.md +83 -0
- package/docs/recipes/05-props-bake.md +159 -0
- package/docs/recipes/06-clock-events.md +117 -0
- package/docs/recipes/07-flow-scenes-pause.md +132 -0
- package/docs/recipes/08-weather-sky.md +74 -0
- package/docs/recipes/09-style-pack.md +234 -0
- package/docs/recipes/10-blender-level.md +67 -0
- package/docs/recipes/11-vehicles.md +55 -0
- package/docs/recipes/12-navmesh.md +79 -0
- package/docs/recipes/13-animation.md +149 -0
- package/docs/recipes/14-custom-module.md +91 -0
- package/docs/recipes/15-perf.md +78 -0
- package/docs/recipes/16-dev-bridge.md +180 -0
- package/docs/recipes/18-world.md +185 -0
- package/docs/recipes/19-shooting-picking.md +76 -0
- package/docs/recipes/20-content-actions-save.md +176 -0
- package/docs/recipes/21-camera.md +153 -0
- package/docs/recipes/22-shop-gold.md +107 -0
- package/docs/recipes/23-ops.md +175 -0
- package/docs/recipes/26-ui-parts.md +138 -0
- package/docs/recipes/27-net.md +96 -0
- package/docs/recipes/28-terrain.md +80 -0
- package/docs/recipes/29-grid.md +87 -0
- package/docs/recipes/30-templates.md +131 -0
- package/docs/recipes/31-audio.md +126 -0
- package/docs/recipes/32-action-game.md +33 -0
- package/docs/recipes/33-stream-sources.md +37 -0
- package/docs/recipes/34-environment-lighting.md +36 -0
- package/docs/recipes/35-style-from-reference.md +89 -0
- package/docs/recipes/36-sky-ground-plant-looks.md +116 -0
- package/docs/recipes/37-terrain-look-hooks.md +97 -0
- package/docs/recipes/38-environment-look-hooks.md +83 -0
- package/docs/recipes/40-scene.md +108 -0
- package/docs/recipes/41-thing-registry.md +93 -0
- package/docs/recipes/42-terrain-shape.md +64 -0
- package/docs/recipes/43-shader-patches-surface-looks.md +120 -0
- package/docs/recipes/44-water-weather-look-hooks.md +135 -0
- package/docs/recipes/45-cascaded-shadows.md +51 -0
- package/docs/recipes/46-blender-art-route.md +114 -0
- package/docs/recipes/47-island-snow-backdrop.md +44 -0
- package/docs/recipes/48-make-material.md +70 -0
- package/docs/recipes/49-game-module-contract.md +71 -0
- package/docs/recipes/50-own-renderer.md +12 -0
- package/docs/recipes/51-capability-catalog.md +63 -0
- package/docs/recipes/52-look.md +108 -0
- package/examples/action/DESIGN.md +3 -0
- package/examples/action/GAMEMAP.md +127 -0
- package/examples/action/content/actions.js +8 -0
- package/examples/action/content/audio.js +9 -0
- package/examples/action/content/index.js +10 -0
- package/examples/action/content/items.js +4 -0
- package/examples/action/content/places.js +4 -0
- package/examples/action/content/props.js +11 -0
- package/examples/action/content/templates.js +10 -0
- package/examples/action/content/views.js +6 -0
- package/examples/action/look.js +5 -0
- package/examples/action/main.js +137 -0
- package/examples/action/models.js +25 -0
- package/examples/sheepisland/GAMEMAP.md +107 -0
- package/examples/sheepisland/content/index.js +6 -0
- package/examples/sheepisland/content/props.js +19 -0
- package/examples/sheepisland/content/templates.js +5 -0
- package/examples/sheepisland/content/vegetation.js +8 -0
- package/examples/sheepisland/main.js +71 -0
- package/examples/sheepisland/params.js +25 -0
- package/examples/sheepisland/style/index.js +79 -0
- package/examples/sheepisland/style/models.js +59 -0
- package/examples/sheepisland/views.js +9 -0
- package/examples/styletest/GAMEMAP.md +135 -0
- package/examples/styletest/content/index.js +9 -0
- package/examples/styletest/content/items.js +8 -0
- package/examples/styletest/content/npcs.js +8 -0
- package/examples/styletest/content/places.js +5 -0
- package/examples/styletest/content/props.js +16 -0
- package/examples/styletest/content/templates.js +9 -0
- package/examples/styletest/content/vegetation.js +31 -0
- package/examples/styletest/look.js +11 -0
- package/examples/styletest/main.js +95 -0
- package/examples/styletest/models.js +87 -0
- package/examples/styletest/overrides.js +33 -0
- package/examples/styletest/panel.js +135 -0
- package/examples/styletest/params.js +32 -0
- package/examples/styletest/views.js +31 -0
- package/examples/world/DESIGN.md +5 -0
- package/examples/world/GAMEMAP.md +171 -0
- package/examples/world/content/actions.js +8 -0
- package/examples/world/content/audio.js +25 -0
- package/examples/world/content/bodies.js +12 -0
- package/examples/world/content/containers.js +4 -0
- package/examples/world/content/dialogues.js +33 -0
- package/examples/world/content/index.js +17 -0
- package/examples/world/content/items.js +10 -0
- package/examples/world/content/npcs.js +14 -0
- package/examples/world/content/pickups.js +11 -0
- package/examples/world/content/places.js +6 -0
- package/examples/world/content/props.js +12 -0
- package/examples/world/content/quests.js +15 -0
- package/examples/world/content/rules.js +23 -0
- package/examples/world/content/templates.js +5 -0
- package/examples/world/content/vegetation.js +32 -0
- package/examples/world/main.js +168 -0
- package/examples/world/models.js +28 -0
- package/index.d.ts +306 -0
- package/index.js +122 -0
- package/llms.txt +61 -0
- package/modules/ambience/Ambience.js +186 -0
- package/modules/camera/FirstPersonCamera.js +131 -0
- package/modules/camera/FixedCamera.js +162 -0
- package/modules/camera/FollowCamera.js +91 -0
- package/modules/camera/RtsCamera.js +132 -0
- package/modules/camera/common.js +182 -0
- package/modules/camera/index.js +11 -0
- package/modules/camera/projection.js +34 -0
- package/modules/characters/Character.js +235 -0
- package/modules/characters/NPC.js +242 -0
- package/modules/characters/assetModel.js +42 -0
- package/modules/characters/astar.js +66 -0
- package/modules/characters/behaviors.js +72 -0
- package/modules/characters/footsteps.js +13 -0
- package/modules/characters/index.js +215 -0
- package/modules/characters/moveHelpers.js +29 -0
- package/modules/characters/movers/common.js +62 -0
- package/modules/characters/movers/rapier.js +74 -0
- package/modules/characters/movers/simple.js +43 -0
- package/modules/characters/npcAvoid.js +129 -0
- package/modules/characters/npcSim.js +150 -0
- package/modules/characters/npcView.js +42 -0
- package/modules/characters/pathAsync.js +113 -0
- package/modules/characters/pathJob.js +62 -0
- package/modules/characters/pathWorker.js +7 -0
- package/modules/characters/playerStrings.js +12 -0
- package/modules/characters/proceduralRig.js +58 -0
- package/modules/characters/useModel.js +22 -0
- package/modules/characters/walkTo.js +58 -0
- package/modules/collision/Collision.js +274 -0
- package/modules/collision/grid.js +63 -0
- package/modules/content/explain.js +13 -0
- package/modules/content/ids.js +95 -0
- package/modules/content/index.js +154 -0
- package/modules/content/loader.js +190 -0
- package/modules/content/models.js +69 -0
- package/modules/content/packs.js +69 -0
- package/modules/content/props.js +89 -0
- package/modules/content/rules.js +134 -0
- package/modules/content/templates.js +189 -0
- package/modules/debug/DebugPanel.js +174 -0
- package/modules/entities/Entities.js +243 -0
- package/modules/entities/build.js +25 -0
- package/modules/entities/index.js +4 -0
- package/modules/flow/index.js +101 -0
- package/modules/gameplay/Container.js +227 -0
- package/modules/gameplay/Containers.js +89 -0
- package/modules/gameplay/Dialogue.js +219 -0
- package/modules/gameplay/Interactions.js +253 -0
- package/modules/gameplay/Inventory.js +224 -0
- package/modules/gameplay/Quests.js +205 -0
- package/modules/gameplay/boxOps.js +60 -0
- package/modules/gameplay/dialogueBox.js +48 -0
- package/modules/gameplay/interactionPrompt.js +28 -0
- package/modules/gameplay/inventoryOps.js +137 -0
- package/modules/gameplay/pickups.js +115 -0
- package/modules/gameplay/questLog.js +54 -0
- package/modules/gameplay/questSave.js +71 -0
- package/modules/grid/Grid.js +184 -0
- package/modules/grid/Layer.js +142 -0
- package/modules/grid/index.js +236 -0
- package/modules/grid/ops.js +73 -0
- package/modules/grid/preview.js +85 -0
- package/modules/grid/tiles.js +79 -0
- package/modules/hlod/index.js +167 -0
- package/modules/hud/index.js +167 -0
- package/modules/hud/parts.js +80 -0
- package/modules/level/geometry.js +46 -0
- package/modules/level/heightfield.js +160 -0
- package/modules/level/index.js +233 -0
- package/modules/level/nodes.js +84 -0
- package/modules/lights/index.js +227 -0
- package/modules/music/Music.js +294 -0
- package/modules/music/index.js +2 -0
- package/modules/music/rules.js +28 -0
- package/modules/nav/index.js +156 -0
- package/modules/nav/navPath.js +17 -0
- package/modules/net/Client.js +137 -0
- package/modules/net/Host.js +117 -0
- package/modules/net/Net.js +49 -0
- package/modules/net/index.js +77 -0
- package/modules/net/sync.js +114 -0
- package/modules/net/transports.js +118 -0
- package/modules/particles/Particles.js +179 -0
- package/modules/particles/effect.js +112 -0
- package/modules/particles/shaders.js +28 -0
- package/modules/photo/Photo.js +146 -0
- package/modules/rigid/RigidBodies.js +265 -0
- package/modules/rigid/Vehicles.js +97 -0
- package/modules/rigid/sync.js +158 -0
- package/modules/settings/Settings.js +297 -0
- package/modules/settings/apply.js +21 -0
- package/modules/settings/index.js +3 -0
- package/modules/settings/sections.js +156 -0
- package/modules/settings/strings.js +53 -0
- package/modules/settings/view.js +65 -0
- package/modules/sky/Sky.js +259 -0
- package/modules/sky/calendar.js +80 -0
- package/modules/sky/cascades.js +125 -0
- package/modules/sky/clouds.js +79 -0
- package/modules/sky/domeLayers.js +33 -0
- package/modules/sky/environment.js +141 -0
- package/modules/sky/fog.js +139 -0
- package/modules/sky/frame.js +77 -0
- package/modules/sky/layers.js +69 -0
- package/modules/sky/look.js +51 -0
- package/modules/sky/lookFog.js +80 -0
- package/modules/sky/lookShadow.js +50 -0
- package/modules/sky/lookSky.js +108 -0
- package/modules/sky/schedule.js +80 -0
- package/modules/sky/shader.js +96 -0
- package/modules/sky/shadow.js +74 -0
- package/modules/sky/skyModule.js +60 -0
- package/modules/terrain/ChunkManager.js +260 -0
- package/modules/terrain/chunkJob.js +19 -0
- package/modules/terrain/chunkLevels.js +40 -0
- package/modules/terrain/chunkQueries.js +42 -0
- package/modules/terrain/chunkWorker.js +5 -0
- package/modules/terrain/index.js +118 -0
- package/modules/terrain/lookGround.js +61 -0
- package/modules/terrain/mountTerrain.js +32 -0
- package/modules/terrain/terrainColorMap.js +41 -0
- package/modules/terrain/terrainDefaults.js +39 -0
- package/modules/terrain/terrainEdit.js +139 -0
- package/modules/terrain/terrainGen.js +155 -0
- package/modules/terrain/terrainIsland.js +131 -0
- package/modules/terrain/terrainMesh.js +92 -0
- package/modules/terrain/terrainShape.js +108 -0
- package/modules/terrain/terrainShapeMain.js +41 -0
- package/modules/terrain/terrainTexture.js +44 -0
- package/modules/timeline/Timeline.js +253 -0
- package/modules/timeline/Tween.js +114 -0
- package/modules/timeline/letterbox.js +24 -0
- package/modules/timeline/shots.js +90 -0
- package/modules/triggers/index.js +268 -0
- package/modules/vegetation/Vegetation.js +256 -0
- package/modules/vegetation/groundChunks.js +177 -0
- package/modules/vegetation/index.js +43 -0
- package/modules/vegetation/lookWind.js +37 -0
- package/modules/vegetation/modelGeometry.js +21 -0
- package/modules/water/Water.js +160 -0
- package/modules/water/look.js +80 -0
- package/modules/water/surface.js +88 -0
- package/modules/weather/Weather.js +242 -0
- package/modules/weather/look.js +75 -0
- package/modules/weather/particles.js +92 -0
- package/modules/weather/shaders.js +49 -0
- package/modules/weather/strings.js +15 -0
- package/modules/world/World.js +231 -0
- package/modules/world/cells.js +42 -0
- package/modules/world/explain.js +11 -0
- package/modules/world/index.js +71 -0
- package/modules/world/persist.js +107 -0
- package/modules/world/pos.js +20 -0
- package/modules/world/records.js +89 -0
- package/modules/world/sim.js +175 -0
- package/modules/world/simFar.js +82 -0
- package/modules/world/state.js +115 -0
- package/modules/world/thingSource.js +44 -0
- package/modules/world/views.js +182 -0
- package/package.json +66 -4
- package/presets.js +96 -0
- package/render/PostFX.js +240 -0
- package/render/detail.js +105 -0
- package/render/effects.js +144 -0
- package/render/engineUniforms.js +23 -0
- package/render/fuse.js +84 -0
- package/render/lighting.js +100 -0
- package/render/lights.js +18 -0
- package/render/lookSurface.js +161 -0
- package/render/materials.js +220 -0
- package/render/patches.js +252 -0
- package/render/postLook.js +86 -0
- package/render/surface.js +69 -0
- package/render/uniformDecl.js +29 -0
- package/types/common.d.ts +34 -0
- package/types/core.d.ts +1965 -0
- package/types/gameplay.d.ts +1822 -0
- package/types/generated/core/Audio.d.ts +200 -0
- package/types/generated/core/Batching.d.ts +47 -0
- package/types/generated/core/Budget.d.ts +90 -0
- package/types/generated/core/Commits.d.ts +31 -0
- package/types/generated/core/DebugOverrides.d.ts +52 -0
- package/types/generated/core/Events.d.ts +89 -0
- package/types/generated/core/I18n.d.ts +30 -0
- package/types/generated/core/Input.d.ts +118 -0
- package/types/generated/core/Jobs.d.ts +41 -0
- package/types/generated/core/Ops.d.ts +203 -0
- package/types/generated/core/Random.d.ts +49 -0
- package/types/generated/core/Rays.d.ts +49 -0
- package/types/generated/core/Saves.d.ts +162 -0
- package/types/generated/core/Stream.d.ts +93 -0
- package/types/generated/core/Threads.d.ts +82 -0
- package/types/generated/core/Views.d.ts +33 -0
- package/types/generated/core/audioVoice.d.ts +47 -0
- package/types/generated/core/page.d.ts +18 -0
- package/types/generated/core/session.d.ts +48 -0
- package/types/generated/modules/ambience/Ambience.d.ts +48 -0
- package/types/generated/modules/debug/DebugPanel.d.ts +24 -0
- package/types/generated/modules/flow/index.d.ts +10 -0
- package/types/generated/modules/grid/Grid.d.ts +151 -0
- package/types/generated/modules/grid/Layer.d.ts +65 -0
- package/types/generated/modules/grid/index.d.ts +86 -0
- package/types/generated/modules/hlod/index.d.ts +11 -0
- package/types/generated/modules/hud/index.d.ts +10 -0
- package/types/generated/modules/lights/index.d.ts +13 -0
- package/types/generated/modules/music/Music.d.ts +111 -0
- package/types/generated/modules/net/Net.d.ts +34 -0
- package/types/generated/modules/net/index.d.ts +53 -0
- package/types/generated/modules/net/transports.d.ts +58 -0
- package/types/generated/modules/particles/Particles.d.ts +69 -0
- package/types/generated/modules/sky/Sky.d.ts +145 -0
- package/types/generated/modules/sky/skyModule.d.ts +10 -0
- package/types/generated/modules/timeline/Timeline.d.ts +51 -0
- package/types/generated/modules/water/Water.d.ts +29 -0
- package/types/generated/modules/weather/Weather.d.ts +62 -0
- package/types/generated/modules/world/World.d.ts +242 -0
- package/types/generated/modules/world/index.d.ts +15 -0
- package/types/generated/render/PostFX.d.ts +125 -0
- package/types/generated/render/materials.d.ts +100 -0
- package/types/generated/render/patches.d.ts +41 -0
- package/types/generated/ui/Focus.d.ts +11 -0
- package/types/generated/ui/LoadingScreen.d.ts +2 -0
- package/types/generated/ui/UI.d.ts +57 -0
- package/types/nav.d.ts +52 -0
- package/types/physics.d.ts +592 -0
- package/types/style.d.ts +638 -0
- package/types/worker.d.ts +11 -0
- package/types/world.d.ts +772 -0
- package/ui/Focus.js +51 -0
- package/ui/LoadingScreen.js +42 -0
- package/ui/Parts.js +199 -0
- package/ui/UI.js +167 -0
- package/ui/defaults.js +85 -0
- package/ui/theme.js +124 -0
- package/ui/touchPart.js +49 -0
package/docs/AI.md
ADDED
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
# Using threedog.js (read this first)
|
|
2
|
+
|
|
3
|
+
threedog.js is a web 3D game engine on top of three.js 0.187 (plain three.js, no React): **core** (every game needs it) -> **modules** (installed on
|
|
4
|
+
demand with `engine.use`) -> **style pack** (all art, an optional separate package; the engine ships none and draws gray placeholders without one).
|
|
5
|
+
This file is the index for the AI that builds a game on the engine. Paths are relative to this `docs/` folder (`node_modules/threedog/docs/`).
|
|
6
|
+
|
|
7
|
+
## Most common mistakes
|
|
8
|
+
- Hand-writing a system the table lists (inventory, saves, quests, grids, collision): find the row first.
|
|
9
|
+
- `Math.random()`, `setTimeout`, `performance.now()` in game logic: use `engine.random`, `engine.clock.after / every`, fixed `dt`.
|
|
10
|
+
- `addEventListener('keydown')` for gameplay: define an action with `input.define` and read it in the fixed step.
|
|
11
|
+
- Changing gameplay state from a frame hook or a raw callback: do it in `onFixed`, in an op, or via `engine.nextFixed(fn)`.
|
|
12
|
+
- Saving positions or object references: save stable ids; `await` every `saves.*` call.
|
|
13
|
+
- A mesh added with plain `scene.add` and no id: `engine.add(obj, { id })` is what makes it saveable and inspectable.
|
|
14
|
+
- Changing a look by editing `renderer` / `scene.fog` / materials directly, or in logic: `engine.look.<part>` (recipe 52), values in the style pack.
|
|
15
|
+
- Putting game content (dialogue, quests, items, layout) inside the engine package: it lives in the game's `content/`.
|
|
16
|
+
- Editing generated docs (GAMEMAP, API.md, api/, CODEMAP, `types/generated/`): change the code, run `npm run map`.
|
|
17
|
+
- Guessing a name: look it up in `api/<module>.md`; an engine error carries `err.code` / `err.fix` / `err.docs`.
|
|
18
|
+
|
|
19
|
+
## What to read, in order (stop when you have enough)
|
|
20
|
+
1. This file: find the task in the entry table below.
|
|
21
|
+
2. The recipe the row points to (`recipes/NN-*.md`): how to do the task, with a working pattern.
|
|
22
|
+
3. `api/<module>.md` for signatures, options and data shapes (`API.md` is the index, `api/events.md` the events).
|
|
23
|
+
4. The game's own `GAMEMAP.md` (generated): what this game has, and "Read for this game".
|
|
24
|
+
5. When needed: `CODEMAP.md` · `THREE.md` (what the engine lacks: use three.js) · `PERF.md` · `COMMANDS.md` · `CONVENTIONS.md`.
|
|
25
|
+
|
|
26
|
+
What can I do here: `threedog catalog`, `threedog how "<task>"` (ranks these rows and recipes for a task in your own words).
|
|
27
|
+
|
|
28
|
+
## One thing, one entry point (don't build another)
|
|
29
|
+
Three outward concepts: **Scene** (what is in the world; content packs are part of it), **Assets** (models, textures, sounds, fonts),
|
|
30
|
+
**Style** (the look; material roles are labels inside it). Patches, ops and world records are the scene's inner machinery.
|
|
31
|
+
|
|
32
|
+
### Scene
|
|
33
|
+
| To do | Use | Recipe |
|
|
34
|
+
|---|---|---|
|
|
35
|
+
| New game, project layout, canvas inside a page or editor panel | `npm run new-game name`, `createEngine({ canvas, style })`, `engine.use(...)`, `engine.start()` | `recipes/01-new-game.md` |
|
|
36
|
+
| Preset parts on / off, blank game | `openWorld({ camera: 'follow', sky: {...}, debug: false })`, `new-game name --blank` | `recipes/01-new-game.md` |
|
|
37
|
+
| Put something in the scene | `engine.add(obj, { id })`, `engine.spawn(name, at)`, content props | `recipes/40-scene.md` |
|
|
38
|
+
| Game content data, content packs | `engine.content.load(data, { places })`, `load([base, dlc])`, rules in `content/rules.js` | `recipes/20-content-actions-save.md` |
|
|
39
|
+
| Reusable object definitions (prefabs) | content `templates`; props `{ template, x, z }` | `recipes/30-templates.md` |
|
|
40
|
+
| Props, many repeated objects, delete an object, static batching | content `props` / `vegetation`, `engine.remove(obj)`, `engine.batching` (`batch: false`, `tint`) | `recipes/05-props-bake.md` |
|
|
41
|
+
| What is this thing, where is it defined (point -> id) | `engine.pick(x, y).thing`, `engine.world.origin(id)`, `engine.thing(id).explain()` | `recipes/30-templates.md` §5 |
|
|
42
|
+
| Saved / far-away objects, the player record, stream in, teleport | `engine.world`, `player.placeAt()`, `engine.stream.add / teleport / source` | `recipes/18-world.md` |
|
|
43
|
+
| Blender level, grass and trees without terrain | `engine.level`, `npm run assets -- check`, `vegetation({ area })`, `engine.vegetation.rebuild()` | `recipes/10-blender-level.md` |
|
|
44
|
+
| Terrain generator, ground height, terrain editing | `terrain({ height, groundType })`, `terrainPreset()`, `engine.surface(x, z)`, `engine.ground`, `engine.terrain.edit()` | `recipes/28-terrain.md` |
|
|
45
|
+
| Ground color borders, mesh cut, lighting normals | `terrain({ shading: 'texture', colorResolution, normals, diagonal })` | `recipes/37-terrain-look-hooks.md` |
|
|
46
|
+
| Island, floating rock, world with an edge | `terrain({ shape: { mask, edge, side, bottom } })`, `engine.ground.has`, event `terrain:void` | `recipes/42-terrain-shape.md` |
|
|
47
|
+
| Grid placement, per-cell soil state | `engine.grids.add / define`, ops `grid.place / move / remove` | `recipes/29-grid.md` |
|
|
48
|
+
| Collision, fences, rivers, physics, vehicles | `engine.collision` (`addSegment`, `addBlocked`, `lineClear`), `engine.rigid` | `recipes/11-vehicles.md` |
|
|
49
|
+
| Pathfinding, navmesh, "can walk there" | `engine.characters.findPath`, `engine.nav`, `createEngine({ movement })` | `recipes/12-navmesh.md` |
|
|
50
|
+
| Interaction prompts (talk, pick up, open a door or chest), trigger zones | `engine.interactions`, `interactions({ ...presets.interactions.nearest })`, `engine.triggers` | `recipes/20-content-actions-save.md` |
|
|
51
|
+
| Ray / mouse picking, shooting, lock-on | `engine.raycast / pick`, `engine.rays.addStatic`, `engine.entities`, `engine.particles` | `recipes/19-shooting-picking.md` |
|
|
52
|
+
| NPCs and what they do, dialogue | content `npcs` (`behavior`), `engine.npcs.behavior`, content `dialogues`, `engine.dialogue` | `recipes/02-npc.md` |
|
|
53
|
+
| Items, pickups, inventory, chests, shops, gold | content `items` / `pickups`, `engine.inventory` (`container`, `transfer`), currency item + ops | `recipes/03-items-pickups.md`, `22-shop-gold.md` |
|
|
54
|
+
| Quests, objective markers | content `quests`, `engine.quests`, `engine.hud.marker()` | `recipes/04-quests.md` |
|
|
55
|
+
| Player and characters | `engine.player`, `engine.characters.createPlayer({ ...presets.player.thirdPerson, model })` | `recipes/13-animation.md` |
|
|
56
|
+
| Camera, orthographic camera | `openWorld({ camera })` (required), `engine.setCamera(...)`, `engine.cameraRig`, `engine.takeCamera` | `recipes/21-camera.md` |
|
|
57
|
+
| Action game: hp, attacks, enemy AI, drops | your ops + `world.simulate` + `inventory.spawnPickup`; `examples/action/` | `recipes/32-action-game.md` |
|
|
58
|
+
| Use three.js directly, own renderer, no default lights | `engine.scene / renderer / camera`, `createEngine({ lights: false, renderer })` | `recipes/40-scene.md` §8, `50-own-renderer.md` |
|
|
59
|
+
|
|
60
|
+
### Assets
|
|
61
|
+
| To do | Use | Recipe |
|
|
62
|
+
|---|---|---|
|
|
63
|
+
| Art assets, asset packs, fonts, loading, what failed | `engine.assets.manifest({ models, textures, sounds, fonts })`, `engine.loading`, `threedog loading` | `recipes/05-props-bake.md` |
|
|
64
|
+
| Real art assets: Blender -> GLB, baked textures | `threedog assets check [--against old.glb]`, `engine.assets.manifest({ models })` | `recipes/46-blender-art-route.md` |
|
|
65
|
+
| Skeletal animation, far detail (HLOD) | `engine.assets.animate(model, config)`, `anim.sync`, `character.onPose(fn)`, `engine.hlod` | `recipes/13-animation.md`, `15-perf.md` |
|
|
66
|
+
| Sound, buses, ambience, music, footsteps | `createEngine({ audio })`, `engine.audio.sfx(name)`, `engine.ambience`, `engine.music` | `recipes/31-audio.md` |
|
|
67
|
+
|
|
68
|
+
### Style and look
|
|
69
|
+
| To do | Use | Recipe |
|
|
70
|
+
|---|---|---|
|
|
71
|
+
| Change any look at run time: tone, lights, fog, sky, clouds, shadow, wind, ground, water, weather, post | `engine.look.<part>.set / patch / replace` (`engine.catalog('look')`); own plain three.js: when to | `recipes/52-look.md`, `40-scene.md` §8 |
|
|
72
|
+
| Set the starting look: pack, materials, mixing packs, exposure, sky layers | style pack (`style: [lowpoly, { sky }]`), `engine.makeMaterial('role', {...})`, `style.palette`, `postAdd` / `postRemove` | `recipes/09-style-pack.md`, `36-sky-ground-plant-looks.md`, `48-make-material.md` |
|
|
73
|
+
| Material and lighting shader patches, toon ramp, wind, fog hooks | `applyEffects`, `look.surface.patch`, `look.wind.patch`, `look.fog.patch` | `recipes/43-shader-patches-surface-looks.md`, `38-environment-look-hooks.md` |
|
|
74
|
+
| Water depth / foam, rain and snow shapes, own weather particles, snow cover, backdrop | `look.water`, `look.weather`, `style.weather.snow.cover`, `style.sky.backdrop` | `recipes/44-water-weather-look-hooks.md`, `47-island-snow-backdrop.md` |
|
|
75
|
+
| Shadows too blurry near the camera; shadow type | `look.shadow.set({ cascades: 3, type })` | `recipes/45-cascaded-shadows.md`, `15-perf.md` |
|
|
76
|
+
| Environment lighting (PBR reflections, HDR) | `look.env.replace('sky' | asset)`, `look.env.set({ intensity })`\| asset })`, `look.env` | `recipes/34-environment-lighting.md` |
|
|
77
|
+
| Color grading, grain, vignette, DOF, outline, bloom | `@threedog/post-effects`, `postAdd(vignette())`, `engine.post`, `look.post.set` | `recipes/09-style-pack.md`, `52-look.md` |
|
|
78
|
+
| Many lights (torches, lamps, muzzle flashes) | `lightPool({ point })`, `engine.lightPool.add(obj, { color, intensity, distance, flicker })` | `recipes/09-style-pack.md` |
|
|
79
|
+
| Day, night, seasons, sky, weather, water, isDay | `engine.sky` (`at / between / daily / onSeason`), `engine.weather`, `engine.water` | `recipes/08-weather-sky.md` |
|
|
80
|
+
| Who set tone / post / lights; why does it look like this | `engine.describe().look` (value, by, at), `describe().render`, `debug.view('albedo'\|'lighting'\|'shadow'\|'normals')` | `recipes/52-look.md`, `16-dev-bridge.md` |
|
|
81
|
+
| New style from a reference image | `threedog style palette <image>`, `npm run new-style`, `style check`, `style compare <ref> <shot>` | `recipes/35-style-from-reference.md` |
|
|
82
|
+
|
|
83
|
+
### Rules and flow
|
|
84
|
+
| To do | Use | Recipe |
|
|
85
|
+
|---|---|---|
|
|
86
|
+
| Player actions, UI buttons that change state | `engine.ops.define('noun.verb', { can, run, undo })`, `ops.run(name, args)` | `recipes/23-ops.md` |
|
|
87
|
+
| What can this game do (modules, ops, saves, time) | `engine.catalog(id?)`, `threedog catalog [id]` | `recipes/51-capability-catalog.md` |
|
|
88
|
+
| Why can't / what can the player do here | `engine.explain(...)`, `engine.inspect(at?)`, `describeText()`, scenario tests | `recipes/23-ops.md` |
|
|
89
|
+
| Story flags, counters | `engine.vars` (`setFlag / flag / bump / counter`, saved) | `recipes/20-content-actions-save.md` |
|
|
90
|
+
| Saves: save game, load game, progress, slot, autosave, 存档 | `engine.saves.register(key, { save, load })`, `saves.autosave(minutes)` | `recipes/20-content-actions-save.md` |
|
|
91
|
+
| New game / continue / back to title / retry | `await engine.session.newGame() / load(slot)`, `quit()`, `session.track(h)` | `recipes/07-flow-scenes-pause.md` |
|
|
92
|
+
| Scene flow, fades, pausing, cutscenes, tweens | `engine.flow`, `fadeScreen(engine, to, s)`, `engine.pause(owner)`, `engine.timeline.tween` | `recipes/07-flow-scenes-pause.md` |
|
|
93
|
+
| Time, timers, skipping time | `engine.clock` (`after / every`), `await engine.skip({ to: '06:00' })`, `checkSkip`, `checkSave` | `recipes/06-clock-events.md` |
|
|
94
|
+
| Events, cause chain, randomness | `engine.events.on / emit`, `engine.random` (saved), `events.trace(name)`, `traceFocus(id)` | `recipes/06-clock-events.md` |
|
|
95
|
+
| Keys, input contexts, open / interact key; text and languages (`engine.t`, `engine.i18n`) | `input.define('action', keys, label)`, `engine.input.push('menu')`, `input.simulate` | `recipes/26-ui-parts.md` |
|
|
96
|
+
| Screen UI parts, Esc layering, settings menu, labels over the world, photo mode | `createEngine({ ui })`, `engine.ui.set`, `engine.hud`, `engine.settings`, `worldToScreen()`, `engine.photo` | `recipes/26-ui-parts.md` |
|
|
97
|
+
| Drive and test the running game | dev bridge: `applyState`, `defineState`, `status`, `verify <scenario>`, `scene --hidden`, `state`, `step`, `skip` | `recipes/16-dev-bridge.md` |
|
|
98
|
+
| Fixed camera views, same shot before / after | `engine.views.define`, `shot --view name --compare` | `recipes/46-blender-art-route.md` |
|
|
99
|
+
| Drive the game from an MCP client | `claude mcp add threedog -- npx threedog mcp` | `recipes/16-dev-bridge.md` §10 |
|
|
100
|
+
| Will a save keep it; hide / recolor on screen only | `engine.add(obj, { id })`, `engine.thing(id)`, ops `thing.set / remove`, `debug.override(owner, id, {...})` | `recipes/41-thing-registry.md` |
|
|
101
|
+
| Your own module, own game system (crop, machine) | `{ name, install, fixed, frame, describe, afterLoad }`, `engine.use`; `before` / `after`, `critical`; save, `skip` hook, ops `can` | `recipes/14-custom-module.md`, `49-game-module-contract.md` |
|
|
102
|
+
| Heavy loops, workers; performance budget, debug panel | `engine.jobs.add`, `engine.threads.lane`, `engine.commits`, `engine.budget`, `engine.debug.panel`, `threedog capture` | `recipes/15-perf.md` |
|
|
103
|
+
| Co-op multiplayer | `engine.use(net({ role, transport }))`, `engine.net` | `recipes/27-net.md` |
|
|
104
|
+
|
|
105
|
+
## Commands
|
|
106
|
+
Drive the running game with the MCP tools or `node node_modules/@threedog/tools/bin/threedog.mjs <cmd>` (avoid npx: +2.5 s per call); details
|
|
107
|
+
in `COMMANDS.md`. `npm run dev` · `npm run check` (after every change) · `npm test -- name` (related tests only) · `npm run map` (after code,
|
|
108
|
+
JSDoc or content changes). Browser errors go to `.threedog/errors.log`: **read it first when something breaks**.
|
|
109
|
+
|
|
110
|
+
## Verification rules for AI
|
|
111
|
+
1. Order: `npm run map` -> `npm run check` -> the related tests.
|
|
112
|
+
2. Check logic with `describeText()`, not screenshots; screenshots only for what the eye must judge. Ops run through the bridge change this
|
|
113
|
+
session only; a lasting change is an edit to `content/*.js`. `main.js` sets `window.engine = engine` before `start()`.
|
|
114
|
+
|
|
115
|
+
## Conventions (detailed in `CONVENTIONS.md`)
|
|
116
|
+
- **A position is one argument** (Vector3, Object3D, `[x, y, z]` or `{ x, z }`); sizes and counts go in the options object after it.
|
|
117
|
+
- **Registrations return a handle**; `h.remove()` undoes it. **Ready is the boolean `ready`**. **Event names are `noun:action`**.
|
|
118
|
+
- **Fixed step vs frame**: `onFixed` runs game time (damage, AI, timers); `onFrame` is presentation (animation, camera feel, HUD).
|
|
119
|
+
- **The engine owns** sky lights, fog and the camera every frame: see CONVENTIONS "Adjusting sky brightness".
|
|
120
|
+
- **Units** are meters, Y up, north -Z; characters face +Z. **Errors say how to fix it**: an old form throws with the fix.
|
|
121
|
+
|
|
122
|
+
## Stability
|
|
123
|
+
Tested but may change before 1.0: `net()` · `engine.threads` · `grids()` · `terrain.edit` · `world.simulate({ worker })` · `look.post.add` · `stream.source` · `hlod()` · `ops.guard / allow`.
|
package/docs/API.md
ADDED
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
# Engine API index (generated, do not edit by hand; produced by npm run map)
|
|
2
|
+
|
|
3
|
+
> **To do something, first look at the recipe in `recipes/` whose file name matches** (it has a ready-made pattern, faster than browsing the API): 01-new-game · 02-npc · 03-items-pickups · 04-quests · 05-props-bake · 06-clock-events · 07-flow-scenes-pause · 08-weather-sky · 09-style-pack · 10-blender-level · 11-vehicles · 12-navmesh · 13-animation · 14-custom-module · 15-perf · 16-dev-bridge · 18-world · 19-shooting-picking · 20-content-actions-save · 21-camera · 22-shop-gold · 23-ops · 26-ui-parts · 27-net · 28-terrain · 29-grid · 30-templates · 31-audio · 32-action-game · 33-stream-sources · 34-environment-lighting · 35-style-from-reference · 36-sky-ground-plant-looks · 37-terrain-look-hooks · 38-environment-look-hooks · 40-scene · 41-thing-registry · 42-terrain-shape · 43-shader-patches-surface-looks · 44-water-weather-look-hooks · 45-cascaded-shadows · 46-blender-art-route · 47-island-snow-backdrop · 48-make-material · 49-game-module-contract · 50-own-renderer · 51-capability-catalog · 52-look
|
|
4
|
+
> The api pages are generated too, do not edit them by hand; `?` in a signature means optional, what follows `→` is the return value; the full types are in `types/*.d.ts`.
|
|
5
|
+
> With no matching recipe: read this page first: the core everyday API + one line per core object / module (listing method names). For the one you need, **read only that page** `api/<name>.md` (methods, parameters, properties and data structures are all in it).
|
|
6
|
+
> Paths are relative to the package (`node_modules/threedog/`). Entry: `import { createEngine, openWorld, … } from 'threedog'` (the engine package's own examples use relative paths); a module that is not installed is undefined, so use `engine.xxx?.method()`.
|
|
7
|
+
|
|
8
|
+
## Core everyday API (all methods, properties, createEngine options and how to write a module are in [api/engine.md](api/engine.md))
|
|
9
|
+
- `createEngine(opts: EngineOptions) → Engine` — creates the engine (core only); options: canvas style loading saveKey headless budget …
|
|
10
|
+
- `openWorld(opts: OpenWorldOptions) → ModuleDef[]` — open-world preset (world and environment + basic modules; add gameplay modules yourself; `xxx: false` turns one off), options in [api/openWorld.md](api/openWorld.md)
|
|
11
|
+
- `engine.use(...mods: ModuleInput[])` — Install one or more modules
|
|
12
|
+
- `engine.start() → Promise<this>` — Start: initialize modules, preload assets, wait for the world to be ready
|
|
13
|
+
- `engine.step(seconds: number, opts?: { render?, frameEvery?, describe? }) → GameState | null` — Advance seconds of fixed-step time synchronously
|
|
14
|
+
- `engine.describeText(opts?: { radius?, full?, path? }) → string` — The same information as English text, summary first: at most 30 lines…
|
|
15
|
+
- `engine.applyState(params: StateParams) → Promise<void>` — Set up a scenario: time of day, weather, player position, load a save, advance time, skip cutscenes
|
|
16
|
+
- `engine.onFixed(fn: (dt: number) => void) → Handle` — Fixed-step logic (60 times per second, dt in fixed seconds): movement, physics, cooldowns, and game…
|
|
17
|
+
- `engine.onFrame(fn: (dt: number) => void) → Handle` — Once per frame (dt in frame seconds): animation, camera, UI and UI keys…
|
|
18
|
+
- `engine.add(obj: T, ...more: (Object3D | { id?, save? })[]) → T` — Add objects to the scene and register them (engine.thing), returns the first one
|
|
19
|
+
- `engine.remove(...objs: Object3D[])` — Fully delete an object (use it when you no longer want the object): removes it from its parent, unr…
|
|
20
|
+
- `engine.surface(x: number, z: number, refY?: number) → number` — Ground height (meters) at (x, z)
|
|
21
|
+
- `engine.snapToGround(obj: T, offset?: number) → T` — Put an object on the ground under it (y = ground height + offset) and return the object
|
|
22
|
+
- `engine.raycast(origin: Vec3Like, dir: Vec3Like, opts?: RaycastOptions) → RayHit | null` — Ray: shoot from origin along dir, returns the nearest hit or null…
|
|
23
|
+
- `engine.pick(ndcX: number, ndcY: number, opts?: RaycastOptions) → RayHit | null` — Shoot a ray through the camera from screen coordinates (-1..1, e.g. input.pointer.ndcX/ndcY)
|
|
24
|
+
- `engine.freeze(owner?: string | { owner?, kind? }, opts?: { kind?: 'title' }) → ChainedHandle` — Gameplay pause (menu, flow's paused): fixed steps are skipped entirely…
|
|
25
|
+
- `engine.pause(owner?: string | { owner?, kind? }, opts?: { kind?: 'test' }) → ChainedHandle` — Pause the real-time loop: the picture stops and even rendering stops, only step() advances…
|
|
26
|
+
- `engine.stateApplied` — Scenario is ready: start() completed, and the URL parameters / the latest applyState have all been …
|
|
27
|
+
- `engine.ready` — True once start() completes and the loading screen is gone…
|
|
28
|
+
- `engine.player` — The player (exists only after characters.createPlayer())
|
|
29
|
+
- `engine.scene` — three.js scene
|
|
30
|
+
- `engine.camera` — three.js perspective camera
|
|
31
|
+
|
|
32
|
+
## Core objects (engine.xxx, no install needed)
|
|
33
|
+
- [`engine.events`](api/events.md) the event bus: traceFocus note trace recent on once emit; event table
|
|
34
|
+
- [`engine.input`](api/input.md) Input: read by "action": define touchButton simulate rebind keysOf label down pressed released pressedRaw push
|
|
35
|
+
- [`engine.clock`](api/clock.md) game seconds and "after how long / every how long": after every
|
|
36
|
+
- [`engine.vars`](api/vars.md) story flags and counters (autosaved): flag setFlag counter bump
|
|
37
|
+
- [`engine.saves`](api/saves.md) engine.saves handles saving: register queue flush collect check apply save load list remove export import exportFile importFile …
|
|
38
|
+
- [`engine.assets`](api/assets.md) Assets: manifest builder preload font model modelNow geometry texture release trim users forget cached animate …
|
|
39
|
+
- [`engine.audio`](api/audio.md) buses: addBus setVolume duck register condition measure value matches volumeOf sfx noiseBurst tone load play
|
|
40
|
+
- [`engine.i18n`](api/i18n.md) string tables: add setLocale has t
|
|
41
|
+
- [`engine.rays`](api/rays.md) engine.rays is the ray registry…: addStatic forget addProvider cast pick
|
|
42
|
+
- [`engine.jobs`](api/jobs.md) engine.jobs queues build work in a binary heap: add run
|
|
43
|
+
- [`engine.stream`](api/stream.md) engine.stream builds on demand by space: only entries n…: add setRadius source teleport readyCheck sources
|
|
44
|
+
- [`engine.budget`](api/budget.md) performance budget (turned on by createEngine: enable disable metric limitOf report checkStartup values byTag
|
|
45
|
+
- [`engine.post`](api/post.md) PostFX: add get enable setAntialias list
|
|
46
|
+
- [`engine.ground`](api/ground.md) Ground: whoever provides the ground height is the "terr…: height slope type has voidY forEachCollider viewRange chunkCollision staticTrimeshes staticVersion navGeometry
|
|
47
|
+
|
|
48
|
+
## Modules (installed with engine.use; the openWorld preset installs only world and environment, see [api/openWorld.md](api/openWorld.md))
|
|
49
|
+
- [`engine.terrain`](api/terrain.md) terrain() Procedural terrain: setViewChunks setDensity rebuild edit isReadyAround
|
|
50
|
+
- [`engine.vegetation`](api/vegetation.md) vegetation() Vegetation: rebuild setShadowRing add get list isRemoved removeInstance restoreInstance instanceAt
|
|
51
|
+
- [`engine.sky`](api/sky.md) sky() Sky, day/night, calendar: modify at between daily onSeason setShadow setShadowMapSize setEnvironment
|
|
52
|
+
- [`engine.weather`](api/weather.md) weather() Weather: define setAuto set label
|
|
53
|
+
- [`engine.water`](api/water.md) water() Water surface
|
|
54
|
+
- [`engine.world`](api/world.md) World data: add origin idOf get set move remove query forEachNear present view refresh …
|
|
55
|
+
- [`engine.net`](api/net.md) net: reconnect
|
|
56
|
+
- [`engine.grids`](api/grids.md) grids: add get list define preview
|
|
57
|
+
- [`engine.collision`](api/collision.md) collision() Lightweight collision: addCircle addBox addSegment addBlocked blockedAt addObject forEachStatic walkable walkableAt lineClear
|
|
58
|
+
- [`engine.rigid`](api/rigid.md) rigid() Real physics, Rapier: addBox addBall addHull impulse setPosition groundReady addVehicle
|
|
59
|
+
- [`engine.cameraRig`](api/cameraRig.md) followCamera() / firstPersonCamera() / fixedCamera() / rtsCamera() Current camera: follow forward right focusPoint update onOverride onEnter onExit
|
|
60
|
+
- [`engine.timeline`](api/timeline.md) timeline() Cutscenes, tweens: tween play skip
|
|
61
|
+
- [`engine.level`](api/level.md) level() Hand-built level: marker markersWith unload load track
|
|
62
|
+
- [`engine.triggers`](api/triggers.md) triggers() Trigger zones: list add clear byTag fromMarkers setDebug
|
|
63
|
+
- [`engine.entities`](api/entities.md) entities() Entities: define spawn get byType list nearest remove clear setStage
|
|
64
|
+
- [`engine.particles`](api/particles.md) particles() Particles: define has emit attach count clear
|
|
65
|
+
- [`engine.settings`](api/settings.md) settings() Settings menu: get set preset define addSection removeSection open close toggle resetBindings rebind actionList …
|
|
66
|
+
- [`engine.music`](api/music.md) music() Background music: addTracks play stop stinger rules override pick
|
|
67
|
+
- [`engine.characters`](api/characters.md) characters() Characters: findSpawn createPlayer moveInput removePlayer findPath findPathAsync; Character, NPC; engine.npcs: list add remove behavior get character avoid (behavior and avoid: see recipes/02-npc)
|
|
68
|
+
- [`engine.interactions`](api/interactions.md) interactions() Interaction prompts: add get
|
|
69
|
+
- [`engine.dialogue`](api/dialogue.md) dialogue() Dialogue: define start say end
|
|
70
|
+
- [`engine.inventory`](api/inventory.md) inventory() Inventory: define item count has list get add remove trade setData container transfer …
|
|
71
|
+
- [`engine.quests`](api/quests.md) quests() Quests: define start isDone isActive isFailed check list
|
|
72
|
+
- [`engine.photo`](api/photo.md) photo() Photo mode: take subject
|
|
73
|
+
- [`engine.ambience`](api/ambience.md) ambience() Ambience: add rules nearWater
|
|
74
|
+
- [`engine.nav`](api/nav.md) nav() Navmesh: findPath dispose
|
|
75
|
+
- [`engine.hlod`](api/hlod.md) hlod() hlod: add
|
|
76
|
+
- [`engine.lightPool`](api/lightPool.md) lightPool() Light pool: add usage
|
|
77
|
+
- [`engine.content`](api/content.md) content() Content loading: load condition test run place where template
|
|
78
|
+
- [`engine.flow`](api/flow.md) flow() Game flow and scene transitions: define go transition
|
|
79
|
+
- [`engine.hud`](api/hud.md) hud() Objective markers, counters, progress bars: marker counter bar remove
|
|
80
|
+
|
|
81
|
+
## Other
|
|
82
|
+
- [Style pack Style](api/style.md): all look options (sky, weather, water, terrain, UI, materials, particles, sound, models)
|
|
83
|
+
- [Utility functions](api/tools.md): postAdd postRemove presets world net fakeNetwork webSocket grids screenToGround EASINGS ease checkOptions readParams defineLookPart createTerrain terrainMaterial mergeColored applyEffects MATERIAL_PURPOSES makeMaterial materialPatches toast makeWindow worldToScreen …
|
package/docs/CODEMAP.md
ADDED
|
@@ -0,0 +1,347 @@
|
|
|
1
|
+
# Code map (generated, do not edit by hand)
|
|
2
|
+
|
|
3
|
+
> `npm run map` scans the engine source. Read when needed, after `AI.md` and the game's `GAMEMAP.md`; API details are in `API.md` and `api/<module>.md`. Paths are relative to the package.
|
|
4
|
+
|
|
5
|
+
## Modules (installed with engine.use)
|
|
6
|
+
|
|
7
|
+
Requires, optional, stage, run order, params, ops, saves and time model of each module: `npx threedog catalog` (and `catalog <module>`); only the file is listed here.
|
|
8
|
+
|
|
9
|
+
| Module (engine.xxx) | File |
|
|
10
|
+
|---|---|
|
|
11
|
+
| cameraRig (firstPersonCamera()) | modules/camera/FirstPersonCamera.js |
|
|
12
|
+
| cameraRig (fixedCamera()) | modules/camera/FixedCamera.js |
|
|
13
|
+
| cameraRig (followCamera()) | modules/camera/FollowCamera.js |
|
|
14
|
+
| cameraRig (rtsCamera()) | modules/camera/RtsCamera.js |
|
|
15
|
+
| terrain | modules/terrain/index.js |
|
|
16
|
+
| vegetation | modules/vegetation/index.js |
|
|
17
|
+
| world | modules/world/index.js |
|
|
18
|
+
| sky | modules/sky/skyModule.js |
|
|
19
|
+
| water | modules/water/Water.js |
|
|
20
|
+
| weather | modules/weather/Weather.js |
|
|
21
|
+
| interactions | modules/gameplay/Interactions.js |
|
|
22
|
+
| grids | modules/grid/index.js |
|
|
23
|
+
| triggers | modules/triggers/index.js |
|
|
24
|
+
| particles | modules/particles/Particles.js |
|
|
25
|
+
| content | modules/content/index.js |
|
|
26
|
+
| inventory | modules/gameplay/Inventory.js |
|
|
27
|
+
| quests | modules/gameplay/Quests.js |
|
|
28
|
+
|
|
29
|
+
## Files
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
**./**
|
|
33
|
+
- index.js: Engine entry
|
|
34
|
+
|
|
35
|
+
**core/**
|
|
36
|
+
- Animator.js: Animation state machine: assets.animate(model, config) retu…
|
|
37
|
+
- Assets.js: Asset management: Asset manifest: register every model, tex…
|
|
38
|
+
- Audio.js: Audio core: buses (master, music, sfx, ambience, ui + the g…
|
|
39
|
+
- Baked.js: Code-generated model <-> GLB file (shared by the auto-cache…
|
|
40
|
+
- Batching.js: Automatic batching, engine.batching: the same static model …
|
|
41
|
+
- Budget.js: Performance budget, engine.budget: the game sets limits (on…
|
|
42
|
+
- Clock.js: Game clock, engine.clock: game seconds `now` + "after a del…
|
|
43
|
+
- Commits.js: How background results take effect: engine.commits
|
|
44
|
+
- DebugOverrides.js: engine.debug: diagnostic overrides with an owner ("show me …
|
|
45
|
+
- Describe.js: Game state description: engine.describe() returns a plain o…
|
|
46
|
+
- Engine.js: Engine core: what every 3D web game needs (rendering and po…
|
|
47
|
+
- Events.js: Event bus: modules do not call each other directly; they "s…
|
|
48
|
+
- I18n.js: i18n: engine and modules hardcode no UI text; they fetch it…
|
|
49
|
+
- Input.js: Input: read by "action", not by "key"
|
|
50
|
+
- Inspect.js: engine.inspect / engine.explain: questions an AI asks while…
|
|
51
|
+
- InspectScene.js: engine.inspect.scene(): "the mesh exists but I do not see i…
|
|
52
|
+
- Jobs.js: engine.jobs: a frame-sliced job scheduler
|
|
53
|
+
- Loading.js: engine.loading: one observable view of everything startup (…
|
|
54
|
+
- MaterialInfo.js: Material provenance for engine.inspect.scene(): "why is thi…
|
|
55
|
+
- Ops.js: One entry point for actions: engine.ops
|
|
56
|
+
- Random.js: Seeded random numbers, engine.random: gameplay randomness (…
|
|
57
|
+
- Rays.js: Rays: engine.raycast / engine.pick, with the registry engin…
|
|
58
|
+
- SaveStore.js: Save storage layer: uses the browser's native IndexedDB (no…
|
|
59
|
+
- Saves.js: Saves: each module registers "how to save and load", and sa…
|
|
60
|
+
- Stream.js: Spatial stream-in, engine.stream: entries are only register…
|
|
61
|
+
- Threads.js: engine.threads: a small worker pool
|
|
62
|
+
- UrlState.js: Reproduce a scenario in one call: engine.applyState({ time,…
|
|
63
|
+
- Vars.js: Story flags and counters, engine.vars (saved automatically …
|
|
64
|
+
- Views.js: Named fixed camera views declared by the game, so a screens…
|
|
65
|
+
- actor.js: Who acts for the local user (part of Engine, mixed into Eng…
|
|
66
|
+
- assetEntry.js: The life of one engine.assets entry, split from Assets.js (…
|
|
67
|
+
- assetLoad.js: File loading for engine.assets, split into the phases engin…
|
|
68
|
+
- assetManifest.js: engine.assets.manifest(pack) (helper of Assets.js): registe…
|
|
69
|
+
- assetReport.js: Import report of a loaded glTF (engine.assets.report): what…
|
|
70
|
+
- audioRules.js: The data side of audio rules: condition keys, measures (com…
|
|
71
|
+
- audioVoice.js: One playing sound (a "voice") of engine.audio.sfx / play: s…
|
|
72
|
+
- batchGroups.js: InstancedMesh side of engine.batching (core/Batching.js): b…
|
|
73
|
+
- canvasBox.js: The canvas's CSS box and the UI root laid over it (split ou…
|
|
74
|
+
- catalog.js: engine.catalog(): what this game can do, read from the regi…
|
|
75
|
+
- checks.js: Consistency checks a game (or an AI) can call in dev and te…
|
|
76
|
+
- claims.js: claims(): one small "who holds this" primitive shared by pa…
|
|
77
|
+
- dayTime.js: Clock-time conversion (pure functions): sky time of day `ti…
|
|
78
|
+
- debugView.js: Diagnostic view modes behind engine.debug.view('albedo' / '…
|
|
79
|
+
- describeRender.js: describe().render: what the renderer, lights and post effec…
|
|
80
|
+
- describeText.js: engine.describeText(): write describe() as plain English fo…
|
|
81
|
+
- easing.js: Easing functions: input progress 0..1, output 0..1 (back/el…
|
|
82
|
+
- errorCodes.js: Stable error codes: errors the engine raises by name end th…
|
|
83
|
+
- errorHints.js: Error hints: a table of "message pattern -> likely cause + …
|
|
84
|
+
- errors.js: Error tiers: what to do when a module hook, onFixed / onFra…
|
|
85
|
+
- events.generated.js: Generated, do not edit by hand: npm run map generates it fr…
|
|
86
|
+
- ground.js: Ground API (part of Engine, mixed into Engine.prototype): w…
|
|
87
|
+
- holds.js: Who holds the engine still: pause / resume, freeze / unfree…
|
|
88
|
+
- inputContext.js: Input contexts (like Unity's Action Maps): a stack of named…
|
|
89
|
+
- inputDefaults.js: Input defaults and strings (split out of Input.js): neutral…
|
|
90
|
+
- inputPad.js: Gamepad (standard layout) button names; like keyboard key n…
|
|
91
|
+
- inputPointer.js: The mouse / touch pointer part of input: drag to look, whee…
|
|
92
|
+
- inputTouch.js: The touch part of input: which on-screen controls the game …
|
|
93
|
+
- lifecycle.js: Engine lifecycle (part of Engine, mixed into Engine.prototy…
|
|
94
|
+
- lightWatch.js: Dev-only check (called from loop.js after each render once …
|
|
95
|
+
- look/coreParts.js: look.tone, lights, clouds
|
|
96
|
+
- look/layers.js: The layer arithmetic behind a LookPart (part.js): where a k…
|
|
97
|
+
- look/part.js: engine.look.<part>: set / patch / replace and the layers
|
|
98
|
+
- look/report.js: describe().look, catalog('look.*')
|
|
99
|
+
- look/write.js: How a value gets into a LookPart: normalize, flatten, check…
|
|
100
|
+
- loop.js: Main loop (part of Engine, mixed into Engine.prototype): fi…
|
|
101
|
+
- math.js: Small shared helpers (used by several modules)
|
|
102
|
+
- modules.js: Module installation (part of Engine, mixed into Engine.prot…
|
|
103
|
+
- movement.js: One shared definition of "can walk there": character radius…
|
|
104
|
+
- mulberry32.js: mulberry32, the one copy (engine.random and terrain placeme…
|
|
105
|
+
- opsAtomic.js: Atomic ops (op definition atomic: true): world records, inv…
|
|
106
|
+
- opsCheck.js: Dev checks for engine.ops (split out of Ops.js): op definit…
|
|
107
|
+
- opsFail.js: Structured op failures
|
|
108
|
+
- opsGuard.js: The dev guard of engine.ops (split out of Ops.js): reports …
|
|
109
|
+
- opsHistory.js: The history of engine.ops (split out of Ops.js): a ring of …
|
|
110
|
+
- opsRun.js: ops.run itself (split out of Ops.js)
|
|
111
|
+
- page.js: engine.page: the one place that listens to the browser wind…
|
|
112
|
+
- params.js: Param schemas: one plain-object description per field, shar…
|
|
113
|
+
- pureWorker.js: Worker that runs pure-function batches for engine.threads (…
|
|
114
|
+
- renamed.js: The ONE list of names renamed in 0.2: plain data with no im…
|
|
115
|
+
- saveApply.js: Applying a save (split out of Saves.js): every part is chec…
|
|
116
|
+
- saveFiles.js: Save files (.json download / restore), split out of Saves.j…
|
|
117
|
+
- saveIds.js: Record ids inside save data, for upgrade steps (saves.regis…
|
|
118
|
+
- saveVersions.js: Save format and per-part versions
|
|
119
|
+
- scatter.js: Scatter by rule: where instances go in one ground chunk (pl…
|
|
120
|
+
- sceneMethods.js: Scene and render settings on the engine (split out of Engin…
|
|
121
|
+
- screenToGround.js: Screen point -> ground point: what clicking the ground mean…
|
|
122
|
+
- services.js: Engine services: the objects every engine owns besides rend…
|
|
123
|
+
- session.js: engine.session: one playthrough, from "new game" or "load" …
|
|
124
|
+
- shadowTypes.js: three 0.187 shadow filters
|
|
125
|
+
- skip.js: Skipping time (part of Engine, mixed into Engine.prototype)…
|
|
126
|
+
- startup.js: Startup (part of Engine, mixed into Engine.prototype): star…
|
|
127
|
+
- streamCells.js: Per-chunk view of stream sources for loaders that sync whol…
|
|
128
|
+
- streamSources.js: Stream sources (internal half of engine.stream): the places…
|
|
129
|
+
- styleParts.js: A style built from parts: createEngine({ style: [lowpoly, {…
|
|
130
|
+
- targeting.js: Target selection: pure functions (no camera, input or engin…
|
|
131
|
+
- thingExplain.js: engine.thing(id).explain(): everything known about one id i…
|
|
132
|
+
- thingOps.js: engine.thing and the two built-in ops on things (thing.set …
|
|
133
|
+
- things.js: Object registry behind engine.thing: every root handed to e…
|
|
134
|
+
- threadPure.js: Pure functions for workers: a function is sent as its sourc…
|
|
135
|
+
- threadServe.js: Worker side of engine.threads lanes: serve(handler) answers…
|
|
136
|
+
- tier.js: Device tier: Engine uses it at construction to pick default…
|
|
137
|
+
- util.js: Small helpers several core files need
|
|
138
|
+
- validate.js: Runtime checks: when an option or name is misspelled, print…
|
|
139
|
+
|
|
140
|
+
**modules/** (one line per folder: what it does; its files)
|
|
141
|
+
- ambience/ Ambience module: a rule table of background sounds — Ambience.js
|
|
142
|
+
- camera/ Camera module collection — FirstPersonCamera.js, FixedCamera.js, FollowCamera.js, RtsCamera.js, common.js, index.js, projection.js
|
|
143
|
+
- characters/ Characters module: player (keyboard/stick control, camera follow, footsteps, en… — Character.js, NPC.js, assetModel.js, astar.js, behaviors.js, footsteps.js, index.js, moveHelpers.js, movers/common.js, movers/rapier.js, movers/simple.js, npcAvoid.js, npcSim.js, npcView.js, pathAsync.js, pathJob.js, pathWorker.js, playerStrings.js, proceduralRig.js, useModel.js, walkTo.js
|
|
144
|
+
- collision/ Lightweight collision: characters are upright cylinders, trees/rocks are circle… — Collision.js, grid.js
|
|
145
|
+
- content/ Content loader: hands the plain data in the game's content/*.js to the engine (… — explain.js, ids.js, index.js, loader.js, models.js, packs.js, props.js, rules.js, templates.js
|
|
146
|
+
- debug/ Performance panel + time/weather debugging + stress test — DebugPanel.js
|
|
147
|
+
- entities/ Entities — Entities.js, build.js, index.js
|
|
148
|
+
- flow/ Game flow: states (title, playing, paused, game over...) and scene transitions … — index.js
|
|
149
|
+
- gameplay/ Inventory module: define items first, then add/remove — Container.js, Containers.js, Dialogue.js, Interactions.js, Inventory.js, Quests.js, boxOps.js, dialogueBox.js, interactionPrompt.js, inventoryOps.js, pickups.js, questLog.js, questSave.js
|
|
150
|
+
- grid/ grids() module: placement grids for anything placed on cells (furniture, buildi… — Grid.js, Layer.js, index.js, ops.js, preview.js, tiles.js
|
|
151
|
+
- hlod/ HLOD: merge far-away buildings into a few proxy meshes, show originals when nea… — index.js
|
|
152
|
+
- hud/ Objective markers and a simple HUD: world markers (an edge-of-screen arrow when… — index.js, parts.js
|
|
153
|
+
- level/ Level module: load a hand-built scene (glTF/GLB from Blender, or THREE objects … — geometry.js, heightfield.js, index.js, nodes.js
|
|
154
|
+
- lights/ Light pool: many light sources (torches, street lamps, campfires, muzzle flashe… — index.js
|
|
155
|
+
- music/ Background music module entry — Music.js, index.js, rules.js
|
|
156
|
+
- nav/ Navmesh (Recast): generated after a level loads; engine.characters.findPath swi… — index.js, navPath.js
|
|
157
|
+
- net/ net() module: optional co-op multiplayer, host authority + state sync — Client.js, Host.js, Net.js, index.js, sync.js, transports.js
|
|
158
|
+
- particles/ Particles module: dust, falling leaves, splashes, chimney smoke, sparks.. — Particles.js, effect.js, shaders.js
|
|
159
|
+
- photo/ Photo mode: while taking the shot, temporarily raise resolution and shadow prec… — Photo.js
|
|
160
|
+
- rigid/ Real physics (Rapier): objects that topple, roll, get pushed and float on water — RigidBodies.js, Vehicles.js, sync.js
|
|
161
|
+
- settings/ Settings menu module entry — Settings.js, apply.js, index.js, sections.js, strings.js, view.js
|
|
162
|
+
- sky/ Sky module: dome shader (gradient + sun + moon + stars), sun/moon directional l… — Sky.js, calendar.js, cascades.js, clouds.js, domeLayers.js, environment.js, fog.js, frame.js, layers.js, look.js, lookFog.js, lookShadow.js, lookSky.js, schedule.js, shader.js, shadow.js, skyModule.js
|
|
163
|
+
- terrain/ Terrain module: chunked, streamed ground built from a height function (or a hei… — ChunkManager.js, chunkJob.js, chunkLevels.js, chunkQueries.js, chunkWorker.js, index.js, lookGround.js, mountTerrain.js, terrainColorMap.js, terrainDefaults.js, terrainEdit.js, terrainGen.js, terrainIsland.js, terrainMesh.js, terrainShape.js, terrainShapeMain.js, terrainTexture.js
|
|
164
|
+
- timeline/ Timeline: cutscenes, camera moves, scripted movement — Timeline.js, Tween.js, letterbox.js, shots.js
|
|
165
|
+
- triggers/ Trigger zone module: invisible regions in the world that notify you when the pl… — index.js
|
|
166
|
+
- vegetation/ Vegetation module factory: engine.use(vegetation(...)) — Vegetation.js, groundChunks.js, index.js, lookWind.js, modelGeometry.js
|
|
167
|
+
- water/ Water module: draws the global water plane (sea, big lakes; snaps to a grid fol… — Water.js, look.js, surface.js
|
|
168
|
+
- weather/ Weather: the game's table of weather types (weather({ types })); without one on… — Weather.js, look.js, particles.js, shaders.js, strings.js
|
|
169
|
+
- world/ world() module: installed as engine.world (world data, see World.js) — World.js, cells.js, explain.js, index.js, persist.js, pos.js, records.js, sim.js, simFar.js, state.js, thingSource.js, views.js
|
|
170
|
+
|
|
171
|
+
**render/**
|
|
172
|
+
- PostFX.js: Post-processing as an ordered list of named effects in four…
|
|
173
|
+
- detail.js: The `detail` surface patch: grain, paper, brush strokes or …
|
|
174
|
+
- effects.js: Built-in shader effects (used by render/materials.js): the …
|
|
175
|
+
- engineUniforms.js: Engine uniforms (helper of patches.js): a patch uniform tha…
|
|
176
|
+
- fuse.js: Fused post pass: several effects that each carry a small GL…
|
|
177
|
+
- lighting.js: The `lighting` surface patch and the toon ramp: extra, opti…
|
|
178
|
+
- lights.js: Default lights every engine has (engine.lights, the mechani…
|
|
179
|
+
- lookSurface.js: look.materials and look.surface (render/materials.js reads …
|
|
180
|
+
- materials.js: Materials and shaders: Material factory makeMaterial(role, …
|
|
181
|
+
- patches.js: Named shader patches: one way to add shader code to any thr…
|
|
182
|
+
- postLook.js: look.post: the post-processing chain as a look part (recipe…
|
|
183
|
+
- surface.js: Surface keys of a material spec (used by makeMaterial): tex…
|
|
184
|
+
- uniformDecl.js: Declares style-supplied GLSL uniforms (sky clouds, wind): {…
|
|
185
|
+
|
|
186
|
+
**ui/**
|
|
187
|
+
- Focus.js: UI focus stack: windows, dialogue, cutscenes and the settin…
|
|
188
|
+
- LoadingScreen.js: Default 'loading' UI part: covers the view at start, shows …
|
|
189
|
+
- Parts.js: UI parts (engine.ui): every piece of screen UI the engine o…
|
|
190
|
+
- UI.js: UI base
|
|
191
|
+
- defaults.js: The core UI parts every engine declares: 'loading' (on), 't…
|
|
192
|
+
- theme.js: UI theme and default CSS in <head> (part of ui/UI.js): the …
|
|
193
|
+
- touchPart.js: Default 'touch' UI part: an on-screen stick (bottom left) a…
|
|
194
|
+
|
|
195
|
+
## Events (internal emitters and listeners; arguments are in api/events.md)
|
|
196
|
+
|
|
197
|
+
| Event | Emitted by | Listened by |
|
|
198
|
+
|---|---|---|
|
|
199
|
+
| anim:end | core/Animator.js | — |
|
|
200
|
+
| audio:ready | core/Audio.js | — |
|
|
201
|
+
| camera:change | camera | settings |
|
|
202
|
+
| camera:shot | camera | — |
|
|
203
|
+
| character:jump | characters | — |
|
|
204
|
+
| character:land | characters | — |
|
|
205
|
+
| character:model | characters | — |
|
|
206
|
+
| day:start | sky | — |
|
|
207
|
+
| dialogue:end | gameplay | music |
|
|
208
|
+
| dialogue:line | gameplay | — |
|
|
209
|
+
| dialogue:start | gameplay | music |
|
|
210
|
+
| engine:error | core/errors.js | — |
|
|
211
|
+
| engine:ready | core/startup.js | content, flow |
|
|
212
|
+
| entity:remove | entities | — |
|
|
213
|
+
| entity:spawn | entities | — |
|
|
214
|
+
| entity:stage | entities | — |
|
|
215
|
+
| entity:state | entities | — |
|
|
216
|
+
| flow:change | flow | — |
|
|
217
|
+
| flow:transition | flow | — |
|
|
218
|
+
| ground:change | terrain | characters |
|
|
219
|
+
| i18n:change | core/I18n.js | core/inputTouch.js, gameplay, hud, settings, timeline, ui/UI.js |
|
|
220
|
+
| input:context | core/inputContext.js | — |
|
|
221
|
+
| input:rebind | core/Input.js, settings | gameplay, timeline, ui/UI.js |
|
|
222
|
+
| item:pickup | gameplay | — |
|
|
223
|
+
| item:use | gameplay | — |
|
|
224
|
+
| level:loaded | level | characters, grid, hlod, nav |
|
|
225
|
+
| module:disabled | core/errors.js | — |
|
|
226
|
+
| music:change | music | — |
|
|
227
|
+
| music:stinger | music | — |
|
|
228
|
+
| net:close | net | — |
|
|
229
|
+
| net:join | net | — |
|
|
230
|
+
| net:leave | net | — |
|
|
231
|
+
| net:open | net | — |
|
|
232
|
+
| net:result | net | — |
|
|
233
|
+
| net:sync | net | — |
|
|
234
|
+
| page:blur | core/page.js | core/Input.js |
|
|
235
|
+
| page:contextlost | core/page.js | — |
|
|
236
|
+
| page:contextrestored | core/page.js | — |
|
|
237
|
+
| page:focus | core/page.js | — |
|
|
238
|
+
| page:pointerlock | core/page.js | — |
|
|
239
|
+
| photo:denied | photo | — |
|
|
240
|
+
| photo:taken | photo | — |
|
|
241
|
+
| quest:done | gameplay | — |
|
|
242
|
+
| quest:fail | gameplay | — |
|
|
243
|
+
| quest:part | gameplay | — |
|
|
244
|
+
| quest:start | gameplay | — |
|
|
245
|
+
| quest:step | gameplay | — |
|
|
246
|
+
| save:imported | core/saveFiles.js | photo |
|
|
247
|
+
| save:loaded | core/saveApply.js | characters |
|
|
248
|
+
| save:written | core/Saves.js | — |
|
|
249
|
+
| season:change | sky | sky |
|
|
250
|
+
| session:end | core/session.js | core/skip.js, flow, gameplay, hud, music, timeline, triggers |
|
|
251
|
+
| session:start | core/session.js | core/things.js, camera, flow |
|
|
252
|
+
| settings:change | settings | — |
|
|
253
|
+
| settings:shadows | core/sceneMethods.js | terrain |
|
|
254
|
+
| state:applied | core/UrlState.js | — |
|
|
255
|
+
| terrain:void | rigid, terrain | — |
|
|
256
|
+
| time:skip | core/skip.js | — |
|
|
257
|
+
| timeline:end | timeline | — |
|
|
258
|
+
| timeline:start | timeline | — |
|
|
259
|
+
| trigger:enter | triggers | camera, content |
|
|
260
|
+
| trigger:exit | triggers | content |
|
|
261
|
+
| ui:close | ui/Parts.js, ui/UI.js | core/services.js, settings |
|
|
262
|
+
| ui:open | ui/Parts.js, ui/UI.js | core/services.js, settings |
|
|
263
|
+
| vegetation:remove | vegetation | — |
|
|
264
|
+
| vegetation:restore | vegetation | — |
|
|
265
|
+
| vehicle:enter | characters | characters |
|
|
266
|
+
| vehicle:exit | characters | characters |
|
|
267
|
+
| water:add | core/ground.js | water |
|
|
268
|
+
| water:remove | core/ground.js | water |
|
|
269
|
+
| weather:change | weather | — |
|
|
270
|
+
| weather:lightning | weather | weather |
|
|
271
|
+
| world:add | world | grid |
|
|
272
|
+
| world:change | world | grid |
|
|
273
|
+
| world:load | world | characters, content, entities, gameplay, grid |
|
|
274
|
+
| world:remove | world | characters, entities, gameplay, grid |
|
|
275
|
+
|
|
276
|
+
## Key actions (engine.input)
|
|
277
|
+
|
|
278
|
+
| Action | Default keys | Text key | Registered at |
|
|
279
|
+
|---|---|---|---|
|
|
280
|
+
| moveForward | ['KeyW', 'ArrowUp'] | input.moveForward | core/inputDefaults.js |
|
|
281
|
+
| moveBack | ['KeyS', 'ArrowDown'] | input.moveBack | core/inputDefaults.js |
|
|
282
|
+
| moveLeft | ['KeyA', 'ArrowLeft'] | input.moveLeft | core/inputDefaults.js |
|
|
283
|
+
| moveRight | ['KeyD', 'ArrowRight'] | input.moveRight | core/inputDefaults.js |
|
|
284
|
+
| confirm | ['Space', 'Enter'] | input.confirm | core/inputDefaults.js |
|
|
285
|
+
| cancel | ['Escape'] | input.cancel | core/inputDefaults.js |
|
|
286
|
+
| rotateLeft | rotateKeys.left//['KeyQ'] | camera.rotateLeft | camera |
|
|
287
|
+
| rotateRight | rotateKeys.right//['KeyR'] | camera.rotateRight | camera |
|
|
288
|
+
| jump | opts.jumpKeys | input.jump | characters |
|
|
289
|
+
| run | opts.runKeys | input.run | characters |
|
|
290
|
+
| brake | brakeKeys??[] | input.brake | characters |
|
|
291
|
+
| debugPanel | ['F3'] | debug.toggle | debug |
|
|
292
|
+
| 'choice'+i | ['Digit'+i,'Numpad'+i] | dialogue.choice | gameplay |
|
|
293
|
+
| interact (parameter action) | keys | input.interact | gameplay |
|
|
294
|
+
| inventory (parameter action) | keys | inventory.action | gameplay |
|
|
295
|
+
| quests (parameter action) | keys | quests.action | gameplay |
|
|
296
|
+
| "{a}" | ["KeyR"] | undefined | grid |
|
|
297
|
+
| rotate (parameter rotate) | rotateKeys | grid.rotate | grid |
|
|
298
|
+
| photo | keys | photo.action | photo |
|
|
299
|
+
| menu (parameter action) | ['Escape'] (parameter keys) | settings.action | settings |
|
|
300
|
+
| skip | ['Escape', 'Backspace'] (parameter skipKeys) | timeline.skipAction | timeline |
|
|
301
|
+
| triggersDebug (parameter action) | keys | triggers.debug | triggers |
|
|
302
|
+
|
|
303
|
+
## i18n key groups (engine.t; full keys are in each string table)
|
|
304
|
+
|
|
305
|
+
- core/I18n.js: common.* (8), loading.* (6), input.* (8), key.* (5), ground.* (1), module.* (32), shop.* (1)
|
|
306
|
+
- core/page.js: page.* (2)
|
|
307
|
+
- core/saveFiles.js: saves.* (7)
|
|
308
|
+
- modules/camera/common.js: camera.* (2)
|
|
309
|
+
- modules/characters/playerStrings.js: npc.* (1), input.* (2)
|
|
310
|
+
- modules/debug/DebugPanel.js: debug.* (1)
|
|
311
|
+
- modules/entities/Entities.js: entities.* (1)
|
|
312
|
+
- modules/gameplay/Dialogue.js: dialogue.* (2)
|
|
313
|
+
- modules/gameplay/Quests.js: quests.* (7)
|
|
314
|
+
- modules/gameplay/inventoryOps.js: inventory.* (8)
|
|
315
|
+
- modules/grid/preview.js: grid.* (1)
|
|
316
|
+
- modules/hud/index.js: hud.* (1)
|
|
317
|
+
- modules/level/index.js: level.* (2)
|
|
318
|
+
- modules/photo/Photo.js: photo.* (1)
|
|
319
|
+
- modules/rigid/Vehicles.js: vehicle.* (2)
|
|
320
|
+
- modules/settings/strings.js: settings.* (42)
|
|
321
|
+
- modules/timeline/Timeline.js: timeline.* (2)
|
|
322
|
+
- modules/triggers/index.js: triggers.* (1)
|
|
323
|
+
- modules/weather/strings.js: weather.* (8)
|
|
324
|
+
- ui/defaults.js: title.* (3)
|
|
325
|
+
|
|
326
|
+
## Style pack keys (who reads engine.style.xxx)
|
|
327
|
+
|
|
328
|
+
| Key | Read in |
|
|
329
|
+
|---|---|
|
|
330
|
+
| character | characters |
|
|
331
|
+
| clouds | core/look/coreParts.js |
|
|
332
|
+
| exposure | core/look/coreParts.js |
|
|
333
|
+
| grid | grid |
|
|
334
|
+
| lighting | render/lookSurface.js |
|
|
335
|
+
| materials | render/lookSurface.js |
|
|
336
|
+
| palette | core/Assets.js, core/assetLoad.js |
|
|
337
|
+
| particles | particles |
|
|
338
|
+
| pickup | gameplay |
|
|
339
|
+
| seasons | sky |
|
|
340
|
+
| sky | sky |
|
|
341
|
+
| terrain | terrain |
|
|
342
|
+
| toneMapping | core/look/coreParts.js |
|
|
343
|
+
| triggers | triggers |
|
|
344
|
+
| ui | gameplay, hud, ui/LoadingScreen.js, ui/UI.js |
|
|
345
|
+
| water | water |
|
|
346
|
+
| weather | weather |
|
|
347
|
+
| wind | vegetation |
|