incanto 0.71.0 → 0.72.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 (62) hide show
  1. package/bin/incanto-editor.mjs +15 -9
  2. package/bin/incanto-feel.mjs +11 -1
  3. package/bin/incanto-play.mjs +11 -1
  4. package/bin/incanto-playtest.mjs +11 -1
  5. package/dist/2d.d.ts +3 -3
  6. package/dist/2d.js +3 -3
  7. package/dist/3d.d.ts +3 -3
  8. package/dist/3d.js +5 -5
  9. package/dist/{agent8-Cfmd3ar_.js → agent8-BqZ0_O1u.js} +1 -1
  10. package/dist/{audio-player-L8yccdMP.d.ts → audio-player-ioZ7VKC6.d.ts} +1 -1
  11. package/dist/{behavior-Dcz0fr1S.d.ts → behavior-Bf9P9oB2.d.ts} +1 -1
  12. package/dist/{create-game-CH4kt78v.js → create-game-C9rWqqAC.js} +36 -12
  13. package/dist/{create-game-LCHBLfA4.js → create-game-CmFAtLZp.js} +7 -6
  14. package/dist/debug.d.ts +1 -1
  15. package/dist/editor.js +1069 -1035
  16. package/dist/{environment-presets-99BzP_L-.js → environment-presets-BeHoaGhy.js} +3 -3
  17. package/dist/{gameplay-CNULJvwh.js → gameplay-BlQe-M07.js} +1 -1
  18. package/dist/gameplay.d.ts +1 -1
  19. package/dist/gameplay.js +1 -1
  20. package/dist/index.d.ts +4 -4
  21. package/dist/index.js +4 -4
  22. package/dist/{loader-8-IHvbKD.d.ts → loader-CBfQzB6S.d.ts} +10 -3
  23. package/dist/net.d.ts +2 -2
  24. package/dist/net.js +2 -2
  25. package/dist/{physics-2d-FhrXUc6B.js → physics-2d-DrIgTlLk.js} +2 -2
  26. package/dist/{physics-3d-CFEGxBXZ.js → physics-3d-BzOCw1VS.js} +3 -3
  27. package/dist/{picking-DVo7fI13.js → picking-C9McVJrO.js} +2 -2
  28. package/dist/react.d.ts +1 -1
  29. package/dist/react.js +1 -1
  30. package/dist/{register-DuVdzxbq.js → register-5IYfooAN.js} +1 -1
  31. package/dist/{register-BYQCBySi.js → register-C8HuRkOf.js} +3 -3
  32. package/dist/{replay-F7IZHdFR.d.ts → replay-CBEChqXq.d.ts} +2 -2
  33. package/dist/{replay-DEvp3kyV.js → replay-datiAE-b.js} +15 -8
  34. package/dist/{save-slots-Bvuh2p_r.js → save-slots-CEuJPUle.js} +46 -1
  35. package/dist/{split-screen-eULetcg-.js → split-screen-Bm5DTElG.js} +3 -3
  36. package/dist/{split-screen-CIYf1zSf.d.ts → split-screen-DkqLng6q.d.ts} +2 -2
  37. package/dist/{src-_jk0qLsS.js → src-DRSsRleD.js} +1 -1
  38. package/dist/{test-CmN54kWv.js → test-Djuq3Vhq.js} +13 -13
  39. package/dist/test.d.ts +4 -4
  40. package/dist/test.js +2 -2
  41. package/dist/vite.d.ts +8 -1
  42. package/dist/vite.js +22 -5
  43. package/editor/assets/{agent8-yLIEYHbd.js → agent8-CMKz2cax.js} +1 -1
  44. package/editor/assets/{debug-u31w_yhq.js → debug-DLrQm-az.js} +1 -1
  45. package/editor/assets/{index-DK9xMGpW.js → index-BEKuxYcE.js} +92 -92
  46. package/editor/index.html +1 -1
  47. package/package.json +1 -1
  48. package/skills/incanto-building-2d-games.md +6 -0
  49. package/skills/incanto-editor.md +4 -0
  50. package/skills/incanto-scene-json-authoring.md +30 -0
  51. package/templates-app/beacon-isle-3d/package.json +1 -1
  52. package/templates-app/beacon-isle-3d/src/game.scene.json +377 -185
  53. package/templates-app/molehill-2d/package.json +1 -1
  54. package/templates-app/platformer-2d/package.json +1 -1
  55. package/templates-app/platformer-2d/src/game.scene.json +193 -93
  56. package/templates-app/star-survivor/package.json +1 -1
  57. package/templates-app/star-survivor/src/game.scene.json +18 -9
  58. package/templates-app/tps-3d/package.json +1 -1
  59. package/templates-app/tps-3d/src/game.scene.json +82 -39
  60. package/templates-app/village-quest-3d/package.json +1 -1
  61. package/templates-app/village-quest-3d/src/grove.scene.json +98 -46
  62. package/templates-app/village-quest-3d/src/village.scene.json +449 -223
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-DK9xMGpW.js"></script>
8
+ <script type="module" crossorigin src="./assets/index-BEKuxYcE.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.71.0",
3
+ "version": "0.72.0",
4
4
  "description": "Vibe-coding-first web game engine SDK — JSON-driven scenes on three.js",
