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
|
@@ -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,7 +32,7 @@ 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
|
|
|
@@ -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 studio # open the game in Studio
|
|
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`.
|
|
@@ -87,12 +89,15 @@ Each is on by default with a named override. Detail: `node_modules/create-threen
|
|
|
87
89
|
- **Frame spans** `#spans`: off. Override: `TN_FRAME_SPANS=1`. Marker: `TN_FRAME_SPANS`.
|
|
88
90
|
- **Multiplayer** `#net`: none; unsupported transport rejects. Override: `connect` from `@threenative/core/net` with four limits. Marker: `TN_NET_UNAVAILABLE`.
|
|
89
91
|
- **Desktop window** `#desktop-mode`: CLI, then `display.fullscreen`, then `window.maximized`. Override: `--windowed`; `--maximized`; `--fullscreen`.
|
|
92
|
+
- **CPU priority** `#cpu-priority`: game threads first. Override: `display.priority: "normal"`. Marker: `TN_PROCESS_PRIORITY`.
|
|
90
93
|
- **Terrain** `#terrain`: authored in the game. Override: optional `@threenative/terrain`; `references/terrain-authoring.md`.
|
|
91
94
|
- **Navigation** `#navigation`: none; browser-only WASM. Override: import `@threenative/physics/navigation` on purpose.
|
|
95
|
+
- **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`.
|
|
92
96
|
- **Move input** `#move-axis`: `input.vector("move").y` is +up. Override: one explicit `-move.y` conversion.
|
|
93
97
|
- **Scene change** `#scene-change`: `ctx.goto(name)` keeps state. Override: `game.goto(name)` resets state.
|
|
94
98
|
- **Randomness** `#seed`: unseeded. Override: `defineGame({ seed })`.
|
|
95
99
|
- **Engine** `#engine`: owned C++ engine. Override: `engine: "threejs"` only when the user asks. Marker: `TN_NATIVE_ENGINE_UNBOUND`.
|
|
100
|
+
- **Refused imports** `#engine-catalog`: refused `three` imports fail at their line. Override: `createEngineCatalogPlugin({ mode: "warn" })`. Marker: `TN_ENGINE_CATALOG`.
|
|
96
101
|
<!-- /shared -->
|
|
97
102
|
|
|
98
103
|
<!-- shared: kit-stuck -->
|
|
@@ -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"
|
|
@@ -30,11 +30,11 @@
|
|
|
30
30
|
"@tailwindcss/vite": "4.3.3",
|
|
31
31
|
"@vitejs/plugin-react": "6.0.5",
|
|
32
32
|
"@types/three": "0.187.0",
|
|
33
|
-
"@threenative/assets": "0.3.
|
|
34
|
-
"@threenative/playtest": "0.3.
|
|
33
|
+
"@threenative/assets": ">=0.3.16",
|
|
34
|
+
"@threenative/playtest": ">=0.3.15",
|
|
35
35
|
"@types/react": "19.2.0",
|
|
36
36
|
"@types/react-dom": "19.2.0",
|
|
37
|
-
"create-threenative": "0.2.
|
|
37
|
+
"create-threenative": "0.2.20",
|
|
38
38
|
"esbuild": "0.27.0",
|
|
39
39
|
"playwright": "1.62.1",
|
|
40
40
|
"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",
|
|
@@ -26,7 +26,7 @@ const game = defineGame<GameState, IPhysicsContext>({
|
|
|
26
26
|
},
|
|
27
27
|
plugins: [rapier({ gravity: { x: 0, y: -36, z: 0 } }), playtest({ events })],
|
|
28
28
|
display: config.display,
|
|
29
|
-
|
|
29
|
+
renderer: config.renderer,
|
|
30
30
|
scenes: { play: Play },
|
|
31
31
|
// The course is procedural; the seed makes its rocks, grass and coin wobble the same every run.
|
|
32
32
|
seed: 6402,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { WaveField } from "@threenative/core";
|
|
1
|
+
import { type IAssetLoader, WaveField, createRandom } from "@threenative/core";
|
|
2
2
|
import {
|
|
3
3
|
Box3,
|
|
4
4
|
BoxGeometry,
|
|
@@ -19,7 +19,14 @@ import {
|
|
|
19
19
|
import { HERO_FEEL } from "../entities/Hero.js";
|
|
20
20
|
import type { WalkerKind } from "../entities/Walker.js";
|
|
21
21
|
import { buildCastle, buildSignpost, planarUv, wrapUv } from "../render/castle.js";
|
|
22
|
-
import {
|
|
22
|
+
import {
|
|
23
|
+
type IMeadow,
|
|
24
|
+
type IPlantingRecord,
|
|
25
|
+
type IPlantingSite,
|
|
26
|
+
buildPlanting,
|
|
27
|
+
checkedPlanting,
|
|
28
|
+
planPlanting,
|
|
29
|
+
} from "../render/foliage.js";
|
|
23
30
|
import { farHills, paintGround } from "../render/ground.js";
|
|
24
31
|
import { mottle, patches } from "../render/materials.js";
|
|
25
32
|
import {
|
|
@@ -191,6 +198,18 @@ function auditCourse(
|
|
|
191
198
|
* A boulder `size` metres across its middle: an icosphere pushed in and out by a few seeded waves and
|
|
192
199
|
* flattened a little, smooth-shaded, so it reads as weathered rock and not as a faceted gem.
|
|
193
200
|
*/
|
|
201
|
+
/**
|
|
202
|
+
* `Math.hypot(dx, dz) < reach`, asked thousands of times by the planting: squared distances settle
|
|
203
|
+
* every case more than a millionth from the edge, and the edge itself takes the same `hypot`.
|
|
204
|
+
*/
|
|
205
|
+
function within(dx: number, dz: number, reach: number): boolean {
|
|
206
|
+
const squared = dx * dx + dz * dz;
|
|
207
|
+
const edge = reach * reach;
|
|
208
|
+
if (squared > edge * 1.000001) return false;
|
|
209
|
+
if (squared < edge * 0.999999 && reach > 0) return true;
|
|
210
|
+
return Math.hypot(dx, dz) < reach;
|
|
211
|
+
}
|
|
212
|
+
|
|
194
213
|
function boulderGeometry(size: number, rng: () => number): BufferGeometry {
|
|
195
214
|
const geometry = new IcosahedronGeometry(size, 2);
|
|
196
215
|
const position = geometry.attributes.position;
|
|
@@ -209,18 +228,33 @@ function boulderGeometry(size: number, rng: () => number): BufferGeometry {
|
|
|
209
228
|
}
|
|
210
229
|
|
|
211
230
|
export function makeRng(seed: number): () => number {
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
231
|
+
return createRandom(seed);
|
|
232
|
+
}
|
|
233
|
+
/**
|
|
234
|
+
* The island planted: drawn from `site` on a run that has nothing stored, and read back from
|
|
235
|
+
* `memo` on the next run of this build, so `buildPlanting` has the same placements either way.
|
|
236
|
+
*/
|
|
237
|
+
async function planted(
|
|
238
|
+
site: IPlantingSite,
|
|
239
|
+
memo: IAssetLoader["memo"] | undefined,
|
|
240
|
+
): Promise<{ group: Group; meadow: IMeadow }> {
|
|
241
|
+
if (memo === undefined) return buildPlanting(planPlanting(site), site);
|
|
242
|
+
const record: IPlantingRecord = await memo("planting", () => planPlanting(site));
|
|
243
|
+
// The memo hands back flat arrays either way, so a hit costs a length check, not a rebuild.
|
|
244
|
+
return buildPlanting(checkedPlanting(record), site);
|
|
217
245
|
}
|
|
218
246
|
|
|
219
247
|
/**
|
|
220
248
|
* `surfaces` are the loaded textures (`loadSurfaces` in surface.ts); `grassShare` is the share of
|
|
221
|
-
* grass tufts the quality tier draws (`GRASS_SHARE` in `quality.ts`).
|
|
249
|
+
* grass tufts the quality tier draws (`GRASS_SHARE` in `quality.ts`). `memo` keeps the planting
|
|
250
|
+
* between runs; without one every run draws it.
|
|
222
251
|
*/
|
|
223
|
-
export function buildCourse(
|
|
252
|
+
export async function buildCourse(
|
|
253
|
+
rng: () => number,
|
|
254
|
+
surfaces: ISurfaces,
|
|
255
|
+
grassShare = 1,
|
|
256
|
+
memo?: IAssetLoader["memo"],
|
|
257
|
+
): Promise<ICourse> {
|
|
224
258
|
const group = new Group();
|
|
225
259
|
group.name = "course";
|
|
226
260
|
const [doorX, doorZ] = COURSE.castle.door;
|
|
@@ -451,7 +485,7 @@ export function buildCourse(rng: () => number, surfaces: ISurfaces, grassShare =
|
|
|
451
485
|
/** Every pickup: scenery keeps a clear metre round each, so none hangs inside a tree or a rock. */
|
|
452
486
|
const pickups = [...coins, ...gems, ...Object.values(seeds)];
|
|
453
487
|
const nearPickup = (x: number, zz: number, reach: number): boolean =>
|
|
454
|
-
pickups.some(([kx, , kz]) =>
|
|
488
|
+
pickups.some(([kx, , kz]) => within(x - kx, zz - kz, reach));
|
|
455
489
|
|
|
456
490
|
// Scenery: boulders where the ground breaks into a slope, never on a route and never inside a
|
|
457
491
|
// landmark (a rock through the shaft's wall, under the pillar's coin ring or in the castle).
|
|
@@ -499,11 +533,11 @@ export function buildCourse(rng: () => number, surfaces: ISurfaces, grassShare =
|
|
|
499
533
|
|
|
500
534
|
// Planting (`render/foliage.ts`): never on a route a scenario runs, a landmark or a boulder.
|
|
501
535
|
const taken = [...keepOut, ...boulders] as const;
|
|
502
|
-
const
|
|
536
|
+
const plantingSite: IPlantingSite = {
|
|
503
537
|
bounds: TERRAIN_BOUNDS,
|
|
504
538
|
clear: (x, zz, w) =>
|
|
505
539
|
!onRoute(x, zz, w) &&
|
|
506
|
-
!taken.some(([kx, kz, kr]) =>
|
|
540
|
+
!taken.some(([kx, kz, kr]) => within(x - kx, zz - kz, kr + w)) &&
|
|
507
541
|
!nearPickup(x, zz, w + 1),
|
|
508
542
|
flatness: terrain.flatness,
|
|
509
543
|
grassShare,
|
|
@@ -519,7 +553,8 @@ export function buildCourse(rng: () => number, surfaces: ISurfaces, grassShare =
|
|
|
519
553
|
surfaces,
|
|
520
554
|
// The islet's drum cliff radius at the waterline: it narrows to 92% over its height.
|
|
521
555
|
shores: [[COURSE.islet.at[0], COURSE.islet.at[1], COURSE.islet.radius * 0.98]],
|
|
522
|
-
}
|
|
556
|
+
};
|
|
557
|
+
const planting = await planted(plantingSite, memo);
|
|
523
558
|
group.add(planting.group);
|
|
524
559
|
|
|
525
560
|
// The world's shape on a 1 m grid of land: the climb from the shore to the top, the share of
|
|
@@ -555,8 +590,14 @@ export function buildCourse(rng: () => number, surfaces: ISurfaces, grassShare =
|
|
|
555
590
|
steepShare: steep / landCells,
|
|
556
591
|
};
|
|
557
592
|
|
|
593
|
+
let audit: ICourse["audit"] | undefined;
|
|
558
594
|
return {
|
|
559
|
-
|
|
595
|
+
// Measured on first read, not on every load: only the debug snapshot and the layout
|
|
596
|
+
// playtests read it, and walking every solid's bounds cost a run ~0.1 s.
|
|
597
|
+
get audit() {
|
|
598
|
+
audit ??= { ...auditCourse(group, pickups, ground), ...world };
|
|
599
|
+
return audit;
|
|
600
|
+
},
|
|
560
601
|
checkpoints: [
|
|
561
602
|
new Vector3(...COURSE.spawn),
|
|
562
603
|
new Vector3(...onGround(sx + 9, 0, sz + 13)),
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Heightfield } from "@threenative/core/world";
|
|
2
|
+
import { MathUtils } from "three";
|
|
2
3
|
|
|
3
4
|
/** A rectangle [x min, x max, z min, z max] or a disc [x, z, radius] of level ground at y = 0. */
|
|
4
5
|
export type LevelZone =
|
|
@@ -35,7 +36,7 @@ const HEADLAND = { x: 2, z: -60, rx: 30, rz: 26 } as const;
|
|
|
35
36
|
const clamp01 = (t: number): number => Math.min(1, Math.max(0, t));
|
|
36
37
|
const smooth = (from: number, to: number, value: number): number => {
|
|
37
38
|
const t = clamp01((value - from) / (to - from));
|
|
38
|
-
return t
|
|
39
|
+
return MathUtils.smoothstep(t, 0, 1);
|
|
39
40
|
};
|
|
40
41
|
const lerp = (a: number, b: number, t: number): number => a + (b - a) * t;
|
|
41
42
|
|
|
@@ -130,15 +131,36 @@ export function buildTerrain(plan: ITerrainPlan): ITerrain {
|
|
|
130
131
|
const inside = (x: number, z: number): boolean =>
|
|
131
132
|
x >= minX && x <= maxX && z >= minZ && z <= maxZ;
|
|
132
133
|
const seaFloor = plan.seaLevel - 6.5;
|
|
134
|
+
// Each path segment with its bounding box, in path order: a segment whose box lies clearly
|
|
135
|
+
// farther than the nearest so far cannot be nearer, so its exact distance is never needed.
|
|
136
|
+
const segments = plan.paths.flatMap((path) =>
|
|
137
|
+
path.slice(1).map((b, i) => {
|
|
138
|
+
const a = path[i] as readonly [number, number];
|
|
139
|
+
return {
|
|
140
|
+
a,
|
|
141
|
+
b,
|
|
142
|
+
minX: Math.min(a[0], b[0]),
|
|
143
|
+
maxX: Math.max(a[0], b[0]),
|
|
144
|
+
minZ: Math.min(a[1], b[1]),
|
|
145
|
+
maxZ: Math.max(a[1], b[1]),
|
|
146
|
+
};
|
|
147
|
+
}),
|
|
148
|
+
);
|
|
133
149
|
return {
|
|
134
150
|
field,
|
|
135
151
|
flatness: (x, z) => (inside(x, z) ? field.normalAt(x, z).y : 1),
|
|
136
152
|
ground: (x, z) => (inside(x, z) ? field.heightAt(x, z) : seaFloor),
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
153
|
+
// Planting asks this thousands of times a load. Same segments, same order, same minimum: a box
|
|
154
|
+
// skipped is more than a millionth farther than the nearest, past any rounding of its distance.
|
|
155
|
+
pathDistance: (x, z) => {
|
|
156
|
+
let nearest = Number.POSITIVE_INFINITY;
|
|
157
|
+
for (const segment of segments) {
|
|
158
|
+
const dx = Math.max(segment.minX - x, 0, x - segment.maxX);
|
|
159
|
+
const dz = Math.max(segment.minZ - z, 0, z - segment.maxZ);
|
|
160
|
+
if (dx * dx + dz * dz > nearest * nearest * 1.000001) continue;
|
|
161
|
+
nearest = Math.min(nearest, segmentDistance(x, z, segment.a, segment.b));
|
|
162
|
+
}
|
|
163
|
+
return nearest;
|
|
164
|
+
},
|
|
143
165
|
};
|
|
144
166
|
}
|
|
@@ -151,10 +151,10 @@ export function createOrbitCamera(camera: PerspectiveCamera): IOrbitCamera {
|
|
|
151
151
|
// Running at the camera does not spin it round: only travel within 120° of the view swings it.
|
|
152
152
|
if (Math.abs(turn) < (Math.PI * 2) / 3) {
|
|
153
153
|
const rate = CAMERA_RIG.swingRate * Math.min(1, speed / 9.6);
|
|
154
|
-
yaw
|
|
154
|
+
yaw = MathUtils.damp(yaw, yaw + turn, rate, dt);
|
|
155
155
|
}
|
|
156
156
|
}
|
|
157
|
-
place(target, probe,
|
|
157
|
+
place(target, probe, MathUtils.damp(0, 1, CAMERA_RIG.followRate, dt));
|
|
158
158
|
},
|
|
159
159
|
debug() {
|
|
160
160
|
return { closest, cuts, distance, elevation, peakElevation, pulledIn, tilt, yaw };
|