incanto 0.46.0 → 0.47.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.
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-Y-93awAL.js"></script>
8
+ <script type="module" crossorigin src="./assets/index-B-6eYZEi.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.46.0",
3
+ "version": "0.47.0",
4
4
  "description": "Vibe-coding-first web game engine SDK — JSON-driven scenes on three.js",
5
5
  "keywords": [
6
6
  "game-engine",
@@ -98,6 +98,7 @@
98
98
  "incanto-playtest": "bin/incanto-playtest.mjs",
99
99
  "incanto-feel": "bin/incanto-feel.mjs",
100
100
  "incanto-new": "bin/incanto-new.mjs",
101
- "incanto-frame": "bin/incanto-frame.mjs"
101
+ "incanto-frame": "bin/incanto-frame.mjs",
102
+ "incanto-verify": "./bin/incanto-verify.mjs"
102
103
  }
103
104
  }
@@ -19,6 +19,7 @@ bunx incanto-model public/models/knight.glb
19
19
  # anim Idle: 2.4s
20
20
  # anim Run: 0.8s ← exact clip names for `animation`
21
21
  bunx incanto-model avatar.vrm --json # full machine-readable report
22
+ bunx incanto-model https://.../goblin.glb # a URL works anywhere a path does
22
23
  ```
23
24
 
24
25
  The report gives you: the TRANSFORMED scene bounding box (size/center/min/max — skinned
@@ -63,6 +64,35 @@ tint), `castShadow`/`receiveShadow`, plus the usual Node3D transform.
63
64
 
64
65
  ## Animating named sub-nodes (wheels, turrets, doors) — `poseNode`
65
66
 
67
+ ## What the file will DO here
68
+
69
+ `incanto-model` ends with a verdict, and it answers the three questions that
70
+ cost the most time. Finding an asset is the agent8 library's job — its search
71
+ matches meaning. This says whether what it found works in YOUR scene:
72
+
73
+ ```
74
+ mixamorig rig — the 3d/animations clips play on this as they are
75
+ stands 1.5 units tall
76
+ ```
77
+ ```
78
+ skinned, but NOT a mixamorig rig — the 3d/animations clips will not bind to it
79
+ (bones are matched by name; a mismatch keeps the bind pose and only warns)
80
+ stands 28.45 units tall — not a character's size; set targetHeight (1.7) to fix it
81
+ clips in the file: die, idle, walk, normal_attack, … (play by name, no asset needed)
82
+ ```
83
+ ```
84
+ does NOT stand on its own origin — it sits 10.1 units above the origin. A node at
85
+ [0,0,0] puts it there too; offset the node, or expect an empty-looking frame
86
+ ```
87
+ ```
88
+ an animation CLIP — no mesh of its own. It plays ON a character: declare it as
89
+ {"type":"animation"} and point a ModelInstance3D's `animation` at it. Used as a
90
+ `model` it draws nothing at all, with no error
91
+ ```
92
+
93
+ It then prints the scene JSON to paste — the asset entry and the node, with
94
+ `targetHeight` already set when the raw size calls for it.
95
+
66
96
  Many GLBs ship articulated parts as NAMED nodes (`bunx incanto-model <file>` lists them —
67
97
  e.g. the Kenney vehicles have `wheel-front-left` … `wheel-back-right`). From a behavior,
68
98
  rotate one per frame with `poseNode(name, [rxDeg, ryDeg, rzDeg])` (local Euler XYZ):
@@ -26,6 +26,34 @@ A run that finishes is not a run that worked. `runScript()` fails the run when
26
26
  `stats().errors` is non-zero, and prints the engine's warnings under the
27
27
  failures — but `framing` and `assetErrors()` you have to ASK for.
28
28
 
29
+ ## 0. The whole ladder, one command: `incanto-verify`
30
+
31
+ ```
32
+ $ bunx incanto-verify # finds your scene
33
+ ✓ loads — the scene is legal and its assets resolve
34
+ ? plays — nothing declares a win — 8 runs played without error, and there was no end to reach
35
+ ? draws — the dev server is running on :5173, but no page answered
36
+
37
+ passes what was measured — plays, draws not measured.
38
+ next: if it is meant to be finishable, emit `won` (GameFlow, ScoreKeeper, or your own behaviour)
39
+ ```
40
+
41
+ Runs the rungs below in order and says the ONE thing to do next. Three rules it
42
+ encodes so you do not have to remember them:
43
+
44
+ - a **failed** rung makes the ones above it meaningless, so only the first is
45
+ worth reading — the rest are marked `·` skipped;
46
+ - an **unmeasured** rung (`?`) is not a failure. "No dev server" means the
47
+ question was never asked; treating that as a broken game sends you editing a
48
+ scene that is fine;
49
+ - a scene that declares **no win** is not a scene that cannot be won. A
50
+ walkabout has no end, and that is reported as unmeasured, not failed.
51
+
52
+ Exit 1 only when a rung actually failed. `--behaviors src/behaviors.ts` matters:
53
+ without it your game logic is stubbed and only the structure is played.
54
+
55
+ The sections below are the same rungs one at a time, for when you need the detail.
56
+
29
57
  ## 1. After EVERY scene edit: `incanto-check`
30
58
 
31
59
  ```bash
