@jgengine/core 0.10.0 → 0.12.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 +39 -2
- package/LICENSE +203 -661
- package/README.md +1 -1
- package/dist/ai/crowd.d.ts +55 -0
- package/dist/ai/crowd.js +114 -0
- package/dist/ai/flock.d.ts +5 -2
- package/dist/ai/flock.js +5 -2
- package/dist/ai/groupAssist.d.ts +1 -0
- package/dist/ai/groupAssist.js +1 -0
- package/dist/ai/heatSystem.d.ts +76 -0
- package/dist/ai/heatSystem.js +97 -0
- package/dist/ai/interestScheduler.d.ts +107 -0
- package/dist/ai/interestScheduler.js +118 -0
- package/dist/ai/jobBoard.d.ts +1 -0
- package/dist/ai/jobBoard.js +1 -0
- package/dist/ai/laneSelect.d.ts +5 -2
- package/dist/ai/laneSelect.js +5 -2
- package/dist/ai/mobBrain.d.ts +1 -0
- package/dist/ai/mobBrain.js +1 -0
- package/dist/ai/populationDirector.d.ts +103 -0
- package/dist/ai/populationDirector.js +190 -0
- package/dist/ai/pursuit.d.ts +56 -0
- package/dist/ai/pursuit.js +53 -0
- package/dist/ai/spawnDirector.d.ts +7 -2
- package/dist/ai/spawnDirector.js +18 -15
- package/dist/ai/spawnPoint.d.ts +3 -1
- package/dist/ai/spawnPoint.js +3 -1
- package/dist/ai/targetAcquisition.d.ts +84 -0
- package/dist/ai/targetAcquisition.js +92 -0
- package/dist/anim/easing.d.ts +19 -0
- package/dist/anim/easing.js +19 -0
- package/dist/anim/oscillator.d.ts +12 -0
- package/dist/anim/oscillator.js +25 -0
- package/dist/area/areaEffectField.d.ts +127 -0
- package/dist/area/areaEffectField.js +175 -0
- package/dist/area/stackPolicy.d.ts +47 -0
- package/dist/area/stackPolicy.js +99 -0
- package/dist/authoring.d.ts +2 -1
- package/dist/authoring.js +2 -1
- package/dist/board/laneBoard.d.ts +13 -0
- package/dist/board/laneBoard.js +13 -0
- package/dist/board/timelineBoard.d.ts +10 -0
- package/dist/board/timelineBoard.js +10 -0
- package/dist/combat/abilityKit.d.ts +18 -0
- package/dist/combat/abilityKit.js +24 -9
- package/dist/combat/animationState.d.ts +5 -0
- package/dist/combat/animationState.js +5 -0
- package/dist/combat/breakMeters.d.ts +10 -0
- package/dist/combat/breakMeters.js +10 -0
- package/dist/combat/castRunner.d.ts +5 -0
- package/dist/combat/castRunner.js +5 -0
- package/dist/combat/comboPoints.d.ts +5 -0
- package/dist/combat/comboPoints.js +5 -0
- package/dist/combat/comboString.d.ts +5 -0
- package/dist/combat/comboString.js +5 -0
- package/dist/combat/damageInterceptors.d.ts +192 -0
- package/dist/combat/damageInterceptors.js +251 -0
- package/dist/combat/damageMatchup.d.ts +68 -0
- package/dist/combat/damageMatchup.js +42 -0
- package/dist/combat/damageResolution.d.ts +63 -0
- package/dist/combat/damageResolution.js +50 -0
- package/dist/combat/death.d.ts +7 -1
- package/dist/combat/death.js +5 -0
- package/dist/combat/deathReason.d.ts +14 -0
- package/dist/combat/deathReason.js +1 -0
- package/dist/combat/defensiveWindow.d.ts +5 -0
- package/dist/combat/defensiveWindow.js +5 -0
- package/dist/combat/dotField.d.ts +5 -1
- package/dist/combat/dotField.js +5 -1
- package/dist/combat/downed.d.ts +5 -0
- package/dist/combat/downed.js +5 -0
- package/dist/combat/effects.d.ts +5 -0
- package/dist/combat/effects.js +5 -0
- package/dist/combat/encounterSequence.d.ts +258 -0
- package/dist/combat/encounterSequence.js +426 -0
- package/dist/combat/hitReaction.d.ts +57 -1
- package/dist/combat/hitReaction.js +45 -5
- package/dist/combat/magazine.d.ts +54 -0
- package/dist/combat/magazine.js +96 -0
- package/dist/combat/projectiles.d.ts +5 -0
- package/dist/combat/projectiles.js +32 -14
- package/dist/combat/receivedDamage.d.ts +117 -0
- package/dist/combat/receivedDamage.js +92 -0
- package/dist/combat/regenShield.d.ts +5 -1
- package/dist/combat/regenShield.js +5 -1
- package/dist/combat/renderCues.d.ts +51 -0
- package/dist/combat/renderCues.js +44 -0
- package/dist/combat/resourcePool.d.ts +5 -0
- package/dist/combat/resourcePool.js +5 -0
- package/dist/combat/rewardAllocation.d.ts +121 -0
- package/dist/combat/rewardAllocation.js +251 -0
- package/dist/combat/shotOrigin.d.ts +18 -1
- package/dist/combat/shotOrigin.js +39 -0
- package/dist/combat/statusApplication.d.ts +96 -0
- package/dist/combat/statusApplication.js +81 -0
- package/dist/combat/telegraph.d.ts +11 -2
- package/dist/combat/telegraph.js +11 -2
- package/dist/combat/thresholdCrossings.d.ts +85 -0
- package/dist/combat/thresholdCrossings.js +116 -0
- package/dist/combat.d.ts +35 -0
- package/dist/combat.js +35 -0
- package/dist/commands/commandRegistry.d.ts +11 -0
- package/dist/commands/commandRegistry.js +9 -2
- package/dist/crafting/crop.d.ts +18 -0
- package/dist/crafting/crop.js +18 -0
- package/dist/crafting/production.d.ts +5 -0
- package/dist/crafting/production.js +5 -0
- package/dist/devtools/controls.d.ts +38 -0
- package/dist/devtools/controls.js +181 -0
- package/dist/devtools/devtools.d.ts +5 -197
- package/dist/devtools/devtools.js +38 -774
- package/dist/devtools/discover.d.ts +32 -0
- package/dist/devtools/discover.js +240 -0
- package/dist/devtools/fallbackSeams.d.ts +50 -0
- package/dist/devtools/fallbackSeams.js +111 -0
- package/dist/devtools/frame.d.ts +15 -0
- package/dist/devtools/frame.js +247 -0
- package/dist/devtools/logs.d.ts +15 -0
- package/dist/devtools/logs.js +86 -0
- package/dist/devtools/overrides.d.ts +16 -0
- package/dist/devtools/overrides.js +66 -0
- package/dist/devtools/rewriteTunables.d.ts +17 -0
- package/dist/devtools/rewriteTunables.js +276 -0
- package/dist/devtools/saveEndpoint.d.ts +46 -0
- package/dist/devtools/saveEndpoint.js +48 -0
- package/dist/devtools/transformTunables.d.ts +3 -0
- package/dist/devtools/transformTunables.js +3 -0
- package/dist/devtools/tunableSchema.d.ts +31 -0
- package/dist/devtools/tunableSchema.js +31 -0
- package/dist/devtools/types.d.ts +212 -0
- package/dist/devtools/types.js +1 -0
- package/dist/economy/auctionBook.d.ts +122 -0
- package/dist/economy/auctionBook.js +213 -0
- package/dist/economy/currency.d.ts +12 -1
- package/dist/economy/currency.js +12 -1
- package/dist/economy/listingBook.d.ts +91 -0
- package/dist/economy/listingBook.js +144 -0
- package/dist/economy/priceHistory.d.ts +44 -0
- package/dist/economy/priceHistory.js +89 -0
- package/dist/economy/resourceLedger.d.ts +222 -0
- package/dist/economy/resourceLedger.js +353 -0
- package/dist/economy/sharedWallet.d.ts +14 -0
- package/dist/economy/sharedWallet.js +14 -0
- package/dist/economy/techTree.d.ts +12 -0
- package/dist/economy/techTree.js +12 -0
- package/dist/economy/unlockPoints.d.ts +92 -0
- package/dist/economy/unlockPoints.js +103 -0
- package/dist/economy/wallet.d.ts +26 -2
- package/dist/economy/wallet.js +35 -6
- package/dist/editor/commandApply.d.ts +5 -0
- package/dist/editor/commandApply.js +755 -0
- package/dist/editor/commands.d.ts +235 -7
- package/dist/editor/commands.js +82 -124
- package/dist/editor/directives.d.ts +94 -0
- package/dist/editor/directives.js +206 -0
- package/dist/editor/document.d.ts +194 -13
- package/dist/editor/document.js +1166 -19
- package/dist/editor/entityCatalog.d.ts +42 -0
- package/dist/editor/entityCatalog.js +101 -0
- package/dist/editor/environment.d.ts +74 -0
- package/dist/editor/environment.js +169 -0
- package/dist/editor/grid.d.ts +229 -0
- package/dist/editor/grid.js +366 -0
- package/dist/editor/gridAdapters.d.ts +80 -0
- package/dist/editor/gridAdapters.js +134 -0
- package/dist/editor/index.d.ts +98 -6
- package/dist/editor/index.js +13 -2
- package/dist/editor/liveSync.d.ts +127 -0
- package/dist/editor/liveSync.js +249 -0
- package/dist/editor/minimap.d.ts +31 -0
- package/dist/editor/minimap.js +73 -0
- package/dist/editor/runtimeInspector.d.ts +88 -0
- package/dist/editor/runtimeInspector.js +239 -0
- package/dist/editor/streamer.d.ts +66 -0
- package/dist/editor/streamer.js +68 -0
- package/dist/editor/types.d.ts +250 -1
- package/dist/editor/world.d.ts +136 -0
- package/dist/editor/world.js +303 -0
- package/dist/faction/reputation.d.ts +5 -0
- package/dist/faction/reputation.js +5 -0
- package/dist/format/distance.d.ts +17 -0
- package/dist/format/distance.js +18 -0
- package/dist/format/duration.d.ts +27 -0
- package/dist/format/duration.js +45 -0
- package/dist/format/speed.d.ts +17 -0
- package/dist/format/speed.js +25 -0
- package/dist/game/breeding.d.ts +161 -0
- package/dist/game/breeding.js +181 -0
- package/dist/game/cameraConfig.d.ts +451 -0
- package/dist/game/cameraConfig.js +1 -0
- package/dist/game/connectedPlayers.d.ts +6 -4
- package/dist/game/connectedPlayers.js +2 -2
- package/dist/game/cosmetics.d.ts +9 -0
- package/dist/game/cosmetics.js +16 -0
- package/dist/game/defineGame.d.ts +110 -5
- package/dist/game/defineGame.js +49 -4
- package/dist/game/defineSystem.d.ts +90 -0
- package/dist/game/defineSystem.js +47 -0
- package/dist/game/dialogue.d.ts +33 -0
- package/dist/game/dialogue.js +21 -0
- package/dist/game/events.d.ts +63 -13
- package/dist/game/events.js +5 -0
- package/dist/game/feed.d.ts +33 -0
- package/dist/game/feed.js +35 -2
- package/dist/game/gamePhase.d.ts +11 -0
- package/dist/game/gamePhase.js +16 -0
- package/dist/game/leaderboard.d.ts +5 -0
- package/dist/game/leaderboard.js +5 -0
- package/dist/game/loadout.d.ts +5 -0
- package/dist/game/loadout.js +5 -0
- package/dist/game/lootFilter.d.ts +2 -0
- package/dist/game/lootFilter.js +2 -0
- package/dist/game/lootPipeline.d.ts +164 -0
- package/dist/game/lootPipeline.js +216 -0
- package/dist/game/lootTable.d.ts +19 -2
- package/dist/game/lootTable.js +15 -5
- package/dist/game/objectives.d.ts +43 -0
- package/dist/game/objectives.js +36 -0
- package/dist/game/paramLayers.d.ts +148 -0
- package/dist/game/paramLayers.js +185 -0
- package/dist/game/ping.d.ts +5 -0
- package/dist/game/ping.js +5 -0
- package/dist/game/playableGame.d.ts +116 -432
- package/dist/game/playableGame.js +1 -1
- package/dist/game/progression.d.ts +35 -0
- package/dist/game/progression.js +19 -0
- package/dist/game/quest.d.ts +8 -0
- package/dist/game/quest.js +30 -3
- package/dist/game/race.d.ts +141 -0
- package/dist/game/race.js +169 -0
- package/dist/game/recordBook.d.ts +3 -1
- package/dist/game/recordBook.js +4 -1
- package/dist/game/ruleSelection.d.ts +75 -0
- package/dist/game/ruleSelection.js +127 -0
- package/dist/game/runDraft.d.ts +5 -0
- package/dist/game/runDraft.js +5 -0
- package/dist/game/saveStore.d.ts +111 -0
- package/dist/game/saveStore.js +312 -0
- package/dist/game/snapshotHistory.d.ts +67 -0
- package/dist/game/snapshotHistory.js +95 -0
- package/dist/game/social.d.ts +38 -1
- package/dist/game/social.js +71 -0
- package/dist/game/spawnPoints.d.ts +5 -0
- package/dist/game/spawnPoints.js +5 -0
- package/dist/game/systemRuntime.d.ts +50 -0
- package/dist/game/systemRuntime.js +157 -0
- package/dist/game/systemSchedule.d.ts +72 -0
- package/dist/game/systemSchedule.js +242 -0
- package/dist/game/toasts.d.ts +43 -0
- package/dist/game/toasts.js +44 -0
- package/dist/game/trade.d.ts +10 -0
- package/dist/game/trade.js +10 -0
- package/dist/game/tribe.d.ts +184 -0
- package/dist/game/tribe.js +432 -0
- package/dist/game/unlocks.d.ts +8 -0
- package/dist/game/unlocks.js +16 -0
- package/dist/game/vfxInstance.d.ts +138 -0
- package/dist/game/vfxInstance.js +96 -0
- package/dist/game/worldItem.d.ts +17 -4
- package/dist/game/worldItem.js +17 -4
- package/dist/gameplay.d.ts +93 -0
- package/dist/gameplay.js +93 -0
- package/dist/index.d.ts +5 -14
- package/dist/index.js +5 -14
- package/dist/input/actionBindings.d.ts +23 -6
- package/dist/input/actionBindings.js +23 -6
- package/dist/input/axisInput.d.ts +7 -2
- package/dist/input/axisInput.js +7 -2
- package/dist/input/controlGroups.d.ts +67 -0
- package/dist/input/controlGroups.js +41 -0
- package/dist/input/touchScheme.d.ts +82 -6
- package/dist/input/touchScheme.js +123 -10
- package/dist/interaction/lockpick.d.ts +61 -0
- package/dist/interaction/lockpick.js +168 -0
- package/dist/interaction/proximityPrompt.d.ts +2 -0
- package/dist/interaction/proximityPrompt.js +2 -0
- package/dist/interaction/qte.d.ts +5 -0
- package/dist/interaction/qte.js +5 -0
- package/dist/interaction/skillCheck.d.ts +5 -0
- package/dist/interaction/skillCheck.js +5 -0
- package/dist/inventory/encumbrance.d.ts +69 -0
- package/dist/inventory/encumbrance.js +68 -0
- package/dist/inventory/inventoryModel.d.ts +12 -0
- package/dist/inventory/inventoryModel.js +12 -0
- package/dist/inventory/shapedGrid.d.ts +16 -0
- package/dist/inventory/shapedGrid.js +16 -0
- package/dist/inventory/slotModel.d.ts +10 -0
- package/dist/inventory/slotModel.js +10 -0
- package/dist/item/durability.d.ts +5 -0
- package/dist/item/durability.js +6 -3
- package/dist/item/itemIdentity.d.ts +171 -0
- package/dist/item/itemIdentity.js +138 -0
- package/dist/item/itemInstanceRegistry.d.ts +32 -0
- package/dist/item/itemInstanceRegistry.js +34 -0
- package/dist/item/itemgen.d.ts +163 -0
- package/dist/item/itemgen.js +151 -0
- package/dist/item/modularItem.d.ts +5 -0
- package/dist/item/modularItem.js +5 -0
- package/dist/item/use.d.ts +5 -0
- package/dist/item/use.js +5 -0
- package/dist/item/useBehavior.d.ts +142 -0
- package/dist/item/useBehavior.js +105 -0
- package/dist/item/weapon.d.ts +5 -0
- package/dist/item/weapon.js +5 -0
- package/dist/math/scalar.d.ts +25 -0
- package/dist/math/scalar.js +47 -0
- package/dist/meta/changelog.d.ts +4 -1
- package/dist/meta/changelog.js +39 -2
- package/dist/movement/avoidance.d.ts +45 -0
- package/dist/movement/avoidance.js +123 -0
- package/dist/movement/cameraRig.d.ts +8 -0
- package/dist/movement/cameraRig.js +8 -0
- package/dist/movement/dash.d.ts +11 -0
- package/dist/movement/dash.js +11 -0
- package/dist/movement/formation.d.ts +135 -0
- package/dist/movement/formation.js +194 -0
- package/dist/movement/glideModel.d.ts +5 -0
- package/dist/movement/glideModel.js +5 -0
- package/dist/movement/grappleSwing.d.ts +5 -0
- package/dist/movement/grappleSwing.js +5 -0
- package/dist/movement/leaderTrail.d.ts +5 -0
- package/dist/movement/leaderTrail.js +5 -0
- package/dist/movement/movementModel.d.ts +50 -9
- package/dist/movement/movementModel.js +75 -29
- package/dist/movement/playerMovement.js +167 -12
- package/dist/movement/poseState.d.ts +13 -0
- package/dist/movement/poseState.js +16 -0
- package/dist/movement/steering.d.ts +8 -0
- package/dist/movement/steering.js +18 -0
- package/dist/multiplayer/combatSnapshot.d.ts +3 -0
- package/dist/multiplayer/combatSnapshot.js +16 -8
- package/dist/multiplayer/lagCompensation.d.ts +5 -0
- package/dist/multiplayer/lagCompensation.js +5 -0
- package/dist/multiplayer/presenceModel.d.ts +11 -1
- package/dist/multiplayer/presenceModel.js +17 -1
- package/dist/multiplayer/simultaneousCommit.d.ts +3 -0
- package/dist/multiplayer/simultaneousCommit.js +3 -0
- package/dist/multiplayer.d.ts +11 -0
- package/dist/multiplayer.js +11 -0
- package/dist/nav/pathFollow.d.ts +57 -0
- package/dist/nav/pathFollow.js +109 -0
- package/dist/orders/orderKinds.d.ts +156 -0
- package/dist/orders/orderKinds.js +197 -0
- package/dist/orders/orderQueue.d.ts +208 -0
- package/dist/orders/orderQueue.js +211 -0
- package/dist/physics/drivableVehicle.d.ts +31 -0
- package/dist/physics/drivableVehicle.js +16 -0
- package/dist/physics/flightDynamics.d.ts +82 -0
- package/dist/physics/flightDynamics.js +165 -0
- package/dist/physics/gravityField.d.ts +25 -0
- package/dist/physics/gravityField.js +41 -0
- package/dist/physics/kinematicVehicle.d.ts +108 -1
- package/dist/physics/kinematicVehicle.js +212 -15
- package/dist/physics/physicsWorld.d.ts +50 -12
- package/dist/physics/physicsWorld.js +120 -122
- package/dist/physics/radialImpulse.d.ts +25 -0
- package/dist/physics/radialImpulse.js +27 -0
- package/dist/physics/vehicleObstacles.d.ts +44 -0
- package/dist/physics/vehicleObstacles.js +115 -0
- package/dist/procedural.d.ts +3 -0
- package/dist/procedural.js +3 -0
- package/dist/progression/statGraph.d.ts +116 -0
- package/dist/progression/statGraph.js +318 -0
- package/dist/puzzle/cellGrid.d.ts +9 -0
- package/dist/puzzle/cellGrid.js +9 -0
- package/dist/puzzle/fallingPiece.d.ts +9 -0
- package/dist/puzzle/fallingPiece.js +9 -0
- package/dist/puzzle/nonogram.d.ts +39 -0
- package/dist/puzzle/nonogram.js +136 -0
- package/dist/random/nameGen.d.ts +5 -0
- package/dist/random/nameGen.js +5 -0
- package/dist/random/pick.d.ts +8 -0
- package/dist/random/pick.js +31 -0
- package/dist/random/rng.d.ts +26 -1
- package/dist/random/rng.js +32 -9
- package/dist/random/seedLink.d.ts +4 -0
- package/dist/random/seedLink.js +4 -0
- package/dist/relation/keyedValues.d.ts +54 -0
- package/dist/relation/keyedValues.js +115 -0
- package/dist/relation/thresholds.d.ts +62 -0
- package/dist/relation/thresholds.js +62 -0
- package/dist/render/color.d.ts +12 -0
- package/dist/render/color.js +26 -0
- package/dist/render/lookPreset.d.ts +41 -0
- package/dist/render/lookPreset.js +29 -0
- package/dist/render/postProcessing.d.ts +20 -0
- package/dist/render/postProcessing.js +21 -1
- package/dist/rules/predicate.d.ts +53 -0
- package/dist/rules/predicate.js +64 -0
- package/dist/rules/ruleEffects.d.ts +38 -0
- package/dist/rules/ruleEffects.js +37 -0
- package/dist/rules/triggeredRules.d.ts +160 -0
- package/dist/rules/triggeredRules.js +241 -0
- package/dist/runtime/adapter.d.ts +55 -3
- package/dist/runtime/adapter.js +57 -1
- package/dist/runtime/cameraDirector.d.ts +1 -0
- package/dist/runtime/cameraDirector.js +1 -0
- package/dist/runtime/commandRunner.d.ts +1 -0
- package/dist/runtime/commandRunner.js +1 -0
- package/dist/runtime/context/combat.d.ts +51 -0
- package/dist/runtime/context/combat.js +130 -0
- package/dist/runtime/context/combatFx.d.ts +23 -0
- package/dist/runtime/context/combatFx.js +161 -0
- package/dist/runtime/context/deathLoot.d.ts +30 -0
- package/dist/runtime/context/deathLoot.js +39 -0
- package/dist/runtime/context/player.d.ts +48 -0
- package/dist/runtime/context/player.js +125 -0
- package/dist/runtime/context/registries.d.ts +13 -0
- package/dist/runtime/context/registries.js +84 -0
- package/dist/runtime/context/scene.d.ts +59 -0
- package/dist/runtime/context/scene.js +291 -0
- package/dist/runtime/context/snapshotCodecs.d.ts +12 -0
- package/dist/runtime/context/snapshotCodecs.js +26 -0
- package/dist/runtime/context/worldItems.d.ts +21 -0
- package/dist/runtime/context/worldItems.js +37 -0
- package/dist/runtime/descriptors/baseline.d.ts +48 -0
- package/dist/runtime/descriptors/baseline.js +157 -0
- package/dist/runtime/descriptors/features.d.ts +79 -0
- package/dist/runtime/descriptors/features.js +299 -0
- package/dist/runtime/gameContext.d.ts +2 -327
- package/dist/runtime/gameContext.js +273 -778
- package/dist/runtime/gameContextTypes.d.ts +467 -0
- package/dist/runtime/gameContextTypes.js +1 -0
- package/dist/runtime/gameRuntime.d.ts +1 -0
- package/dist/runtime/gameRuntime.js +1 -0
- package/dist/runtime/headlessRunner.d.ts +62 -0
- package/dist/runtime/headlessRunner.js +45 -0
- package/dist/runtime/hostPersistence.d.ts +12 -0
- package/dist/runtime/hostPersistence.js +12 -0
- package/dist/runtime/hostPolicy.d.ts +51 -0
- package/dist/runtime/hostPolicy.js +68 -0
- package/dist/runtime/hostedGameRunner.d.ts +11 -4
- package/dist/runtime/hostedGameRunner.js +27 -3
- package/dist/runtime/hostedWorldSession.d.ts +15 -5
- package/dist/runtime/hostedWorldSession.js +12 -4
- package/dist/runtime/inputSnapshot.d.ts +8 -3
- package/dist/runtime/inputSnapshot.js +6 -2
- package/dist/runtime/motionIntents.d.ts +11 -2
- package/dist/runtime/motionIntents.js +16 -2
- package/dist/runtime/perContext.d.ts +15 -0
- package/dist/runtime/perContext.js +21 -0
- package/dist/runtime/runtimeSave.d.ts +79 -0
- package/dist/runtime/runtimeSave.js +105 -0
- package/dist/runtime/save.d.ts +4 -0
- package/dist/runtime/save.js +4 -0
- package/dist/runtime/snapshot.d.ts +7 -0
- package/dist/runtime/snapshot.js +7 -0
- package/dist/runtime/visibility.d.ts +2 -1
- package/dist/runtime/visibility.js +2 -1
- package/dist/runtime/worldChannel.d.ts +7 -3
- package/dist/runtime/worldChannel.js +51 -6
- package/dist/runtime/worldMirror.d.ts +14 -2
- package/dist/runtime/worldMirror.js +15 -2
- package/dist/runtime/worldProjection.d.ts +47 -0
- package/dist/runtime/worldProjection.js +52 -0
- package/dist/runtime/worldReplication.d.ts +30 -7
- package/dist/runtime/worldReplication.js +41 -9
- package/dist/runtime/worldSnapshot.d.ts +42 -3
- package/dist/runtime/worldSnapshot.js +34 -7
- package/dist/scene/assetCatalog.d.ts +26 -0
- package/dist/scene/assetCatalog.js +4 -0
- package/dist/scene/assetDiagnostics.d.ts +69 -0
- package/dist/scene/assetDiagnostics.js +110 -0
- package/dist/scene/assetGenerator.d.ts +65 -0
- package/dist/scene/assetGenerator.js +64 -0
- package/dist/scene/assetSpace.d.ts +137 -0
- package/dist/scene/assetSpace.js +257 -0
- package/dist/scene/authoredTriggers.d.ts +219 -0
- package/dist/scene/authoredTriggers.js +454 -0
- package/dist/scene/behaviorRuntime.d.ts +75 -0
- package/dist/scene/behaviorRuntime.js +217 -0
- package/dist/scene/behaviors.d.ts +14 -2
- package/dist/scene/behaviors.js +7 -2
- package/dist/scene/bodyBind.d.ts +60 -0
- package/dist/scene/bodyBind.js +51 -0
- package/dist/scene/builtinSceneKinds.d.ts +5 -0
- package/dist/scene/builtinSceneKinds.js +67 -0
- package/dist/scene/colliders.d.ts +71 -1
- package/dist/scene/colliders.js +145 -1
- package/dist/scene/collisionMesh.d.ts +94 -0
- package/dist/scene/collisionMesh.js +699 -0
- package/dist/scene/companion.d.ts +147 -0
- package/dist/scene/companion.js +193 -0
- package/dist/scene/entityStats.d.ts +18 -11
- package/dist/scene/entityStats.js +21 -16
- package/dist/scene/entityStore.d.ts +12 -1
- package/dist/scene/entityStore.js +15 -0
- package/dist/scene/facing.d.ts +18 -0
- package/dist/scene/facing.js +26 -0
- package/dist/scene/modelSockets.d.ts +33 -0
- package/dist/scene/modelSockets.js +29 -0
- package/dist/scene/objectQuery.d.ts +2 -0
- package/dist/scene/objectQuery.js +2 -0
- package/dist/scene/objectStore.d.ts +4 -0
- package/dist/scene/objectStore.js +6 -0
- package/dist/scene/possession.d.ts +8 -0
- package/dist/scene/possession.js +14 -0
- package/dist/scene/roster.d.ts +3 -0
- package/dist/scene/roster.js +12 -0
- package/dist/scene/sceneKinds.d.ts +256 -0
- package/dist/scene/sceneKinds.js +218 -0
- package/dist/scene/sceneOwnership.d.ts +169 -0
- package/dist/scene/sceneOwnership.js +179 -0
- package/dist/scene/sceneRaycast.js +15 -0
- package/dist/scene/selectionBookmarks.d.ts +93 -0
- package/dist/scene/selectionBookmarks.js +122 -0
- package/dist/scene/vehicleSeat.d.ts +68 -0
- package/dist/scene/vehicleSeat.js +59 -0
- package/dist/sensor/concealment.d.ts +3 -0
- package/dist/sensor/concealment.js +3 -0
- package/dist/sensor/freezeMonitor.d.ts +1 -0
- package/dist/sensor/freezeMonitor.js +1 -0
- package/dist/sensor/frustumSensor.d.ts +7 -3
- package/dist/sensor/frustumSensor.js +7 -3
- package/dist/sensor/hiddenStateProbe.d.ts +5 -2
- package/dist/sensor/hiddenStateProbe.js +5 -2
- package/dist/sensor/recordingBuffer.d.ts +2 -1
- package/dist/sensor/recordingBuffer.js +2 -1
- package/dist/sensor/replayLoop.d.ts +6 -2
- package/dist/sensor/replayLoop.js +6 -2
- package/dist/sensor/revealQuery.d.ts +2 -1
- package/dist/sensor/revealQuery.js +2 -1
- package/dist/sensor/visionCone.d.ts +10 -3
- package/dist/sensor/visionCone.js +10 -3
- package/dist/session/contestedChannel.d.ts +1 -0
- package/dist/session/contestedChannel.js +1 -0
- package/dist/session/extraction.d.ts +1 -0
- package/dist/session/extraction.js +1 -0
- package/dist/session/roles.d.ts +6 -0
- package/dist/session/roles.js +6 -0
- package/dist/session/roundState.d.ts +8 -0
- package/dist/session/roundState.js +2 -0
- package/dist/settings/settingsModel.d.ts +1 -0
- package/dist/settings/settingsModel.js +1 -0
- package/dist/stats/accumulatorMeter.d.ts +6 -0
- package/dist/stats/accumulatorMeter.js +6 -0
- package/dist/stats/eventMeter.d.ts +5 -0
- package/dist/stats/eventMeter.js +5 -0
- package/dist/stats/rollCheck.d.ts +5 -0
- package/dist/stats/rollCheck.js +5 -0
- package/dist/stats/spawnLevelStats.d.ts +110 -0
- package/dist/stats/spawnLevelStats.js +140 -0
- package/dist/stats/statModifiers.d.ts +5 -0
- package/dist/stats/statModifiers.js +5 -0
- package/dist/stats/statPool.d.ts +70 -0
- package/dist/stats/statPool.js +59 -0
- package/dist/store/changeSignal.d.ts +3 -0
- package/dist/store/changeSignal.js +2 -0
- package/dist/store/defineKeyedStore.d.ts +38 -0
- package/dist/store/defineKeyedStore.js +42 -0
- package/dist/store/defineStore.d.ts +33 -0
- package/dist/store/defineStore.js +35 -0
- package/dist/store/observableKeyedStore.d.ts +7 -0
- package/dist/store/observableKeyedStore.js +35 -2
- package/dist/survival/decayMeter.d.ts +55 -0
- package/dist/survival/decayMeter.js +130 -57
- package/dist/survival/moodle.d.ts +2 -0
- package/dist/survival/regionHealth.d.ts +6 -0
- package/dist/survival/regionHealth.js +6 -3
- package/dist/tactics/fallingGrid.d.ts +4 -2
- package/dist/tactics/fallingGrid.js +4 -2
- package/dist/tactics/predictiveQuery.d.ts +3 -0
- package/dist/tactics/predictiveQuery.js +3 -0
- package/dist/tactics/snapshot.d.ts +2 -0
- package/dist/tactics/snapshot.js +2 -0
- package/dist/tactics/surface.d.ts +1 -0
- package/dist/tactics/surface.js +1 -0
- package/dist/tactics/tacticalGrid.d.ts +1 -0
- package/dist/tactics/tacticalGrid.js +1 -0
- package/dist/time/beatClock.d.ts +14 -4
- package/dist/time/beatClock.js +14 -4
- package/dist/time/calendarClock.d.ts +3 -0
- package/dist/time/calendarClock.js +3 -0
- package/dist/time/idleProgress.d.ts +4 -0
- package/dist/time/idleProgress.js +4 -0
- package/dist/time/simClock.d.ts +2 -0
- package/dist/time/simClock.js +20 -5
- package/dist/ui/actionModel.d.ts +110 -0
- package/dist/ui/actionModel.js +159 -0
- package/dist/ui/gameLayout.d.ts +30 -11
- package/dist/ui/gameLayout.js +30 -11
- package/dist/ui/hudDocument.d.ts +114 -0
- package/dist/ui/hudDocument.js +220 -0
- package/dist/ui/hudLayout.d.ts +38 -1
- package/dist/ui/hudLayout.js +220 -17
- package/dist/ui/selectionModel.d.ts +92 -0
- package/dist/ui/selectionModel.js +88 -0
- package/dist/ui/tooltipModel.d.ts +63 -0
- package/dist/ui/tooltipModel.js +82 -0
- package/dist/ui.d.ts +15 -0
- package/dist/ui.js +15 -0
- package/dist/visibility/bounds.d.ts +8 -1
- package/dist/visibility/bounds.js +8 -1
- package/dist/visibility/frustum.d.ts +12 -3
- package/dist/visibility/frustum.js +12 -3
- package/dist/work/jobQueue.d.ts +201 -0
- package/dist/work/jobQueue.js +253 -0
- package/dist/work/unitTraining.d.ts +58 -0
- package/dist/work/unitTraining.js +52 -0
- package/dist/world/authoredEntities.d.ts +29 -0
- package/dist/world/authoredEntities.js +29 -0
- package/dist/world/authoredObjects.d.ts +72 -0
- package/dist/world/authoredObjects.js +81 -0
- package/dist/world/authoredSpawn.d.ts +39 -0
- package/dist/world/authoredSpawn.js +37 -0
- package/dist/world/buildSockets.d.ts +152 -0
- package/dist/world/buildSockets.js +188 -0
- package/dist/world/buildingGenerator.d.ts +18 -0
- package/dist/world/buildingGenerator.js +62 -0
- package/dist/world/buildings.d.ts +5 -0
- package/dist/world/buildings.js +5 -0
- package/dist/world/catenary.d.ts +22 -0
- package/dist/world/catenary.js +69 -0
- package/dist/world/cityBlocks.d.ts +152 -0
- package/dist/world/cityBlocks.js +670 -0
- package/dist/world/cityContent.d.ts +77 -0
- package/dist/world/cityContent.js +261 -0
- package/dist/world/cityGeometry.d.ts +114 -0
- package/dist/world/cityGeometry.js +573 -0
- package/dist/world/cityKind.d.ts +314 -0
- package/dist/world/cityKind.js +1578 -0
- package/dist/world/features.d.ts +133 -10
- package/dist/world/features.js +66 -6
- package/dist/world/footprintGrid.d.ts +59 -0
- package/dist/world/footprintGrid.js +141 -0
- package/dist/world/geometry.d.ts +64 -0
- package/dist/world/geometry.js +94 -0
- package/dist/world/grassKind.d.ts +51 -0
- package/dist/world/grassKind.js +101 -0
- package/dist/world/markers.d.ts +50 -4
- package/dist/world/markers.js +49 -0
- package/dist/world/massing.js +1 -1
- package/dist/world/minimapBake.d.ts +78 -0
- package/dist/world/minimapBake.js +208 -0
- package/dist/world/minimapTrack.d.ts +17 -0
- package/dist/world/minimapTrack.js +22 -0
- package/dist/world/pathInstances.d.ts +27 -0
- package/dist/world/pathInstances.js +27 -0
- package/dist/world/pathNetwork.d.ts +159 -0
- package/dist/world/pathNetwork.js +684 -0
- package/dist/world/pathTerrain.d.ts +80 -0
- package/dist/world/pathTerrain.js +142 -0
- package/dist/world/place.d.ts +166 -0
- package/dist/world/place.js +96 -0
- package/dist/world/placeAsset.d.ts +81 -0
- package/dist/world/placeAsset.js +79 -0
- package/dist/world/placement.d.ts +4 -0
- package/dist/world/placement.js +4 -0
- package/dist/world/placementController.d.ts +6 -0
- package/dist/world/placementController.js +6 -0
- package/dist/world/poleLineKind.d.ts +40 -0
- package/dist/world/poleLineKind.js +97 -0
- package/dist/world/polyline.d.ts +34 -0
- package/dist/world/polyline.js +88 -0
- package/dist/world/resourceNode.d.ts +109 -0
- package/dist/world/resourceNode.js +140 -0
- package/dist/world/roads.d.ts +8 -0
- package/dist/world/roads.js +38 -0
- package/dist/world/scatter.js +2 -20
- package/dist/world/scatterRegion.d.ts +164 -0
- package/dist/world/scatterRegion.js +409 -0
- package/dist/world/sceneShapes.d.ts +43 -0
- package/dist/world/sceneShapes.js +1 -0
- package/dist/world/segment.d.ts +27 -0
- package/dist/world/segment.js +43 -0
- package/dist/world/soilKind.d.ts +48 -0
- package/dist/world/soilKind.js +92 -0
- package/dist/world/spatialSample.d.ts +241 -0
- package/dist/world/spatialSample.js +465 -0
- package/dist/world/streets.d.ts +29 -0
- package/dist/world/streets.js +55 -0
- package/dist/world/terraform.d.ts +213 -1
- package/dist/world/terraform.js +627 -22
- package/dist/world/terrain.d.ts +164 -20
- package/dist/world/terrain.js +325 -41
- package/dist/world/terrainGuides.d.ts +182 -0
- package/dist/world/terrainGuides.js +343 -0
- package/dist/world/vec2.d.ts +81 -0
- package/dist/world/vec2.js +128 -0
- package/dist/world/vec3.d.ts +49 -0
- package/dist/world/vec3.js +76 -0
- package/dist/world/vegetation.d.ts +71 -0
- package/dist/world/vegetation.js +151 -0
- package/dist/world/visibilityField.d.ts +154 -0
- package/dist/world/visibilityField.js +271 -0
- package/dist/world/volumetricClouds.d.ts +52 -0
- package/dist/world/volumetricClouds.js +43 -0
- package/dist/world/walls.d.ts +9 -0
- package/dist/world/walls.js +9 -0
- package/dist/world/waterKind.d.ts +55 -0
- package/dist/world/waterKind.js +99 -0
- package/dist/world.d.ts +141 -0
- package/dist/world.js +141 -0
- package/package.json +32 -8
- package/skills/game-design/SKILL.md +28 -0
- package/skills/game-design/agents/openai.yaml +4 -0
- package/skills/game-design/references/application-playbook.md +170 -0
- package/skills/game-design/references/field-guide.md +288 -0
- package/skills/jgengine/SKILL.md +54 -0
- package/skills/jgengine/api.md +527 -0
- package/skills/jgengine/capabilities.md +131 -0
- package/skills/jgengine/recipes/minimal-game.md +88 -0
- package/skills/jgengine-combat/SKILL.md +38 -0
- package/skills/jgengine-combat/api.md +585 -0
- package/skills/jgengine-combat/capabilities.md +213 -0
- package/skills/jgengine-combat/recipes/portable-stat-pools.md +122 -0
- package/skills/jgengine-combat/reference.md +108 -0
- package/skills/jgengine-gameplay/SKILL.md +39 -0
- package/skills/jgengine-gameplay/api.md +1920 -0
- package/skills/jgengine-gameplay/capabilities.md +454 -0
- package/skills/jgengine-gameplay/reference-systems.md +56 -0
- package/skills/jgengine-world/SKILL.md +51 -0
- package/skills/jgengine-world/api.md +3056 -0
- package/skills/jgengine-world/capabilities.md +476 -0
- package/skills/jgengine-world/recipes/commanding-entities.md +128 -0
- package/skills/jgengine-world/reference.md +261 -0
- package/dist/cartridge/runtime.d.ts +0 -15
- package/dist/cartridge/runtime.js +0 -556
- package/dist/cartridge/spec.d.ts +0 -188
- package/dist/cartridge/spec.js +0 -19
- package/dist/cartridge/validate.d.ts +0 -2
- package/dist/cartridge/validate.js +0 -78
- package/dist/store/engineStore.d.ts +0 -22
- package/dist/store/engineStore.js +0 -50
- package/dist/store/features.d.ts +0 -10
- package/dist/store/features.js +0 -23
- package/llms.txt +0 -5389
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import type { AudioBusDef, SoundDef } from "../audio/audioFalloff.js";
|
|
2
2
|
import type { MusicTheme } from "../audio/music.js";
|
|
3
|
+
import type { EditorCatalogDefinition, EditorDocument } from "../editor/types.js";
|
|
3
4
|
import type { PostProcessingConfig } from "../render/postProcessing.js";
|
|
5
|
+
import type { LookPreset } from "../render/lookPreset.js";
|
|
4
6
|
import type { TouchControlsConfig } from "../input/touchScheme.js";
|
|
5
7
|
import type { GameSettingsConfig } from "../settings/settingsModel.js";
|
|
6
8
|
import type { GameOrientation } from "../ui/orientation.js";
|
|
@@ -8,11 +10,15 @@ import type { HudPlatform, HudViewportConfig } from "../ui/hudScale.js";
|
|
|
8
10
|
import type { PositionedPrompt } from "../interaction/proximityPrompt.js";
|
|
9
11
|
import type { CatalogEntityRole, GameContext, GameContextContent } from "../runtime/gameContext.js";
|
|
10
12
|
import type { ModelDims } from "../scene/assetCatalog.js";
|
|
13
|
+
import type { CollisionMeshData } from "../scene/collisionMesh.js";
|
|
11
14
|
import type { SkyEnvironmentConfig } from "../world/features.js";
|
|
12
15
|
import type { VisibilityConfig } from "../visibility/config.js";
|
|
13
16
|
import type { GameDefinition, GameLoop } from "./defineGame.js";
|
|
17
|
+
import type { GameCameraConfig } from "./cameraConfig.js";
|
|
14
18
|
import type { LootFilterRule } from "./lootFilter.js";
|
|
15
19
|
import type { RarityStyle } from "./worldItem.js";
|
|
20
|
+
export type { CameraFollowState, CameraKeyframe, CameraProjection, CameraRigKind, CameraShakeConfig, ChaseCameraConfig, ChaseView, CinematicCameraConfig, FirstPersonCameraConfig, GameCameraConfig, InspectionCameraConfig, InspectionZoomAnchor, LockOnCameraConfig, ObserverCameraConfig, PlayerFovConfig, RtsCameraConfig, ShoulderCameraConfig, SideScrollCameraConfig, TopDownCameraConfig, TurntableCameraConfig, } from "./cameraConfig.js";
|
|
21
|
+
export { CAMERA_FRUSTUM_DEFAULTS } from "./cameraConfig.js";
|
|
16
22
|
export interface PointerConfig {
|
|
17
23
|
/**
|
|
18
24
|
* Left-click on open ground runs this command with `{ point, entity, object }`
|
|
@@ -36,434 +42,9 @@ export interface PointerConfig {
|
|
|
36
42
|
/** Right-click runs this command with `{ point, entity, object, aim }` when neither `orderCommand` nor `contextMenu` claims the click (#164.4). */
|
|
37
43
|
secondaryCommand?: string;
|
|
38
44
|
}
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
x: number;
|
|
43
|
-
y: number;
|
|
44
|
-
z: number;
|
|
45
|
-
};
|
|
46
|
-
camera: {
|
|
47
|
-
x: number;
|
|
48
|
-
y: number;
|
|
49
|
-
z: number;
|
|
50
|
-
};
|
|
51
|
-
distance: number;
|
|
52
|
-
}
|
|
53
|
-
export interface FirstPersonCameraConfig {
|
|
54
|
-
/** Camera height above the followed entity's origin. Default 1.6. */
|
|
55
|
-
eyeHeight?: number;
|
|
56
|
-
/** Mouse-look radians per pixel of pointer movement. Default 0.0025. */
|
|
57
|
-
sensitivity?: number;
|
|
58
|
-
/** Clamp on look pitch in radians (± from horizon). Default 1.45. */
|
|
59
|
-
maxPitch?: number;
|
|
60
|
-
/** Show the centered crosshair overlay. Default true. */
|
|
61
|
-
reticle?: boolean;
|
|
62
|
-
/** Render a simple first-person weapon in view. Default true. */
|
|
63
|
-
viewmodel?: boolean;
|
|
64
|
-
}
|
|
65
|
-
/**
|
|
66
|
-
* Which camera rig the shell mounts. Every rig accepts `followEntityId: null`
|
|
67
|
-
* (avatar-less games — city-builders, card games, auto-battlers — still get a
|
|
68
|
-
* camera). Rigs are tuned through their config block below, never by writing
|
|
69
|
-
* camera positions from `onTick`.
|
|
70
|
-
* - `orbit` — third-person chase (the historical default; `perspective: "third"`).
|
|
71
|
-
* - `first` — pointer-lock mouse-look (`perspective: "first"`).
|
|
72
|
-
* - `topDown` — fixed height/pitch/yaw with decoupled follow (ARPG iso, top-down).
|
|
73
|
-
* - `rts` — free-pan / edge-scroll / rotate / zoom, optional follow.
|
|
74
|
-
* - `shoulder` — over-the-shoulder with ADS transition + shoulder swap.
|
|
75
|
-
* - `lockOn` — yaw bound to the player→target vector; move axis becomes strafe.
|
|
76
|
-
* - `chase` — speed-reactive vehicle chase (speed→FOV, spring arm, shake) + cockpit/hood/rear views.
|
|
77
|
-
* - `observer` — detached spectator/photo cam bound to any entity or fixed point; never reads player input.
|
|
78
|
-
* - `turntable` — slow auto-orbit of a fixed point: a rotating display stand for a scene. The friendly, flat spelling of `observer`'s point-orbit mode; providing `camera.turntable` selects it without an explicit `rig`.
|
|
79
|
-
* - `sideScroll` — fixed lateral follow (2.5D platformer/beat-'em-up side view); reads no player input.
|
|
80
|
-
* - `inspection` — model-viewer rig (#207.7): left-drag orbit, middle/right-drag pan, scroll zoom toward a configurable anchor; orbits a fixed point, reads no player/entity input.
|
|
81
|
-
* - `none` — no camera rig is mounted; use for HUD-only presentations or a game that manages its own camera.
|
|
82
|
-
*/
|
|
83
|
-
export type CameraRigKind = "orbit" | "first" | "topDown" | "rts" | "shoulder" | "lockOn" | "chase" | "observer" | "turntable" | "sideScroll" | "inspection" | "none";
|
|
84
|
-
/** Canvas camera projection. "orthographic" renders a flat 2D-style view (side-scrollers, falling-block puzzles) — pair with `rig: "sideScroll"`; default "perspective". */
|
|
85
|
-
export type CameraProjection = "perspective" | "orthographic";
|
|
86
|
-
/** Fixed lateral 2.5D follow (side-on platformer cam): the camera sits perpendicular to the travel axis, tracks the followed entity, and never reads player look input. */
|
|
87
|
-
export interface SideScrollCameraConfig {
|
|
88
|
-
/** World axis the action travels along; the camera watches from the perpendicular side. Default "x". */
|
|
89
|
-
axis?: "x" | "z";
|
|
90
|
-
/** Camera distance from the followed entity along the perpendicular axis. Default 10. */
|
|
91
|
-
distance?: number;
|
|
92
|
-
/** Camera height above the followed entity. Default 3. */
|
|
93
|
-
height?: number;
|
|
94
|
-
/** Height of the look point above the entity. Default 1. */
|
|
95
|
-
lookHeight?: number;
|
|
96
|
-
/** Per-second smoothing factor for the follow (0 hard-locks). Default 8. */
|
|
97
|
-
followSmoothing?: number;
|
|
98
|
-
fov?: number;
|
|
99
|
-
}
|
|
100
|
-
/** Fixed top-down / isometric rig (#23) — height/pitch/yaw + decoupled follow. */
|
|
101
|
-
export interface TopDownCameraConfig {
|
|
102
|
-
/** Camera height above the follow point. Default 18. */
|
|
103
|
-
height?: number;
|
|
104
|
-
/** Elevation of the camera above the ground plane in radians (PI/2 = straight down, near 0 = grazing; values below 0.05 clamp to 0.05). Default ~1.02 (~58°, ARPG iso). */
|
|
105
|
-
pitch?: number;
|
|
106
|
-
/** Fixed azimuth in radians; ~PI/4 reads as isometric, 0 as straight top-down. Default PI/4. */
|
|
107
|
-
yaw?: number;
|
|
108
|
-
/** Horizontal look offset applied to the follow point. */
|
|
109
|
-
targetOffset?: {
|
|
110
|
-
x?: number;
|
|
111
|
-
y?: number;
|
|
112
|
-
z?: number;
|
|
113
|
-
};
|
|
114
|
-
/** Exponential follow smoothing (higher = snappier, decoupled from any orbit drag). Default 8. */
|
|
115
|
-
followSmoothing?: number;
|
|
116
|
-
/** Scroll zoom bounds as a height multiplier. */
|
|
117
|
-
zoom?: {
|
|
118
|
-
min?: number;
|
|
119
|
-
max?: number;
|
|
120
|
-
speed?: number;
|
|
121
|
-
};
|
|
122
|
-
}
|
|
123
|
-
/** Free-pan / edge-scroll RTS rig (#24) — pan/rotate/zoom independent of any avatar. */
|
|
124
|
-
export interface RtsCameraConfig extends TopDownCameraConfig {
|
|
125
|
-
/** WASD / arrow pan speed in world units per second. Default 24. */
|
|
126
|
-
panSpeed?: number;
|
|
127
|
-
/** Edge-scroll when the pointer nears a screen edge; number sets the margin fraction. Default true. */
|
|
128
|
-
edgeScroll?: boolean | {
|
|
129
|
-
margin?: number;
|
|
130
|
-
speed?: number;
|
|
131
|
-
};
|
|
132
|
-
/** Yaw rotate speed (radians/sec) for rotate keys / middle-drag. Default 1.4. */
|
|
133
|
-
rotateSpeed?: number;
|
|
134
|
-
/** World-space clamp for the pan center. */
|
|
135
|
-
bounds?: {
|
|
136
|
-
minX?: number;
|
|
137
|
-
maxX?: number;
|
|
138
|
-
minZ?: number;
|
|
139
|
-
maxZ?: number;
|
|
140
|
-
};
|
|
141
|
-
/** Start centered on this world point when there is no follow target. */
|
|
142
|
-
start?: {
|
|
143
|
-
x?: number;
|
|
144
|
-
z?: number;
|
|
145
|
-
};
|
|
146
|
-
/** Read WASD/arrow pan, edge-scroll, Q/E rotate, and wheel zoom. `false` sits static at the start/bounds position — a backdrop camera, no input at all. Default true. */
|
|
147
|
-
pan?: boolean;
|
|
148
|
-
}
|
|
149
|
-
/** Over-the-shoulder combat rig (#25) — offset, ADS, shoulder swap, decoupled reticle. */
|
|
150
|
-
export interface ShoulderCameraConfig {
|
|
151
|
-
/** Lateral shoulder offset (world units, sign flips on swap). Default 0.6. */
|
|
152
|
-
shoulderOffset?: number;
|
|
153
|
-
/** Vertical offset above the follow point. Default 1.6. */
|
|
154
|
-
heightOffset?: number;
|
|
155
|
-
/** Boom distance behind the shoulder. Default 3.2. */
|
|
156
|
-
distance?: number;
|
|
157
|
-
/** Starting shoulder side. Default "right". */
|
|
158
|
-
side?: "left" | "right";
|
|
159
|
-
/** Aim-down-sights framing, blended in while `aim` is held. */
|
|
160
|
-
ads?: {
|
|
161
|
-
distance?: number;
|
|
162
|
-
shoulderOffset?: number;
|
|
163
|
-
fov?: number;
|
|
164
|
-
heightOffset?: number;
|
|
165
|
-
};
|
|
166
|
-
/** ADS blend speed (higher = snappier). Default 10. */
|
|
167
|
-
adsTransitionSpeed?: number;
|
|
168
|
-
/** Screen-space reticle offset (fraction of viewport), decoupled from camera center. */
|
|
169
|
-
reticleOffset?: {
|
|
170
|
-
x?: number;
|
|
171
|
-
y?: number;
|
|
172
|
-
};
|
|
173
|
-
/** Mouse-look sensitivity (radians per pixel). Default 0.0025. */
|
|
174
|
-
sensitivity?: number;
|
|
175
|
-
/** Base field of view. Default 55. */
|
|
176
|
-
fov?: number;
|
|
177
|
-
}
|
|
178
|
-
/** Lock-on / strafe rig (#26) — yaw bound to player→target, move axis becomes strafe. */
|
|
179
|
-
export interface LockOnCameraConfig {
|
|
180
|
-
/** Target instance id; when omitted the rig reads the follower's current `getTarget`. */
|
|
181
|
-
targetEntityId?: string;
|
|
182
|
-
/** Boom distance behind the player, away from the target. Default 5. */
|
|
183
|
-
distance?: number;
|
|
184
|
-
/** Camera height above the follow point. Default 2.4. */
|
|
185
|
-
height?: number;
|
|
186
|
-
/** Height of the framed look point above the midpoint. Default 1.2. */
|
|
187
|
-
lookHeight?: number;
|
|
188
|
-
/** 0 frames the player, 1 frames the target, 0.5 the midpoint. Default 0.5. */
|
|
189
|
-
framingBias?: number;
|
|
190
|
-
/** Exponential yaw smoothing toward the player→target vector. Default 9. */
|
|
191
|
-
yawSmoothing?: number;
|
|
192
|
-
}
|
|
193
|
-
/** Fixed interior view for the chase rig (#27). */
|
|
194
|
-
export type ChaseView = "chase" | "cockpit" | "hood" | "rear";
|
|
195
|
-
/** Speed-reactive vehicle chase rig (#27) — speed→FOV, spring arm, procedural shake, interior views. */
|
|
196
|
-
export interface ChaseCameraConfig {
|
|
197
|
-
/** Boom distance behind the vehicle. Default 6. */
|
|
198
|
-
distance?: number;
|
|
199
|
-
/** Camera height above the follow point. Default 2.6. */
|
|
200
|
-
height?: number;
|
|
201
|
-
/** Height of the look point above the follow point. Default 1.2. */
|
|
202
|
-
lookHeight?: number;
|
|
203
|
-
/** Spring-arm damping (higher = stiffer, less lag). Default 6. */
|
|
204
|
-
springDamping?: number;
|
|
205
|
-
/** Speed→FOV curve: FOV lerps from `base` to `max` as speed climbs to `speedForMax`. */
|
|
206
|
-
fov?: {
|
|
207
|
-
base?: number;
|
|
208
|
-
max?: number;
|
|
209
|
-
speedForMax?: number;
|
|
210
|
-
};
|
|
211
|
-
/** Procedural shake amplitude per unit of speed (adds to the trauma channel). Default 0.0. */
|
|
212
|
-
shakePerSpeed?: number;
|
|
213
|
-
/** Velocity-lead / predictive follow (#286.9): the rig aims `time` seconds ahead of the target along its velocity, clamped to `max` world units (default 4). */
|
|
214
|
-
lead?: {
|
|
215
|
-
time: number;
|
|
216
|
-
max?: number;
|
|
217
|
-
};
|
|
218
|
-
/** Roll into turns (#286.10): radians of camera roll per rad/s of the target's yaw rate, clamped to `max` (default 0.35), exponentially smoothed by `damping` (default 8). */
|
|
219
|
-
bank?: {
|
|
220
|
-
perYawRate: number;
|
|
221
|
-
max?: number;
|
|
222
|
-
damping?: number;
|
|
223
|
-
};
|
|
224
|
-
/** Which view to mount. Default "chase". */
|
|
225
|
-
view?: ChaseView;
|
|
226
|
-
/** Local offset for cockpit/hood/rear seats (relative to the vehicle, +z forward). */
|
|
227
|
-
seatOffsets?: {
|
|
228
|
-
cockpit?: {
|
|
229
|
-
x?: number;
|
|
230
|
-
y?: number;
|
|
231
|
-
z?: number;
|
|
232
|
-
};
|
|
233
|
-
hood?: {
|
|
234
|
-
x?: number;
|
|
235
|
-
y?: number;
|
|
236
|
-
z?: number;
|
|
237
|
-
};
|
|
238
|
-
rear?: {
|
|
239
|
-
x?: number;
|
|
240
|
-
y?: number;
|
|
241
|
-
z?: number;
|
|
242
|
-
};
|
|
243
|
-
};
|
|
244
|
-
}
|
|
245
|
-
/** Detached spectator/photo cam (#120) — binds to any entity or fixed point, never reads player input. */
|
|
246
|
-
export interface ObserverCameraConfig {
|
|
247
|
-
/** What the observer looks at. Omit to stay on a fixed point at the origin (or `point`, if given). */
|
|
248
|
-
bind?: {
|
|
249
|
-
kind: "entity";
|
|
250
|
-
entityId: string;
|
|
251
|
-
} | {
|
|
252
|
-
kind: "point";
|
|
253
|
-
position: {
|
|
254
|
-
x: number;
|
|
255
|
-
y: number;
|
|
256
|
-
z: number;
|
|
257
|
-
};
|
|
258
|
-
};
|
|
259
|
-
/** Orbit distance from the bound subject. Default 8. */
|
|
260
|
-
distance?: number;
|
|
261
|
-
/** Camera height above the bound subject. Default 3. */
|
|
262
|
-
height?: number;
|
|
263
|
-
/** Height of the look point above the subject. Default 1.2. */
|
|
264
|
-
lookHeight?: number;
|
|
265
|
-
/** Radians/second of automatic orbit around the subject (CCTV-style sweep); 0 holds a fixed angle. Default 0.2. */
|
|
266
|
-
orbitSpeed?: number;
|
|
267
|
-
/** Starting orbit angle in radians. Default 0. */
|
|
268
|
-
startAngle?: number;
|
|
269
|
-
fov?: number;
|
|
270
|
-
}
|
|
271
|
-
/**
|
|
272
|
-
* Turntable / showcase rig — slowly auto-orbits a fixed world point (no player
|
|
273
|
-
* input), the way a museum turntable rotates an object on display. A flat,
|
|
274
|
-
* self-describing spelling of `observer`'s point-orbit mode: `target` names the
|
|
275
|
-
* point directly instead of `bind: { kind: "point", position }`. Set
|
|
276
|
-
* `camera.turntable` and the rig is inferred — you don't also write `rig`.
|
|
277
|
-
*/
|
|
278
|
-
export interface TurntableCameraConfig {
|
|
279
|
-
/** World point the camera circles. Default the world origin. */
|
|
280
|
-
target?: {
|
|
281
|
-
x: number;
|
|
282
|
-
y: number;
|
|
283
|
-
z: number;
|
|
284
|
-
};
|
|
285
|
-
/** Orbit radius from the target. Default 8. */
|
|
286
|
-
distance?: number;
|
|
287
|
-
/** Camera height above the target. Default 3. */
|
|
288
|
-
height?: number;
|
|
289
|
-
/** Height of the look point above the target. Default 1.2. */
|
|
290
|
-
lookHeight?: number;
|
|
291
|
-
/** Radians/second of rotation; 0 holds a fixed angle. Default 0.2. */
|
|
292
|
-
orbitSpeed?: number;
|
|
293
|
-
/** Starting angle in radians. Default 0. */
|
|
294
|
-
startAngle?: number;
|
|
295
|
-
fov?: number;
|
|
296
|
-
}
|
|
297
|
-
/**
|
|
298
|
-
* How scroll-zoom re-anchors the view for the inspection rig (#207.7):
|
|
299
|
-
* - `target` — dolly toward the orbit target (classic OrbitControls behavior).
|
|
300
|
-
* - `cursor` — dolly toward the point under the pointer.
|
|
301
|
-
* - `center` — dolly toward the viewport center; equivalent to `target` for an
|
|
302
|
-
* OrbitControls-driven rig, since the camera always faces `target` and that
|
|
303
|
-
* point already projects to the exact center of the viewport.
|
|
304
|
-
*/
|
|
305
|
-
export type InspectionZoomAnchor = "target" | "cursor" | "center";
|
|
306
|
-
/** Model-viewer / inspection rig (#207.7) — orbit + pan + anchored zoom around a fixed point, never reads player input. */
|
|
307
|
-
export interface InspectionCameraConfig {
|
|
308
|
-
/** Where scroll-zoom re-anchors the view. Default "target". */
|
|
309
|
-
anchor?: InspectionZoomAnchor;
|
|
310
|
-
/** Orbit target (the point orbited/panned around). Default origin. */
|
|
311
|
-
target?: {
|
|
312
|
-
x?: number;
|
|
313
|
-
y?: number;
|
|
314
|
-
z?: number;
|
|
315
|
-
};
|
|
316
|
-
/** Camera distance from `target` used to seed the initial camera position when `initialPosition` is unset. Default 6. */
|
|
317
|
-
initialDistance?: number;
|
|
318
|
-
/** Explicit starting camera world position; overrides `initialDistance` when set. */
|
|
319
|
-
initialPosition?: {
|
|
320
|
-
x?: number;
|
|
321
|
-
y?: number;
|
|
322
|
-
z?: number;
|
|
323
|
-
};
|
|
324
|
-
minDistance?: number;
|
|
325
|
-
maxDistance?: number;
|
|
326
|
-
/** Vertical orbit clamp (radians). Unset allows a full pole-to-pole orbit, unlike the tighter default on the classic orbit rig. */
|
|
327
|
-
minPolarAngle?: number;
|
|
328
|
-
maxPolarAngle?: number;
|
|
329
|
-
/** Middle-mouse/right-drag pan. Default true for this rig. */
|
|
330
|
-
pan?: boolean;
|
|
331
|
-
rotateSpeed?: number;
|
|
332
|
-
zoomSpeed?: number;
|
|
333
|
-
dampingFactor?: number;
|
|
334
|
-
}
|
|
335
|
-
/** One stop on a scripted camera path (#29). */
|
|
336
|
-
export interface CameraKeyframe {
|
|
337
|
-
position: {
|
|
338
|
-
x: number;
|
|
339
|
-
y: number;
|
|
340
|
-
z: number;
|
|
341
|
-
};
|
|
342
|
-
lookAt: {
|
|
343
|
-
x: number;
|
|
344
|
-
y: number;
|
|
345
|
-
z: number;
|
|
346
|
-
};
|
|
347
|
-
fov?: number;
|
|
348
|
-
/** Seconds to travel from the previous keyframe to this one. Default 1. */
|
|
349
|
-
duration?: number;
|
|
350
|
-
/** Interpolation into this keyframe. Default "smooth" (smoothstep ease). */
|
|
351
|
-
ease?: "linear" | "smooth";
|
|
352
|
-
}
|
|
353
|
-
/** Scripted keyframe / path player (#29). When set it overrides the active rig. */
|
|
354
|
-
export interface CinematicCameraConfig {
|
|
355
|
-
keyframes: readonly CameraKeyframe[];
|
|
356
|
-
/** Restart from the first keyframe after the last. Default false. */
|
|
357
|
-
loop?: boolean;
|
|
358
|
-
}
|
|
359
|
-
/** Camera-shake / trauma defaults (#28). Any rig reads the trauma channel; game systems feed it via `cameraShake()`. */
|
|
360
|
-
export interface CameraShakeConfig {
|
|
361
|
-
/** Positional shake amplitude at full trauma (world units). Default 0.5. */
|
|
362
|
-
maxOffset?: number;
|
|
363
|
-
/** Rotational shake amplitude at full trauma (radians). Default 0.06. */
|
|
364
|
-
maxRoll?: number;
|
|
365
|
-
/** Trauma decay per second (fraction). Default 1.6. */
|
|
366
|
-
decayPerSecond?: number;
|
|
367
|
-
/** Trauma→shake exponent; 2 = quadratic falloff so small hits are subtle. Default 2. */
|
|
368
|
-
exponent?: number;
|
|
369
|
-
/** Noise frequency (Hz) of the shake oscillation. Default 24. */
|
|
370
|
-
frequency?: number;
|
|
371
|
-
}
|
|
372
|
-
export declare const CAMERA_FRUSTUM_DEFAULTS: {
|
|
373
|
-
readonly fov: 55;
|
|
374
|
-
readonly near: 0.1;
|
|
375
|
-
readonly far: 300;
|
|
376
|
-
readonly zoom: 50;
|
|
377
|
-
};
|
|
378
|
-
/** Player-facing FOV preference applied across every perspective camera rig. Orthographic projections ignore it. */
|
|
379
|
-
export interface PlayerFovConfig {
|
|
380
|
-
/** Inclusive lower bound for the slider and persisted values. Default 40. */
|
|
381
|
-
min?: number;
|
|
382
|
-
/** Inclusive upper bound for the slider and persisted values. Default 120. */
|
|
383
|
-
max?: number;
|
|
384
|
-
/** Initial FOV when nothing is persisted. Defaults to `frustum.fov` or 55. */
|
|
385
|
-
default?: number;
|
|
386
|
-
/** Persist the preference in localStorage across reloads. Default true. */
|
|
387
|
-
persist?: boolean;
|
|
388
|
-
/** Show the shell FOV slider. Default true for perspective cameras; forced off for orthographic. */
|
|
389
|
-
control?: boolean;
|
|
390
|
-
}
|
|
391
|
-
export interface GameCameraConfig {
|
|
392
|
-
/** Selects the rig. Overrides `perspective`; leave unset to fall back to `perspective`. */
|
|
393
|
-
rig?: CameraRigKind;
|
|
394
|
-
/** Canvas camera projection. "orthographic" renders a flat 2D-style view (side-scrollers, falling-block puzzles) — pair with `rig: "sideScroll"`; default perspective. */
|
|
395
|
-
projection?: CameraProjection;
|
|
396
|
-
/** Render frustum overrides applied to the canvas camera. `far` defaults to 300 — raise it for worlds whose content spans more than a few hundred units, or distant scenery silently clips. `zoom` is the orthographic zoom in canvas pixels per world unit, read only when `projection` is "orthographic"; default 50. */
|
|
397
|
-
frustum?: {
|
|
398
|
-
fov?: number;
|
|
399
|
-
near?: number;
|
|
400
|
-
far?: number;
|
|
401
|
-
zoom?: number;
|
|
402
|
-
};
|
|
403
|
-
/** Universal player FOV preference (slider + persistence) for perspective rigs. Ignored when `projection` is `"orthographic"`. */
|
|
404
|
-
playerFov?: PlayerFovConfig;
|
|
405
|
-
/** "third" mounts the orbit camera (default); "first" mounts pointer-lock mouse-look. Shorthand for `rig: "orbit" | "first"`. */
|
|
406
|
-
perspective?: "third" | "first";
|
|
407
|
-
/** First-person tuning; only read when the rig resolves to "first". */
|
|
408
|
-
firstPerson?: FirstPersonCameraConfig;
|
|
409
|
-
/** Top-down / isometric tuning (#23); read when `rig: "topDown"`. */
|
|
410
|
-
topDown?: TopDownCameraConfig;
|
|
411
|
-
/** Free-pan / edge-scroll RTS tuning (#24); read when `rig: "rts"`. */
|
|
412
|
-
rts?: RtsCameraConfig;
|
|
413
|
-
/** Over-the-shoulder tuning (#25); read when `rig: "shoulder"`. */
|
|
414
|
-
shoulder?: ShoulderCameraConfig;
|
|
415
|
-
/** Lock-on / strafe tuning (#26); read when `rig: "lockOn"`. */
|
|
416
|
-
lockOn?: LockOnCameraConfig;
|
|
417
|
-
/** Vehicle chase tuning (#27); read when `rig: "chase"`. */
|
|
418
|
-
chase?: ChaseCameraConfig;
|
|
419
|
-
/** Detached spectator/photo cam tuning (#120); read when `rig: "observer"`. */
|
|
420
|
-
observer?: ObserverCameraConfig;
|
|
421
|
-
/** Turntable / showcase tuning; setting this selects the `turntable` rig on its own. */
|
|
422
|
-
turntable?: TurntableCameraConfig;
|
|
423
|
-
/** Fixed side-on follow tuning; read when `rig: "sideScroll"`. */
|
|
424
|
-
sideScroll?: SideScrollCameraConfig;
|
|
425
|
-
/** Model-viewer / inspection tuning (#207.7); read when `rig: "inspection"`. */
|
|
426
|
-
inspection?: InspectionCameraConfig;
|
|
427
|
-
/** Camera-shake / trauma channel defaults (#28); read by every rig. */
|
|
428
|
-
shake?: CameraShakeConfig;
|
|
429
|
-
/** Scripted keyframe path (#29); when set, plays over the active rig. */
|
|
430
|
-
cinematic?: CinematicCameraConfig;
|
|
431
|
-
/** Seconds to cross-fade the camera when the rig changes (#29). 0 hard-cuts. Default 0.6. */
|
|
432
|
-
transitionSeconds?: number;
|
|
433
|
-
minDistance?: number;
|
|
434
|
-
maxDistance?: number;
|
|
435
|
-
targetHeight?: number;
|
|
436
|
-
/** Extra offset on top of entity position for the orbit target. */
|
|
437
|
-
targetOffset?: {
|
|
438
|
-
x?: number;
|
|
439
|
-
y?: number;
|
|
440
|
-
z?: number;
|
|
441
|
-
};
|
|
442
|
-
initialDistance?: number;
|
|
443
|
-
initialHeight?: number;
|
|
444
|
-
/** Lock orbit radius while the follow target moves (default true in shell). */
|
|
445
|
-
followLock?: boolean;
|
|
446
|
-
/** When false, orbit target stays fixed (cinematic / debug). Default true. */
|
|
447
|
-
followEnabled?: boolean;
|
|
448
|
-
/** Instance id to follow, or null for an avatar-less free camera; defaults to local player in the dev shell. */
|
|
449
|
-
followEntityId?: string | null;
|
|
450
|
-
/** Fired each frame after cameraFollow lock is applied. */
|
|
451
|
-
onCameraFollow?: (state: CameraFollowState) => void;
|
|
452
|
-
rotateSpeed?: number;
|
|
453
|
-
zoomSpeed?: number;
|
|
454
|
-
dampingFactor?: number;
|
|
455
|
-
targetSmoothing?: number;
|
|
456
|
-
dragTargetSmoothing?: number;
|
|
457
|
-
distanceSmoothing?: number;
|
|
458
|
-
/** Vertical look clamp (three.js polar angle, radians): 0 = top-down over the head, PI/2 = level, >PI/2 = look up from below. Widen for top-down or vertical aim; unset keeps the standard chase feel. */
|
|
459
|
-
minPolarAngle?: number;
|
|
460
|
-
maxPolarAngle?: number;
|
|
461
|
-
/** Spring-arm occlusion for the orbit rig: pull the camera in past walls/terrain so it never clips inside geometry. Off unless `enabled`. */
|
|
462
|
-
collision?: {
|
|
463
|
-
enabled?: boolean;
|
|
464
|
-
padding?: number;
|
|
465
|
-
minTargetDistance?: number;
|
|
466
|
-
};
|
|
45
|
+
/** Props handed to a `WorldOverlay` component (#542): explicit `ctx` access so canvas-layer VFX read live engine state directly, without an extra hook or a module-global workaround. */
|
|
46
|
+
export interface WorldOverlayProps {
|
|
47
|
+
ctx: GameContext;
|
|
467
48
|
}
|
|
468
49
|
export interface EntitySpriteConfig {
|
|
469
50
|
url: string;
|
|
@@ -538,6 +119,17 @@ export interface ModelAnimationConfig {
|
|
|
538
119
|
*/
|
|
539
120
|
oneShots?: Record<string, string | readonly string[]>;
|
|
540
121
|
}
|
|
122
|
+
/**
|
|
123
|
+
* Real PBR map URLs (e.g. `buildMaterialCatalog(...).resolve(id)!.maps` from `@jgengine/assets`)
|
|
124
|
+
* layered onto a model's material — the seam for texturing an otherwise-flat/untextured GLB. Any
|
|
125
|
+
* role may be omitted to keep the model's own map.
|
|
126
|
+
*/
|
|
127
|
+
export interface ModelMaterialMaps {
|
|
128
|
+
color?: string;
|
|
129
|
+
normal?: string;
|
|
130
|
+
roughness?: string;
|
|
131
|
+
ao?: string;
|
|
132
|
+
}
|
|
541
133
|
/** Per-entity PBR material override (#151.3) applied to every `MeshStandardMaterial` in the model's cloned scene graph. */
|
|
542
134
|
export interface ModelMaterialOverride {
|
|
543
135
|
color?: string;
|
|
@@ -545,6 +137,8 @@ export interface ModelMaterialOverride {
|
|
|
545
137
|
roughness?: number;
|
|
546
138
|
emissive?: string;
|
|
547
139
|
emissiveIntensity?: number;
|
|
140
|
+
/** Real PBR texture maps applied over the model's material — see {@link ModelMaterialMaps}. */
|
|
141
|
+
maps?: ModelMaterialMaps;
|
|
548
142
|
}
|
|
549
143
|
/** Parents a prop/weapon model to a named bone or node on the host model's rig — a sword on `handslot.r`, a spellbook offhand — following the bone's animated transform each frame. */
|
|
550
144
|
export interface ModelAttachment {
|
|
@@ -559,6 +153,17 @@ export interface ModelAttachment {
|
|
|
559
153
|
/** Uniform scale of the attached model at the bone. Default 1. */
|
|
560
154
|
scale?: number;
|
|
561
155
|
}
|
|
156
|
+
/** Static child model stacked at a fixed local offset under its parent's transform — no bone/rig resolution, unlike `ModelAttachment`. Assembles a compound entity (e.g. a modular castle wall + tower + roof) from several single-mesh kit pieces. */
|
|
157
|
+
export interface ModelPart {
|
|
158
|
+
/** The child model — a catalog asset id or an inline `ModelConfig`; resolves through the catalog exactly like the top-level model and gets its own `dims`/anchor centering. */
|
|
159
|
+
model: string | ModelConfig;
|
|
160
|
+
/** Local position offset under the parent's transform. */
|
|
161
|
+
position?: [number, number, number];
|
|
162
|
+
/** Local Euler rotation (radians) under the parent's transform. */
|
|
163
|
+
rotation?: [number, number, number];
|
|
164
|
+
/** Uniform scale of the part under the parent's transform. Default 1. */
|
|
165
|
+
scale?: number;
|
|
166
|
+
}
|
|
562
167
|
export interface ModelConfig {
|
|
563
168
|
url: string;
|
|
564
169
|
scale?: number;
|
|
@@ -569,12 +174,16 @@ export interface ModelConfig {
|
|
|
569
174
|
anchor?: "center" | "origin";
|
|
570
175
|
/** Measured footprint/center/minY; supplied automatically when the model resolves through an `@jgengine/assets` catalog. Required for `anchor: "center"` to take effect. */
|
|
571
176
|
dims?: ModelDims;
|
|
177
|
+
/** Opt-in compact collision mesh from the asset index; when present, collider auto-fit raycasts the actual triangles, so shots pass through holes in concave models (torus, archway) instead of hitting the fitted box. Supplied automatically for opted-in catalog assets. */
|
|
178
|
+
collisionMesh?: CollisionMeshData;
|
|
572
179
|
/** Per-entity PBR tint/finish override (#151.3); cloned onto each `MeshStandardMaterial` in the model so shared GLTF caches stay untouched. */
|
|
573
180
|
material?: ModelMaterialOverride;
|
|
574
181
|
/** Plays a GLTF animation clip on the model when the source has any (skinned or not); omit to render the rig's bind pose. */
|
|
575
182
|
animation?: ModelAnimationConfig;
|
|
576
183
|
/** Props/weapons parented to named bones on this model's rig; each follows its bone through animation. */
|
|
577
184
|
attachments?: readonly ModelAttachment[];
|
|
185
|
+
/** Static kit-of-parts pieces stacked at fixed local offsets — no bone/rig involved. Use this for a compound entity assembled from several modular meshes (a castle keep from base + mid + roof pieces); use `attachments` for props parented to an animated rig's bones. */
|
|
186
|
+
parts?: readonly ModelPart[];
|
|
578
187
|
}
|
|
579
188
|
export interface ObjectStyle {
|
|
580
189
|
color?: string;
|
|
@@ -637,6 +246,18 @@ export interface PlayerMovementConfig {
|
|
|
637
246
|
beforeCommit?: (frame: MovementCommitFrame) => readonly [number, number, number] | undefined | void;
|
|
638
247
|
/** Gates the built-in sprint (`runSpeedMultiplier`) behind live game state — a stamina stat, an encumbrance check (#282.3). Called each frame while sprint is held; `false` walks. */
|
|
639
248
|
canSprint?: (ctx: GameContext) => boolean;
|
|
249
|
+
/** Fraction of walk speed while backpedalling (holding `moveBack`). Overrides the engine default (0.65). */
|
|
250
|
+
backpedalMult?: number;
|
|
251
|
+
/** Radians/second the rendered body rotates toward its movement heading (shortest arc), so strafing/backpedalling read as a turn rather than an instant flip; also the rate the internally-integrated `turnLeft`/`turnRight` heading turns when the shell doesn't own yaw. Unset = body facing snaps instantly (no change to existing feel). */
|
|
252
|
+
turnSpeed?: number;
|
|
253
|
+
/** On-foot swimming when the terrain declares a `waterLevel` and the player is submerged: caps speed and floats them at the surface. `true` uses defaults; default off. */
|
|
254
|
+
swim?: {
|
|
255
|
+
speedMultiplier?: number;
|
|
256
|
+
} | boolean;
|
|
257
|
+
/** Slide the player downhill on terrain steeper than they can stand on (heightfield worlds only). `true` uses defaults; default off. */
|
|
258
|
+
slopeSlide?: {
|
|
259
|
+
maxClimbSlope?: number;
|
|
260
|
+
} | boolean;
|
|
640
261
|
}
|
|
641
262
|
/** One frame's movement resolution handed to `PlayerMovementConfig.beforeCommit`. */
|
|
642
263
|
export interface MovementCommitFrame {
|
|
@@ -647,17 +268,56 @@ export interface MovementCommitFrame {
|
|
|
647
268
|
/** The live game context (#282.2) — movement rules read stores/stats directly instead of module-level bridge objects. */
|
|
648
269
|
ctx: GameContext;
|
|
649
270
|
}
|
|
650
|
-
|
|
271
|
+
/**
|
|
272
|
+
* Per-channel combat presentation toggles for the 3D shell canvas.
|
|
273
|
+
* Missing keys default to enabled when the parent `presentationEffects` is an object.
|
|
274
|
+
*/
|
|
275
|
+
export interface PresentationEffectsConfig {
|
|
276
|
+
/** Ground telegraphs for AoE / cast indicators. Default true. */
|
|
277
|
+
telegraphs?: boolean;
|
|
278
|
+
/** One-shot spell VFX + retained (persistent) VFX instances. Default true. */
|
|
279
|
+
vfx?: boolean;
|
|
280
|
+
/** Floating combat text (damage numbers, etc.). Default true. */
|
|
281
|
+
floatText?: boolean;
|
|
282
|
+
/** Projectile tracer lines. Default true. */
|
|
283
|
+
tracers?: boolean;
|
|
284
|
+
/** Trauma-driven combat camera shake. Default true. */
|
|
285
|
+
shake?: boolean;
|
|
286
|
+
}
|
|
287
|
+
/** How a screenshot host reaches live gameplay in this game — the data behind `shoot --mode play`. */
|
|
288
|
+
export interface GameCaptureConfig {
|
|
289
|
+
/** Commands run (in order, via `ctx.game.commands.run`) right after boot when a capture host requests the play screen — the same commands the start-menu buttons dispatch. A bare string runs with a default input; the object form carries the input a command needs (e.g. `[{ name: "class.select", input: { classId: "siren" } }, "startRun"]`). A name the game never registers fails the capture loudly instead of shipping a menu screenshot. */
|
|
290
|
+
play?: readonly (string | {
|
|
291
|
+
name: string;
|
|
292
|
+
input?: unknown;
|
|
293
|
+
})[];
|
|
294
|
+
/** Named capture states beyond live gameplay — any screen worth screenshotting on demand (`lobby`, `store`, `game_over`), each mapping to the command sequence that reaches it from boot. `shoot <game> --state <name>` runs that sequence and captures whatever is on screen — menus included, no live-play guard. An unknown state name fails the capture with the declared list. */
|
|
295
|
+
states?: Record<string, readonly (string | {
|
|
296
|
+
name: string;
|
|
297
|
+
input?: unknown;
|
|
298
|
+
})[]>;
|
|
299
|
+
/** Extra milliseconds the capture host waits after `play` commands before taking the play-mode screenshot — cover an intro cinematic or spawn-in fade. Default 2500. */
|
|
300
|
+
settleMs?: number;
|
|
301
|
+
/** Bot-playtest read hook: maps live game state to a flat vector of numeric progress metrics the `drive --playtest` harness samples over time (e.g. `{ x, z, score, phase }`). Genre-agnostic — "progress" is whatever the game reports; the engine stays neutral. The harness watches these numbers move under scripted input: any metric changing beyond an epsilon counts as forward progress, all metrics flat past the softlock threshold under active input flags a softlock. Return every value that should count as advancing; omit to opt the game out of the playtest rung. */
|
|
302
|
+
probe?: (ctx: GameContext) => Record<string, number>;
|
|
303
|
+
}
|
|
304
|
+
export interface PlayableGame<TUi = unknown, TWorldOverlay = unknown, TRenderEntity = never, TRenderObject = never, TViewmodel = unknown, TOverlay = TWorldOverlay> {
|
|
651
305
|
game: GameDefinition;
|
|
652
306
|
content: GameContextContent;
|
|
653
307
|
loop: Required<Omit<GameLoop<GameContext>, "onPlayerLeave">> & Pick<GameLoop<GameContext>, "onPlayerLeave">;
|
|
654
308
|
GameUI: TUi;
|
|
655
309
|
/** Which shell mount to use. Default `"3d"` (canvas, camera rig, pointer, world rendering). `"hud"` mounts no 3D canvas, camera rig, or pointer — the game is `GameUI` plus the command/input loop, for board/card/menu games. */
|
|
656
310
|
presentation?: "3d" | "hud";
|
|
657
|
-
/** Optional canvas-layer VFX component (e.g. traveling projectiles). */
|
|
658
|
-
WorldOverlay?:
|
|
311
|
+
/** Optional canvas-layer VFX component (e.g. traveling projectiles); receives `{ ctx }` (#542) so overlay VFX read live engine state without a separate hook or a module-global workaround. */
|
|
312
|
+
WorldOverlay?: TOverlay;
|
|
659
313
|
/** Replaces the default demo backdrop (ground + grid + rocks) with the game's own scene — ground, sky, structures. Camera, input, HUD, entity rendering, and the loop stay shell-provided; supply your world without forking the shell. When unset and `game.world` is an `environment()` descriptor, the shell auto-renders that world here — no manual wiring needed. */
|
|
660
314
|
environment?: TWorldOverlay;
|
|
315
|
+
/** The game's authored scene document (`editor.scene.json`, normalized). When set, `defineGame` always mounts `AuthoredScene` over it (draped paths, scatter, studios, placed catalog props) — any `WorldOverlay` renders alongside it as VFX only — and the embedded editor opens it as its default layers: the zero-wiring path from document to play and edit modes. */
|
|
316
|
+
editorLayers?: EditorDocument;
|
|
317
|
+
/** Game-exported gameplay catalog definitions (schemas + defaults). `GameHost` forwards them to the summoned editor's Data panel; no per-game editor bootstrap needed. */
|
|
318
|
+
editorCatalogs?: readonly EditorCatalogDefinition[];
|
|
319
|
+
/** Custom first-person viewmodel (#542), read when the active rig is first-person. Rendered inside the shell's camera-locked, muzzle-tracked anchor in place of the built-in three-mesh gun; receives a live `cuesRef` (velocity/bob/firing/reloading/recoil) driven from the followed entity — see `@jgengine/shell/camera`'s `ViewmodelProps`. Set `camera.firstPerson.viewmodel: false` to render no viewmodel at all regardless of this field. */
|
|
320
|
+
viewmodel?: TViewmodel;
|
|
661
321
|
/** Per-entity visual override: return your own mesh for an entity and the shell still positions it and drives selection/targeting. Return null/undefined to fall back to model → sprite → primitive. */
|
|
662
322
|
renderEntity?: TRenderEntity;
|
|
663
323
|
/** Per-object visual override: return your own mesh for a placed scene object and the shell still positions it and drives picking. Return null/undefined to fall back to objectModels → styled box. */
|
|
@@ -676,6 +336,8 @@ export interface PlayableGame<TUi = unknown, TWorldOverlay = unknown, TRenderEnt
|
|
|
676
336
|
prompts?: (ctx: GameContext) => readonly PositionedPrompt[];
|
|
677
337
|
/** Camera tuning (perspective, orbit, first-person) for the dev game player shell. */
|
|
678
338
|
camera?: GameCameraConfig;
|
|
339
|
+
/** Screenshot-host recipe for reaching live gameplay past a start menu (`shoot --mode play` runs `capture.play` automatically). Any game with a start/title screen declares this. */
|
|
340
|
+
capture?: GameCaptureConfig;
|
|
679
341
|
/** Cast/receive shadows across the scene (R3F Canvas shadow pass). Default true. */
|
|
680
342
|
shadows?: boolean;
|
|
681
343
|
/** Pointer-driven input: click-to-move, box-select, right-click verbs, cursor aim (#22/#30/#31). */
|
|
@@ -694,6 +356,26 @@ export interface PlayableGame<TUi = unknown, TWorldOverlay = unknown, TRenderEnt
|
|
|
694
356
|
roles?: readonly CatalogEntityRole[];
|
|
695
357
|
maxDistance?: number;
|
|
696
358
|
};
|
|
359
|
+
/**
|
|
360
|
+
* Opt in to billboarded nameplates (name + optional HP bar) floating over non-local entities — the
|
|
361
|
+
* MMO "who's this and how hurt are they" readout. `roles` restricts to entities whose catalog entry
|
|
362
|
+
* declares one of the given roles (default: all); `maxDistance` hides nameplates beyond this many
|
|
363
|
+
* world units from the player (default 40). Headless: skin every part via `className`/`data-*` hooks
|
|
364
|
+
* on `WorldNameplates` (`@jgengine/shell/world/WorldHud`) — this flag only turns the readout on and
|
|
365
|
+
* scopes which entities it covers.
|
|
366
|
+
*/
|
|
367
|
+
nameplates?: boolean | {
|
|
368
|
+
statId?: string;
|
|
369
|
+
roles?: readonly CatalogEntityRole[];
|
|
370
|
+
maxDistance?: number;
|
|
371
|
+
};
|
|
372
|
+
/**
|
|
373
|
+
* Combat presentation stack mounted inside the 3D canvas (telegraphs, spell VFX, retained VFX,
|
|
374
|
+
* float text, projectile tracers, camera shake). Default `true` preserves historical always-on
|
|
375
|
+
* behavior. `false` mounts none. An object mounts only the listed pieces (missing keys default
|
|
376
|
+
* on so games can disable a single expensive channel, e.g. `{ tracers: false }`).
|
|
377
|
+
*/
|
|
378
|
+
presentationEffects?: boolean | PresentationEffectsConfig;
|
|
697
379
|
/** Sound catalog + mix buses (music/sfx/ambient/…) the shell's Web Audio glue plays from. Catalog-first — no per-game audio wiring. `sounds` may be sample (`url`) or procedural (`synth`); `music` holds procedural themes crossfaded via `ctx.game.audio.music(id)`. */
|
|
698
380
|
audio?: {
|
|
699
381
|
sounds: Record<string, SoundDef>;
|
|
@@ -711,13 +393,15 @@ export interface PlayableGame<TUi = unknown, TWorldOverlay = unknown, TRenderEnt
|
|
|
711
393
|
collision?: VoxelCollisionConfig;
|
|
712
394
|
/** Movement-control levers (axis/grid constraints, object collision, pre-commit hook) for the shell-driven walk controller. */
|
|
713
395
|
movement?: PlayerMovementConfig;
|
|
396
|
+
/** Default-look preset (#773). Unset/`"cinematic"` composes a real sky, a shadow-casting sun+hemisphere rig, a network-free image-based-lighting environment (soft PBR reflections), and a tuned tone-map/bloom/AO/vignette post stack, so a scene reads lit-like-a-game out of the box; `"flat"` opts out to the bare ambient+directional default. Upgraded default primitive materials (tuned PBR + subtle procedural surface detail) apply under both presets. Any explicit `lighting`/`backdrop`/`postProcessing` always wins. */
|
|
397
|
+
look?: LookPreset;
|
|
714
398
|
/** Declarative ambient/directional/hemisphere lighting (#207.5); replaces the shell's hardcoded default lights when present, regardless of world kind. */
|
|
715
399
|
lighting?: LightingConfig;
|
|
716
400
|
/** Generic background/sky/fog (#207.6), applied for any world kind including a custom `environment` component. */
|
|
717
401
|
backdrop?: BackdropConfig;
|
|
718
402
|
/** Declarative post-processing chain (AO/bloom/tone-map/grade). When set, the shell mounts an EffectComposer and owns the render; absent leaves the renderer drawing directly (unchanged). */
|
|
719
403
|
postProcessing?: PostProcessingConfig;
|
|
720
|
-
/** F2 debug overlay (frame/sim timing, logs, backend latency, keybinds, live tunables). On for every game by default; `false` disables the toggle. */
|
|
404
|
+
/** F2+D debug overlay (frame/sim timing, logs, backend latency, keybinds, live tunables). On for every game by default; `false` disables the toggle. */
|
|
721
405
|
devtools?: boolean;
|
|
722
406
|
/** Player settings menu. Auto-mounted for every game (Sound / Graphics / Gameplay / Controls); unset uses the defaults, `false` opts out. Add game-specific rows via `extra`, switch overlay/full-page via `mode`, or swap the gear for compact on-screen buttons via `surface: "quick"`. */
|
|
723
407
|
settings?: GameSettingsConfig | false;
|