incanto 0.78.1 → 0.79.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 (47) hide show
  1. package/README.md +1 -1
  2. package/assets/backdrops/sky_gradient.png +0 -0
  3. package/assets/catalog.json +8 -0
  4. package/dist/2d.js +4 -4
  5. package/dist/3d.d.ts +39 -0
  6. package/dist/3d.js +5 -5
  7. package/dist/{agent8-B-bh3n0X.js → agent8---rIaJ3j.js} +1 -1
  8. package/dist/{create-game-BMIPKrQW.js → create-game-CtYQT8Uk.js} +6 -6
  9. package/dist/{create-game-Dai5vfVu.js → create-game-Cxx820o9.js} +67 -9
  10. package/dist/editor.js +37 -25
  11. package/dist/{environment-presets-e_9YCnGu.js → environment-presets-fGpZHUab.js} +3 -3
  12. package/dist/{gameplay-Bfff_beb.js → gameplay-CplbZE7c.js} +1 -1
  13. package/dist/gameplay.js +2 -2
  14. package/dist/index.js +4 -4
  15. package/dist/net.js +2 -2
  16. package/dist/{physics-2d-Tuf5LAyq.js → physics-2d-Cm1DIjk2.js} +3 -3
  17. package/dist/{physics-3d-C5MOujfQ.js → physics-3d-CwJzo3fP.js} +3 -3
  18. package/dist/{picking-DIwE48sU.js → picking-DxHiUoLo.js} +2 -2
  19. package/dist/{pose-ByFB_J3O.js → pose-O50uVW-j.js} +18 -1
  20. package/dist/react.js +1 -1
  21. package/dist/{register-B768Qedj.js → register-CIDbUbFG.js} +1 -1
  22. package/dist/{register-7E3P1gz6.js → register-l4ZWcLwD.js} +3 -3
  23. package/dist/{replay-DrqQ6dZj.js → replay-CooHM9lL.js} +2 -2
  24. package/dist/{split-screen-B-dIcQsQ.js → split-screen-BRbSkBMO.js} +3 -3
  25. package/dist/{src-SWXe-bub.js → src-rS7AyeKD.js} +1 -1
  26. package/dist/{test-CVbxnXlv.js → test-Def33MoL.js} +13 -13
  27. package/dist/test.js +2 -2
  28. package/dist/vite.js +3 -3
  29. package/editor/assets/{agent8-DA-I5qhv.js → agent8-WXuvhs5H.js} +1 -1
  30. package/editor/assets/{debug-99tEPoGm.js → debug-xpJQqbx1.js} +1 -1
  31. package/editor/assets/{index-Db74LZY-.js → index-DJryzpvb.js} +102 -102
  32. package/editor/index.html +1 -1
  33. package/package.json +5 -5
  34. package/schemas/scene.schema.json +1 -1
  35. package/skills/incanto-assets.md +15 -0
  36. package/skills/incanto-behaviors-and-scripts.md +1 -1
  37. package/skills/incanto-building-2d-games.md +1 -1
  38. package/skills/incanto-building-3d-games.md +39 -0
  39. package/skills/incanto-physics-and-input.md +1 -1
  40. package/templates-app/beacon-isle-3d/package.json +1 -1
  41. package/templates-app/molehill-2d/package.json +1 -1
  42. package/templates-app/platformer-2d/package.json +1 -1
  43. package/templates-app/star-survivor/package.json +1 -1
  44. package/templates-app/tps-3d/package.json +1 -1
  45. package/templates-app/village-quest-3d/package.json +1 -1
  46. package/templates-app/molehill-2d/.incanto/playtest/lost-seed1.json +0 -4277
  47. package/templates-app/village-quest-3d/.incanto/playtest/swapped-seed1.json +0 -1735
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-Db74LZY-.js"></script>
8
+ <script type="module" crossorigin src="./assets/index-DJryzpvb.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.78.1",
3
+ "version": "0.79.0",
4
4
  "description": "Vibe-coding-first web game engine SDK — JSON-driven scenes on three.js",
5
5
  "keywords": [
6
6
  "game-engine",
@@ -15,7 +15,7 @@
15
15
  "license": "UNLICENSED",
16
16
  "repository": {
17
17
  "type": "git",
18
- "url": "git+https://github.com/rareboe/Incanto.git",
18
+ "url": "git+https://github.com/planetarium/Incanto.git",
19
19
  "directory": "packages/engine"
20
20
  },
21
21
  "type": "module",
@@ -91,8 +91,8 @@
91
91
  "incanto-feel": "bin/incanto-feel.mjs",
92
92
  "incanto-new": "bin/incanto-new.mjs",
93
93
  "incanto-frame": "bin/incanto-frame.mjs",
94
- "incanto-verify": "./bin/incanto-verify.mjs",
95
- "incanto-logs": "./bin/incanto-logs.mjs",
96
- "incanto-serve": "./bin/incanto-serve.mjs"
94
+ "incanto-verify": "bin/incanto-verify.mjs",
95
+ "incanto-logs": "bin/incanto-logs.mjs",
96
+ "incanto-serve": "bin/incanto-serve.mjs"
97
97
  }