5
5
  "keywords": [
6
6
  "game-engine",
@@ -117,6 +117,12 @@ stop hand-placing dozens of ColorRect walls:
117
117
  } }
118
118
  ```
119
119
 
120
+ A grid with rows and NEITHER of them draws nothing at all — the mesh is
121
+ hidden, the colliders are still there, and you get a floor you can stand on
122
+ and cannot see. `incanto-check` says so now (`examples/tiles-2d` shipped
123
+ exactly that), so if you meant an invisible collision map over scenery you
124
+ drew yourself, the warning is the price of saying so.
125
+
120
126
  Exclusive with `texture` (one material, one draw call — a half-textured level
121
127
  that loads clean is exactly the silence this engine fails loudly about), and
122
128
  `solid` takes the CHAR you painted as well as an atlas index, because that is
@@ -181,6 +181,10 @@ Opens a local page (default `http://127.0.0.1:5179/`) with three panes:
181
181
  registered node types appear automatically. Edits re-validate through the real
182
182
  loader: hard `IncantoError`s appear in a banner. Validation is STRUCTURE-level —
183
183
  physics semantics are checked when physics actually runs.
184
+ - A node placed with **`instance:`** shows a PLACEMENT card first — which
185
+ prefab file it is (editable, to re-point it) and its `overrides` as JSON, the
186
+ props deep-merged onto the sub-scene root. Dragging its gizmo writes there
187
+ too; `props` on a placement is a load error and is read by nothing.
184
188
  - **Inspector** — schema-driven from the node registry, with STRUCTURED editors for
185
189
  the hard parts: `collider` (shape dropdown + per-shape dimensions, mirrored by
186
190
  the wireframe), `network` (mode dropdown + sync-key chips + throttle),
@@ -398,6 +398,35 @@ that do exist at the failing spot).
398
398
  - Current limitation: exporting expands instances into full trees (the `instance` reference is
399
399
  not preserved on export yet).
400
400
  - Cycles (`a` instances `b` instances `a`) and missing resolvers → `UNRESOLVED_INSTANCE`.
401
+ - A placement's props go in `overrides`. `props` on an `instance:` node is a
402
+ hard `BAD_FORMAT` error — it used to be accepted and read by nothing, so a
403
+ position written there was silently the sub-scene's own.
404
+
405
+ ### Giving the loader the sub-scenes (the half that is not JSON)
406
+
407
+ `loadScene` never reads files: it asks `resolveScene(path)` for the JSON behind
408
+ an `instance:` string, synchronously, and without one a scene with a prefab in
409
+ it does not load. Every CLI (`incanto-check`, `-playtest`, `-verify`, `-feel`,
410
+ `-play`) passes one already, resolved against the SCENE's own folder — your
411
+ game and your harness are the two places you write it yourself:
412
+
413
+ ```ts
414
+ // main.ts — vite. Every *.scene.json beside this file, keyed by the path an
415
+ // `instance:` names.
416
+ const prefabs = import.meta.glob('./*.scene.json', { eager: true, import: 'default' });
417
+ const resolveScene = (path: string): unknown => prefabs[`./${path}`] ?? null;
418
+ await createGame2D({ canvas, scene: sceneJson, resolveScene });
419
+ ```
420
+
421
+ ```ts
422
+ // verify.ts — bun, no bundler: import the prefab and hand it over by path.
423
+ import crateJson from './src/crate.scene.json';
424
+ const resolveScene = (path: string) => (path === 'crate.scene.json' ? crateJson : null);
425
+ await runScript(sceneJson, { durationMs: 4000, resolveScene, steps: [...] });
426
+ ```
427
+
428
+ `examples/tiles-2d` is the worked example: two crates that ARE
429
+ `crate.scene.json`, one of them adding a rope child of its own.
401
430
 
402
431
  ## Error codes you will see (all hard failures at load)
403
432
 
@@ -417,6 +446,7 @@ that do exist at the failing spot).
417
446
  | `UNKNOWN_SIGNAL` | connection (or emit/on) names a signal the from node never declares | use a declared signal, or declare it (`static signals` / `declareSignal`) |
418
447
  | `UNKNOWN_BEHAVIOR` | `script.name` not registered | `registerBehavior(name, Class)` before `loadScene` |
419
448
  | `UNRESOLVED_INSTANCE` | no resolver, unknown path, or instance cycle | provide/fix `resolveScene`, break the cycle |
449
+ | `WRONG_DIMENSION` | a `*3D` node in a 2D scene (or the reverse), or `createGame2D` given a 3D scene | use the matching node type / the matching `createGame*` |
420
450
  | `DUPLICATE_NODE_TYPE` | two classes registered under one type name | rename one type, or `{ replace: true }` for hot reload |
421
451
  | `DUPLICATE_BEHAVIOR` | two classes registered under one behavior name | rename one, or `{ replace: true }` for hot reload |
422
452
  | `TREE_VIOLATION` | invalid name, re-parenting without detach, cycles, double root | follow the rule in the message |
@@ -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.71.0",
17
+ "incanto": "^0.72.0",
18
18
  "three": "^0.184.0"
19
19
  },
20
20
  "devDependencies": {