@homie-rocks/studio 0.43.0 → 0.44.1

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/CHANGELOG.md CHANGED
@@ -17,9 +17,47 @@ To bring a studio up to date, tell Claude: "Upgrade my studio to the newest Homi
17
17
  `npx -y @homie-rocks/studio@latest upgrade`, which shows what's new since the version your studio pins (from this
18
18
  file) and what the upgrade would change, and changes nothing until you agree.
19
19
 
20
+ ## [0.44.1] - 2026-10-10
21
+
22
+ **Plugin 0.44.1**
23
+
24
+ Predicted movement meets the live world, and local builds keep dev running.
25
+
26
+ ### Added
27
+
28
+ - Rules movement sweeps, support and overlap queries include declared live colliders: rectangular cover, doors and platforms, with tick-stamped geometry in prediction and room restores.
29
+ - The npm package ships generated, version-matched game authoring and rewrite guides. Studio guidance and check/build output point to them and report older plugin copies with an update step.
30
+
31
+ ### Fixed
32
+
33
+ - Spatial delivery retains live collision revisions in keyframes and compact updates, even when a collider lies outside the player’s visual interest radius.
34
+ - Rebuilding while dev is running preserves immutable Worker module graphs and atomically switches the entry, so a reload cannot lose its imported chunks.
35
+ - Customer offers omit the studio refund window when no window is set.
36
+
37
+ ### Upgrade notes
38
+
39
+ - Declare non-player entity colliders with `collider: true` or `{size, enabled}` field names. Movement uses `ctx.world.sweep/support/overlaps`; existing `ctx.map.sweep` includes declared colliders too. Games without colliders keep their existing snapshot shape.
40
+ - Read `node_modules/@homie-rocks/studio/guides/game/` after upgrading. Older plugin sessions need an update and a new session; the installed guides are usable immediately.
41
+
42
+ ## [0.44.0] - 2026-10-10
43
+
44
+ **Plugin 0.44.0** · [#83](https://github.com/homie-rocks/homie/pull/83)
45
+
46
+ Send each player the part of the room near their character.
47
+
48
+ ### Added
49
+
50
+ - Server-hosted rules games can choose `room.view.radiusM` in game.json. Views receive nearby entities and their own body, with compact state updates and fresh state on reconnect. Omit it to keep the whole-room view.
51
+ - Seeded tests cover spatial visibility, delta recovery and 300 simulated clients through the host and relay. The longer capacity workload runs in the extended suite.
52
+
53
+ ### Upgrade notes
54
+
55
+ - `room.each`, `enter` and `leave` describe visible entities when a radius is set. Dispose of departed meshes and recreate them when they return. Rules and movement need no changes; existing starters keep their whole-room views.
56
+ - This is the first bigger-rooms slice. The public build/join path still has 32 seats until Gates ship in the next slice. The 300-client proof is local, not a Cloudflare capacity measurement. Interest filtering does not hide secrets; private fields and tells follow later.
57
+
20
58
  ## [0.43.0] - 2026-10-09
21
59
 
22
- **Plugin 0.43.0**
60
+ **Plugin 0.43.0** · [release-2026-10-10-studio-0.43.0](https://github.com/homie-rocks/homie/releases/tag/release-2026-10-10-studio-0.43.0)
23
61
 
24
62
  Ask for a game and its rules run on your server.
25
63
 
package/README.md CHANGED
@@ -41,7 +41,8 @@ asks (`game new <id> --from gem-rush`, or `--from ember-vale` for a hero who las
41
41
  New games are rules plus view: `src/rules.ts` declares state and server decisions,
42
42
  `src/move.ts` supplies shared movement and local prediction, and `src/view.ts` draws
43
43
  and sends input through `openRoom`. All five starters declare `room.host: server`.
44
- Follow the game skill and `RULES.md`; `build` checks rules, movement and view types
44
+ Read the installed [game skill](guides/game/SKILL.md), [rules guide](guides/game/RULES.md)
45
+ and [rewrite guide](guides/game/REWRITE.md), generated from the matching plugin release; `build` checks rules, movement and view types
45
46
  and refuses a game with neither rules nor a browser-hosted netplay contract.
46
47
  The same rules support browser hosting for offline, local and private play.
47
48
  Existing browser-hosted games remain supported; rewriting one is an explicit task.
@@ -1259,3 +1260,17 @@ Homie as a short note you see and send yourself (`homie_feedback`, above).
1259
1260
  ## License
1260
1261
 
1261
1262
  Apache-2.0. See `LICENSE` and `NOTICE`.
1263
+
1264
+
1265
+ ### Spatial state delivery
1266
+
1267
+ Server-hosted rules games may set `room.view.radiusM` in game.json to send each
1268
+ player nearby entities and its own body. Omitted or null sends the whole room.
1269
+ Rules and movement stay the same; the view's `each`, `enter` and `leave` describe
1270
+ the visible set. Dispose of meshes on leave and recreate them on enter.
1271
+ Watchers, shared state, effects and rosters remain public. This is bandwidth
1272
+ filtering, not private state. Browser-hosted rooms send the whole room.
1273
+
1274
+ 0.44.0 delivers this first part of bigger rooms. Public admission above 32 seats
1275
+ arrives with Gates in the next slice. See [the milestone 2 notes](../../docs/rooms-milestone-2-notes.md)
1276
+ for the remaining slices and the local 300-client proof.
@@ -901,6 +901,10 @@ async function main() {
901
901
  // The starter library and the optimiser work anywhere; the rest of style and assets inside a studio (lib/art-cli.mjs).
902
902
  if (cmd === 'assets' && ['find', 'optimise', 'optimize'].includes(sub)) return assetsCommand(null, sub, positional, flags, { log });
903
903
  const root = requireStudio();
904
+ // Keep guidance visible to AI callers using --json as well as human output.
905
+ if (['build', 'check', 'upgrade'].includes(cmd)) {
906
+ for (const line of (await import('../lib/authoring-guides.mjs')).authoringWords()) process.stderr.write(`${line}\n`);
907
+ }
904
908
  if (cmd === 'function') return (await import('../lib/functions-cli.mjs')).functionCommand(root, sub, positional, flags, { log });
905
909
  if (cmd === 'tool') return (await import('../lib/tools-cli.mjs')).toolCommand(root, sub, positional, flags, { log });
906
910
  // A trailer is the plugin's video skill; this hands the words after the id over to it (lib/trailer.mjs).
@@ -0,0 +1,78 @@
1
+ # Rewrite a browser-hosted game as rules plus view
2
+
3
+ Use this path when the owner asks to move an old game's rules onto the server.
4
+ There is no automatic converter. An ordinary edit is not permission to rewrite;
5
+ old games continue to work as they are. Read RULES.md before starting.
6
+
7
+ 1. Read this game's codex, manifest, entry, host loop, input, packing/checkpoint
8
+ code, bots, saves and tests. Record what players must keep: controls, timings,
9
+ movement curve, camera, art, sound, collisions, scoring, rounds and joining.
10
+ Play a baseline on computer and phone and capture the same short actions and
11
+ screenshots you will repeat later. Keep a commit or separate copy to compare.
12
+ Do not change other games, shared studio configuration or their tests to make
13
+ this game pass. Install the studio's pinned dependencies; upgrade the toolkit
14
+ only when needed for the requested rewrite, preserving unrelated dependencies.
15
+ An old file named rules.ts may already export pure helpers that tests import.
16
+ Preserve that public test API and every existing test file byte-for-byte,
17
+ including imports. Re-export the old helpers from rules.ts if extracted into
18
+ another module; do not redirect tests to that module. Record test-file hashes
19
+ before editing and compare them at the end. The filename alone does not
20
+ mean it is a rules-plus-view game. If tests now load toolkit TypeScript under
21
+ Node, use a narrowly scoped TypeScript loader and keep the normal test command
22
+ working. Do not count a special test invocation while `npm test` is broken.
23
+ 2. Keep the renderer, assets, camera, UI and audio as the view. Make an inventory
24
+ of every value that can change play. Put each on the entity that owns it with
25
+ declared fields; put room-wide facts in shared. Replace packed rows with named
26
+ fields, numeric IDs with opaque refs, and remembered module state with fields.
27
+ 3. Extract the existing movement curve into defineMove. Keep its units and timing
28
+ by converting to metres and seconds at one boundary. Use ctx.math and the
29
+ compiled map; encode knockback, cooldowns and freezes in motion. The view must
30
+ draw room.me/room.each, not integrate a second body. The same movement now runs
31
+ on the server and predicts on the player's screen. Preserve feel by measuring
32
+ acceleration, jump apex, duration, stop distance and knock distance against baseline.
33
+ 4. Move hits, pickups, spawns, scores and victory into rules. An entity writes only
34
+ itself; requests to other entities become declared events. The receiver validates
35
+ the request and changes itself, then sends a result. Shared writes and round ends
36
+ belong to room handlers. Replace clocks and random calls with world ticks/math/RNG.
37
+ Replace direct model calls with declared asks and a deterministic floor. Bots
38
+ produce inputs in think. Companions use guide/view/floor and vocabulary goals.
39
+ 5. Write map/main.json from the existing collision geometry. Use it for the view
40
+ too; keep purely decorative art out of collisions. In 3D z is up in rules, feet
41
+ locate a body, and Three.js maps x,y,z to x,z,y. Preserve spawn locations and
42
+ arrival/reset behavior, including arrivals during the results break.
43
+ 6. Replace view-side networking with openRoom<typeof rules>(). Send input and
44
+ declared commands, listen for declared effects, retain chat/watch/prefs through
45
+ room.net. Remove the old host loop, Roster, packing, snapshots and checkpoint
46
+ callbacks from this game's entry. Keep cloud character saves and their key/schema;
47
+ they remain separate from automatic room saves and are not verified currency.
48
+ Set manifest entry to src/view.ts, index.html to the relative ./assets/main.js
49
+ module script, and room.host to server.
50
+ Retain the game's ID and public URLs. Do not change to browser hosting to pass.
51
+ In a studio made before server rules, compare site/src/worker.mjs with the
52
+ installed toolkit's Worker template: it must import the generated
53
+ ./rules/index.mjs registry and call hostRules(rules). Add that small hookup
54
+ while retaining the studio's existing routes and configuration. Confirm both
55
+ browsers report hosted=server and role=replica; a successful build alone cannot
56
+ prove an older custom Worker registered the rules.
57
+ 7. Build early and after each coherent extraction. Read every diagnostic and repair
58
+ its source using RULES.md's message guide; never edit the toolkit/guard or remove
59
+ tests to escape a restriction. Type errors often name a capability moved to the
60
+ wrong half. A save/checker internal failure must be reported as such.
61
+ 8. Repeat the baseline in two real browsers with 150 ms delay: same controls, art,
62
+ camera, first minute, win/loss and next round; both browsers must be replicas of
63
+ the server. Check late join, reload, reconnect and a player leaving. Run check,
64
+ this game's existing tests and the studio's other tests unchanged. Compare files
65
+ outside this game against baseline and explain any necessary shared-file change.
66
+ Report observed differences and limits rather than claiming equivalence from a build.
67
+
68
+ Do the engineering yourself. Tell the owner what changed for their game, what was
69
+ preserved and how you checked it. Never promise larger rooms, private per-seat
70
+ state, perfect latency or automatic conversion.
71
+
72
+ For buildable/destructible worlds, declare non-player entities with `collider: true`
73
+ or `collider: {size: 'size', enabled: 'solid'}` (declared vec3 and bit fields).
74
+ Move uses `ctx.world.sweep/support/overlaps`; `ctx.map` exposes these same queries
75
+ for existing movement code. Keep build/damage/door logic in entity handlers.
76
+ Never copy collision lists into player motion or implement a second replay loop.
77
+ Test visible prediction at 300 ms with loss, rejoin and saved-room restore.
78
+ The installed toolkit's `guides/game/` is the version-matched source for this guide.