98
98
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "$schema": "https://json-schema.org/draft/2020-12/schema",
3
- "$id": "https://github.com/rareboe/Incanto/schemas/scene.schema.json",
3
+ "$id": "https://github.com/planetarium/Incanto/schemas/scene.schema.json",
4
4
  "title": "Incanto scene (format 1)",
5
5
  "type": "object",
6
6
  "properties": {
@@ -56,6 +56,7 @@ second copy, and it drifted: `2dbasic` said 192×192 for art whose real grid is
56
56
  | `foliage` | `bark_oak/birch/pine_{color,normal,roughness}` | **Tree3D** trunk bark (sampled by default) |
57
57
  | `foliage` | `ground_grass`, `ground_dirt`, `ground_dirt_normal` | **Terrain3D** grassland ground textures |
58
58
  | `audio` | `explosion`, `gold-loot`, `slash`, `heal`, `ui-click`, … | **AudioPlayer** `src` sound files (see below) |
59
+ | `backdrop` | `sky_gradient` | **`environment.skybox`** — an equirect picture behind the scene, never a light |
59
60
 
60
61
  ### 1b. The `url` contract — referencing each kind
61
62
 
@@ -86,6 +87,20 @@ Every catalog entry has a `url` that is directly usable; there are two classes:
86
87
  For zero-asset sound, prefer the procedural SFX **presets** instead of a file.
87
88
  Full guide: **incanto-audio.md** (presets, AudioPlayer, volume buses).
88
89
 
90
+ - **Backdrop (`kind: "backdrop"`)** — an equirectangular picture for
91
+ `environment.skybox`. `url` is `incanto/assets/backdrops/<file>`, which the
92
+ dev server serves as written — but a **built** game has no such route, so
93
+ `incanto-assets copy sky_gradient --out public` and write the copied name:
94
+
95
+ ```json
96
+ "environment": { "sky": { "type": "atmosphere" }, "skybox": "sky_gradient.png" }
97
+ ```
98
+
99
+ It is a picture behind the scene and NEVER a light source (an 8-bit image as
100
+ light turns every metal into plastic); keep `sky` or `preset` for lighting.
101
+ Why the two roles are separate, and what `.hdr` is for: the "A picture as
102
+ the sky" section of **incanto-building-3d-games.md**.
103
+
89
104
  - **Packaged 2D sprites (character / tile / item / effect)** — `url` is
90
105
  `incanto/assets/<file>` (e.g. `incanto/assets/items/coin.png`). This is the
91
106
  **bundler-import / copy** reference. In a bundler game (vite, the usual target)
@@ -352,7 +352,7 @@ Child of a `CharacterBody2D` (hard error otherwise):
352
352
  now, not a silent wrong call; `incanto check` warns on the same pair from the
353
353
  file alone. Prefix handlers with `on`.
354
354
 
355
- Reference: [examples/2d-phaser-sprite-character-gravity](https://github.com/rareboe/Incanto/tree/main/examples/2d-phaser-sprite-character-gravity) — engine nodes + one small PlayerControl behavior
355
+ Reference: [examples/2d-phaser-sprite-character-gravity](https://github.com/planetarium/Incanto/tree/main/examples/2d-phaser-sprite-character-gravity) — engine nodes + one small PlayerControl behavior
356
356
  (`CoinCounter`, `Pickup`) wired entirely through JSON connections. Verified in Chromium.
357
357
 
358
358
  ## Spawning nodes at runtime
@@ -312,7 +312,7 @@ between a readable and an unusable phone build.
312
312
  (master/sfx/music + mute). Browsers gate audio behind a gesture; `createGame2D`
313
313
  retries blocked plays on the first pointerdown. Headless-safe no-op. Full guide:
314
314
  **incanto-audio.md**.
315
- - Reference example: [examples/2d-phaser-sprite-character-gravity](https://github.com/rareboe/Incanto/tree/main/examples/2d-phaser-sprite-character-gravity) —
315
+ - Reference example: [examples/2d-phaser-sprite-character-gravity](https://github.com/planetarium/Incanto/tree/main/examples/2d-phaser-sprite-character-gravity) —
316
316
  spritesheet character with a walk/jump/attack behavior state machine.
317
317
  - **Tap / drag / click**: `createGame2D({ pointer: true })` attaches pointer
318
318
  input — MOUSE, FINGER and pen alike — and then
@@ -595,6 +595,45 @@ show it as the background (otherwise `background` color applies). Standard
595
595
  materials need this OR explicit lights to be visible. An explicit HDRI wins
596
596
  over the `sky`'s image-based ambience.
597
597
 
598
+ `hdri` is **`.hdr` only**, on purpose: that texture is the scene's LIGHT, and an
599
+ 8-bit jpg fed to it clips the sun to flat white — chrome loses its highlight,
600
+ `metalness: 1` reads as plastic, `clearcoat` paint goes matte, `Water3D` loses
601
+ its glint. A jpg cannot get that range back; it was never in the file.
602
+
603
+ ### A picture as the sky (`skybox: "<url>"`)
604
+
605
+ What is VISIBLE behind the scene is a different question from what lights it,
606
+ and for the visible half a picture is the right tool — a 2k `.hdr` is ~10 MB, a
607
+ 2k `.jpg` is ~300 KB. So `skybox` also takes a url:
608
+
609
+ ```json
610
+ "environment": {
611
+ "sky": { "type": "atmosphere", "elevationDeg": 30, "azimuthDeg": 150 },
612
+ "skybox": "sky_gradient.png"
613
+ }
614
+ ```
615
+
616
+ | `skybox` | you SEE | the scene is LIT by |
617
+ |---|---|---|
618
+ | `true` | the `hdri`/`preset` | the `hdri`/`preset` |
619
+ | `"<url>"` (`.jpg` `.png` `.webp`, or `.hdr`) | that picture | `hdri`/`preset` if set → else the `sky`'s PMREM → else `ambient` only |
620
+ | absent | `background` colour | same |
621
+
622
+ The picture is assigned to the background **only** — it never reaches
623
+ `scene.environment` — so the composition above is the intended one: a free
624
+ procedural `sky` doing the lighting and the sun, and a cheap painted panorama
625
+ doing the looking. The `sky` mesh stops drawing while a picture is up (it is a
626
+ 450 km sphere and would paint over it) but keeps aiming the sun and feeding the
627
+ PMREM. Underwater still wins. `fog` does not tint a background image (three
628
+ does not fog `scene.background`) — pick a picture whose horizon already matches.
629
+
630
+ The url must look like one — a path (`sky.png`, `/textures/night.hdr`) or an
631
+ https url. A bare word (`"yes"`) is refused at load: it would be fetched
632
+ verbatim and 404 into a black sky with nothing to grep for. A picture that
633
+ does 404 is reported by `game.assetErrors()` under the url you wrote, like any
634
+ texture. The built-in `sky_gradient` (`bunx incanto-assets copy sky_gradient
635
+ --out public`) is the zero-setup starting point.
636
+
598
637
  ## NEVER compute a Y against the terrain by hand
599
638
 
600
639
  This is the single most repeated mistake in scene authoring, and it is not a
@@ -360,7 +360,7 @@ Injected state combines with key state (vectors clamped to unit length).
360
360
  angle was applied once at creation, the mesh turned and the collider stayed put.)
361
361
  A free dynamic body's rotation belongs to the solver and is left alone.
362
362
  Launch: write `linearVelocity`.
363
- - Reference: [examples/2d-phaser-sprite-character-gravity](https://github.com/rareboe/Incanto/tree/main/examples/2d-phaser-sprite-character-gravity) — gravity, jump, attack lockout, custom
363
+ - Reference: [examples/2d-phaser-sprite-character-gravity](https://github.com/planetarium/Incanto/tree/main/examples/2d-phaser-sprite-character-gravity) — gravity, jump, attack lockout, custom
364
364
  `Player` node type. Verified in Chromium end-to-end.
365
365
 
366
366
  ## Platformer staples (2D)
@@ -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.78.1",
17
+ "incanto": "^0.78.2",
18
18
  "react": "^18.3.1",
19
19
  "react-dom": "^18.3.1",
20
20
  "three": "^0.184.0"
@@ -11,7 +11,7 @@
11
11
  },
12
12
  "dependencies": {
13
13
  "@dimforge/rapier2d-compat": "0.19.3",
14
- "incanto": "^0.78.1",
14
+ "incanto": "^0.78.2",
15
15
  "react": "^18.3.1",
16
16
  "react-dom": "^18.3.1",
17
17
  "three": "^0.184.0"
@@ -11,7 +11,7 @@
11
11
  },
12
12
  "dependencies": {
13
13
  "@dimforge/rapier2d-compat": "0.19.3",
14
- "incanto": "^0.78.1",
14
+ "incanto": "^0.78.2",
15
15
  "react": "^18.3.1",
16
16
  "react-dom": "^18.3.1",
17
17
  "three": "^0.184.0"
@@ -11,7 +11,7 @@
11
11
  },
12
12
  "dependencies": {
13
13
  "@dimforge/rapier2d-compat": "0.19.3",
14
- "incanto": "^0.78.1",
14
+ "incanto": "^0.78.2",
15
15
  "react": "^18.3.1",
16
16
  "react-dom": "^18.3.1",
17
17
  "three": "^0.184.0"
@@ -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.78.1",
16
+ "incanto": "^0.78.2",
17
17
  "react": "^18.3.1",
18
18
  "react-dom": "^18.3.1",
19
19
  "three": "^0.184.0"
@@ -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.78.1",
16
+ "incanto": "^0.78.2",
17
17
  "react": "^18.3.1",
18
18
  "react-dom": "^18.3.1",
19
19
  "three": "^0.184.0"