@@ -329,6 +357,22 @@ black screen, a material that failed, or a shader drawing where it should not.
329
357
  ```
330
358
  $ bunx incanto-frame
331
359
  frame 1280×720 · luminance 0.62
360
+ subject 412×690 at 434,18 · fills 21.4% of frame
361
+ ```
362
+
363
+ `subject` is what the frame is OF: everything that is not the background,
364
+ measured from the frame's own edges. It answers the question `black` and
365
+ `uniform` cannot — **is the thing IN the shot, and can you see it**:
366
+
367
+ ```
368
+ nothing but background — the camera is pointed away from everything in the scene
369
+ ```
370
+ ```
371
+ the subject fills almost nothing (0.3%) — the camera is too far back, or what
372
+ you meant to see is not what got drawn
373
+ ```
374
+ ```
375
+ subject 1280×720 at 0,0 · fills 84.1% of frame · CLIPPED by the frame edge
332
376
  ```
333
377
 
334
378
  ```
@@ -342,7 +386,22 @@ browser, not in the dev server.** You do not have to tell it where anything is
342
386
  it reads the ports that are actually listening, asks each one whether it is an
343
387
  incanto dev server, and asks that page for a frame over vite's own HMR channel.
344
388
 
345
- It writes **no files**. `--json` gives the full report, including a 16×9 grid of
389
+ #### Look at it
390
+
391
+ ```
392
+ $ bunx incanto-frame --out shot.png
393
+ frame 1280×720 · luminance 0.62
394
+ subject 412×690 at 434,18 · fills 21.4% of frame
395
+ wrote shot.png — open it, or read it
396
+ ```
397
+
398
+ `--out` writes the frame as a PNG (`--size N` sets the longest side, default
399
+ 512). Read it like any other image. The numbers above are cheaper and are what
400
+ you should assert on, but when a report says a scene is fine and it plainly is
401
+ not, a picture settles it in one look — and there is still no browser to install
402
+ and nothing headless involved: the page that is already open does the drawing.
403
+
404
+ Without `--out` it writes **no files**. `--json` gives the full report, including a 16×9 grid of
346
405
  mean cell colours — enough to answer *where* the frame changed, small enough to
347
406
  read. From game code or the console, `game.frame()` returns the same object.
348
407
 
@@ -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.46.0",
17
+ "incanto": "^0.47.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.46.0",
16
+ "incanto": "^0.47.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.46.0",
16
+ "incanto": "^0.47.0",
17
17
  "three": "^0.184.0"
18
18
  },
19
19
  "devDependencies": {