create-threenative 0.2.5 → 0.2.6
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/README.md +23 -1
- package/agent-docs/references/assertion-reference.md +40 -1
- package/agent-docs/references/capability-reference.md +972 -66
- package/agent-docs/references/finding-assets.md +8 -1
- package/agent-docs/references/performance-basics.md +114 -0
- package/agent-docs/references/rigging-characters.md +51 -0
- package/agent-docs/references/webview-ui.md +3 -2
- package/agent-files/.agents/skills/ponytail/SKILL.md +68 -0
- package/agent-files/.agents/skills/threenative-assets/SKILL.md +8 -0
- package/agent-files/.agents/skills/threenative-context/SKILL.md +8 -0
- package/agent-files/.agents/skills/threenative-performance/SKILL.md +26 -10
- package/agent-files/.claude/hooks/ponytail-context.mjs +51 -0
- package/agent-files/.claude/settings.json +38 -0
- package/agent-files/.claude/skills/ponytail/SKILL.md +68 -0
- package/agent-files/.claude/skills/threenative-assets/SKILL.md +8 -0
- package/agent-files/.claude/skills/threenative-context/SKILL.md +8 -0
- package/agent-files/.claude/skills/threenative-performance/SKILL.md +26 -10
- package/agent-files/.codex/hooks.json +40 -0
- package/capabilities.json +1344 -88
- package/dist/index.d.ts +10 -1
- package/dist/index.js +186 -1
- package/dist/threenative.js +660 -150
- package/package.json +6 -6
- package/template-assets/patches/three@0.185.1.patch +179 -19
- package/templates/action-rpg/AGENTS.md +5 -5
- package/templates/action-rpg/CLAUDE.md +5 -5
- package/templates/action-rpg/package.json +8 -8
- package/templates/defense/AGENTS.md +5 -5
- package/templates/defense/CLAUDE.md +5 -5
- package/templates/defense/package.json +8 -8
- package/templates/minimal/AGENTS.md +5 -5
- package/templates/minimal/CLAUDE.md +5 -5
- package/templates/minimal/package.json +7 -7
- package/templates/minimal/threenative.config.ts +1 -0
- package/templates/platformer/AGENTS.md +5 -5
- package/templates/platformer/CLAUDE.md +5 -5
- package/templates/platformer/package.json +9 -9
- package/templates/puzzle/AGENTS.md +5 -5
- package/templates/puzzle/CLAUDE.md +5 -5
- package/templates/puzzle/package.json +8 -8
- package/templates/racing/AGENTS.md +5 -5
- package/templates/racing/CLAUDE.md +5 -5
- package/templates/racing/package.json +8 -8
- package/templates/runner/AGENTS.md +5 -5
- package/templates/runner/CLAUDE.md +5 -5
- package/templates/runner/package.json +8 -8
- package/templates/sailing/AGENTS.md +6 -6
- package/templates/sailing/CLAUDE.md +6 -6
- package/templates/sailing/package.json +8 -8
- package/templates/shooter/AGENTS.md +5 -5
- package/templates/shooter/CLAUDE.md +5 -5
- package/templates/shooter/package.json +8 -8
- package/templates/starter/AGENTS.md +8 -8
- package/templates/starter/CLAUDE.md +8 -8
- package/templates/starter/package.json +9 -9
- package/templates/starter/playtests/production-readiness.playtest.json +96 -0
- package/templates/starter/src/ui/Hud.tsx +2 -2
- package/templates/starter/src/ui/Menu.tsx +5 -1
|
@@ -6,13 +6,13 @@ Instructions for the AI agent in this game. This template has no React or Tailwi
|
|
|
6
6
|
## Ownership
|
|
7
7
|
|
|
8
8
|
ThreeNative owns bootstrap, renderer, fixed-step loop, input, loading, physics bindings, and the state store. This repository owns `src/render/`, `src/entities/`, and `src/scenes/`; all are
|
|
9
|
-
ordinary user code, and nothing in `@threenative/*` reads or chooses their appearance.
|
|
9
|
+
ordinary user code, and nothing in `@threenative/*` reads or chooses their appearance. The render camera also skips an object that projects under **0.5 px** in it; `renderer.minimumProjectedPixels` raises that threshold (`false` disables the cut, not the count) and `alwaysRender(object)` exempts an object, while camera-attached objects and shadow casters are kept. The engine also owns the per-frame world-matrix walk, and by default it does not descend into a hidden subtree — so a game that reads a hidden object's `matrixWorld` directly must use `getWorldPosition` (or call `object.updateWorldMatrix(true, false)`) first; `renderer.matrixWorld: "all"` restores three's every-node walk, and `TN_PROJECTION` reports the visited-node count either way.
|
|
10
10
|
|
|
11
11
|
## Start every change
|
|
12
12
|
|
|
13
13
|
1. **Critical planning gate:** invoke `threenative-capabilities` before `prd-creator`. Search
|
|
14
14
|
`engine_search_capabilities` for the full request and each concrete mechanic, inspect relevant
|
|
15
|
-
matches with `engine_capability_detail`, and record a capability or no-match for the plan.
|
|
15
|
+
matches with `engine_capability_detail`, and record a capability or no-match for the plan. Apply the `ponytail` ladder before writing code; never hand-write what the capability search already installs.
|
|
16
16
|
2. Then invoke `prd-creator`. Draft the plan around those capabilities and binding constraints,
|
|
17
17
|
direct the user to review it, and wait for explicit approval plus an instruction to implement it.
|
|
18
18
|
3. Treat returned constraints as binding. `@threenative/physics/navigation` is browser-only WASM;
|
|
@@ -38,7 +38,7 @@ bridge; avoid DOM globals, dynamic `import()`, and raw physics handles. **Report
|
|
|
38
38
|
- `.agents/skills/threenative-performance/SKILL.md` / `.claude/skills/threenative-performance/SKILL.md` — measured budgets.
|
|
39
39
|
- `.agents/skills/threenative-ui/SKILL.md` / `.claude/skills/threenative-ui/SKILL.md` — native-safe UI.
|
|
40
40
|
- `.agents/skills/threenative-context/SKILL.md` / `.claude/skills/threenative-context/SKILL.md` — portable ctx APIs.
|
|
41
|
-
- Confirmed framework bugs: use `file-engine-bug` in `.agents/skills/` or `.claude/skills/` after a minimal repro.
|
|
41
|
+
- Confirmed framework bugs: use `file-engine-bug` in `.agents/skills/` or `.claude/skills/` after a minimal repro. Lazy-first: `.agents/skills/ponytail/SKILL.md` / `.claude/skills/ponytail/SKILL.md` — smallest correct change, and its reuse rung is the capability search above.
|
|
42
42
|
|
|
43
43
|
## Commands and map
|
|
44
44
|
|
|
@@ -89,8 +89,8 @@ supposed to be touching. Two loading conventions come from `@threenative/core`,
|
|
|
89
89
|
|
|
90
90
|
Reference-driven authoring starts at `agent-docs/dream-loop.md`.
|
|
91
91
|
|
|
92
|
-
Open a capture after visual changes. A scenario with no assertions or missing observations fails.
|
|
92
|
+
Open a capture after visual changes. A scenario with no assertions or missing observations fails. The engine warns you before a human does: `TN_SCENE_WARNING` fires when the GPU used under a third of the frame while the JS render phase ran longer than the display's own period, and names the census behind it — objects considered, draws per pass, triangles per draw, shadow-exempt casters. It is a scene-shape verdict, so answer it by moving the draw and object counts, not the engine: read the bucket census before promising a merge. `npx threenative doctor` repeats the last verdict and the `DEV_MODE=true` chip shows it beside the frame rate; `TN_FRAME_SPANS=1` adds the render phase's own span tree when you need to know which part costs the milliseconds. The cheapest static object is one whose transform you never write: measured on 1,561 objects, leaving them alone costs 10.10 ms of render phase against 17.45 ms when the game rewrites every transform each frame, because three skips the per-object binding update when nothing changed. So do not touch a transform you do not need to — that is worth ~7 ms where `markStatic(root)`, which additionally composes a never-moving subtree once, measured 0.009 ms. Use it for scenery you are sure of, and `invalidateStatic(object)` to announce a write inside one; it deletes matrix arithmetic, not the walk. `TN_RENDERLIST_VALIDATE=1` recomputes every world matrix the long way each frame and throws on the first that disagrees, which is how you prove a freeze did not leave something stale on screen.
|
|
93
93
|
|
|
94
|
-
Recipes shipped in the project: `agent-docs/assertion-reference.md`, `agent-docs/capability-reference.md`, `agent-docs/capture-the-frame.md`, `agent-docs/creating-creatures.md`, `agent-docs/ctx-cookbook.md`, `agent-docs/debug-surface.md`, `agent-docs/finding-assets.md`, `agent-docs/gameplay-recipes.md`, `agent-docs/menu-screens.md`, `agent-docs/mobile-memory-budget.md`, `agent-docs/sculpt-from-a-reference.md`, `agent-docs/trace-a-slow-frame.md`, `agent-docs/visual-baseline.md`, and `agent-docs/webview-ui.md`.
|
|
94
|
+
Recipes shipped in the project: `agent-docs/assertion-reference.md`, `agent-docs/capability-reference.md`, `agent-docs/capture-the-frame.md`, `agent-docs/creating-creatures.md`, `agent-docs/ctx-cookbook.md`, `agent-docs/debug-surface.md`, `agent-docs/finding-assets.md`, `agent-docs/gameplay-recipes.md`, `agent-docs/menu-screens.md`, `agent-docs/mobile-memory-budget.md`, `agent-docs/performance-basics.md`, `agent-docs/rigging-characters.md`, `agent-docs/sculpt-from-a-reference.md`, `agent-docs/trace-a-slow-frame.md`, `agent-docs/visual-baseline.md`, and `agent-docs/webview-ui.md`.
|
|
95
95
|
## Optional multiplayer transport
|
|
96
96
|
For online play only, import `connect` from `@threenative/core/net` with an HTTPS URL and nonempty identity credential; configure `connectTimeoutMs`, `maxReliableMessageBytes`, `maxQueuedReliableBytes`, and `maxQueuedDatagrams` (10s/65,536/1 MiB/256), use `reliable-ordered` for ordered reliable messages and bounded `unreliable` datagrams that may drop, and keep serialization, replication, prediction, interpolation, snapshots and rejoin in this game's `src/` and server. There is no fallback: unsupported WebTransport/native rejects with `TN_NET_UNAVAILABLE`; reference Go server: `packages/runtime-native/examples/webtransport/server`.
|
|
@@ -8,13 +8,13 @@ Instructions for the AI agent in this game. This template has no React or Tailwi
|
|
|
8
8
|
## Ownership
|
|
9
9
|
|
|
10
10
|
ThreeNative owns bootstrap, renderer, fixed-step loop, input, loading, physics bindings, and the state store. This repository owns `src/render/`, `src/entities/`, and `src/scenes/`; all are
|
|
11
|
-
ordinary user code, and nothing in `@threenative/*` reads or chooses their appearance.
|
|
11
|
+
ordinary user code, and nothing in `@threenative/*` reads or chooses their appearance. The render camera also skips an object that projects under **0.5 px** in it; `renderer.minimumProjectedPixels` raises that threshold (`false` disables the cut, not the count) and `alwaysRender(object)` exempts an object, while camera-attached objects and shadow casters are kept. The engine also owns the per-frame world-matrix walk, and by default it does not descend into a hidden subtree — so a game that reads a hidden object's `matrixWorld` directly must use `getWorldPosition` (or call `object.updateWorldMatrix(true, false)`) first; `renderer.matrixWorld: "all"` restores three's every-node walk, and `TN_PROJECTION` reports the visited-node count either way.
|
|
12
12
|
|
|
13
13
|
## Start every change
|
|
14
14
|
|
|
15
15
|
1. **Critical planning gate:** invoke `threenative-capabilities` before `prd-creator`. Search
|
|
16
16
|
`engine_search_capabilities` for the full request and each concrete mechanic, inspect relevant
|
|
17
|
-
matches with `engine_capability_detail`, and record a capability or no-match for the plan.
|
|
17
|
+
matches with `engine_capability_detail`, and record a capability or no-match for the plan. Apply the `ponytail` ladder before writing code; never hand-write what the capability search already installs.
|
|
18
18
|
2. Then invoke `prd-creator`. Draft the plan around those capabilities and binding constraints,
|
|
19
19
|
direct the user to review it, and wait for explicit approval plus an instruction to implement it.
|
|
20
20
|
3. Treat returned constraints as binding. `@threenative/physics/navigation` is browser-only WASM;
|
|
@@ -40,7 +40,7 @@ bridge; avoid DOM globals, dynamic `import()`, and raw physics handles. **Report
|
|
|
40
40
|
- `.agents/skills/threenative-performance/SKILL.md` / `.claude/skills/threenative-performance/SKILL.md` — measured budgets.
|
|
41
41
|
- `.agents/skills/threenative-ui/SKILL.md` / `.claude/skills/threenative-ui/SKILL.md` — native-safe UI.
|
|
42
42
|
- `.agents/skills/threenative-context/SKILL.md` / `.claude/skills/threenative-context/SKILL.md` — portable ctx APIs.
|
|
43
|
-
- Confirmed framework bugs: use `file-engine-bug` in `.agents/skills/` or `.claude/skills/` after a minimal repro.
|
|
43
|
+
- Confirmed framework bugs: use `file-engine-bug` in `.agents/skills/` or `.claude/skills/` after a minimal repro. Lazy-first: `.agents/skills/ponytail/SKILL.md` / `.claude/skills/ponytail/SKILL.md` — smallest correct change, and its reuse rung is the capability search above.
|
|
44
44
|
|
|
45
45
|
## Commands and map
|
|
46
46
|
|
|
@@ -91,8 +91,8 @@ supposed to be touching. Two loading conventions come from `@threenative/core`,
|
|
|
91
91
|
|
|
92
92
|
Reference-driven authoring starts at `agent-docs/dream-loop.md`.
|
|
93
93
|
|
|
94
|
-
Open a capture after visual changes. A scenario with no assertions or missing observations fails.
|
|
94
|
+
Open a capture after visual changes. A scenario with no assertions or missing observations fails. The engine warns you before a human does: `TN_SCENE_WARNING` fires when the GPU used under a third of the frame while the JS render phase ran longer than the display's own period, and names the census behind it — objects considered, draws per pass, triangles per draw, shadow-exempt casters. It is a scene-shape verdict, so answer it by moving the draw and object counts, not the engine: read the bucket census before promising a merge. `npx threenative doctor` repeats the last verdict and the `DEV_MODE=true` chip shows it beside the frame rate; `TN_FRAME_SPANS=1` adds the render phase's own span tree when you need to know which part costs the milliseconds. The cheapest static object is one whose transform you never write: measured on 1,561 objects, leaving them alone costs 10.10 ms of render phase against 17.45 ms when the game rewrites every transform each frame, because three skips the per-object binding update when nothing changed. So do not touch a transform you do not need to — that is worth ~7 ms where `markStatic(root)`, which additionally composes a never-moving subtree once, measured 0.009 ms. Use it for scenery you are sure of, and `invalidateStatic(object)` to announce a write inside one; it deletes matrix arithmetic, not the walk. `TN_RENDERLIST_VALIDATE=1` recomputes every world matrix the long way each frame and throws on the first that disagrees, which is how you prove a freeze did not leave something stale on screen.
|
|
95
95
|
|
|
96
|
-
Recipes shipped in the project: `agent-docs/assertion-reference.md`, `agent-docs/capability-reference.md`, `agent-docs/capture-the-frame.md`, `agent-docs/creating-creatures.md`, `agent-docs/ctx-cookbook.md`, `agent-docs/debug-surface.md`, `agent-docs/finding-assets.md`, `agent-docs/gameplay-recipes.md`, `agent-docs/menu-screens.md`, `agent-docs/mobile-memory-budget.md`, `agent-docs/sculpt-from-a-reference.md`, `agent-docs/trace-a-slow-frame.md`, `agent-docs/visual-baseline.md`, and `agent-docs/webview-ui.md`.
|
|
96
|
+
Recipes shipped in the project: `agent-docs/assertion-reference.md`, `agent-docs/capability-reference.md`, `agent-docs/capture-the-frame.md`, `agent-docs/creating-creatures.md`, `agent-docs/ctx-cookbook.md`, `agent-docs/debug-surface.md`, `agent-docs/finding-assets.md`, `agent-docs/gameplay-recipes.md`, `agent-docs/menu-screens.md`, `agent-docs/mobile-memory-budget.md`, `agent-docs/performance-basics.md`, `agent-docs/rigging-characters.md`, `agent-docs/sculpt-from-a-reference.md`, `agent-docs/trace-a-slow-frame.md`, `agent-docs/visual-baseline.md`, and `agent-docs/webview-ui.md`.
|
|
97
97
|
## Optional multiplayer transport
|
|
98
98
|
For online play only, import `connect` from `@threenative/core/net` with an HTTPS URL and nonempty identity credential; configure `connectTimeoutMs`, `maxReliableMessageBytes`, `maxQueuedReliableBytes`, and `maxQueuedDatagrams` (10s/65,536/1 MiB/256), use `reliable-ordered` for ordered reliable messages and bounded `unreliable` datagrams that may drop, and keep serialization, replication, prediction, interpolation, snapshots and rejoin in this game's `src/` and server. There is no fallback: unsupported WebTransport/native rejects with `TN_NET_UNAVAILABLE`; reference Go server: `packages/runtime-native/examples/webtransport/server`.
|
|
@@ -12,19 +12,19 @@
|
|
|
12
12
|
"build:android": "threenative build --target android",
|
|
13
13
|
"build:ios": "threenative build --target ios",
|
|
14
14
|
"pretest": "playwright install chromium",
|
|
15
|
-
"test": "
|
|
15
|
+
"test": "pnpm build:web && threenative-playtest --scenario \"playtests/*.playtest.json\" --browser-recipe webgpu --headed --server-command \"pnpm exec vite preview --host 127.0.0.1 --port $PORT --strictPort\"",
|
|
16
16
|
"typecheck": "tsc --noEmit -p tsconfig.json"
|
|
17
17
|
},
|
|
18
18
|
"dependencies": {
|
|
19
|
-
"@threenative/core": "0.3.
|
|
20
|
-
"@threenative/physics": "0.3.
|
|
19
|
+
"@threenative/core": "0.3.3",
|
|
20
|
+
"@threenative/physics": "0.3.3",
|
|
21
21
|
"three": "0.185.1"
|
|
22
22
|
},
|
|
23
23
|
"devDependencies": {
|
|
24
|
-
"@threenative/assets": "0.3.
|
|
25
|
-
"@threenative/playtest": "0.3.
|
|
24
|
+
"@threenative/assets": "0.3.3",
|
|
25
|
+
"@threenative/playtest": "0.3.3",
|
|
26
26
|
"@types/three": "0.185.3",
|
|
27
|
-
"create-threenative": "0.2.
|
|
27
|
+
"create-threenative": "0.2.6",
|
|
28
28
|
"esbuild": "0.27.0",
|
|
29
29
|
"playwright": "1.62.1",
|
|
30
30
|
"typescript": "5.9.3",
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
"@gltf-transform/cli": "4.4.2"
|
|
33
33
|
},
|
|
34
34
|
"optionalDependencies": {
|
|
35
|
-
"@threenative/runtime-native": "0.3.
|
|
35
|
+
"@threenative/runtime-native": "0.3.3"
|
|
36
36
|
},
|
|
37
37
|
"pnpm": {
|
|
38
38
|
"onlyBuiltDependencies": ["@threenative/core", "@threenative/runtime-native"],
|
|
@@ -26,6 +26,7 @@ const config: IThreeNativeConfig = {
|
|
|
26
26
|
backgroundColor: "#0d1b2a",
|
|
27
27
|
},
|
|
28
28
|
nativeEntry: "src/game.ts",
|
|
29
|
+
ui: { renderer: "native" }, // This template draws its HUD in the scene and has no src/ui/.
|
|
29
30
|
renderer: {
|
|
30
31
|
preferWebGPU: true, // Use WebGPU when the host exposes it.
|
|
31
32
|
// The engine holds the `display.maxFps` budget by scaling the 3D drawing buffer, and reports
|
|
@@ -5,13 +5,13 @@ Instructions for the AI agent in this game. `CLAUDE.md` mirrors this file; edit
|
|
|
5
5
|
## Ownership
|
|
6
6
|
|
|
7
7
|
ThreeNative owns bootstrap, renderer, fixed-step loop, input, loading, physics bindings, and the state bridge. This repository owns the level, character feel, enemies, pickups, checkpoints, HUD,
|
|
8
|
-
and look; `src/game.ts` is portable and React mounts from `src/main.ts`.
|
|
8
|
+
and look; `src/game.ts` is portable and React mounts from `src/main.ts`. The render camera also skips an object that projects under **0.5 px** in it; `renderer.minimumProjectedPixels` raises that threshold (`false` disables the cut, not the count) and `alwaysRender(object)` exempts an object, while camera-attached objects and shadow casters are kept. The engine also owns the per-frame world-matrix walk, and by default it does not descend into a hidden subtree — so a game that reads a hidden object's `matrixWorld` directly must use `getWorldPosition` (or call `object.updateWorldMatrix(true, false)`) first; `renderer.matrixWorld: "all"` restores three's every-node walk, and `TN_PROJECTION` reports the visited-node count either way.
|
|
9
9
|
|
|
10
10
|
## Start every change
|
|
11
11
|
|
|
12
12
|
1. **Critical planning gate:** invoke `threenative-capabilities` before `prd-creator`. Search
|
|
13
13
|
`engine_search_capabilities` for the full request and each concrete mechanic, inspect relevant
|
|
14
|
-
matches with `engine_capability_detail`, and record a capability or no-match for the plan.
|
|
14
|
+
matches with `engine_capability_detail`, and record a capability or no-match for the plan. Apply the `ponytail` ladder before writing code; never hand-write what the capability search already installs.
|
|
15
15
|
2. Then invoke `prd-creator`. Draft the plan around those capabilities and binding constraints,
|
|
16
16
|
direct the user to review it, and wait for explicit approval plus an instruction to implement it.
|
|
17
17
|
3. Treat returned constraints as binding. `@threenative/physics/navigation` is browser-only WASM;
|
|
@@ -37,7 +37,7 @@ bridge; avoid DOM globals, dynamic `import()`, and raw physics handles. **Report
|
|
|
37
37
|
- `.agents/skills/threenative-performance/SKILL.md` / `.claude/skills/threenative-performance/SKILL.md` — measured budgets.
|
|
38
38
|
- `.agents/skills/threenative-ui/SKILL.md` / `.claude/skills/threenative-ui/SKILL.md` — native-safe UI.
|
|
39
39
|
- `.agents/skills/threenative-context/SKILL.md` / `.claude/skills/threenative-context/SKILL.md` — portable ctx APIs.
|
|
40
|
-
- Confirmed framework bugs: use `file-engine-bug` in `.agents/skills/` or `.claude/skills/` after a minimal repro.
|
|
40
|
+
- Confirmed framework bugs: use `file-engine-bug` in `.agents/skills/` or `.claude/skills/` after a minimal repro. Lazy-first: `.agents/skills/ponytail/SKILL.md` / `.claude/skills/ponytail/SKILL.md` — smallest correct change, and its reuse rung is the capability search above.
|
|
41
41
|
|
|
42
42
|
## Commands and map
|
|
43
43
|
|
|
@@ -87,8 +87,8 @@ supposed to be touching. Two loading conventions come from `@threenative/core`,
|
|
|
87
87
|
|
|
88
88
|
Reference-driven authoring starts at `agent-docs/dream-loop.md`.
|
|
89
89
|
|
|
90
|
-
Open a capture after visual changes. A scenario with no assertions or missing observations fails.
|
|
90
|
+
Open a capture after visual changes. A scenario with no assertions or missing observations fails. The engine warns you before a human does: `TN_SCENE_WARNING` fires when the GPU used under a third of the frame while the JS render phase ran longer than the display's own period, and names the census behind it — objects considered, draws per pass, triangles per draw, shadow-exempt casters. It is a scene-shape verdict, so answer it by moving the draw and object counts, not the engine: read the bucket census before promising a merge. `npx threenative doctor` repeats the last verdict and the `DEV_MODE=true` chip shows it beside the frame rate; `TN_FRAME_SPANS=1` adds the render phase's own span tree when you need to know which part costs the milliseconds. The cheapest static object is one whose transform you never write: measured on 1,561 objects, leaving them alone costs 10.10 ms of render phase against 17.45 ms when the game rewrites every transform each frame, because three skips the per-object binding update when nothing changed. So do not touch a transform you do not need to — that is worth ~7 ms where `markStatic(root)`, which additionally composes a never-moving subtree once, measured 0.009 ms. Use it for scenery you are sure of, and `invalidateStatic(object)` to announce a write inside one; it deletes matrix arithmetic, not the walk. `TN_RENDERLIST_VALIDATE=1` recomputes every world matrix the long way each frame and throws on the first that disagrees, which is how you prove a freeze did not leave something stale on screen.
|
|
91
91
|
|
|
92
|
-
Recipes shipped in the project: `agent-docs/assertion-reference.md`, `agent-docs/capability-reference.md`, `agent-docs/capture-the-frame.md`, `agent-docs/creating-creatures.md`, `agent-docs/ctx-cookbook.md`, `agent-docs/debug-surface.md`, `agent-docs/finding-assets.md`, `agent-docs/gameplay-recipes.md`, `agent-docs/menu-screens.md`, `agent-docs/mobile-memory-budget.md`, `agent-docs/sculpt-from-a-reference.md`, `agent-docs/trace-a-slow-frame.md`, `agent-docs/visual-baseline.md`, and `agent-docs/webview-ui.md`.
|
|
92
|
+
Recipes shipped in the project: `agent-docs/assertion-reference.md`, `agent-docs/capability-reference.md`, `agent-docs/capture-the-frame.md`, `agent-docs/creating-creatures.md`, `agent-docs/ctx-cookbook.md`, `agent-docs/debug-surface.md`, `agent-docs/finding-assets.md`, `agent-docs/gameplay-recipes.md`, `agent-docs/menu-screens.md`, `agent-docs/mobile-memory-budget.md`, `agent-docs/performance-basics.md`, `agent-docs/rigging-characters.md`, `agent-docs/sculpt-from-a-reference.md`, `agent-docs/trace-a-slow-frame.md`, `agent-docs/visual-baseline.md`, and `agent-docs/webview-ui.md`.
|
|
93
93
|
## Optional multiplayer transport
|
|
94
94
|
For online play only, import `connect` from `@threenative/core/net` with an HTTPS URL and nonempty identity credential; configure `connectTimeoutMs`, `maxReliableMessageBytes`, `maxQueuedReliableBytes`, and `maxQueuedDatagrams` (10s/65,536/1 MiB/256), use `reliable-ordered` for ordered reliable messages and bounded `unreliable` datagrams that may drop, and keep serialization, replication, prediction, interpolation, snapshots and rejoin in this game's `src/` and server. There is no fallback: unsupported WebTransport/native rejects with `TN_NET_UNAVAILABLE`; reference Go server: `packages/runtime-native/examples/webtransport/server`.
|
|
@@ -7,13 +7,13 @@ Instructions for the AI agent in this game. `CLAUDE.md` mirrors this file; edit
|
|
|
7
7
|
## Ownership
|
|
8
8
|
|
|
9
9
|
ThreeNative owns bootstrap, renderer, fixed-step loop, input, loading, physics bindings, and the state bridge. This repository owns the level, character feel, enemies, pickups, checkpoints, HUD,
|
|
10
|
-
and look; `src/game.ts` is portable and React mounts from `src/main.ts`.
|
|
10
|
+
and look; `src/game.ts` is portable and React mounts from `src/main.ts`. The render camera also skips an object that projects under **0.5 px** in it; `renderer.minimumProjectedPixels` raises that threshold (`false` disables the cut, not the count) and `alwaysRender(object)` exempts an object, while camera-attached objects and shadow casters are kept. The engine also owns the per-frame world-matrix walk, and by default it does not descend into a hidden subtree — so a game that reads a hidden object's `matrixWorld` directly must use `getWorldPosition` (or call `object.updateWorldMatrix(true, false)`) first; `renderer.matrixWorld: "all"` restores three's every-node walk, and `TN_PROJECTION` reports the visited-node count either way.
|
|
11
11
|
|
|
12
12
|
## Start every change
|
|
13
13
|
|
|
14
14
|
1. **Critical planning gate:** invoke `threenative-capabilities` before `prd-creator`. Search
|
|
15
15
|
`engine_search_capabilities` for the full request and each concrete mechanic, inspect relevant
|
|
16
|
-
matches with `engine_capability_detail`, and record a capability or no-match for the plan.
|
|
16
|
+
matches with `engine_capability_detail`, and record a capability or no-match for the plan. Apply the `ponytail` ladder before writing code; never hand-write what the capability search already installs.
|
|
17
17
|
2. Then invoke `prd-creator`. Draft the plan around those capabilities and binding constraints,
|
|
18
18
|
direct the user to review it, and wait for explicit approval plus an instruction to implement it.
|
|
19
19
|
3. Treat returned constraints as binding. `@threenative/physics/navigation` is browser-only WASM;
|
|
@@ -39,7 +39,7 @@ bridge; avoid DOM globals, dynamic `import()`, and raw physics handles. **Report
|
|
|
39
39
|
- `.agents/skills/threenative-performance/SKILL.md` / `.claude/skills/threenative-performance/SKILL.md` — measured budgets.
|
|
40
40
|
- `.agents/skills/threenative-ui/SKILL.md` / `.claude/skills/threenative-ui/SKILL.md` — native-safe UI.
|
|
41
41
|
- `.agents/skills/threenative-context/SKILL.md` / `.claude/skills/threenative-context/SKILL.md` — portable ctx APIs.
|
|
42
|
-
- Confirmed framework bugs: use `file-engine-bug` in `.agents/skills/` or `.claude/skills/` after a minimal repro.
|
|
42
|
+
- Confirmed framework bugs: use `file-engine-bug` in `.agents/skills/` or `.claude/skills/` after a minimal repro. Lazy-first: `.agents/skills/ponytail/SKILL.md` / `.claude/skills/ponytail/SKILL.md` — smallest correct change, and its reuse rung is the capability search above.
|
|
43
43
|
|
|
44
44
|
## Commands and map
|
|
45
45
|
|
|
@@ -89,8 +89,8 @@ supposed to be touching. Two loading conventions come from `@threenative/core`,
|
|
|
89
89
|
|
|
90
90
|
Reference-driven authoring starts at `agent-docs/dream-loop.md`.
|
|
91
91
|
|
|
92
|
-
Open a capture after visual changes. A scenario with no assertions or missing observations fails.
|
|
92
|
+
Open a capture after visual changes. A scenario with no assertions or missing observations fails. The engine warns you before a human does: `TN_SCENE_WARNING` fires when the GPU used under a third of the frame while the JS render phase ran longer than the display's own period, and names the census behind it — objects considered, draws per pass, triangles per draw, shadow-exempt casters. It is a scene-shape verdict, so answer it by moving the draw and object counts, not the engine: read the bucket census before promising a merge. `npx threenative doctor` repeats the last verdict and the `DEV_MODE=true` chip shows it beside the frame rate; `TN_FRAME_SPANS=1` adds the render phase's own span tree when you need to know which part costs the milliseconds. The cheapest static object is one whose transform you never write: measured on 1,561 objects, leaving them alone costs 10.10 ms of render phase against 17.45 ms when the game rewrites every transform each frame, because three skips the per-object binding update when nothing changed. So do not touch a transform you do not need to — that is worth ~7 ms where `markStatic(root)`, which additionally composes a never-moving subtree once, measured 0.009 ms. Use it for scenery you are sure of, and `invalidateStatic(object)` to announce a write inside one; it deletes matrix arithmetic, not the walk. `TN_RENDERLIST_VALIDATE=1` recomputes every world matrix the long way each frame and throws on the first that disagrees, which is how you prove a freeze did not leave something stale on screen.
|
|
93
93
|
|
|
94
|
-
Recipes shipped in the project: `agent-docs/assertion-reference.md`, `agent-docs/capability-reference.md`, `agent-docs/capture-the-frame.md`, `agent-docs/creating-creatures.md`, `agent-docs/ctx-cookbook.md`, `agent-docs/debug-surface.md`, `agent-docs/finding-assets.md`, `agent-docs/gameplay-recipes.md`, `agent-docs/menu-screens.md`, `agent-docs/mobile-memory-budget.md`, `agent-docs/sculpt-from-a-reference.md`, `agent-docs/trace-a-slow-frame.md`, `agent-docs/visual-baseline.md`, and `agent-docs/webview-ui.md`.
|
|
94
|
+
Recipes shipped in the project: `agent-docs/assertion-reference.md`, `agent-docs/capability-reference.md`, `agent-docs/capture-the-frame.md`, `agent-docs/creating-creatures.md`, `agent-docs/ctx-cookbook.md`, `agent-docs/debug-surface.md`, `agent-docs/finding-assets.md`, `agent-docs/gameplay-recipes.md`, `agent-docs/menu-screens.md`, `agent-docs/mobile-memory-budget.md`, `agent-docs/performance-basics.md`, `agent-docs/rigging-characters.md`, `agent-docs/sculpt-from-a-reference.md`, `agent-docs/trace-a-slow-frame.md`, `agent-docs/visual-baseline.md`, and `agent-docs/webview-ui.md`.
|
|
95
95
|
## Optional multiplayer transport
|
|
96
96
|
For online play only, import `connect` from `@threenative/core/net` with an HTTPS URL and nonempty identity credential; configure `connectTimeoutMs`, `maxReliableMessageBytes`, `maxQueuedReliableBytes`, and `maxQueuedDatagrams` (10s/65,536/1 MiB/256), use `reliable-ordered` for ordered reliable messages and bounded `unreliable` datagrams that may drop, and keep serialization, replication, prediction, interpolation, snapshots and rejoin in this game's `src/` and server. There is no fallback: unsupported WebTransport/native rejects with `TN_NET_UNAVAILABLE`; reference Go server: `packages/runtime-native/examples/webtransport/server`.
|
|
@@ -13,14 +13,14 @@
|
|
|
13
13
|
"build:ios": "threenative build --target ios",
|
|
14
14
|
"pretest": "playwright install chromium",
|
|
15
15
|
"pretest:terminal-loop": "playwright install chromium",
|
|
16
|
-
"test": "
|
|
17
|
-
"test:terminal-loop": "
|
|
16
|
+
"test": "pnpm build:web && threenative-playtest --scenario \"playtests/*.playtest.json\" --browser-recipe webgpu --headed --server-command \"pnpm exec vite preview --host 127.0.0.1 --port $PORT --strictPort\"",
|
|
17
|
+
"test:terminal-loop": "pnpm build:web && threenative-playtest --scenario playtests/terminal-loop-win.playtest.json --scenario playtests/terminal-loop-fail.playtest.json --browser-recipe webgpu --headed --server-command \"pnpm exec vite preview --host 127.0.0.1 --port $PORT --strictPort\"",
|
|
18
18
|
"typecheck": "tsc --noEmit -p tsconfig.json"
|
|
19
19
|
},
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"@threenative/core": "0.3.
|
|
22
|
-
"@threenative/physics": "0.3.
|
|
23
|
-
"@threenative/ui": "0.3.
|
|
21
|
+
"@threenative/core": "0.3.3",
|
|
22
|
+
"@threenative/physics": "0.3.3",
|
|
23
|
+
"@threenative/ui": "0.3.3",
|
|
24
24
|
"react": "19.2.0",
|
|
25
25
|
"react-dom": "19.2.0",
|
|
26
26
|
"three": "0.185.1"
|
|
@@ -29,11 +29,11 @@
|
|
|
29
29
|
"@tailwindcss/vite": "4.3.3",
|
|
30
30
|
"@vitejs/plugin-react": "6.0.5",
|
|
31
31
|
"@types/three": "0.185.3",
|
|
32
|
-
"@threenative/assets": "0.3.
|
|
33
|
-
"@threenative/playtest": "0.3.
|
|
32
|
+
"@threenative/assets": "0.3.3",
|
|
33
|
+
"@threenative/playtest": "0.3.3",
|
|
34
34
|
"@types/react": "19.2.0",
|
|
35
35
|
"@types/react-dom": "19.2.0",
|
|
36
|
-
"create-threenative": "0.2.
|
|
36
|
+
"create-threenative": "0.2.6",
|
|
37
37
|
"esbuild": "0.27.0",
|
|
38
38
|
"playwright": "1.62.1",
|
|
39
39
|
"tailwindcss": "4.3.3",
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
"@gltf-transform/cli": "4.4.2"
|
|
43
43
|
},
|
|
44
44
|
"optionalDependencies": {
|
|
45
|
-
"@threenative/runtime-native": "0.3.
|
|
45
|
+
"@threenative/runtime-native": "0.3.3"
|
|
46
46
|
},
|
|
47
47
|
"pnpm": {
|
|
48
48
|
"onlyBuiltDependencies": ["@threenative/core", "@threenative/runtime-native"],
|
|
@@ -5,13 +5,13 @@ Instructions for the AI agent in this game. `CLAUDE.md` mirrors this file; edit
|
|
|
5
5
|
## Ownership
|
|
6
6
|
|
|
7
7
|
ThreeNative owns bootstrap, renderer, fixed-step loop, input, loading, physics bindings, and the state bridge. This repository owns the room, the crates, the hinge, the ball, the goal, the HUD
|
|
8
|
-
and the look; `src/game.ts` is portable and React mounts only from `src/main.ts`.
|
|
8
|
+
and the look; `src/game.ts` is portable and React mounts only from `src/main.ts`. The render camera also skips an object that projects under **0.5 px** in it; `renderer.minimumProjectedPixels` raises that threshold (`false` disables the cut, not the count) and `alwaysRender(object)` exempts an object, while camera-attached objects and shadow casters are kept. The engine also owns the per-frame world-matrix walk, and by default it does not descend into a hidden subtree — so a game that reads a hidden object's `matrixWorld` directly must use `getWorldPosition` (or call `object.updateWorldMatrix(true, false)`) first; `renderer.matrixWorld: "all"` restores three's every-node walk, and `TN_PROJECTION` reports the visited-node count either way.
|
|
9
9
|
|
|
10
10
|
## Start every change
|
|
11
11
|
|
|
12
12
|
1. **Critical planning gate:** invoke `threenative-capabilities` before `prd-creator`. Search
|
|
13
13
|
`engine_search_capabilities` for the full request and each concrete mechanic, inspect relevant
|
|
14
|
-
matches with `engine_capability_detail`, and record a capability or no-match for the plan.
|
|
14
|
+
matches with `engine_capability_detail`, and record a capability or no-match for the plan. Apply the `ponytail` ladder before writing code; never hand-write what the capability search already installs.
|
|
15
15
|
2. Then invoke `prd-creator`. Draft the plan around those capabilities and binding constraints,
|
|
16
16
|
direct the user to review it, and wait for explicit approval plus an instruction to implement it.
|
|
17
17
|
3. Treat returned constraints as binding. This kit needs no navmesh and imports none, so it runs
|
|
@@ -37,7 +37,7 @@ bridge; avoid DOM globals, dynamic `import()`, and raw physics handles. **Report
|
|
|
37
37
|
- `.agents/skills/threenative-performance/SKILL.md` / `.claude/skills/threenative-performance/SKILL.md` — measured budgets.
|
|
38
38
|
- `.agents/skills/threenative-ui/SKILL.md` / `.claude/skills/threenative-ui/SKILL.md` — native-safe UI.
|
|
39
39
|
- `.agents/skills/threenative-context/SKILL.md` / `.claude/skills/threenative-context/SKILL.md` — portable ctx APIs.
|
|
40
|
-
- Confirmed framework bugs: use `file-engine-bug` in `.agents/skills/` or `.claude/skills/` after a minimal repro.
|
|
40
|
+
- Confirmed framework bugs: use `file-engine-bug` in `.agents/skills/` or `.claude/skills/` after a minimal repro. Lazy-first: `.agents/skills/ponytail/SKILL.md` / `.claude/skills/ponytail/SKILL.md` — smallest correct change, and its reuse rung is the capability search above.
|
|
41
41
|
|
|
42
42
|
## Commands and map
|
|
43
43
|
|
|
@@ -89,8 +89,8 @@ supposed to be touching. Two loading conventions come from `@threenative/core`,
|
|
|
89
89
|
Edit `src/render/` directly; `postprocessing.ts` reports stages but decides no game colour. Quality
|
|
90
90
|
tiers live in `src/render/quality.ts`: `low`, `medium`, `high`; `isMobile()` chooses `low`, otherwise
|
|
91
91
|
`high`; override with `setupPost(..., { tier: "low" })`. Unknown tiers throw and `TN_QUALITY_TIER`
|
|
92
|
-
reports the source. A scenario with no assertions or missing observations fails; open a real capture.
|
|
92
|
+
reports the source. A scenario with no assertions or missing observations fails; open a real capture. The engine warns you before a human does: `TN_SCENE_WARNING` fires when the GPU used under a third of the frame while the JS render phase ran longer than the display's own period, and names the census behind it — objects considered, draws per pass, triangles per draw, shadow-exempt casters. It is a scene-shape verdict, so answer it by moving the draw and object counts, not the engine: read the bucket census before promising a merge. `npx threenative doctor` repeats the last verdict and the `DEV_MODE=true` chip shows it beside the frame rate; `TN_FRAME_SPANS=1` adds the render phase's own span tree when you need to know which part costs the milliseconds. The cheapest static object is one whose transform you never write: measured on 1,561 objects, leaving them alone costs 10.10 ms of render phase against 17.45 ms when the game rewrites every transform each frame, because three skips the per-object binding update when nothing changed. So do not touch a transform you do not need to — that is worth ~7 ms where `markStatic(root)`, which additionally composes a never-moving subtree once, measured 0.009 ms. Use it for scenery you are sure of, and `invalidateStatic(object)` to announce a write inside one; it deletes matrix arithmetic, not the walk. `TN_RENDERLIST_VALIDATE=1` recomputes every world matrix the long way each frame and throws on the first that disagrees, which is how you prove a freeze did not leave something stale on screen.
|
|
93
93
|
|
|
94
|
-
Recipes shipped in the project: `agent-docs/assertion-reference.md`, `agent-docs/capability-reference.md`, `agent-docs/capture-the-frame.md`, `agent-docs/creating-creatures.md`, `agent-docs/ctx-cookbook.md`, `agent-docs/debug-surface.md`, `agent-docs/finding-assets.md`, `agent-docs/gameplay-recipes.md`, `agent-docs/menu-screens.md`, `agent-docs/mobile-memory-budget.md`, `agent-docs/sculpt-from-a-reference.md`, `agent-docs/trace-a-slow-frame.md`, `agent-docs/visual-baseline.md`, and `agent-docs/webview-ui.md`.
|
|
94
|
+
Recipes shipped in the project: `agent-docs/assertion-reference.md`, `agent-docs/capability-reference.md`, `agent-docs/capture-the-frame.md`, `agent-docs/creating-creatures.md`, `agent-docs/ctx-cookbook.md`, `agent-docs/debug-surface.md`, `agent-docs/finding-assets.md`, `agent-docs/gameplay-recipes.md`, `agent-docs/menu-screens.md`, `agent-docs/mobile-memory-budget.md`, `agent-docs/performance-basics.md`, `agent-docs/rigging-characters.md`, `agent-docs/sculpt-from-a-reference.md`, `agent-docs/trace-a-slow-frame.md`, `agent-docs/visual-baseline.md`, and `agent-docs/webview-ui.md`.
|
|
95
95
|
## Optional multiplayer transport
|
|
96
96
|
For online play only, import `connect` from `@threenative/core/net` with an HTTPS URL and nonempty identity credential; configure `connectTimeoutMs`, `maxReliableMessageBytes`, `maxQueuedReliableBytes`, and `maxQueuedDatagrams` (10s/65,536/1 MiB/256), use `reliable-ordered` for ordered reliable messages and bounded `unreliable` datagrams that may drop, and keep serialization, replication, prediction, interpolation, snapshots and rejoin in this game's `src/` and server. There is no fallback: unsupported WebTransport/native rejects with `TN_NET_UNAVAILABLE`; reference Go server: `packages/runtime-native/examples/webtransport/server`.
|
|
@@ -7,13 +7,13 @@ Instructions for the AI agent in this game. `CLAUDE.md` mirrors this file; edit
|
|
|
7
7
|
## Ownership
|
|
8
8
|
|
|
9
9
|
ThreeNative owns bootstrap, renderer, fixed-step loop, input, loading, physics bindings, and the state bridge. This repository owns the room, the crates, the hinge, the ball, the goal, the HUD
|
|
10
|
-
and the look; `src/game.ts` is portable and React mounts only from `src/main.ts`.
|
|
10
|
+
and the look; `src/game.ts` is portable and React mounts only from `src/main.ts`. The render camera also skips an object that projects under **0.5 px** in it; `renderer.minimumProjectedPixels` raises that threshold (`false` disables the cut, not the count) and `alwaysRender(object)` exempts an object, while camera-attached objects and shadow casters are kept. The engine also owns the per-frame world-matrix walk, and by default it does not descend into a hidden subtree — so a game that reads a hidden object's `matrixWorld` directly must use `getWorldPosition` (or call `object.updateWorldMatrix(true, false)`) first; `renderer.matrixWorld: "all"` restores three's every-node walk, and `TN_PROJECTION` reports the visited-node count either way.
|
|
11
11
|
|
|
12
12
|
## Start every change
|
|
13
13
|
|
|
14
14
|
1. **Critical planning gate:** invoke `threenative-capabilities` before `prd-creator`. Search
|
|
15
15
|
`engine_search_capabilities` for the full request and each concrete mechanic, inspect relevant
|
|
16
|
-
matches with `engine_capability_detail`, and record a capability or no-match for the plan.
|
|
16
|
+
matches with `engine_capability_detail`, and record a capability or no-match for the plan. Apply the `ponytail` ladder before writing code; never hand-write what the capability search already installs.
|
|
17
17
|
2. Then invoke `prd-creator`. Draft the plan around those capabilities and binding constraints,
|
|
18
18
|
direct the user to review it, and wait for explicit approval plus an instruction to implement it.
|
|
19
19
|
3. Treat returned constraints as binding. This kit needs no navmesh and imports none, so it runs
|
|
@@ -39,7 +39,7 @@ bridge; avoid DOM globals, dynamic `import()`, and raw physics handles. **Report
|
|
|
39
39
|
- `.agents/skills/threenative-performance/SKILL.md` / `.claude/skills/threenative-performance/SKILL.md` — measured budgets.
|
|
40
40
|
- `.agents/skills/threenative-ui/SKILL.md` / `.claude/skills/threenative-ui/SKILL.md` — native-safe UI.
|
|
41
41
|
- `.agents/skills/threenative-context/SKILL.md` / `.claude/skills/threenative-context/SKILL.md` — portable ctx APIs.
|
|
42
|
-
- Confirmed framework bugs: use `file-engine-bug` in `.agents/skills/` or `.claude/skills/` after a minimal repro.
|
|
42
|
+
- Confirmed framework bugs: use `file-engine-bug` in `.agents/skills/` or `.claude/skills/` after a minimal repro. Lazy-first: `.agents/skills/ponytail/SKILL.md` / `.claude/skills/ponytail/SKILL.md` — smallest correct change, and its reuse rung is the capability search above.
|
|
43
43
|
|
|
44
44
|
## Commands and map
|
|
45
45
|
|
|
@@ -91,8 +91,8 @@ supposed to be touching. Two loading conventions come from `@threenative/core`,
|
|
|
91
91
|
Edit `src/render/` directly; `postprocessing.ts` reports stages but decides no game colour. Quality
|
|
92
92
|
tiers live in `src/render/quality.ts`: `low`, `medium`, `high`; `isMobile()` chooses `low`, otherwise
|
|
93
93
|
`high`; override with `setupPost(..., { tier: "low" })`. Unknown tiers throw and `TN_QUALITY_TIER`
|
|
94
|
-
reports the source. A scenario with no assertions or missing observations fails; open a real capture.
|
|
94
|
+
reports the source. A scenario with no assertions or missing observations fails; open a real capture. The engine warns you before a human does: `TN_SCENE_WARNING` fires when the GPU used under a third of the frame while the JS render phase ran longer than the display's own period, and names the census behind it — objects considered, draws per pass, triangles per draw, shadow-exempt casters. It is a scene-shape verdict, so answer it by moving the draw and object counts, not the engine: read the bucket census before promising a merge. `npx threenative doctor` repeats the last verdict and the `DEV_MODE=true` chip shows it beside the frame rate; `TN_FRAME_SPANS=1` adds the render phase's own span tree when you need to know which part costs the milliseconds. The cheapest static object is one whose transform you never write: measured on 1,561 objects, leaving them alone costs 10.10 ms of render phase against 17.45 ms when the game rewrites every transform each frame, because three skips the per-object binding update when nothing changed. So do not touch a transform you do not need to — that is worth ~7 ms where `markStatic(root)`, which additionally composes a never-moving subtree once, measured 0.009 ms. Use it for scenery you are sure of, and `invalidateStatic(object)` to announce a write inside one; it deletes matrix arithmetic, not the walk. `TN_RENDERLIST_VALIDATE=1` recomputes every world matrix the long way each frame and throws on the first that disagrees, which is how you prove a freeze did not leave something stale on screen.
|
|
95
95
|
|
|
96
|
-
Recipes shipped in the project: `agent-docs/assertion-reference.md`, `agent-docs/capability-reference.md`, `agent-docs/capture-the-frame.md`, `agent-docs/creating-creatures.md`, `agent-docs/ctx-cookbook.md`, `agent-docs/debug-surface.md`, `agent-docs/finding-assets.md`, `agent-docs/gameplay-recipes.md`, `agent-docs/menu-screens.md`, `agent-docs/mobile-memory-budget.md`, `agent-docs/sculpt-from-a-reference.md`, `agent-docs/trace-a-slow-frame.md`, `agent-docs/visual-baseline.md`, and `agent-docs/webview-ui.md`.
|
|
96
|
+
Recipes shipped in the project: `agent-docs/assertion-reference.md`, `agent-docs/capability-reference.md`, `agent-docs/capture-the-frame.md`, `agent-docs/creating-creatures.md`, `agent-docs/ctx-cookbook.md`, `agent-docs/debug-surface.md`, `agent-docs/finding-assets.md`, `agent-docs/gameplay-recipes.md`, `agent-docs/menu-screens.md`, `agent-docs/mobile-memory-budget.md`, `agent-docs/performance-basics.md`, `agent-docs/rigging-characters.md`, `agent-docs/sculpt-from-a-reference.md`, `agent-docs/trace-a-slow-frame.md`, `agent-docs/visual-baseline.md`, and `agent-docs/webview-ui.md`.
|
|
97
97
|
## Optional multiplayer transport
|
|
98
98
|
For online play only, import `connect` from `@threenative/core/net` with an HTTPS URL and nonempty identity credential; configure `connectTimeoutMs`, `maxReliableMessageBytes`, `maxQueuedReliableBytes`, and `maxQueuedDatagrams` (10s/65,536/1 MiB/256), use `reliable-ordered` for ordered reliable messages and bounded `unreliable` datagrams that may drop, and keep serialization, replication, prediction, interpolation, snapshots and rejoin in this game's `src/` and server. There is no fallback: unsupported WebTransport/native rejects with `TN_NET_UNAVAILABLE`; reference Go server: `packages/runtime-native/examples/webtransport/server`.
|
|
@@ -11,13 +11,13 @@
|
|
|
11
11
|
"build:android": "threenative build --target android",
|
|
12
12
|
"build:ios": "threenative build --target ios",
|
|
13
13
|
"pretest": "playwright install chromium",
|
|
14
|
-
"test": "
|
|
14
|
+
"test": "pnpm build:web && threenative-playtest --scenario \"playtests/*.playtest.json\" --browser-recipe webgpu --headed --server-command \"pnpm exec vite preview --host 127.0.0.1 --port $PORT --strictPort\"",
|
|
15
15
|
"typecheck": "tsc --noEmit -p tsconfig.json"
|
|
16
16
|
},
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"@threenative/core": "0.3.
|
|
19
|
-
"@threenative/physics": "0.3.
|
|
20
|
-
"@threenative/ui": "0.3.
|
|
18
|
+
"@threenative/core": "0.3.3",
|
|
19
|
+
"@threenative/physics": "0.3.3",
|
|
20
|
+
"@threenative/ui": "0.3.3",
|
|
21
21
|
"react": "19.2.0",
|
|
22
22
|
"react-dom": "19.2.0",
|
|
23
23
|
"three": "0.185.1"
|
|
@@ -25,13 +25,13 @@
|
|
|
25
25
|
"devDependencies": {
|
|
26
26
|
"@gltf-transform/cli": "4.4.2",
|
|
27
27
|
"@tailwindcss/vite": "4.3.3",
|
|
28
|
-
"@threenative/assets": "0.3.
|
|
29
|
-
"@threenative/playtest": "0.3.
|
|
28
|
+
"@threenative/assets": "0.3.3",
|
|
29
|
+
"@threenative/playtest": "0.3.3",
|
|
30
30
|
"@types/react": "19.2.0",
|
|
31
31
|
"@types/react-dom": "19.2.0",
|
|
32
32
|
"@types/three": "0.185.3",
|
|
33
33
|
"@vitejs/plugin-react": "6.0.5",
|
|
34
|
-
"create-threenative": "0.2.
|
|
34
|
+
"create-threenative": "0.2.6",
|
|
35
35
|
"esbuild": "0.27.0",
|
|
36
36
|
"playwright": "1.62.1",
|
|
37
37
|
"tailwindcss": "4.3.3",
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
"vite": "8.2.0"
|
|
40
40
|
},
|
|
41
41
|
"optionalDependencies": {
|
|
42
|
-
"@threenative/runtime-native": "0.3.
|
|
42
|
+
"@threenative/runtime-native": "0.3.3"
|
|
43
43
|
},
|
|
44
44
|
"pnpm": {
|
|
45
45
|
"onlyBuiltDependencies": ["@threenative/core", "@threenative/runtime-native"],
|
|
@@ -5,13 +5,13 @@ Instructions for the AI agent in this game. `CLAUDE.md` mirrors this file; edit
|
|
|
5
5
|
## Ownership
|
|
6
6
|
|
|
7
7
|
ThreeNative owns bootstrap, renderer, fixed-step loop, input, loading, physics bindings, and the state bridge. This repository owns the car feel, track, race rules, rescue, HUD, and look;
|
|
8
|
-
`src/game.ts` is portable and React mounts from `src/main.ts`.
|
|
8
|
+
`src/game.ts` is portable and React mounts from `src/main.ts`. The render camera also skips an object that projects under **0.5 px** in it; `renderer.minimumProjectedPixels` raises that threshold (`false` disables the cut, not the count) and `alwaysRender(object)` exempts an object, while camera-attached objects and shadow casters are kept. The engine also owns the per-frame world-matrix walk, and by default it does not descend into a hidden subtree — so a game that reads a hidden object's `matrixWorld` directly must use `getWorldPosition` (or call `object.updateWorldMatrix(true, false)`) first; `renderer.matrixWorld: "all"` restores three's every-node walk, and `TN_PROJECTION` reports the visited-node count either way.
|
|
9
9
|
|
|
10
10
|
## Start every change
|
|
11
11
|
|
|
12
12
|
1. **Critical planning gate:** invoke `threenative-capabilities` before `prd-creator`. Search
|
|
13
13
|
`engine_search_capabilities` for the full request and each concrete mechanic, inspect relevant
|
|
14
|
-
matches with `engine_capability_detail`, and record a capability or no-match for the plan.
|
|
14
|
+
matches with `engine_capability_detail`, and record a capability or no-match for the plan. Apply the `ponytail` ladder before writing code; never hand-write what the capability search already installs.
|
|
15
15
|
2. Then invoke `prd-creator`. Draft the plan around those capabilities and binding constraints,
|
|
16
16
|
direct the user to review it, and wait for explicit approval plus an instruction to implement it.
|
|
17
17
|
3. Treat returned constraints as binding. `@threenative/physics/navigation` is browser-only WASM;
|
|
@@ -37,7 +37,7 @@ bridge; avoid DOM globals, dynamic `import()`, and raw physics handles. **Report
|
|
|
37
37
|
- `.agents/skills/threenative-performance/SKILL.md` / `.claude/skills/threenative-performance/SKILL.md` — measured budgets.
|
|
38
38
|
- `.agents/skills/threenative-ui/SKILL.md` / `.claude/skills/threenative-ui/SKILL.md` — native-safe UI.
|
|
39
39
|
- `.agents/skills/threenative-context/SKILL.md` / `.claude/skills/threenative-context/SKILL.md` — portable ctx APIs.
|
|
40
|
-
- Confirmed framework bugs: use `file-engine-bug` in `.agents/skills/` or `.claude/skills/` after a minimal repro.
|
|
40
|
+
- Confirmed framework bugs: use `file-engine-bug` in `.agents/skills/` or `.claude/skills/` after a minimal repro. Lazy-first: `.agents/skills/ponytail/SKILL.md` / `.claude/skills/ponytail/SKILL.md` — smallest correct change, and its reuse rung is the capability search above.
|
|
41
41
|
|
|
42
42
|
## Commands and map
|
|
43
43
|
|
|
@@ -89,8 +89,8 @@ supposed to be touching. Two loading conventions come from `@threenative/core`,
|
|
|
89
89
|
|
|
90
90
|
Reference-driven authoring starts at `agent-docs/dream-loop.md`.
|
|
91
91
|
|
|
92
|
-
Open a capture after visual changes. A scenario with no assertions or missing observations fails.
|
|
92
|
+
Open a capture after visual changes. A scenario with no assertions or missing observations fails. The engine warns you before a human does: `TN_SCENE_WARNING` fires when the GPU used under a third of the frame while the JS render phase ran longer than the display's own period, and names the census behind it — objects considered, draws per pass, triangles per draw, shadow-exempt casters. It is a scene-shape verdict, so answer it by moving the draw and object counts, not the engine: read the bucket census before promising a merge. `npx threenative doctor` repeats the last verdict and the `DEV_MODE=true` chip shows it beside the frame rate; `TN_FRAME_SPANS=1` adds the render phase's own span tree when you need to know which part costs the milliseconds. The cheapest static object is one whose transform you never write: measured on 1,561 objects, leaving them alone costs 10.10 ms of render phase against 17.45 ms when the game rewrites every transform each frame, because three skips the per-object binding update when nothing changed. So do not touch a transform you do not need to — that is worth ~7 ms where `markStatic(root)`, which additionally composes a never-moving subtree once, measured 0.009 ms. Use it for scenery you are sure of, and `invalidateStatic(object)` to announce a write inside one; it deletes matrix arithmetic, not the walk. `TN_RENDERLIST_VALIDATE=1` recomputes every world matrix the long way each frame and throws on the first that disagrees, which is how you prove a freeze did not leave something stale on screen.
|
|
93
93
|
|
|
94
|
-
Recipes shipped in the project: `agent-docs/assertion-reference.md`, `agent-docs/capability-reference.md`, `agent-docs/capture-the-frame.md`, `agent-docs/creating-creatures.md`, `agent-docs/ctx-cookbook.md`, `agent-docs/debug-surface.md`, `agent-docs/finding-assets.md`, `agent-docs/gameplay-recipes.md`, `agent-docs/menu-screens.md`, `agent-docs/mobile-memory-budget.md`, `agent-docs/sculpt-from-a-reference.md`, `agent-docs/trace-a-slow-frame.md`, `agent-docs/visual-baseline.md`, and `agent-docs/webview-ui.md`.
|
|
94
|
+
Recipes shipped in the project: `agent-docs/assertion-reference.md`, `agent-docs/capability-reference.md`, `agent-docs/capture-the-frame.md`, `agent-docs/creating-creatures.md`, `agent-docs/ctx-cookbook.md`, `agent-docs/debug-surface.md`, `agent-docs/finding-assets.md`, `agent-docs/gameplay-recipes.md`, `agent-docs/menu-screens.md`, `agent-docs/mobile-memory-budget.md`, `agent-docs/performance-basics.md`, `agent-docs/rigging-characters.md`, `agent-docs/sculpt-from-a-reference.md`, `agent-docs/trace-a-slow-frame.md`, `agent-docs/visual-baseline.md`, and `agent-docs/webview-ui.md`.
|
|
95
95
|
## Optional multiplayer transport
|
|
96
96
|
For online play only, import `connect` from `@threenative/core/net` with an HTTPS URL and nonempty identity credential; configure `connectTimeoutMs`, `maxReliableMessageBytes`, `maxQueuedReliableBytes`, and `maxQueuedDatagrams` (10s/65,536/1 MiB/256), use `reliable-ordered` for ordered reliable messages and bounded `unreliable` datagrams that may drop, and keep serialization, replication, prediction, interpolation, snapshots and rejoin in this game's `src/` and server. There is no fallback: unsupported WebTransport/native rejects with `TN_NET_UNAVAILABLE`; reference Go server: `packages/runtime-native/examples/webtransport/server`.
|
|
@@ -7,13 +7,13 @@ Instructions for the AI agent in this game. `CLAUDE.md` mirrors this file; edit
|
|
|
7
7
|
## Ownership
|
|
8
8
|
|
|
9
9
|
ThreeNative owns bootstrap, renderer, fixed-step loop, input, loading, physics bindings, and the state bridge. This repository owns the car feel, track, race rules, rescue, HUD, and look;
|
|
10
|
-
`src/game.ts` is portable and React mounts from `src/main.ts`.
|
|
10
|
+
`src/game.ts` is portable and React mounts from `src/main.ts`. The render camera also skips an object that projects under **0.5 px** in it; `renderer.minimumProjectedPixels` raises that threshold (`false` disables the cut, not the count) and `alwaysRender(object)` exempts an object, while camera-attached objects and shadow casters are kept. The engine also owns the per-frame world-matrix walk, and by default it does not descend into a hidden subtree — so a game that reads a hidden object's `matrixWorld` directly must use `getWorldPosition` (or call `object.updateWorldMatrix(true, false)`) first; `renderer.matrixWorld: "all"` restores three's every-node walk, and `TN_PROJECTION` reports the visited-node count either way.
|
|
11
11
|
|
|
12
12
|
## Start every change
|
|
13
13
|
|
|
14
14
|
1. **Critical planning gate:** invoke `threenative-capabilities` before `prd-creator`. Search
|
|
15
15
|
`engine_search_capabilities` for the full request and each concrete mechanic, inspect relevant
|
|
16
|
-
matches with `engine_capability_detail`, and record a capability or no-match for the plan.
|
|
16
|
+
matches with `engine_capability_detail`, and record a capability or no-match for the plan. Apply the `ponytail` ladder before writing code; never hand-write what the capability search already installs.
|
|
17
17
|
2. Then invoke `prd-creator`. Draft the plan around those capabilities and binding constraints,
|
|
18
18
|
direct the user to review it, and wait for explicit approval plus an instruction to implement it.
|
|
19
19
|
3. Treat returned constraints as binding. `@threenative/physics/navigation` is browser-only WASM;
|
|
@@ -39,7 +39,7 @@ bridge; avoid DOM globals, dynamic `import()`, and raw physics handles. **Report
|
|
|
39
39
|
- `.agents/skills/threenative-performance/SKILL.md` / `.claude/skills/threenative-performance/SKILL.md` — measured budgets.
|
|
40
40
|
- `.agents/skills/threenative-ui/SKILL.md` / `.claude/skills/threenative-ui/SKILL.md` — native-safe UI.
|
|
41
41
|
- `.agents/skills/threenative-context/SKILL.md` / `.claude/skills/threenative-context/SKILL.md` — portable ctx APIs.
|
|
42
|
-
- Confirmed framework bugs: use `file-engine-bug` in `.agents/skills/` or `.claude/skills/` after a minimal repro.
|
|
42
|
+
- Confirmed framework bugs: use `file-engine-bug` in `.agents/skills/` or `.claude/skills/` after a minimal repro. Lazy-first: `.agents/skills/ponytail/SKILL.md` / `.claude/skills/ponytail/SKILL.md` — smallest correct change, and its reuse rung is the capability search above.
|
|
43
43
|
|
|
44
44
|
## Commands and map
|
|
45
45
|
|
|
@@ -91,8 +91,8 @@ supposed to be touching. Two loading conventions come from `@threenative/core`,
|
|
|
91
91
|
|
|
92
92
|
Reference-driven authoring starts at `agent-docs/dream-loop.md`.
|
|
93
93
|
|
|
94
|
-
Open a capture after visual changes. A scenario with no assertions or missing observations fails.
|
|
94
|
+
Open a capture after visual changes. A scenario with no assertions or missing observations fails. The engine warns you before a human does: `TN_SCENE_WARNING` fires when the GPU used under a third of the frame while the JS render phase ran longer than the display's own period, and names the census behind it — objects considered, draws per pass, triangles per draw, shadow-exempt casters. It is a scene-shape verdict, so answer it by moving the draw and object counts, not the engine: read the bucket census before promising a merge. `npx threenative doctor` repeats the last verdict and the `DEV_MODE=true` chip shows it beside the frame rate; `TN_FRAME_SPANS=1` adds the render phase's own span tree when you need to know which part costs the milliseconds. The cheapest static object is one whose transform you never write: measured on 1,561 objects, leaving them alone costs 10.10 ms of render phase against 17.45 ms when the game rewrites every transform each frame, because three skips the per-object binding update when nothing changed. So do not touch a transform you do not need to — that is worth ~7 ms where `markStatic(root)`, which additionally composes a never-moving subtree once, measured 0.009 ms. Use it for scenery you are sure of, and `invalidateStatic(object)` to announce a write inside one; it deletes matrix arithmetic, not the walk. `TN_RENDERLIST_VALIDATE=1` recomputes every world matrix the long way each frame and throws on the first that disagrees, which is how you prove a freeze did not leave something stale on screen.
|
|
95
95
|
|
|
96
|
-
Recipes shipped in the project: `agent-docs/assertion-reference.md`, `agent-docs/capability-reference.md`, `agent-docs/capture-the-frame.md`, `agent-docs/creating-creatures.md`, `agent-docs/ctx-cookbook.md`, `agent-docs/debug-surface.md`, `agent-docs/finding-assets.md`, `agent-docs/gameplay-recipes.md`, `agent-docs/menu-screens.md`, `agent-docs/mobile-memory-budget.md`, `agent-docs/sculpt-from-a-reference.md`, `agent-docs/trace-a-slow-frame.md`, `agent-docs/visual-baseline.md`, and `agent-docs/webview-ui.md`.
|
|
96
|
+
Recipes shipped in the project: `agent-docs/assertion-reference.md`, `agent-docs/capability-reference.md`, `agent-docs/capture-the-frame.md`, `agent-docs/creating-creatures.md`, `agent-docs/ctx-cookbook.md`, `agent-docs/debug-surface.md`, `agent-docs/finding-assets.md`, `agent-docs/gameplay-recipes.md`, `agent-docs/menu-screens.md`, `agent-docs/mobile-memory-budget.md`, `agent-docs/performance-basics.md`, `agent-docs/rigging-characters.md`, `agent-docs/sculpt-from-a-reference.md`, `agent-docs/trace-a-slow-frame.md`, `agent-docs/visual-baseline.md`, and `agent-docs/webview-ui.md`.
|
|
97
97
|
## Optional multiplayer transport
|
|
98
98
|
For online play only, import `connect` from `@threenative/core/net` with an HTTPS URL and nonempty identity credential; configure `connectTimeoutMs`, `maxReliableMessageBytes`, `maxQueuedReliableBytes`, and `maxQueuedDatagrams` (10s/65,536/1 MiB/256), use `reliable-ordered` for ordered reliable messages and bounded `unreliable` datagrams that may drop, and keep serialization, replication, prediction, interpolation, snapshots and rejoin in this game's `src/` and server. There is no fallback: unsupported WebTransport/native rejects with `TN_NET_UNAVAILABLE`; reference Go server: `packages/runtime-native/examples/webtransport/server`.
|
|
@@ -12,13 +12,13 @@
|
|
|
12
12
|
"build:ios": "threenative build --target ios",
|
|
13
13
|
"test:native": "pnpm build:desktop && threenative-playtest --scenario native-playtests/survives.playtest.json --target desktop --executable dist-native/__PROJECT_NAME__",
|
|
14
14
|
"pretest": "playwright install chromium",
|
|
15
|
-
"test": "
|
|
15
|
+
"test": "pnpm build:web && threenative-playtest --scenario \"playtests/*.playtest.json\" --browser-recipe webgpu --headed --server-command \"pnpm exec vite preview --host 127.0.0.1 --port $PORT --strictPort\"",
|
|
16
16
|
"typecheck": "tsc --noEmit -p tsconfig.json"
|
|
17
17
|
},
|
|
18
18
|
"dependencies": {
|
|
19
|
-
"@threenative/core": "0.3.
|
|
20
|
-
"@threenative/physics": "0.3.
|
|
21
|
-
"@threenative/ui": "0.3.
|
|
19
|
+
"@threenative/core": "0.3.3",
|
|
20
|
+
"@threenative/physics": "0.3.3",
|
|
21
|
+
"@threenative/ui": "0.3.3",
|
|
22
22
|
"react": "19.2.0",
|
|
23
23
|
"react-dom": "19.2.0",
|
|
24
24
|
"three": "0.185.1"
|
|
@@ -26,13 +26,13 @@
|
|
|
26
26
|
"devDependencies": {
|
|
27
27
|
"@gltf-transform/cli": "4.4.2",
|
|
28
28
|
"@tailwindcss/vite": "4.3.3",
|
|
29
|
-
"@threenative/assets": "0.3.
|
|
30
|
-
"@threenative/playtest": "0.3.
|
|
29
|
+
"@threenative/assets": "0.3.3",
|
|
30
|
+
"@threenative/playtest": "0.3.3",
|
|
31
31
|
"@types/react": "19.2.0",
|
|
32
32
|
"@types/react-dom": "19.2.0",
|
|
33
33
|
"@types/three": "0.185.3",
|
|
34
34
|
"@vitejs/plugin-react": "6.0.5",
|
|
35
|
-
"create-threenative": "0.2.
|
|
35
|
+
"create-threenative": "0.2.6",
|
|
36
36
|
"esbuild": "0.27.0",
|
|
37
37
|
"playwright": "1.62.1",
|
|
38
38
|
"tailwindcss": "4.3.3",
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
"vite": "8.2.0"
|
|
41
41
|
},
|
|
42
42
|
"optionalDependencies": {
|
|
43
|
-
"@threenative/runtime-native": "0.3.
|
|
43
|
+
"@threenative/runtime-native": "0.3.3"
|
|
44
44
|
},
|
|
45
45
|
"pnpm": {
|
|
46
46
|
"onlyBuiltDependencies": ["@threenative/core", "@threenative/runtime-native"],
|
|
@@ -5,13 +5,13 @@ Instructions for the AI agent in this game. `CLAUDE.md` mirrors this file; edit
|
|
|
5
5
|
## Ownership
|
|
6
6
|
|
|
7
7
|
ThreeNative owns bootstrap, renderer, fixed-step loop, input, loading, physics bindings, and the state bridge. This repository owns the track, the runner, the obstacles, the dust, the HUD and the
|
|
8
|
-
look; `src/game.ts` is portable and React mounts only from `src/main.ts`.
|
|
8
|
+
look; `src/game.ts` is portable and React mounts only from `src/main.ts`. The render camera also skips an object that projects under **0.5 px** in it; `renderer.minimumProjectedPixels` raises that threshold (`false` disables the cut, not the count) and `alwaysRender(object)` exempts an object, while camera-attached objects and shadow casters are kept. The engine also owns the per-frame world-matrix walk, and by default it does not descend into a hidden subtree — so a game that reads a hidden object's `matrixWorld` directly must use `getWorldPosition` (or call `object.updateWorldMatrix(true, false)`) first; `renderer.matrixWorld: "all"` restores three's every-node walk, and `TN_PROJECTION` reports the visited-node count either way.
|
|
9
9
|
|
|
10
10
|
## Start every change
|
|
11
11
|
|
|
12
12
|
1. **Critical planning gate:** invoke `threenative-capabilities` before `prd-creator`. Search
|
|
13
13
|
`engine_search_capabilities` for the full request and each concrete mechanic, inspect relevant
|
|
14
|
-
matches with `engine_capability_detail`, and record a capability or no-match for the plan.
|
|
14
|
+
matches with `engine_capability_detail`, and record a capability or no-match for the plan. Apply the `ponytail` ladder before writing code; never hand-write what the capability search already installs.
|
|
15
15
|
2. Then invoke `prd-creator`. Draft the plan around those capabilities and binding constraints,
|
|
16
16
|
direct the user to review it, and wait for explicit approval plus an instruction to implement it.
|
|
17
17
|
3. Treat returned constraints as binding. No navmesh is imported, so this kit runs on every
|
|
@@ -38,7 +38,7 @@ bridge; avoid DOM globals, dynamic `import()`, and raw physics handles. **Report
|
|
|
38
38
|
- `.agents/skills/threenative-performance/SKILL.md` / `.claude/skills/threenative-performance/SKILL.md` — measured budgets.
|
|
39
39
|
- `.agents/skills/threenative-ui/SKILL.md` / `.claude/skills/threenative-ui/SKILL.md` — native-safe UI.
|
|
40
40
|
- `.agents/skills/threenative-context/SKILL.md` / `.claude/skills/threenative-context/SKILL.md` — portable ctx APIs.
|
|
41
|
-
- Confirmed framework bugs: use `file-engine-bug` in `.agents/skills/` or `.claude/skills/` after a minimal repro.
|
|
41
|
+
- Confirmed framework bugs: use `file-engine-bug` in `.agents/skills/` or `.claude/skills/` after a minimal repro. Lazy-first: `.agents/skills/ponytail/SKILL.md` / `.claude/skills/ponytail/SKILL.md` — smallest correct change, and its reuse rung is the capability search above.
|
|
42
42
|
|
|
43
43
|
## Commands and map
|
|
44
44
|
|
|
@@ -89,8 +89,8 @@ supposed to be touching. Two loading conventions come from `@threenative/core`,
|
|
|
89
89
|
Edit `src/render/` directly; `postprocessing.ts` reports stages but decides no game colour. Quality
|
|
90
90
|
tiers live in `src/render/quality.ts`: `low`, `medium`, `high`; `isMobile()` chooses `low`, otherwise
|
|
91
91
|
`high`; override with `setupPost(..., { tier: "low" })`. Unknown tiers throw and `TN_QUALITY_TIER`
|
|
92
|
-
reports the source. A scenario with no assertions or missing observations fails; open a real capture.
|
|
92
|
+
reports the source. A scenario with no assertions or missing observations fails; open a real capture. The engine warns you before a human does: `TN_SCENE_WARNING` fires when the GPU used under a third of the frame while the JS render phase ran longer than the display's own period, and names the census behind it — objects considered, draws per pass, triangles per draw, shadow-exempt casters. It is a scene-shape verdict, so answer it by moving the draw and object counts, not the engine: read the bucket census before promising a merge. `npx threenative doctor` repeats the last verdict and the `DEV_MODE=true` chip shows it beside the frame rate; `TN_FRAME_SPANS=1` adds the render phase's own span tree when you need to know which part costs the milliseconds. The cheapest static object is one whose transform you never write: measured on 1,561 objects, leaving them alone costs 10.10 ms of render phase against 17.45 ms when the game rewrites every transform each frame, because three skips the per-object binding update when nothing changed. So do not touch a transform you do not need to — that is worth ~7 ms where `markStatic(root)`, which additionally composes a never-moving subtree once, measured 0.009 ms. Use it for scenery you are sure of, and `invalidateStatic(object)` to announce a write inside one; it deletes matrix arithmetic, not the walk. `TN_RENDERLIST_VALIDATE=1` recomputes every world matrix the long way each frame and throws on the first that disagrees, which is how you prove a freeze did not leave something stale on screen.
|
|
93
93
|
|
|
94
|
-
Recipes shipped in the project: `agent-docs/assertion-reference.md`, `agent-docs/capability-reference.md`, `agent-docs/capture-the-frame.md`, `agent-docs/creating-creatures.md`, `agent-docs/ctx-cookbook.md`, `agent-docs/debug-surface.md`, `agent-docs/finding-assets.md`, `agent-docs/gameplay-recipes.md`, `agent-docs/menu-screens.md`, `agent-docs/mobile-memory-budget.md`, `agent-docs/sculpt-from-a-reference.md`, `agent-docs/trace-a-slow-frame.md`, `agent-docs/visual-baseline.md`, and `agent-docs/webview-ui.md`.
|
|
94
|
+
Recipes shipped in the project: `agent-docs/assertion-reference.md`, `agent-docs/capability-reference.md`, `agent-docs/capture-the-frame.md`, `agent-docs/creating-creatures.md`, `agent-docs/ctx-cookbook.md`, `agent-docs/debug-surface.md`, `agent-docs/finding-assets.md`, `agent-docs/gameplay-recipes.md`, `agent-docs/menu-screens.md`, `agent-docs/mobile-memory-budget.md`, `agent-docs/performance-basics.md`, `agent-docs/rigging-characters.md`, `agent-docs/sculpt-from-a-reference.md`, `agent-docs/trace-a-slow-frame.md`, `agent-docs/visual-baseline.md`, and `agent-docs/webview-ui.md`.
|
|
95
95
|
## Optional multiplayer transport
|
|
96
96
|
For online play only, import `connect` from `@threenative/core/net` with an HTTPS URL and nonempty identity credential; configure `connectTimeoutMs`, `maxReliableMessageBytes`, `maxQueuedReliableBytes`, and `maxQueuedDatagrams` (10s/65,536/1 MiB/256), use `reliable-ordered` for ordered reliable messages and bounded `unreliable` datagrams that may drop, and keep serialization, replication, prediction, interpolation, snapshots and rejoin in this game's `src/` and server. There is no fallback: unsupported WebTransport/native rejects with `TN_NET_UNAVAILABLE`; reference Go server: `packages/runtime-native/examples/webtransport/server`.
|