@homie-rocks/studio 0.44.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 +22 -0
- package/README.md +2 -1
- package/bin/homie-studio.mjs +4 -0
- package/guides/game/REWRITE.md +78 -0
- package/guides/game/RULES.md +737 -0
- package/guides/game/SKILL.md +392 -0
- package/lib/authoring-guides.mjs +27 -0
- package/lib/rules-check-worker.mjs +4 -3
- package/lib/rules-guard.mjs +2 -1
- package/lib/scaffold.mjs +9 -2
- package/lib/template-history.json +42 -0
- package/lib/worker-build.mjs +39 -6
- package/lib/worker-config.mjs +2 -2
- package/package.json +5 -3
- package/rules/collision.ts +6 -6
- package/rules/core.ts +33 -11
- package/rules/interest.mjs +5 -3
- package/rules/live.ts +73 -0
- package/rules/math.ts +10 -7
- package/rules/rules.ts +15 -1
- package/rules/types.ts +4 -3
- package/rules/view.ts +22 -4
- package/starters/hero-rush-3d/src/move.ts +4 -2
- package/worker/customer-shop.mjs +1 -1
- package/worker/version.mjs +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -17,6 +17,28 @@ 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
|
+
|
|
20
42
|
## [0.44.0] - 2026-10-10
|
|
21
43
|
|
|
22
44
|
**Plugin 0.44.0** · [#83](https://github.com/homie-rocks/homie/pull/83)
|
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
|
-
|
|
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.
|
package/bin/homie-studio.mjs
CHANGED
|
@@ -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.
|