incanto 0.30.0 → 0.31.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (42) hide show
  1. package/dist/2d.d.ts +12 -5
  2. package/dist/2d.js +3 -3
  3. package/dist/3d.d.ts +47 -6
  4. package/dist/3d.js +4 -4
  5. package/dist/{audit-C6rMyict.js → audit-C4kmDK0o.js} +16 -0
  6. package/dist/{behavior-BAc0erXF.d.ts → behavior-D_jMpFh8.d.ts} +117 -55
  7. package/dist/{create-game-DuBTv2zI.js → create-game-DqOjMBUS.js} +50 -41
  8. package/dist/{create-game-5z_QVtLx.js → create-game-z5XaB1p5.js} +16 -8
  9. package/dist/debug.d.ts +1 -1
  10. package/dist/debug.js +7 -2
  11. package/dist/{duplicate-BgtFrFo4.js → duplicate-KRPtUtzl.js} +1 -1
  12. package/dist/{editor-switch-B0wB_DSr.d.ts → editor-switch-BJb-CWfA.d.ts} +12 -1
  13. package/dist/{register-DJ0SByQg.js → environment-presets--DigHNg4.js} +42 -11
  14. package/dist/{gameplay-Cfr6aFZ1.js → gameplay-BftxM_It.js} +2 -2
  15. package/dist/gameplay.d.ts +1 -1
  16. package/dist/gameplay.js +1 -1
  17. package/dist/index.d.ts +3 -3
  18. package/dist/index.js +6 -6
  19. package/dist/{loader-B242FF6N.d.ts → loader-BYBrqTxP.d.ts} +1 -1
  20. package/dist/{loader-BZqOKfI2.js → loader-BlaRQGaA.js} +482 -6
  21. package/dist/net.d.ts +1 -1
  22. package/dist/net.js +3 -3
  23. package/dist/{pathfinding-BwD974Ss.d.ts → pathfinding-BwhqPD3i.d.ts} +1 -1
  24. package/dist/{physics-2d-3kOQCtgd.js → physics-2d-D9wquBvK.js} +4 -3
  25. package/dist/{physics-3d-CeRH-Ff_.js → physics-3d-CnPygVGo.js} +5 -4
  26. package/dist/react.d.ts +1 -1
  27. package/dist/react.js +1 -1
  28. package/dist/{register-MelqEdza.js → register-CUY284Is.js} +3 -3
  29. package/dist/{register-BTg0EM7s.js → register-Dzkd6-os.js} +56 -380
  30. package/dist/{register-DWcWq4QG.js → register-tkR_8tWg.js} +4 -4
  31. package/dist/{registry-BVJ2HbCn.js → registry-CJdGpT2V.js} +6 -2
  32. package/dist/test.d.ts +2 -7
  33. package/dist/test.js +43 -14
  34. package/editor/assets/{agent8-CAp0i5qn.js → agent8-o27_Y1xN.js} +1 -1
  35. package/editor/assets/{debug-BoEYfbqK.js → debug-DfcWX3uW.js} +3 -2
  36. package/editor/assets/{index-BO6WU8by.js → index-C9fb5QcT.js} +90 -90
  37. package/editor/index.html +1 -1
  38. package/package.json +1 -1
  39. package/skills/incanto-verifying-your-game.md +62 -0
  40. package/templates-app/beacon-isle-3d/package.json +1 -1
  41. package/templates-app/tps-3d/package.json +1 -1
  42. package/templates-app/village-quest-3d/package.json +1 -1
package/editor/index.html CHANGED
@@ -5,7 +5,7 @@
5
5
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
6
6
  <title>Incanto Scene Editor</title>
7
7
  <link rel="icon" href="data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'><rect width='16' height='16' rx='3' fill='%236ee7dc'/><text x='8' y='12' text-anchor='middle' font-size='11' font-family='monospace' fill='%230e1018'>i</text></svg>" />
8
- <script type="module" crossorigin src="./assets/index-BO6WU8by.js"></script>
8
+ <script type="module" crossorigin src="./assets/index-C9fb5QcT.js"></script>
9
9
  <link rel="modulepreload" crossorigin href="./assets/GameServer-C56iOUgF.js">
10
10
  </head>
11
11
  <body>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "incanto",
3
- "version": "0.30.0",
3
+ "version": "0.31.0",
4
4
  "description": "Vibe-coding-first web game engine SDK — JSON-driven scenes on three.js",
