create-threenative 0.2.17 → 0.2.20
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/agent-docs/kit-mcp.md +1 -1
- package/agent-docs/kit-router.md +1 -1
- package/agent-docs/references/assertion-reference.md +54 -110
- package/agent-docs/references/capability-reference.md +790 -24
- package/agent-docs/references/conventions.md +28 -0
- package/agent-docs/references/kit-racing.md +4 -2
- package/agent-docs/references/performance-basics.md +10 -5
- package/agent-docs/references/terrain-authoring.md +21 -7
- package/agent-files/.agents/skills/ponytail/SKILL.md +1 -1
- package/agent-files/.agents/skills/prd-creator/SKILL.md +24 -0
- package/agent-files/.agents/skills/threenative-capabilities/SKILL.md +7 -4
- package/agent-files/.claude/hooks/discovery-gate.mjs +2 -2
- package/dist/index.d.ts +97 -6
- package/dist/index.js +1040 -529
- package/dist/quality.d.ts +5 -1
- package/dist/quality.js +75 -6
- package/dist/terrain-kit.js +1 -1
- package/dist/threenative.js +98 -17
- package/dist/web-engine-ccd-ik-solver.js +127 -0
- package/dist/web-engine-gltf-loader.js +52 -14
- package/dist/web-engine-post-effects.js +11 -10
- package/dist/web-engine-runtime.js +3638 -361
- package/package.json +8 -7
- package/template-assets/assets/floor-fern-0.glb +0 -0
- package/template-assets/assets/floor-litter-0.glb +0 -0
- package/template-assets/assets/floor-log-0.glb +0 -0
- package/template-assets/assets/floor-log-1.glb +0 -0
- package/template-assets/assets/floor-stump-0.glb +0 -0
- package/template-assets/assets/floor-twig-0.glb +0 -0
- package/template-assets/clearwater/README.md +1 -1
- package/template-assets/patches/manifest.json +18 -0
- package/template-assets/quality/eslint.config.js +1 -1
- package/templates/action-rpg/AGENTS.md +8 -4
- package/templates/action-rpg/CLAUDE.md +8 -4
- package/templates/action-rpg/package.json +7 -7
- package/templates/action-rpg/src/game.ts +1 -1
- package/templates/action-rpg/src/loot/drops.ts +3 -7
- package/templates/action-rpg/src/render/atmosphere.ts +6 -0
- package/templates/action-rpg/src/render/backlightControls.ts +10 -0
- package/templates/action-rpg/src/render/backlightMaterial.ts +4 -4
- package/templates/action-rpg/src/render/camera.ts +2 -2
- package/templates/action-rpg/src/render/clouds.ts +16 -1
- package/templates/action-rpg/src/render/materialLighting.ts +5 -5
- package/templates/action-rpg/src/render/materials.ts +3 -2
- package/templates/action-rpg/src/render/quality.ts +7 -32
- package/templates/action-rpg/src/render/touch-controls.ts +7 -6
- package/templates/action-rpg/src/scenes/Play.ts +5 -16
- package/templates/action-rpg/src/style.css +4 -0
- package/templates/action-rpg/vite.config.ts +2 -0
- package/templates/adventure/AGENTS.md +10 -5
- package/templates/adventure/CLAUDE.md +10 -5
- package/templates/adventure/kit.json +5 -1
- package/templates/adventure/native-playtests/survives.playtest.json +12 -0
- package/templates/adventure/native-playtests/woodland-floor.playtest.json +61 -0
- package/templates/adventure/package.json +7 -7
- package/templates/adventure/playtests/grass.playtest.json +61 -0
- package/templates/adventure/playtests/performance.playtest.json +1 -1
- package/templates/adventure/playtests/survives.playtest.json +2 -2
- package/templates/adventure/playtests/woodland-floor.playtest.json +61 -0
- package/templates/adventure/src/entities/LockOn.ts +42 -4
- package/templates/adventure/src/entities/Warden.ts +4 -1
- package/templates/adventure/src/game.ts +1 -1
- package/templates/adventure/src/level/Vale.ts +241 -16
- package/templates/adventure/src/render/camera.ts +2 -2
- package/templates/adventure/src/render/foliage.ts +64 -20
- package/templates/adventure/src/render/grass.ts +325 -0
- package/templates/adventure/src/render/materials.ts +3 -2
- package/templates/adventure/src/render/palette.ts +3 -0
- package/templates/adventure/src/render/touch-controls.ts +4 -1
- package/templates/adventure/src/scenes/Play.ts +96 -1
- package/templates/adventure/src/style.css +4 -0
- package/templates/adventure/tsconfig.json +1 -1
- package/templates/adventure/vite.config.ts +2 -0
- package/templates/collectathon/AGENTS.md +7 -2
- package/templates/collectathon/CLAUDE.md +7 -2
- package/templates/collectathon/package.json +7 -7
- package/templates/collectathon/src/game.ts +1 -1
- package/templates/collectathon/src/level/Course.ts +55 -14
- package/templates/collectathon/src/level/terrain.ts +29 -7
- package/templates/collectathon/src/main.ts +1 -0
- package/templates/collectathon/src/render/camera.ts +2 -2
- package/templates/collectathon/src/render/foliage.ts +359 -98
- package/templates/collectathon/src/render/ground.ts +4 -4
- package/templates/collectathon/src/render/hero.ts +1 -1
- package/templates/collectathon/src/render/materials.ts +0 -1
- package/templates/collectathon/src/render/sky.ts +80 -15
- package/templates/collectathon/src/render/water.ts +32 -10
- package/templates/collectathon/src/scenes/Play.ts +18 -5
- package/templates/collectathon/src/style.css +4 -0
- package/templates/collectathon/tsconfig.json +1 -1
- package/templates/collectathon/vite.config.ts +2 -0
- package/templates/kart/AGENTS.md +7 -2
- package/templates/kart/CLAUDE.md +7 -2
- package/templates/kart/package.json +6 -6
- package/templates/kart/src/entities/Kart.ts +2 -1
- package/templates/kart/src/game.ts +1 -1
- package/templates/kart/src/main.ts +1 -0
- package/templates/kart/src/render/course.ts +2 -1
- package/templates/kart/src/style.css +4 -0
- package/templates/kart/src/track/Course.ts +3 -1
- package/templates/kart/tsconfig.json +1 -1
- package/templates/kart/vite.config.ts +2 -0
- package/templates/minimal/AGENTS.md +8 -3
- package/templates/minimal/CLAUDE.md +8 -3
- package/templates/minimal/package.json +6 -6
- package/templates/minimal/playtests/stands-still.playtest.json +30 -0
- package/templates/minimal/src/game.ts +1 -1
- package/templates/minimal/src/render/atmosphere.ts +6 -0
- package/templates/minimal/src/render/backlightControls.ts +10 -0
- package/templates/minimal/src/render/backlightMaterial.ts +4 -4
- package/templates/minimal/src/render/camera.ts +14 -3
- package/templates/minimal/src/render/clouds.ts +16 -1
- package/templates/minimal/src/render/lighting.ts +4 -2
- package/templates/minimal/src/render/materialLighting.ts +5 -5
- package/templates/minimal/src/render/materials.ts +13 -2
- package/templates/minimal/src/render/quality.ts +7 -32
- package/templates/minimal/src/render/touch-controls.ts +7 -6
- package/templates/minimal/src/scenes/Play.ts +4 -1
- package/templates/minimal/vite.config.ts +7 -1
- package/templates/platformer/AGENTS.md +9 -4
- package/templates/platformer/CLAUDE.md +9 -4
- package/templates/platformer/index.html +1 -1
- package/templates/platformer/main.html +12 -0
- package/templates/platformer/package.json +7 -7
- package/templates/platformer/playtests/collect.playtest.json +4 -1
- package/templates/platformer/playtests/gamepad-idle.playtest.json +21 -0
- package/templates/platformer/playtests/gamepad.playtest.json +30 -0
- package/templates/platformer/src/entities/Fox.ts +21 -6
- package/templates/platformer/src/game.ts +1 -1
- package/templates/platformer/src/level/Stage.ts +2 -6
- package/templates/platformer/src/main.ts +1 -0
- package/templates/platformer/src/render/backlightControls.ts +10 -0
- package/templates/platformer/src/render/backlightMaterial.ts +4 -4
- package/templates/platformer/src/render/materialLighting.ts +5 -5
- package/templates/platformer/src/render/quality.ts +7 -32
- package/templates/platformer/src/scenes/Play.ts +4 -2
- package/templates/platformer/src/style.css +4 -0
- package/templates/platformer/src/worker-page.ts +29 -0
- package/templates/platformer/src/worker.ts +5 -0
- package/templates/platformer/tsconfig.json +1 -1
- package/templates/platformer/vite.config.ts +4 -0
- package/templates/puzzle/AGENTS.md +7 -2
- package/templates/puzzle/CLAUDE.md +7 -2
- package/templates/puzzle/package.json +7 -7
- package/templates/puzzle/src/entities/Warden.ts +3 -3
- package/templates/puzzle/src/game.ts +1 -1
- package/templates/puzzle/src/render/backlightControls.ts +10 -0
- package/templates/puzzle/src/render/backlightMaterial.ts +4 -4
- package/templates/puzzle/src/render/camera.ts +2 -2
- package/templates/puzzle/src/render/materialLighting.ts +5 -5
- package/templates/puzzle/src/render/quality.ts +7 -32
- package/templates/puzzle/src/render/touch-controls.ts +7 -6
- package/templates/puzzle/src/scenes/Play.ts +1 -1
- package/templates/puzzle/src/style.css +4 -0
- package/templates/puzzle/tsconfig.json +1 -1
- package/templates/puzzle/vite.config.ts +2 -0
- package/templates/racing/AGENTS.md +9 -4
- package/templates/racing/CLAUDE.md +9 -4
- package/templates/racing/CREDITS.md +29 -0
- package/templates/racing/assets/engine-loop.wav +0 -0
- package/templates/racing/assets/grass/Grass004_color.jpg +0 -0
- package/templates/racing/assets/grass/Grass004_normal.jpg +0 -0
- package/templates/racing/assets/grass/Grass004_roughness.jpg +0 -0
- package/templates/racing/assets/nitro-burst.wav +0 -0
- package/templates/racing/assets/tyre-squeal.wav +0 -0
- package/templates/racing/package.json +7 -7
- package/templates/racing/playtests/drift-natural.playtest.json +68 -0
- package/templates/racing/playtests/drift.playtest.json +100 -0
- package/templates/racing/playtests/hud.playtest.json +117 -0
- package/templates/racing/playtests/launch-pose.playtest.json +34 -0
- package/templates/racing/playtests/nitro.playtest.json +158 -0
- package/templates/racing/playtests/outcome.playtest.json +4 -4
- package/templates/racing/playtests/performance.playtest.json +1 -1
- package/templates/racing/playtests/steady-camera.playtest.json +88 -0
- package/templates/racing/src/audio/engine.ts +138 -0
- package/templates/racing/src/entities/CarBody.ts +83 -10
- package/templates/racing/src/entities/Drift.ts +243 -0
- package/templates/racing/src/entities/LineDriver.ts +2 -2
- package/templates/racing/src/entities/Nitro.ts +72 -0
- package/templates/racing/src/entities/RacingCar.ts +86 -21
- package/templates/racing/src/entities/Rival.ts +35 -21
- package/templates/racing/src/game.ts +7 -1
- package/templates/racing/src/gauges.ts +74 -0
- package/templates/racing/src/render/atmosphere.ts +6 -0
- package/templates/racing/src/render/backlightControls.ts +10 -0
- package/templates/racing/src/render/backlightMaterial.ts +4 -4
- package/templates/racing/src/render/camera.ts +29 -4
- package/templates/racing/src/render/clouds.ts +16 -1
- package/templates/racing/src/render/effects.ts +244 -0
- package/templates/racing/src/render/materialLighting.ts +5 -5
- package/templates/racing/src/render/materials.ts +43 -8
- package/templates/racing/src/render/quality.ts +7 -32
- package/templates/racing/src/render/shapes.ts +37 -0
- package/templates/racing/src/render/skids.ts +84 -0
- package/templates/racing/src/render/touch-controls.ts +10 -10
- package/templates/racing/src/scenes/Race.ts +281 -26
- package/templates/racing/src/state.ts +35 -0
- package/templates/racing/src/style.css +7 -0
- package/templates/racing/src/track/Track.ts +132 -58
- package/templates/racing/src/track/TrackSector.ts +19 -1
- package/templates/racing/src/track/circuit.ts +21 -15
- package/templates/racing/src/ui/GameUi.tsx +0 -2
- package/templates/racing/src/ui/Hud.tsx +417 -50
- package/templates/racing/threenative.config.ts +15 -0
- package/templates/racing/tools/make-racing-audio.mjs +388 -0
- package/templates/racing/tsconfig.json +1 -1
- package/templates/racing/vite.config.ts +2 -0
- package/templates/rain/AGENTS.md +6 -2
- package/templates/rain/CLAUDE.md +6 -2
- package/templates/rain/package.json +6 -6
- package/templates/rain/src/game.ts +1 -1
- package/templates/rain/src/render/noise-volume.ts +2 -1
- package/templates/rain/src/state.ts +3 -1
- package/templates/rain/src/ui/GameUi.tsx +1 -1
- package/templates/rain/src/ui/automation.ts +10 -8
- package/templates/rain/src/ui/tempest.ts +3 -4
- package/templates/rain/vite.config.ts +6 -0
- package/templates/rts/AGENTS.md +6 -2
- package/templates/rts/CLAUDE.md +6 -2
- package/templates/rts/package.json +6 -6
- package/templates/rts/src/game.ts +1 -1
- package/templates/rts/src/render/backlightControls.ts +10 -0
- package/templates/rts/src/render/backlightMaterial.ts +4 -4
- package/templates/rts/src/render/materialLighting.ts +5 -5
- package/templates/rts/src/render/quality.ts +7 -31
- package/templates/rts/src/scenes/Play.ts +1 -1
- package/templates/rts/src/sim/terrain.ts +1 -0
- package/templates/rts/src/sim/types.ts +1 -0
- package/templates/rts/src/style.css +4 -0
- package/templates/rts/vite.config.ts +2 -0
- package/templates/runner/AGENTS.md +7 -2
- package/templates/runner/CLAUDE.md +7 -2
- package/templates/runner/package.json +7 -7
- package/templates/runner/src/game.ts +1 -1
- package/templates/runner/src/render/atmosphere.ts +6 -0
- package/templates/runner/src/render/backlightControls.ts +10 -0
- package/templates/runner/src/render/backlightMaterial.ts +4 -4
- package/templates/runner/src/render/clouds.ts +16 -1
- package/templates/runner/src/render/materialLighting.ts +5 -5
- package/templates/runner/src/render/materials.ts +3 -2
- package/templates/runner/src/render/quality.ts +7 -32
- package/templates/runner/src/render/touch-controls.ts +7 -6
- package/templates/runner/src/scenes/Run.ts +8 -10
- package/templates/runner/src/style.css +4 -0
- package/templates/runner/tsconfig.json +1 -1
- package/templates/runner/vite.config.ts +2 -0
- package/templates/sailing/AGENTS.md +7 -2
- package/templates/sailing/CLAUDE.md +7 -2
- package/templates/sailing/package.json +7 -7
- package/templates/sailing/src/game.ts +1 -1
- package/templates/sailing/src/render/backlightControls.ts +10 -0
- package/templates/sailing/src/render/backlightMaterial.ts +4 -4
- package/templates/sailing/src/render/environmentSetup.ts +1 -1
- package/templates/sailing/src/render/materialLighting.ts +5 -5
- package/templates/sailing/src/render/quality.ts +7 -32
- package/templates/sailing/src/render/touch-controls.ts +7 -6
- package/templates/sailing/src/style.css +5 -0
- package/templates/sailing/vite.config.ts +6 -0
- package/templates/shooter/AGENTS.md +6 -2
- package/templates/shooter/CLAUDE.md +6 -2
- package/templates/shooter/package.json +7 -7
- package/templates/shooter/src/game.ts +3 -2
- package/templates/shooter/src/render/atmosphere.ts +6 -0
- package/templates/shooter/src/render/backlightControls.ts +10 -0
- package/templates/shooter/src/render/backlightMaterial.ts +4 -4
- package/templates/shooter/src/render/clouds.ts +16 -1
- package/templates/shooter/src/render/materialLighting.ts +5 -5
- package/templates/shooter/src/render/quality.ts +7 -32
- package/templates/shooter/src/scenes/Play.ts +4 -1
- package/templates/shooter/src/style.css +4 -0
- package/templates/shooter/vite.config.ts +2 -0
- package/templates/snow/AGENTS.md +7 -2
- package/templates/snow/CLAUDE.md +7 -2
- package/templates/snow/package.json +7 -7
- package/templates/snow/src/entities/Explorer.ts +6 -12
- package/templates/snow/src/game.ts +1 -1
- package/templates/snow/src/render/backlightControls.ts +10 -0
- package/templates/snow/src/render/backlightMaterial.ts +4 -4
- package/templates/snow/src/render/bootPrint.ts +3 -1
- package/templates/snow/src/render/camera.ts +3 -2
- package/templates/snow/src/render/materialLighting.ts +5 -5
- package/templates/snow/src/render/quality.ts +7 -32
- package/templates/snow/src/render/scenery.ts +3 -3
- package/templates/snow/src/render/touch-controls.ts +7 -6
- package/templates/snow/src/render/weather.ts +3 -5
- package/templates/snow/src/style.css +5 -0
- package/templates/snow/src/terrain.ts +2 -1
- package/templates/snow/vite.config.ts +6 -0
- package/templates/starter/AGENTS.md +8 -3
- package/templates/starter/CLAUDE.md +8 -3
- package/templates/starter/native-playtests/render-chain.playtest.json +9 -9
- package/templates/starter/package.json +7 -7
- package/templates/starter/src/entities/Crate.ts +5 -2
- package/templates/starter/src/entities/Player.ts +10 -2
- package/templates/starter/src/game.ts +4 -3
- package/templates/starter/src/render/adaptiveQuality.ts +17 -0
- package/templates/starter/src/render/atmosphere.ts +6 -0
- package/templates/starter/src/render/backlightControls.ts +10 -0
- package/templates/starter/src/render/backlightMaterial.ts +4 -4
- package/templates/starter/src/render/camera.ts +2 -2
- package/templates/starter/src/render/clouds.ts +16 -1
- package/templates/starter/src/render/contactShadow.ts +1 -1
- package/templates/starter/src/render/materialLighting.ts +5 -5
- package/templates/starter/src/render/materials.ts +3 -2
- package/templates/starter/src/render/postprocessing.ts +11 -10
- package/templates/starter/src/render/quality.ts +14 -1
- package/templates/starter/src/render/touch-controls.ts +7 -6
- package/templates/starter/src/scenes/Play.ts +13 -17
- package/templates/starter/src/state.ts +2 -0
- package/templates/starter/src/style.css +4 -0
- package/templates/starter/src/ui/Menu.tsx +5 -1
- package/templates/starter/vite.config.ts +2 -0
- package/templates/tower-defense/AGENTS.md +7 -2
- package/templates/tower-defense/CLAUDE.md +7 -2
- package/templates/tower-defense/package.json +7 -7
- package/templates/tower-defense/src/game.ts +1 -1
- package/templates/tower-defense/src/render/backlightControls.ts +10 -0
- package/templates/tower-defense/src/render/backlightMaterial.ts +4 -4
- package/templates/tower-defense/src/render/materialLighting.ts +5 -5
- package/templates/tower-defense/src/render/quality.ts +7 -32
- package/templates/tower-defense/src/render/shapes.ts +1 -2
- package/templates/tower-defense/src/scenes/Battle.ts +4 -9
- package/templates/tower-defense/src/style.css +4 -0
- package/templates/tower-defense/tsconfig.json +1 -1
- package/templates/tower-defense/vite.config.ts +2 -0
- package/templates/action-rpg/src/render/environmentContribution.ts +0 -188
- package/templates/action-rpg/src/render/environmentRadiance.ts +0 -36
- package/templates/action-rpg/src/render/environmentSampleCache.ts +0 -43
- package/templates/action-rpg/src/render/environmentSampling.ts +0 -193
- package/templates/action-rpg/src/render/environmentSnapshot.ts +0 -53
- package/templates/minimal/src/render/environmentContribution.ts +0 -188
- package/templates/minimal/src/render/environmentRadiance.ts +0 -36
- package/templates/minimal/src/render/environmentSampleCache.ts +0 -43
- package/templates/minimal/src/render/environmentSampling.ts +0 -193
- package/templates/minimal/src/render/environmentSnapshot.ts +0 -53
- package/templates/platformer/src/render/environmentContribution.ts +0 -188
- package/templates/platformer/src/render/environmentRadiance.ts +0 -36
- package/templates/platformer/src/render/environmentSampleCache.ts +0 -43
- package/templates/platformer/src/render/environmentSampling.ts +0 -193
- package/templates/platformer/src/render/environmentSnapshot.ts +0 -53
- package/templates/puzzle/src/render/environmentContribution.ts +0 -188
- package/templates/puzzle/src/render/environmentRadiance.ts +0 -36
- package/templates/puzzle/src/render/environmentSampleCache.ts +0 -43
- package/templates/puzzle/src/render/environmentSampling.ts +0 -193
- package/templates/puzzle/src/render/environmentSnapshot.ts +0 -53
- package/templates/racing/src/render/environmentContribution.ts +0 -188
- package/templates/racing/src/render/environmentRadiance.ts +0 -36
- package/templates/racing/src/render/environmentSampleCache.ts +0 -43
- package/templates/racing/src/render/environmentSampling.ts +0 -193
- package/templates/racing/src/render/environmentSnapshot.ts +0 -53
- package/templates/racing/src/ui/Menu.tsx +0 -7
- package/templates/rts/src/render/environmentContribution.ts +0 -188
- package/templates/rts/src/render/environmentRadiance.ts +0 -36
- package/templates/rts/src/render/environmentSampleCache.ts +0 -43
- package/templates/rts/src/render/environmentSampling.ts +0 -193
- package/templates/rts/src/render/environmentSnapshot.ts +0 -53
- package/templates/runner/src/render/environmentContribution.ts +0 -188
- package/templates/runner/src/render/environmentRadiance.ts +0 -36
- package/templates/runner/src/render/environmentSampleCache.ts +0 -43
- package/templates/runner/src/render/environmentSampling.ts +0 -193
- package/templates/runner/src/render/environmentSnapshot.ts +0 -53
- package/templates/sailing/src/render/environmentContribution.ts +0 -188
- package/templates/sailing/src/render/environmentRadiance.ts +0 -36
- package/templates/sailing/src/render/environmentSampleCache.ts +0 -43
- package/templates/sailing/src/render/environmentSampling.ts +0 -193
- package/templates/sailing/src/render/environmentSnapshot.ts +0 -53
- package/templates/shooter/src/render/environmentContribution.ts +0 -188
- package/templates/shooter/src/render/environmentRadiance.ts +0 -36
- package/templates/shooter/src/render/environmentSampleCache.ts +0 -43
- package/templates/shooter/src/render/environmentSampling.ts +0 -193
- package/templates/shooter/src/render/environmentSnapshot.ts +0 -53
- package/templates/snow/src/render/environmentContribution.ts +0 -188
- package/templates/snow/src/render/environmentRadiance.ts +0 -36
- package/templates/snow/src/render/environmentSampleCache.ts +0 -43
- package/templates/snow/src/render/environmentSampling.ts +0 -193
- package/templates/snow/src/render/environmentSnapshot.ts +0 -53
- package/templates/starter/src/render/environmentContribution.ts +0 -188
- package/templates/starter/src/render/environmentRadiance.ts +0 -36
- package/templates/starter/src/render/environmentSampleCache.ts +0 -43
- package/templates/starter/src/render/environmentSampling.ts +0 -193
- package/templates/starter/src/render/environmentSnapshot.ts +0 -53
- package/templates/starter/src/render/rendererGate.ts +0 -36
- package/templates/tower-defense/src/render/environmentContribution.ts +0 -188
- package/templates/tower-defense/src/render/environmentRadiance.ts +0 -36
- package/templates/tower-defense/src/render/environmentSampleCache.ts +0 -43
- package/templates/tower-defense/src/render/environmentSampling.ts +0 -193
- package/templates/tower-defense/src/render/environmentSnapshot.ts +0 -53
|
@@ -48,10 +48,10 @@ export interface IBacklightControls {
|
|
|
48
48
|
const graphs = new WeakMap<IBacklightControls, ReturnType<typeof createGraph>>();
|
|
49
49
|
|
|
50
50
|
/**
|
|
51
|
-
*
|
|
52
|
-
*
|
|
53
|
-
*
|
|
54
|
-
*
|
|
51
|
+
* The game's material, wrapped in a node twin that adds the backlit sheen it was given.
|
|
52
|
+
*
|
|
53
|
+
* @situation give a material a launcher's glow without editing its colour, texture or roughness
|
|
54
|
+
* @constraint every colour, gain and angular size is the caller's; this copies the game's material and adds light
|
|
55
55
|
*/
|
|
56
56
|
export function backlightMaterial(source: MeshStandardMaterial, controls: IBacklightControls) {
|
|
57
57
|
if (
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
// It still breathes. `settle` eases the framing in over the opening drop, and `nudge` lets the
|
|
8
8
|
// shot drift a fraction of a metre toward the warden so the picture is not completely static.
|
|
9
9
|
import type { PerspectiveCamera, Vector3 } from "three";
|
|
10
|
-
import { Vector3 as Vec3 } from "three";
|
|
10
|
+
import { MathUtils, Vector3 as Vec3 } from "three";
|
|
11
11
|
|
|
12
12
|
export const VAULT_SHOT = {
|
|
13
13
|
fov: 31,
|
|
@@ -64,7 +64,7 @@ export function createVaultCamera(camera: PerspectiveCamera): IVaultCamera {
|
|
|
64
64
|
desired.copy(VAULT_SHOT.position).add(aim);
|
|
65
65
|
// 1 - e^(-dt/tau) is the framerate-independent form of a lerp: the same second of drift at
|
|
66
66
|
// 30 fps and at 120 fps ends in the same place.
|
|
67
|
-
camera.position.lerp(desired, 1
|
|
67
|
+
camera.position.lerp(desired, MathUtils.damp(0, 1, 1 / 0.9, dt));
|
|
68
68
|
camera.lookAt(currentAim);
|
|
69
69
|
};
|
|
70
70
|
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
// Generated for you. Scene-owned material assignments; no engine appearance hooks.
|
|
2
|
-
import type { Camera, DirectionalLight, Object3D, Scene, Texture } from "three";
|
|
3
|
-
import type { IBacklightControls } from "./backlightMaterial.js";
|
|
4
1
|
import {
|
|
5
2
|
type IEnvironmentMeasurement,
|
|
6
3
|
measureEnvironment,
|
|
7
4
|
reportEnvironmentContribution,
|
|
8
|
-
} from "
|
|
5
|
+
} from "@threenative/core/render/environment";
|
|
9
6
|
import {
|
|
10
7
|
type IEnvironmentSourceSnapshot,
|
|
11
8
|
captureEnvironmentSnapshot,
|
|
12
9
|
environmentSnapshotCurrent,
|
|
13
|
-
} from "
|
|
10
|
+
} from "@threenative/core/render/environment";
|
|
11
|
+
// Generated for you. Scene-owned material assignments; no engine appearance hooks.
|
|
12
|
+
import type { Camera, DirectionalLight, Object3D, Scene, Texture } from "three";
|
|
13
|
+
import type { IBacklightControls } from "./backlightMaterial.js";
|
|
14
14
|
import { type ILightingConvention, createLightingConvention } from "./lighting.js";
|
|
15
15
|
import { createMaterialAssignments } from "./materialAssignments.js";
|
|
16
16
|
import { type IMaterialLightingEnvironment, materialLightingEnabled } from "./quality.js";
|
|
@@ -27,7 +27,6 @@ import {
|
|
|
27
27
|
} from "@threenative/core";
|
|
28
28
|
import { exposureSettings } from "./exposure.js";
|
|
29
29
|
export type { QualityTier } from "@threenative/core";
|
|
30
|
-
import type { QualityTier } from "@threenative/core";
|
|
31
30
|
|
|
32
31
|
/**
|
|
33
32
|
* The three names this game's look comes in.
|
|
@@ -80,34 +79,10 @@ export function qualityPreset(tier: string): IWorldEnvironmentOptions {
|
|
|
80
79
|
}
|
|
81
80
|
|
|
82
81
|
/** First admitted material lane: high desktop hardware WebGPU in the browser only. */
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
}
|
|
90
|
-
export function materialLightingEnabled(
|
|
91
|
-
tier: QualityTier,
|
|
92
|
-
environment: IMaterialLightingEnvironment,
|
|
93
|
-
): boolean {
|
|
94
|
-
return (
|
|
95
|
-
tier === "high" &&
|
|
96
|
-
environment.web &&
|
|
97
|
-
environment.rendererKind === "webgpu" &&
|
|
98
|
-
environment.mobile !== true &&
|
|
99
|
-
environment.software !== true &&
|
|
100
|
-
environment.webglFallback !== true
|
|
101
|
-
);
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
/** A WebGPURenderer wrapper may run an ordinary WebGL fallback backend. */
|
|
105
|
-
export function isWebGLFallbackRenderer(renderer: unknown): boolean {
|
|
106
|
-
if (renderer === null || typeof renderer !== "object") return false;
|
|
107
|
-
const backend = Reflect.get(renderer, "backend");
|
|
108
|
-
return (
|
|
109
|
-
backend !== null &&
|
|
110
|
-
typeof backend === "object" &&
|
|
111
|
-
Reflect.get(backend, "isWebGLBackend") === true
|
|
112
|
-
);
|
|
113
|
-
}
|
|
82
|
+
// The material lane's admission rule and the WebGL-fallback probe are the engine's: twelve kits
|
|
83
|
+
// held a copy each, so a fix to one left eleven admitting what it refused.
|
|
84
|
+
export {
|
|
85
|
+
type IMaterialLightingEnvironment,
|
|
86
|
+
isWebGLFallbackRenderer,
|
|
87
|
+
materialLightingEnabled,
|
|
88
|
+
} from "@threenative/core/render/environment";
|
|
@@ -14,6 +14,9 @@ import { palette } from "./palette.js";
|
|
|
14
14
|
const MOVE_RADIUS = 72;
|
|
15
15
|
const EDGE = 36;
|
|
16
16
|
|
|
17
|
+
/** The knob's next point: `update` runs every frame, so it uses one instance. */
|
|
18
|
+
const knobPosition = new Vector2();
|
|
19
|
+
|
|
17
20
|
export interface ITouchPointer {
|
|
18
21
|
readonly position: Vector2;
|
|
19
22
|
}
|
|
@@ -101,13 +104,11 @@ export class TouchControls {
|
|
|
101
104
|
}
|
|
102
105
|
|
|
103
106
|
const center = this.#hasMoveAnchor ? this.#moveAnchor : this.#resting;
|
|
104
|
-
|
|
105
|
-
this.#
|
|
106
|
-
|
|
107
|
-
center.x + this.#input.move.x * MOVE_RADIUS,
|
|
108
|
-
center.y - this.#input.move.y * MOVE_RADIUS,
|
|
109
|
-
),
|
|
107
|
+
knobPosition.set(
|
|
108
|
+
center.x + this.#input.move.x * MOVE_RADIUS,
|
|
109
|
+
center.y - this.#input.move.y * MOVE_RADIUS,
|
|
110
110
|
);
|
|
111
|
+
place(this.#moveKnob, knobPosition);
|
|
111
112
|
this.#layout(size);
|
|
112
113
|
return this.#input;
|
|
113
114
|
}
|
|
@@ -7,6 +7,7 @@ import {
|
|
|
7
7
|
isMobile,
|
|
8
8
|
isTouchscreenAvailable,
|
|
9
9
|
} from "@threenative/core";
|
|
10
|
+
import { type IEnvironmentSample, sampleEnvironment } from "@threenative/core/render/environment";
|
|
10
11
|
import { CollisionShape3D, type IPhysicsContext, RigidBody3D } from "@threenative/physics";
|
|
11
12
|
import {
|
|
12
13
|
BufferAttribute,
|
|
@@ -23,7 +24,6 @@ import { Seal } from "../entities/Seal.js";
|
|
|
23
24
|
import { WARDEN_SPAWN, Warden } from "../entities/Warden.js";
|
|
24
25
|
import { createVaultCamera } from "../render/camera.js";
|
|
25
26
|
import { CRATE_SIZE } from "../render/crateShape.js";
|
|
26
|
-
import { type IEnvironmentSample, sampleEnvironment } from "../render/environmentSampling.js";
|
|
27
27
|
import { setupLighting } from "../render/lighting.js";
|
|
28
28
|
import { createLoadingScreen } from "../render/loading.js";
|
|
29
29
|
import { createMaterialLighting } from "../render/materialLighting.js";
|
|
@@ -2,6 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
@source "../index.html";
|
|
4
4
|
@source "./";
|
|
5
|
+
/* `src/render/` is shader and material source: a word in its comments ("blur", "filter",
|
|
6
|
+
"table") became a real utility rule, which is what made a clean HUD look like a native-css
|
|
7
|
+
profile failure. Tailwind scans what it is told to scan. */
|
|
8
|
+
@source not "./render";
|
|
5
9
|
|
|
6
10
|
@theme {
|
|
7
11
|
--color-ink: #0a0e16;
|
|
@@ -2,6 +2,7 @@ import tailwindcss from "@tailwindcss/vite";
|
|
|
2
2
|
import { watchAssets } from "@threenative/assets";
|
|
3
3
|
import react from "@vitejs/plugin-react";
|
|
4
4
|
import {
|
|
5
|
+
createEngineCatalogPlugin,
|
|
5
6
|
createEngineFreshnessPlugin,
|
|
6
7
|
createWebBrandPlugin,
|
|
7
8
|
webRuntimeDecoders,
|
|
@@ -36,6 +37,7 @@ export default defineConfig({
|
|
|
36
37
|
plugins: [
|
|
37
38
|
createEngineFreshnessPlugin(),
|
|
38
39
|
createWebBrandPlugin(),
|
|
40
|
+
createEngineCatalogPlugin(),
|
|
39
41
|
react(),
|
|
40
42
|
tailwindcss(),
|
|
41
43
|
assetsWatchPlugin(),
|
|
@@ -11,7 +11,7 @@ Detail for each step: `threenative-capabilities` skill. Do the steps in order. A
|
|
|
11
11
|
|
|
12
12
|
1. **Kit** (new game only): `engine_search_capabilities {situation: "<the whole request>", scope: "request"}` returns the matching starter kit first. This folder is already a kit.
|
|
13
13
|
2. **Mechanics**: per mechanic, `engine_search_references {situation}`, then `engine_reference_detail` on each hit for pinned constants and feel. To see a mechanic move, `engine_watch_reference {query: "<game> <mechanic>"}` returns a contact sheet of real gameplay. Borrow mechanics only: no code, level layouts, character names or art. Cite `file:line`.
|
|
14
|
-
3. **Built-ins**: per mechanic, system or symptom, `engine_search_capabilities {situation, scope: "mechanic"}
|
|
14
|
+
3. **Built-ins**: per mechanic, system or symptom, `engine_search_capabilities {situation, scope: "mechanic"}`; rows answer; `engine_capability_detail` only for omitted symbols. Constraints are binding. `verdict: "none"` means the game writes it in `src/`.
|
|
15
15
|
4. **Plan** (new game, or a change to several systems): `prd-creator` with the kit, references and built-ins. With a user, wait for explicit approval, then implement. With no user (`claude -p`, a script), record the plan and assumptions, then continue.
|
|
16
16
|
5. **Assets**: `asset_search_sources`, the source's search tool, then `asset_download_file`; record source and licence in `CREDITS.md`. Nothing fits: `sculpt_plan`. A rigged GLB: `animation_inspect` (`threenative-assets` skill).
|
|
17
17
|
6. **Build**: gameplay in `src/`, look in `src/render/` (`threenative-context` and `threenative-ui` skills). For parallel work, give each subagent one area and its files, then integrate.
|
|
@@ -30,15 +30,15 @@ A change to an existing game repeats steps 2-3 for that change, then steps 5-8.
|
|
|
30
30
|
- `threenative-assets`: a texture, HDRI, sound or model. `asset_search_sources`, `asset_download_file`, `audio_search_assets`, `mesh_optimize`.
|
|
31
31
|
- `threenative-sculpt`: a bespoke mesh or character from a reference image. `sculpt_plan`, `sculpt_spec_gate`, `sculpt_compare`, `sculpt_pass_gate`.
|
|
32
32
|
- `threenative-animation`: a rigged GLB with a held prop, foot slide or loop seam. `animation_inspect`, `animation_attach`, `animation_verify`.
|
|
33
|
-
- `threenative-terrain`:
|
|
33
|
+
- `threenative-terrain`: any terrain, from words. `terrain_generate`.
|
|
34
34
|
- `threenative-devtools`: after `npx @threenative/playtest trace` names no cause. `performance_start_trace`, `performance_analyze_insight`.
|
|
35
35
|
<!-- /shared -->
|
|
36
36
|
|
|
37
37
|
## This kit
|
|
38
38
|
|
|
39
39
|
<!-- shared: kit-files -->
|
|
40
|
-
Source in `src/`: `conventions.ts`, `entities/`, `game.ts`, `kart/`, `main.ts`, `playtest-events.ts`, `render/`, `scenes/`, `state.ts`, `track/`, `ui/`.
|
|
41
|
-
|
|
40
|
+
Source in `src/`: `audio/`, `conventions.ts`, `entities/`, `game.ts`, `gauges.ts`, `kart/`, `main.ts`, `playtest-events.ts`, `render/`, `scenes/`, `state.ts`, `track/`, `ui/`.
|
|
41
|
+
17 scenarios in `playtests/`; `playtests/survives.playtest.json` is the smoke proof.
|
|
42
42
|
Exposure policy: `src/render/exposure.ts` (`node_modules/create-threenative/agent-docs/references/auto-exposure.md`).
|
|
43
43
|
Kit notes: `node_modules/create-threenative/agent-docs/references/kit-racing.md`.
|
|
44
44
|
<!-- /shared -->
|
|
@@ -55,6 +55,7 @@ pnpm test # typecheck, lint, format, then every playtest
|
|
|
55
55
|
pnpm build --target desktop # also: web, android, ios
|
|
56
56
|
pnpm test:native # native proof
|
|
57
57
|
npx threenative doctor # build, import, device or blank-frame failure
|
|
58
|
+
npx threenative doctor --fix # refresh agent files
|
|
58
59
|
```
|
|
59
60
|
<!-- /shared -->
|
|
60
61
|
|
|
@@ -64,6 +65,7 @@ npx threenative doctor # build, import, device or blank-frame failure
|
|
|
64
65
|
Each is on by default with a named override. Detail: `node_modules/create-threenative/agent-docs/references/conventions.md#<id>`.
|
|
65
66
|
|
|
66
67
|
- **Look** `#look`: filmic curve, metered auto exposure. Override: `tonemapMode: "aces"`; `autoExposureEnabled: false` + `exposure`. Marker: `TN_WORLD_ENVIRONMENT`.
|
|
68
|
+
- **Ambient occlusion** `#ao-indirect`: darkens indirect light only, not the sun. Override: `gtaoIndirectOnly: false`; `gtaoEnabled: false`. Marker: `TN_WORLD_ENVIRONMENT`.
|
|
67
69
|
- **Quality tier (`src/render/quality.ts`)** `#quality`: GPU class picks `high`, `medium` or `low`. Override: `setupPost(..., { tier: "low" })`. Marker: `TN_QUALITY_TIER`.
|
|
68
70
|
- **Resolution scale** `#resolution`: `"auto"`, 0.85 on mobile-low. Override: numeric `resolutionScale`. Marker: `TN_FRAME_BUDGET`.
|
|
69
71
|
- **Budget real time for the look** `#frame-budget`: frame meter and scene verdict on. Override: `frameBudget: false`. Marker: `TN_FRAME_BUDGET`, `TN_SCENE_WARNING`.
|
|
@@ -88,12 +90,15 @@ Each is on by default with a named override. Detail: `node_modules/create-threen
|
|
|
88
90
|
- **Frame spans** `#spans`: off. Override: `TN_FRAME_SPANS=1`. Marker: `TN_FRAME_SPANS`.
|
|
89
91
|
- **Multiplayer** `#net`: none; unsupported transport rejects. Override: `connect` from `@threenative/core/net` with four limits. Marker: `TN_NET_UNAVAILABLE`.
|
|
90
92
|
- **Desktop window** `#desktop-mode`: CLI, then `display.fullscreen`, then `window.maximized`. Override: `--windowed`; `--maximized`; `--fullscreen`.
|
|
93
|
+
- **CPU priority** `#cpu-priority`: game threads first. Override: `display.priority: "normal"`. Marker: `TN_PROCESS_PRIORITY`.
|
|
91
94
|
- **Terrain** `#terrain`: authored in the game. Override: optional `@threenative/terrain`; `references/terrain-authoring.md`.
|
|
92
95
|
- **Navigation** `#navigation`: none; browser-only WASM. Override: import `@threenative/physics/navigation` on purpose.
|
|
96
|
+
- **Controller** `#gamepad`: W3C standard mapping on every pad, radial dead zone `0.2`, and a button press or a decisive stick move claims which pad is read. Override: `gamepadDeadZone: 0` for raw axes. Marker: `TN_GAMEPAD`.
|
|
93
97
|
- **Move input** `#move-axis`: `input.vector("move").y` is +up. Override: one explicit `-move.y` conversion.
|
|
94
98
|
- **Scene change** `#scene-change`: `ctx.goto(name)` keeps state. Override: `game.goto(name)` resets state.
|
|
95
99
|
- **Randomness** `#seed`: unseeded. Override: `defineGame({ seed })`.
|
|
96
100
|
- **Engine** `#engine`: owned C++ engine. Override: `engine: "threejs"` only when the user asks. Marker: `TN_NATIVE_ENGINE_UNBOUND`.
|
|
101
|
+
- **Refused imports** `#engine-catalog`: refused `three` imports fail at their line. Override: `createEngineCatalogPlugin({ mode: "warn" })`. Marker: `TN_ENGINE_CATALOG`.
|
|
97
102
|
<!-- /shared -->
|
|
98
103
|
|
|
99
104
|
<!-- shared: kit-stuck -->
|
|
@@ -13,7 +13,7 @@ Detail for each step: `threenative-capabilities` skill. Do the steps in order. A
|
|
|
13
13
|
|
|
14
14
|
1. **Kit** (new game only): `engine_search_capabilities {situation: "<the whole request>", scope: "request"}` returns the matching starter kit first. This folder is already a kit.
|
|
15
15
|
2. **Mechanics**: per mechanic, `engine_search_references {situation}`, then `engine_reference_detail` on each hit for pinned constants and feel. To see a mechanic move, `engine_watch_reference {query: "<game> <mechanic>"}` returns a contact sheet of real gameplay. Borrow mechanics only: no code, level layouts, character names or art. Cite `file:line`.
|
|
16
|
-
3. **Built-ins**: per mechanic, system or symptom, `engine_search_capabilities {situation, scope: "mechanic"}
|
|
16
|
+
3. **Built-ins**: per mechanic, system or symptom, `engine_search_capabilities {situation, scope: "mechanic"}`; rows answer; `engine_capability_detail` only for omitted symbols. Constraints are binding. `verdict: "none"` means the game writes it in `src/`.
|
|
17
17
|
4. **Plan** (new game, or a change to several systems): `prd-creator` with the kit, references and built-ins. With a user, wait for explicit approval, then implement. With no user (`claude -p`, a script), record the plan and assumptions, then continue.
|
|
18
18
|
5. **Assets**: `asset_search_sources`, the source's search tool, then `asset_download_file`; record source and licence in `CREDITS.md`. Nothing fits: `sculpt_plan`. A rigged GLB: `animation_inspect` (`threenative-assets` skill).
|
|
19
19
|
6. **Build**: gameplay in `src/`, look in `src/render/` (`threenative-context` and `threenative-ui` skills). For parallel work, give each subagent one area and its files, then integrate.
|
|
@@ -32,15 +32,15 @@ A change to an existing game repeats steps 2-3 for that change, then steps 5-8.
|
|
|
32
32
|
- `threenative-assets`: a texture, HDRI, sound or model. `asset_search_sources`, `asset_download_file`, `audio_search_assets`, `mesh_optimize`.
|
|
33
33
|
- `threenative-sculpt`: a bespoke mesh or character from a reference image. `sculpt_plan`, `sculpt_spec_gate`, `sculpt_compare`, `sculpt_pass_gate`.
|
|
34
34
|
- `threenative-animation`: a rigged GLB with a held prop, foot slide or loop seam. `animation_inspect`, `animation_attach`, `animation_verify`.
|
|
35
|
-
- `threenative-terrain`:
|
|
35
|
+
- `threenative-terrain`: any terrain, from words. `terrain_generate`.
|
|
36
36
|
- `threenative-devtools`: after `npx @threenative/playtest trace` names no cause. `performance_start_trace`, `performance_analyze_insight`.
|
|
37
37
|
<!-- /shared -->
|
|
38
38
|
|
|
39
39
|
## This kit
|
|
40
40
|
|
|
41
41
|
<!-- shared: kit-files -->
|
|
42
|
-
Source in `src/`: `conventions.ts`, `entities/`, `game.ts`, `kart/`, `main.ts`, `playtest-events.ts`, `render/`, `scenes/`, `state.ts`, `track/`, `ui/`.
|
|
43
|
-
|
|
42
|
+
Source in `src/`: `audio/`, `conventions.ts`, `entities/`, `game.ts`, `gauges.ts`, `kart/`, `main.ts`, `playtest-events.ts`, `render/`, `scenes/`, `state.ts`, `track/`, `ui/`.
|
|
43
|
+
17 scenarios in `playtests/`; `playtests/survives.playtest.json` is the smoke proof.
|
|
44
44
|
Exposure policy: `src/render/exposure.ts` (`node_modules/create-threenative/agent-docs/references/auto-exposure.md`).
|
|
45
45
|
Kit notes: `node_modules/create-threenative/agent-docs/references/kit-racing.md`.
|
|
46
46
|
<!-- /shared -->
|
|
@@ -57,6 +57,7 @@ pnpm test # typecheck, lint, format, then every playtest
|
|
|
57
57
|
pnpm build --target desktop # also: web, android, ios
|
|
58
58
|
pnpm test:native # native proof
|
|
59
59
|
npx threenative doctor # build, import, device or blank-frame failure
|
|
60
|
+
npx threenative doctor --fix # refresh agent files
|
|
60
61
|
```
|
|
61
62
|
<!-- /shared -->
|
|
62
63
|
|
|
@@ -66,6 +67,7 @@ npx threenative doctor # build, import, device or blank-frame failure
|
|
|
66
67
|
Each is on by default with a named override. Detail: `node_modules/create-threenative/agent-docs/references/conventions.md#<id>`.
|
|
67
68
|
|
|
68
69
|
- **Look** `#look`: filmic curve, metered auto exposure. Override: `tonemapMode: "aces"`; `autoExposureEnabled: false` + `exposure`. Marker: `TN_WORLD_ENVIRONMENT`.
|
|
70
|
+
- **Ambient occlusion** `#ao-indirect`: darkens indirect light only, not the sun. Override: `gtaoIndirectOnly: false`; `gtaoEnabled: false`. Marker: `TN_WORLD_ENVIRONMENT`.
|
|
69
71
|
- **Quality tier (`src/render/quality.ts`)** `#quality`: GPU class picks `high`, `medium` or `low`. Override: `setupPost(..., { tier: "low" })`. Marker: `TN_QUALITY_TIER`.
|
|
70
72
|
- **Resolution scale** `#resolution`: `"auto"`, 0.85 on mobile-low. Override: numeric `resolutionScale`. Marker: `TN_FRAME_BUDGET`.
|
|
71
73
|
- **Budget real time for the look** `#frame-budget`: frame meter and scene verdict on. Override: `frameBudget: false`. Marker: `TN_FRAME_BUDGET`, `TN_SCENE_WARNING`.
|
|
@@ -90,12 +92,15 @@ Each is on by default with a named override. Detail: `node_modules/create-threen
|
|
|
90
92
|
- **Frame spans** `#spans`: off. Override: `TN_FRAME_SPANS=1`. Marker: `TN_FRAME_SPANS`.
|
|
91
93
|
- **Multiplayer** `#net`: none; unsupported transport rejects. Override: `connect` from `@threenative/core/net` with four limits. Marker: `TN_NET_UNAVAILABLE`.
|
|
92
94
|
- **Desktop window** `#desktop-mode`: CLI, then `display.fullscreen`, then `window.maximized`. Override: `--windowed`; `--maximized`; `--fullscreen`.
|
|
95
|
+
- **CPU priority** `#cpu-priority`: game threads first. Override: `display.priority: "normal"`. Marker: `TN_PROCESS_PRIORITY`.
|
|
93
96
|
- **Terrain** `#terrain`: authored in the game. Override: optional `@threenative/terrain`; `references/terrain-authoring.md`.
|
|
94
97
|
- **Navigation** `#navigation`: none; browser-only WASM. Override: import `@threenative/physics/navigation` on purpose.
|
|
98
|
+
- **Controller** `#gamepad`: W3C standard mapping on every pad, radial dead zone `0.2`, and a button press or a decisive stick move claims which pad is read. Override: `gamepadDeadZone: 0` for raw axes. Marker: `TN_GAMEPAD`.
|
|
95
99
|
- **Move input** `#move-axis`: `input.vector("move").y` is +up. Override: one explicit `-move.y` conversion.
|
|
96
100
|
- **Scene change** `#scene-change`: `ctx.goto(name)` keeps state. Override: `game.goto(name)` resets state.
|
|
97
101
|
- **Randomness** `#seed`: unseeded. Override: `defineGame({ seed })`.
|
|
98
102
|
- **Engine** `#engine`: owned C++ engine. Override: `engine: "threejs"` only when the user asks. Marker: `TN_NATIVE_ENGINE_UNBOUND`.
|
|
103
|
+
- **Refused imports** `#engine-catalog`: refused `three` imports fail at their line. Override: `createEngineCatalogPlugin({ mode: "warn" })`. Marker: `TN_ENGINE_CATALOG`.
|
|
99
104
|
<!-- /shared -->
|
|
100
105
|
|
|
101
106
|
<!-- shared: kit-stuck -->
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# Credits
|
|
2
|
+
|
|
3
|
+
## Audio
|
|
4
|
+
|
|
5
|
+
Every clip in `assets/` is **generated by this project's own tool**, `tools/make-racing-audio.mjs`,
|
|
6
|
+
from the maths in that file. They are original works of this repository under its MIT licence —
|
|
7
|
+
there is no third-party recording in them, and nothing to attribute.
|
|
8
|
+
|
|
9
|
+
| File | Made by | Licence | Source |
|
|
10
|
+
| --- | --- | --- | --- |
|
|
11
|
+
| `assets/engine-loop.wav` | `node tools/make-racing-audio.mjs` | MIT (this repository) | none — synthesised |
|
|
12
|
+
| `assets/tyre-squeal.wav` | `node tools/make-racing-audio.mjs` | MIT (this repository) | none — synthesised |
|
|
13
|
+
| `assets/nitro-burst.wav` | `node tools/make-racing-audio.mjs` | MIT (this repository) | none — synthesised |
|
|
14
|
+
|
|
15
|
+
Why not a downloaded clip: the audio catalogue the asset tools reach was searched for an engine, a
|
|
16
|
+
tyre and a boost (`audio_search_assets`). It returns seven items — two Kenney packs, "Interface
|
|
17
|
+
Sounds" and "Music Jingles", both CC0, and the five Sonniss GDC 2026 bundles, whose stated licence
|
|
18
|
+
is the "Sonniss GDC Game Audio Bundle License" and whose download is one multi-gigabyte archive per
|
|
19
|
+
part. None of them is an engine bed, a tyre squeal or a nitro burst.
|
|
20
|
+
|
|
21
|
+
An engine bed also cannot be a recording here, for a second reason: it is pitched live from 0.62×
|
|
22
|
+
to 2.05× (`src/audio/engine.ts`), so the loop has to be tonal and exactly periodic, and a recording
|
|
23
|
+
of a real engine is neither. `tools/make-racing-audio.mjs` builds the seam in — every frequency is a
|
|
24
|
+
whole number of cycles per loop — and the bake proves it before it writes a byte.
|
|
25
|
+
|
|
26
|
+
Swap any file for a recording without touching the game: the paths are named in `ENGINE_SOUND.clips`
|
|
27
|
+
and the levels in the same object. If you do, add the recording's source, licence and URL to this
|
|
28
|
+
file, and keep `loop: true` for the two beds in `threenative.config.ts` so the audio pass keeps
|
|
29
|
+
checking the join.
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -19,9 +19,9 @@
|
|
|
19
19
|
"format:check": "biome format src"
|
|
20
20
|
},
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"@threenative/core": "0.3.
|
|
23
|
-
"@threenative/physics": "0.3.
|
|
24
|
-
"@threenative/ui": "0.3.
|
|
22
|
+
"@threenative/core": ">=0.3.15",
|
|
23
|
+
"@threenative/physics": ">=0.3.15",
|
|
24
|
+
"@threenative/ui": ">=0.3.15",
|
|
25
25
|
"react": "19.2.0",
|
|
26
26
|
"react-dom": "19.2.0",
|
|
27
27
|
"three": "0.187.0"
|
|
@@ -29,13 +29,13 @@
|
|
|
29
29
|
"devDependencies": {
|
|
30
30
|
"@gltf-transform/cli": "4.4.2",
|
|
31
31
|
"@tailwindcss/vite": "4.3.3",
|
|
32
|
-
"@threenative/assets": "0.3.
|
|
33
|
-
"@threenative/playtest": "0.3.
|
|
32
|
+
"@threenative/assets": ">=0.3.16",
|
|
33
|
+
"@threenative/playtest": ">=0.3.15",
|
|
34
34
|
"@types/react": "19.2.0",
|
|
35
35
|
"@types/react-dom": "19.2.0",
|
|
36
36
|
"@types/three": "0.187.0",
|
|
37
37
|
"@vitejs/plugin-react": "6.0.5",
|
|
38
|
-
"create-threenative": "0.2.
|
|
38
|
+
"create-threenative": "0.2.20",
|
|
39
39
|
"esbuild": "0.27.0",
|
|
40
40
|
"playwright": "1.62.1",
|
|
41
41
|
"tailwindcss": "4.3.3",
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
"eslint": "10.13.0"
|
|
46
46
|
},
|
|
47
47
|
"optionalDependencies": {
|
|
48
|
-
"@threenative/runtime-native": "0.3.
|
|
48
|
+
"@threenative/runtime-native": ">=0.3.15"
|
|
49
49
|
},
|
|
50
50
|
"overrides": {
|
|
51
51
|
"sharp": ">=0.35.4",
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "drift-natural",
|
|
3
|
+
"target": "web",
|
|
4
|
+
"schemaVersion": 1,
|
|
5
|
+
"viewport": {
|
|
6
|
+
"width": 1280,
|
|
7
|
+
"height": 720
|
|
8
|
+
},
|
|
9
|
+
"warmupFrames": 10,
|
|
10
|
+
"subject": "player",
|
|
11
|
+
"steps": [
|
|
12
|
+
{
|
|
13
|
+
"kind": "input",
|
|
14
|
+
"label": "straight",
|
|
15
|
+
"press": ["ArrowUp"],
|
|
16
|
+
"holdTicks": 240,
|
|
17
|
+
"release": false
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
"kind": "input",
|
|
21
|
+
"label": "full-lock",
|
|
22
|
+
"press": ["ArrowUp", "ArrowRight"],
|
|
23
|
+
"holdTicks": 30,
|
|
24
|
+
"release": false
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
"kind": "input",
|
|
28
|
+
"label": "catch",
|
|
29
|
+
"press": ["ArrowUp", "ArrowLeft"],
|
|
30
|
+
"holdTicks": 14,
|
|
31
|
+
"release": false
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
"kind": "input",
|
|
35
|
+
"label": "straighten",
|
|
36
|
+
"press": ["ArrowUp"],
|
|
37
|
+
"holdTicks": 60,
|
|
38
|
+
"release": true
|
|
39
|
+
}
|
|
40
|
+
],
|
|
41
|
+
"assert": {
|
|
42
|
+
"diagnostics": {
|
|
43
|
+
"noConsoleErrors": true,
|
|
44
|
+
"runtimeReady": true
|
|
45
|
+
},
|
|
46
|
+
"resources": [
|
|
47
|
+
{
|
|
48
|
+
"id": "state",
|
|
49
|
+
"path": "driftsBanked",
|
|
50
|
+
"gte": 1,
|
|
51
|
+
"changed": true
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
"id": "state",
|
|
55
|
+
"path": "driftSpins",
|
|
56
|
+
"equals": 0,
|
|
57
|
+
"allowTrivial": "A spin is the failure this scenario looks for; zero is the held invariant while the banked drift above proves the tail let go with no handbrake."
|
|
58
|
+
}
|
|
59
|
+
],
|
|
60
|
+
"components": [
|
|
61
|
+
{
|
|
62
|
+
"entity": "effects",
|
|
63
|
+
"component": "skidMarks",
|
|
64
|
+
"gte": 5
|
|
65
|
+
}
|
|
66
|
+
]
|
|
67
|
+
}
|
|
68
|
+
}
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "drift",
|
|
3
|
+
"target": "web",
|
|
4
|
+
"schemaVersion": 1,
|
|
5
|
+
"viewport": {
|
|
6
|
+
"width": 1280,
|
|
7
|
+
"height": 720
|
|
8
|
+
},
|
|
9
|
+
"warmupFrames": 10,
|
|
10
|
+
"subject": "player",
|
|
11
|
+
"steps": [
|
|
12
|
+
{
|
|
13
|
+
"kind": "input",
|
|
14
|
+
"label": "straight",
|
|
15
|
+
"press": ["ArrowUp"],
|
|
16
|
+
"holdTicks": 170,
|
|
17
|
+
"release": false
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
"kind": "input",
|
|
21
|
+
"label": "kick",
|
|
22
|
+
"press": ["ArrowUp", "ArrowRight", "ShiftLeft"],
|
|
23
|
+
"holdTicks": 8,
|
|
24
|
+
"release": false
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
"kind": "input",
|
|
28
|
+
"label": "hold",
|
|
29
|
+
"press": ["ArrowUp", "ArrowRight"],
|
|
30
|
+
"holdTicks": 22,
|
|
31
|
+
"release": false
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
"kind": "input",
|
|
35
|
+
"label": "catch",
|
|
36
|
+
"press": ["ArrowUp", "ArrowLeft"],
|
|
37
|
+
"holdTicks": 14,
|
|
38
|
+
"release": false
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
"kind": "input",
|
|
42
|
+
"label": "straighten",
|
|
43
|
+
"press": ["ArrowUp"],
|
|
44
|
+
"holdTicks": 60,
|
|
45
|
+
"release": true
|
|
46
|
+
}
|
|
47
|
+
],
|
|
48
|
+
"assert": {
|
|
49
|
+
"diagnostics": {
|
|
50
|
+
"noConsoleErrors": true,
|
|
51
|
+
"runtimeReady": true
|
|
52
|
+
},
|
|
53
|
+
"resources": [
|
|
54
|
+
{
|
|
55
|
+
"id": "state",
|
|
56
|
+
"path": "driftsBanked",
|
|
57
|
+
"gte": 1,
|
|
58
|
+
"changed": true
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
"id": "state",
|
|
62
|
+
"path": "driftSpins",
|
|
63
|
+
"equals": 0,
|
|
64
|
+
"allowTrivial": "A spin is the failure this scenario looks for; zero is the held invariant while the banked drift above proves the slide happened."
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
"id": "state",
|
|
68
|
+
"path": "drifting",
|
|
69
|
+
"atSteps": [
|
|
70
|
+
{
|
|
71
|
+
"label": "straight",
|
|
72
|
+
"equals": false
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
"label": "hold",
|
|
76
|
+
"equals": true
|
|
77
|
+
}
|
|
78
|
+
]
|
|
79
|
+
}
|
|
80
|
+
],
|
|
81
|
+
"components": [
|
|
82
|
+
{
|
|
83
|
+
"entity": "effects",
|
|
84
|
+
"component": "skidMarks",
|
|
85
|
+
"gte": 5,
|
|
86
|
+
"atSteps": [
|
|
87
|
+
{
|
|
88
|
+
"label": "straight",
|
|
89
|
+
"equals": 0
|
|
90
|
+
}
|
|
91
|
+
]
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
"entity": "effects",
|
|
95
|
+
"component": "smokeTicks",
|
|
96
|
+
"gte": 5
|
|
97
|
+
}
|
|
98
|
+
]
|
|
99
|
+
}
|
|
100
|
+
}
|