5
5
  "keywords": [
6
6
  "game-engine",
@@ -161,6 +161,68 @@ ANY scene in the project — not just the one the game booted with. `incantoScen
161
161
  root })` bounds that to a directory other than vite's; nothing outside it is readable
162
162
  or writable, and none of it exists in a build (`configureServer`).
163
163
 
164
+ ## 5b. What a green `incanto-check` now covers
165
+
166
+ `validateScene` / `incanto-check` hard-fail on all of these, so they never reach
167
+ a browser:
168
+
169
+ - **Every prop's type AND its enum values** — `"mesh": "crystal"` names what is
170
+ valid instead of printing `ok` and throwing at boot. All 31 enum props.
171
+ - **`input{}`** — a declaration's shape (`"keys": "Space"` instead of
172
+ `["Space"]`, an unknown `type`, a wrong `touch`). This used to be checked only
173
+ by `Engine.setScene`, i.e. never headlessly.
174
+ - **`assets{}`** — every entry an object with a non-empty `url`.
175
+ - **`environment.preset`** — resolved only inside Renderer3D before, so a typo
176
+ survived every check and died at boot.
177
+
178
+ And `auditScene` (the warnings `incanto-check` prints) gained the loudest
179
+ "why is my screen black" of all: **nothing lights this 3D scene** — no light
180
+ node, no `environment` sky/hdri/preset, no ambient intensity. Ambient defaults to
181
+ 0, so such a scene renders nothing, throws nothing and logs nothing.
182
+
183
+ ## 6c. Engine diagnostics you can actually read
184
+
185
+ Every internal warning the engine produces — a GLB that 404'd, a body with no
186
+ collider, a retarget that dropped bones, an exception swallowed inside a physics
187
+ trigger handler — used to go to `console.*` and nowhere else, which is the one
188
+ channel a headless tool cannot read. The symptom was always the same: the model
189
+ simply never appears, and `logs` comes back empty.
190
+
191
+ They now go to **`engine.log` as well as the console**, so:
192
+
193
+ - `runScript().logs` contains them, and `describe()` prints them under the
194
+ failures (`! warn: …`).
195
+ - The debug overlay's **Logs** panel shows them live.
196
+ - `game.assetErrors()` lists every asset that failed **with its reason and ref**
197
+ — the direct answer to "why is my model not there". The store itself is
198
+ reachable as `renderer.assets` in both dimensions.
199
+
200
+ So the after-every-edit check is: `ok`, then **`stats().errors`**, then
201
+ **`assetErrors()`**.
202
+
203
+ ## 6b. A thrown error no longer stops the game
204
+
205
+ One exception used to end everything: `requestAnimationFrame` reschedules AFTER
206
+ your callback returns, so a throw in any behavior's `update` killed the loop
207
+ permanently — no message, `stats().running` still `true`, a game that just
208
+ stopped. It no longer can.
209
+
210
+ - The thing that threw is **reported once** (which node, which script, which
211
+ phase) to `engine.log` AND the console, then **skipped**. Its children and
212
+ every other node keep running.
213
+ - **Your SCRIPT and the engine's NODE are skipped separately.** A typo in a
214
+ behavior attached to a `CharacterController3D` stops that behavior — the
215
+ character still walks and the camera still turns. Only a throw from the node's
216
+ own update quarantines the node.
217
+ - `engine.stats().errors` counts everything swallowed to stay alive. **A game
218
+ that looks fine with `errors: 3` is a broken game** — read `engine.log`.
219
+ - `engine.erroredNodes()` lists them; `engine.resumeErroredNodes()` puts them
220
+ back after you fix the code.
221
+ - `runScript()` FAILS the run when the count is non-zero. "It finished" must not
222
+ mean "nothing broke" — that is right for a player and wrong for a harness.
223
+
224
+ So the check after every edit is still `ok`, plus: **read `stats().errors`**.
225
+
164
226
  ## 7. See inside the RUNNING game (debug overlay)
165
227
 
166
228
  ```ts
@@ -14,7 +14,7 @@
14
14
  "@dimforge/rapier2d-compat": "0.19.3",
15
15
  "@dimforge/rapier3d-compat": "0.19.3",
16
16
  "@pixiv/three-vrm": "^3.5.3",
17
- "incanto": "^0.30.0",
17
+ "incanto": "^0.31.0",
18
18
  "three": "^0.184.0"
19
19
  },
20
20
  "devDependencies": {
@@ -13,7 +13,7 @@
13
13
  "@dimforge/rapier2d-compat": "0.19.3",
14
14
  "@dimforge/rapier3d-compat": "0.19.3",
15
15
  "@pixiv/three-vrm": "^3.5.3",
16
- "incanto": "^0.30.0",
16
+ "incanto": "^0.31.0",
17
17
  "three": "^0.184.0"
18
18
  },
19
19
  "devDependencies": {
@@ -13,7 +13,7 @@
13
13
  "@dimforge/rapier2d-compat": "0.19.3",
14
14
  "@dimforge/rapier3d-compat": "0.19.3",
15
15
  "@pixiv/three-vrm": "^3.5.3",
16
- "incanto": "^0.30.0",
16
+ "incanto": "^0.31.0",
17
17
  "three": "^0.184.0"
18
18
  },
19
19
  "devDependencies": {