@gameslate/sdk 0.3.30 → 0.3.32
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/README.md +8 -0
- package/lib/assets.d.ts +103 -68
- package/lib/assets.js +8 -0
- package/lib/catalogue.d.ts +44 -42
- package/lib/catalogue.js +5 -1
- package/lib/game-support-limitations.d.ts +2 -0
- package/lib/game-support-limitations.js +70 -0
- package/lib/game-support.d.ts +1 -1
- package/lib/game-support.js +3 -1
- package/lib/host/live-sandbox.js +15 -11
- package/lib/host/quickjs-guest.d.ts +4 -0
- package/lib/host/quickjs-guest.js +13 -7
- package/lib/index.d.ts +1 -0
- package/lib/index.js +1 -0
- package/lib/mission-labels.d.ts +43 -0
- package/lib/mission-labels.js +69 -0
- package/lib/pack.d.ts +107 -98
- package/lib/pack.js +12 -5
- package/lib/plugin/sandbox-guest.js +18 -1
- package/lib/plugins-api.d.ts +2 -2
- package/lib/registry.d.ts +136 -136
- package/lib/sandbox-protocol.d.ts +67 -66
- package/package.json +1 -1
- package/template/claude/skills/build-gameslate-plugin/SKILL.md +232 -8
- package/template/claude/skills/verify-gameslate-plugin/SKILL.md +29 -1
|
@@ -51,6 +51,10 @@ Each manifest game has:
|
|
|
51
51
|
- optional `inputs[]`, only for asset extractors: a `label`, the `folders` under `~` where the
|
|
52
52
|
player's files usually are, and `subfolders` whose files count too, such as a port's `mods/`.
|
|
53
53
|
Hidden folders are refused except under `~/.var/app`, `~/.local/share` and `~/.steam`.
|
|
54
|
+
Every game your assets module extracts needs them: the app offers Build only for a game with
|
|
55
|
+
input folders. Super Mario 64, Diddy Kong Racing, Banjo-Kazooie, Conker and Donkey Kong 64 had
|
|
56
|
+
extractors but no inputs, so players couldn't build their maps (2026-12-06). A manifest test
|
|
57
|
+
that walks `assets.extractors` catches it (gameslate-n64's `plugin/manifest.test.ts`).
|
|
54
58
|
|
|
55
59
|
The build fills in the code files' hashes. Never edit those by hand.
|
|
56
60
|
|
|
@@ -344,8 +348,38 @@ Anything with a place to move through, a track or a board still gets one.
|
|
|
344
348
|
|
|
345
349
|
- `listAssets(inputs, pick)` must be cheap: name what can be built.
|
|
346
350
|
- `buildAsset(id, inputs)` returns outputs in the SDK's shapes: floorplan, location, nav, mesh
|
|
347
|
-
(GS3D), image,
|
|
348
|
-
pack's `localSource`, e.g. `{ file: 'notes/check-notes.json', key: 'collectibleSets.gs' }`)
|
|
351
|
+
(GS3D), image, notes (the text of one JSON object, written as `notes/<id>.json` for a
|
|
352
|
+
pack's `localSource`, e.g. `{ file: 'notes/check-notes.json', key: 'collectibleSets.gs' }`),
|
|
353
|
+
and labels (below).
|
|
354
|
+
|
|
355
|
+
**Mission titles that are the game's text** (sdk 0.3.31). Commit the catalogue's missions with
|
|
356
|
+
numbered titles (`{ id: 'bob.1', title: 'Star 1', … }`) and have one asset return the real names
|
|
357
|
+
read from the player's files:
|
|
358
|
+
|
|
359
|
+
```ts
|
|
360
|
+
{ kind: 'labels', id: 'star-names', missions: { 'bob.1': '…', 'bob.2': '…' } }
|
|
361
|
+
```
|
|
362
|
+
|
|
363
|
+
Keys are the catalogue's mission ids; each title is one line of 1 to 200 characters, at most
|
|
364
|
+
5000 per output. The core writes `labels/<id>.json`, and the daemon puts the labels over the
|
|
365
|
+
titles it serves, so the Missions panel shows them after a build with no change to the pack.
|
|
366
|
+
|
|
367
|
+
- **For the AI**, name a mission with the context's `missionTitle(id)` (the label, else the
|
|
368
|
+
committed title), never from a table of names of your own. The core always passes the
|
|
369
|
+
context; your own tests may not, so default it:
|
|
370
|
+
`describeState: (state, context = noLabelsContext(catalogue)) => [...]`.
|
|
371
|
+
- **Build label ids and catalogue ids from one table.** Labels naming a mission the pack doesn't
|
|
372
|
+
have are never applied: the pack serves its committed titles and the app shows a banner naming
|
|
373
|
+
the labels file and asking for a rebuild.
|
|
374
|
+
- **Renaming or dropping a mission id needs players to rebuild** the game's assets (the cog's
|
|
375
|
+
Build button). Until they do, their old labels are refused as above. Say so in the release
|
|
376
|
+
notes.
|
|
377
|
+
- **Labels need a core with sdk 0.3.31 or later** (core 2.3.0 doesn't have them). An older core
|
|
378
|
+
refuses the whole result of an asset that returns one, maps included, so return labels from
|
|
379
|
+
an asset of their own, never one that also builds maps or locations.
|
|
380
|
+
- Objective labels of a registry location aren't missions: return them as the `objectives` of a
|
|
381
|
+
`location` output, which merges over the registry's numbered ones (it replaces the whole list,
|
|
382
|
+
so carry each objective's difficulty fields too).
|
|
349
383
|
|
|
350
384
|
Images have a `purpose` (`atlas`, `map`, `icon`, `actor`, which picks the folder) and an `encoding`:
|
|
351
385
|
|
|
@@ -596,9 +630,23 @@ Mario Party 3 filed them under `collectiblesOrItems` and Body Harvest under `obj
|
|
|
596
630
|
1. `## Builds & Asset Extraction`
|
|
597
631
|
2. `## Map`
|
|
598
632
|
3. `## Vitals, Inventory, Missions & Reference`
|
|
599
|
-
4. `##
|
|
633
|
+
4. `## Limitations`
|
|
600
634
|
5. `## Verification`
|
|
601
635
|
|
|
636
|
+
`## Limitations` is written for the player: what they'll see that is incomplete or can be wrong,
|
|
637
|
+
with the developer detail (the reason, the address, the decomp symbol) after the player sentence
|
|
638
|
+
in the same bullet. Every top-level bullet starts with one of `**Not tracked:**` (shown, but its
|
|
639
|
+
done or collected state isn't read; give counts and say which), `**Not shown:**` (in the game,
|
|
640
|
+
nowhere in the app), `**Can be wrong:**` (when it misreads, and what the player sees) or
|
|
641
|
+
`**Not supported:**` (builds, regions, modes, menus), in that order; leave out a label with
|
|
642
|
+
nothing under it. Nested bullets are fine. The support check refuses an empty section, an
|
|
643
|
+
unknown label and labels out of order; a game with nothing to say writes
|
|
644
|
+
`- **Not supported:** nothing known beyond the builds listed above.` Take the facts from the
|
|
645
|
+
code, not memory: pin categories and landmark kinds with no `collectedBy` (or one only some pins
|
|
646
|
+
get), missions and counters with no condition the state can satisfy, the caveats in `## Map` and
|
|
647
|
+
`## Vitals...`, and `supportedBuildIds` and the frontmatter's `false`/`none` entries. Until
|
|
648
|
+
0.3.32 this section was `## Known Gaps`, free-form (the maintainer, 2026-12-06).
|
|
649
|
+
|
|
602
650
|
Keep `<!-- gameslate:support-table:start -->` … `<!-- gameslate:support-table:end -->` in the
|
|
603
651
|
repo's top-level `README.md` and run:
|
|
604
652
|
|
|
@@ -684,6 +732,14 @@ the plugin repos) in the same change as the fix. The next game should not have t
|
|
|
684
732
|
- **Check each RE address note against a snapshot before using it.** DOOM64-RE's notes were right
|
|
685
733
|
for `gamemap` and `players[]`, but its `totalkills`/`totalitems`/`totalsecret` addresses read 0
|
|
686
734
|
all through MAP01, a level full of monsters. One note being right says nothing about the next.
|
|
735
|
+
- **A wrong RE address is found where the code writes the value.** Doom 64's real totals were in
|
|
736
|
+
the functions that count them: `P_SpawnMobj` loads `lui 0x8006; addiu 0x3398`, then `lw`,
|
|
737
|
+
`addiu 1`, `sw` under its `MF_COUNTKILL` test. A ~40-line Python decoder of `lui`/`addiu`/`lw`/
|
|
738
|
+
`sw` over a snapshot's `rdram.bin` at the RE's function address is enough when no disassembler
|
|
739
|
+
is installed. Then check the value against the level's own data (THINGS on the snapshot's skill
|
|
740
|
+
gave 55 kills, as RAM did). A neighbour the RE does place right (`end_time`, just before) backs
|
|
741
|
+
it up. Key per-level flags and flag sets by the level (`map-01-…`), so another level's map pins
|
|
742
|
+
read unknown, not this level's state.
|
|
687
743
|
- **Don't take a threshold from a game message without reading its condition.** Doom 64's
|
|
688
744
|
"medikit that you REALLY need" tests health after the medikit is added, so it never shows; a
|
|
689
745
|
chip citing it as "the game's own 25" cited a bug. A health chip also wants `gte: 1`: a dead
|
|
@@ -779,6 +835,13 @@ the plugin repos) in the same change as the fix. The next game should not have t
|
|
|
779
835
|
And `1 << (marker->id + 6)` for a Jinjo is a shift by 96..100, which MIPS `sllv` takes mod 32
|
|
780
836
|
(C calls it undefined): read the compiled shift with `objdump -dr` before mapping a value to a
|
|
781
837
|
bit (BK, 2026-12-06).
|
|
838
|
+
- **A switch's bit is not its effect's, and not every progress bit stays set.** Banjo-Kazooie's
|
|
839
|
+
lair water switch sets its "pressed" bit when hit, but the water level's bit only at the map
|
|
840
|
+
change that ends its cutscene (`func_802D6114`), and the third level's bit is cleared again
|
|
841
|
+
after 30 seconds or on leaving its rooms; a world's entrance bit is set when its lobby next
|
|
842
|
+
loads, after an unnamed bit (0x28 + world) its opening cutscene sets. Show the effect's bit,
|
|
843
|
+
grep every writer of it (clears included) before calling it progress, and check the order
|
|
844
|
+
across a TAS replay's snapshots (BK, 2026-12-06).
|
|
782
845
|
- **Exit pins: read the spawn function first.** Some exits never place the player (BK's 0x65),
|
|
783
846
|
some use hard-coded positions (0x80 and up): neither gets a pin. Keep duplicate exit nodes
|
|
784
847
|
with unique ids (a `Map` keeps the last, not the one the game uses). Many exits drop the
|
|
@@ -848,8 +911,9 @@ the plugin repos) in the same change as the fix. The next game should not have t
|
|
|
848
911
|
beside the name, and otherwise name it by id ("map 0x38") while the live read supplies context.
|
|
849
912
|
Uncited player knowledge isn't a source: 33 of 44 names in DK64's first pass didn't survive
|
|
850
913
|
this. Slug unnamed places by id alone (`map-0c`), so a later name or ruling never changes a
|
|
851
|
-
slug; and a decomp's `.data` tables copied from the ROM (DK64's map → world
|
|
852
|
-
|
|
914
|
+
slug; and a decomp's `.data` tables copied from the ROM: those that only map ids (DK64's map → world,
|
|
915
|
+
Conker's scene → task) may be committed with a ROM-gated test, but gameplay values (start cash,
|
|
916
|
+
prices) are read live, not committed (`data-licensing.md`, decided 2026-12-06).
|
|
853
917
|
- **A counter declared only for `describeState` also reaches the AI.** Shared code puts every
|
|
854
918
|
declared counter the state carries into LIVE_STATE (`readableCountersFor`): DK64's world counter
|
|
855
919
|
told the model the main menu was "a shop". Send such a counter only where its value means
|
|
@@ -963,6 +1027,96 @@ the plugin repos) in the same change as the fix. The next game should not have t
|
|
|
963
1027
|
fact behind one is missing: a Doom secret with no pin to place it by dropped its "where"
|
|
964
1028
|
sentence, so a two-sentence card showed how it opens. A sentence ends at `.`, `?` or `!`
|
|
965
1029
|
before a space.
|
|
1030
|
+
- **A collected state that lasts one visit lives in the spawn list, not the save.** SM64 keeps
|
|
1031
|
+
no save bit for a red coin or a secret: collecting one deactivates it, and the unload marks
|
|
1032
|
+
its macro list entry in RAM (`RESPAWN_INFO_DONT_RESPAWN` in the params word's high byte) until
|
|
1033
|
+
the area reloads. Read it through the game's pointer to the *current* area's list (check the
|
|
1034
|
+
area's own index against the one the reader reports, else untracked), name the flag by room
|
|
1035
|
+
and position (the same point in another area is another coin), test the whole byte, not a
|
|
1036
|
+
bit of it, and tie the preset ids the reader keeps to the extractor's behaviours in a ROM
|
|
1037
|
+
test. Leave a pin with no such record uncollected and say so (gameslate-n64, 2026-12-06).
|
|
1038
|
+
- **A "gone this visit" mark is "collected" only for objects that leave no other way.** SM64
|
|
1039
|
+
marks any deactivated object's spawn entry the same, whatever deactivated it: a sliding or
|
|
1040
|
+
hidden 1-up that flickers away uncollected, a spawner that goes once the player is near, an
|
|
1041
|
+
init that deletes a 1-up before a key is held. Before giving a pin `collectedBy` from such a
|
|
1042
|
+
mark, read every place the object's behaviour deactivates it; keep one table of the kinds that
|
|
1043
|
+
count, shared by the reader and the pins, and add what else must hold (`{ all: [taken,
|
|
1044
|
+
keyFlag] }`, from save flags that are absent before a file is chosen, never from an inventory
|
|
1045
|
+
that reads empty there). Objects placed by level-script commands keep their mark too, in another list (SM64's
|
|
1046
|
+
`SpawnInfo.behaviorArg`): read every list the area spawns from (gameslate-n64, 2026-12-06).
|
|
1047
|
+
- **A place's save bit can sit in a neighbour's byte.** SM64 keeps course c's cannon in bit 7
|
|
1048
|
+
of `courseStars[c]`, the byte after course c's own stars (`save_file_is_cannon_unlocked`), so
|
|
1049
|
+
indexing it like the stars reads the course before's cannon. Copy the game's own getter's
|
|
1050
|
+
index, and table-test the neighbour's bit reading "closed" (gameslate-n64, 2026-12-06).
|
|
1051
|
+
- **Save bits that run across maps need a game-wide index.** DK64 numbers a coloured banana's
|
|
1052
|
+
bit as 0x320 plus every counted model of the worlds before its own, of the maps before its own
|
|
1053
|
+
in that world and of its setup before it (a lobby counts as DK Isles); balloons count from
|
|
1054
|
+
0x26B across every map's actor list. Read every map's setup once per extractor, pass the index
|
|
1055
|
+
in (a hand-made ROM test passes an empty one), and census it on the ROM: the bits must run
|
|
1056
|
+
unbroken up to the game's own total (`gModelCountTotal`, 1700). It costs: the sandbox build
|
|
1057
|
+
went from 13 s to 60 s, one index per builder thread (gameslate-n64, 2026-12-06).
|
|
1058
|
+
- **Bits a game reads as words aren't byte-addressed flags.** DK64's model bits go through
|
|
1059
|
+
`eepromReadBitfield` as big-endian u32s, so bit *n* is byte `(n >> 5) * 4 + 3 - ((n & 31) >> 3)`
|
|
1060
|
+
of the slot, while its file flags are byte `n >> 3`. Give each its own helper and test a bit in
|
|
1061
|
+
each byte of a word.
|
|
1062
|
+
- **Find a packed segment's data member, then prove the split.** DK64's global segment is two
|
|
1063
|
+
gzip members back to back (code, then data); take the one gzip magic inside it as the second
|
|
1064
|
+
member and refuse it unless the two trailers' ISIZEs add up to bss − vram. The data then sits at
|
|
1065
|
+
vram + the code's size, and the code never needs inflating.
|
|
1066
|
+
- **A save item as a mission step is its slot bit, not `has`.** Off a file the inventory is `[]`,
|
|
1067
|
+
so `{ has }` reads "to do" where the truth is unknown; a `{ bit }` on the streamed slot is
|
|
1068
|
+
unknown until a file is loaded. And a pin helper must spread its spec into the landmark: a
|
|
1069
|
+
`category: spec.category` fails the pin-categories scan, which accepts only a literal or
|
|
1070
|
+
`PIN_CATEGORIES.<key>`.
|
|
1071
|
+
- **Colour floors from the game's own textures, not shades of one hue.** Walk the area's geo
|
|
1072
|
+
layout for the display lists it draws in place, run them (vertices, triangles, the texture
|
|
1073
|
+
and light state), give each texture its alpha-weighted mean colour, and draw each up-facing
|
|
1074
|
+
drawn triangle over the collision floor it lies on (within a few dozen units: decals sit just
|
|
1075
|
+
above). Keep the height bands (drawn low to high, darker below), let a hazard (lava, water,
|
|
1076
|
+
gas) override a texture, and merge colours into a small palette by covered area: a drawing
|
|
1077
|
+
holds at most 100 layers. Skip translucent layers (decals and shadows blend over the ground:
|
|
1078
|
+
BoB's shadow discs, intensity 0 with soft alpha, came out as opaque black squares), carry
|
|
1079
|
+
uniform scales (`GEO_SCALE`) down to the vertices and refuse a moved list rather than drop it,
|
|
1080
|
+
and give a texture with nothing opaque no colour. Levels built from objects get only a fallback
|
|
1081
|
+
colour until their models are run too. Render before and after to the scratchpad and look
|
|
1082
|
+
(SM64, 2026-12-06).
|
|
1083
|
+
- **Game text is read from the ROM, never committed.** Act, objective and menu names live in the
|
|
1084
|
+
ROM: read them on the player's PC from the game's own table and charset (SM64's
|
|
1085
|
+
`seg2_act_name_table`), number them in committed code ("Star 4"), use made-up names in tests,
|
|
1086
|
+
and let a ROM test check counts only (the maintainer's call, 2026-12-06).
|
|
1087
|
+
- **Read the spawner's test, not just its mask.** SM64's plain `OBJECT` writes acts 0x1F, which
|
|
1088
|
+
`level_cmd_place_object` treats as "every act" (`|| acts == 0x1F`), so a plain bit test hid
|
|
1089
|
+
act-6 objects. Mirror the game's masks on parameters too (`& 0x1F` on SM64's star index).
|
|
1090
|
+
- **Rebuild a scene graph's nesting as the engine does.** An opened node's children hang under the
|
|
1091
|
+
last node made at that depth (a stack per depth, like SM64's `gCurGraphNodeList`), not under the
|
|
1092
|
+
last command read, and an unbalanced close throws.
|
|
1093
|
+
- **A chapter or scene menu is not one file's progress.** Conker's Chapters menu lists the best
|
|
1094
|
+
save the EEPROM scan found, and outside a slot the task bits belong to the chosen scene: gate
|
|
1095
|
+
progress on the save slot in use (gameslate-n64, 2026-12-06).
|
|
1096
|
+
- **An array behind a pointer that moves:** read the pointer on each side of the bytes and read
|
|
1097
|
+
again if it moved (Conker's `script_reallocTaskDoneBits`).
|
|
1098
|
+
- **Show the HUD's number, not the stored counter.** Read the HUD's draw function: Conker's cash is
|
|
1099
|
+
scaled during the lava race and offset in cutscenes, and the "Heist" gap a README named was
|
|
1100
|
+
really the race.
|
|
1101
|
+
- **Save bits that count across maps need a game-wide index.** DK64's coloured bananas and coins
|
|
1102
|
+
take one bit each in a run that counts every map before this one, so the extractor reads every
|
|
1103
|
+
map's setup once per builder (a build went from 13 s to 60 s). Pin the run against the game's
|
|
1104
|
+
own total (`gModelCountTotal`) in a ROM test.
|
|
1105
|
+
- **Bits a game reads as big-endian words are not byte-addressed flags.** DK64's
|
|
1106
|
+
`eepromReadBitfield` takes bit n lowest-first inside a big-endian u32: build the test buffer the
|
|
1107
|
+
way that function reads it, cite the line, and don't test the formula against itself.
|
|
1108
|
+
- **Find a packed segment's data member by its one gzip magic, then prove the split** with the
|
|
1109
|
+
members' ISIZE sum against the segment's size (DK64's global data).
|
|
1110
|
+
- **A save item as a mission step is its slot bit, not `has`.** Off a file the inventory is `[]`,
|
|
1111
|
+
so `has` reads "not done"; a `{ bit }` on the streamed slot reads unknown.
|
|
1112
|
+
- **A pin helper spreads its spec** (`...spec`), never `category: spec.category` by hand, or the
|
|
1113
|
+
pin-categories scan can't see the category (gameslate-n64, 2026-12-06).
|
|
1114
|
+
- **Labels from the same ROM as the maps want a lazy cache per table.** SM64's `star-names` asset
|
|
1115
|
+
built the level table too until each table was read on first use: a labels-only asset parsed
|
|
1116
|
+
every level script, and a test ROM holding only the act-name table couldn't be built.
|
|
1117
|
+
- **A ROM table's length comes from its declared size,** not the gap to the next symbol; check the
|
|
1118
|
+
gap is rows × stride exactly. And give hubs one meaning everywhere: DK64's lobbies are DK Isles
|
|
1119
|
+
for the save grid, so the chips must say so too.
|
|
966
1120
|
- **An "exit" node may be where the player arrives, not what sends them on.** Banjo-Kazooie's
|
|
967
1121
|
numbered entrance markers are arrival spots; the ways out are separate trigger boxes whose
|
|
968
1122
|
destination comes from the warp function table the box's id selects. Read the code that fires
|
|
@@ -994,7 +1148,7 @@ the plugin repos) in the same change as the fix. The next game should not have t
|
|
|
994
1148
|
- **Follow every source the floor or water query asks.** DK64's floor query merges the map mesh,
|
|
995
1149
|
placed models and actor boxes; Conker's water height comes from water props, trigger-zone
|
|
996
1150
|
volumes and surface type 8 at once. Port the game's query, not one of its sources, and say in
|
|
997
|
-
|
|
1151
|
+
Limitations which sources are built at run time (animated bones, actor floors, scripted water)
|
|
998
1152
|
and so aren't drawn.
|
|
999
1153
|
- **A trigger volume isn't a surface.** Port its contains-test exactly (Conker's
|
|
1000
1154
|
`zone_isOutside`: thresholds, integer truncation, rotation order), draw the floors it holds as
|
|
@@ -1258,7 +1412,7 @@ the plugin repos) in the same change as the fix. The next game should not have t
|
|
|
1258
1412
|
real hole it looks like (2026-12-05).
|
|
1259
1413
|
- **`position` needs a heading.** The sdk's position requires `headingDeg` (0.3.14). An actor
|
|
1260
1414
|
with no heading in memory can't be the position; send it as an `enemies`/`npcs` dot and say so
|
|
1261
|
-
in
|
|
1415
|
+
in Limitations rather than inventing an angle (2026-12-05).
|
|
1262
1416
|
- **Changing a README's frontmatter changes the root support table.** Run
|
|
1263
1417
|
`gameslate-plugin support plugin --built dist/<repo> --write` after editing `npcs`, `enemies` or
|
|
1264
1418
|
capabilities, or the check refuses (2026-12-05).
|
|
@@ -1321,7 +1475,8 @@ the plugin repos) in the same change as the fix. The next game should not have t
|
|
|
1321
1475
|
- **Keep game text out of committed tables.** A builder that copies objective labels from the
|
|
1322
1476
|
game's language files into a committed table or manifest commits the publisher's text. Commit
|
|
1323
1477
|
ids only ("Objective 1", or the bank and entry number), and join the real labels by id from a
|
|
1324
|
-
file on the player's PC or an asset extractor
|
|
1478
|
+
file on the player's PC or an asset extractor (a `labels` output for mission titles, a
|
|
1479
|
+
`location` output's `objectives` for a place's objectives: §5). Then grep your hint prose for quoted game strings:
|
|
1325
1480
|
Perfect Dark's hints quoted an objective verbatim, and MM's objective labels carried the boss
|
|
1326
1481
|
title cards (2026-12-05).
|
|
1327
1482
|
- **A floorplan drawing is not an SVG.** It has no text, no fill opacity, and fills and strokes are
|
|
@@ -1443,3 +1598,72 @@ the plugin repos) in the same change as the fix. The next game should not have t
|
|
|
1443
1598
|
barn defence starts at 2 AM; the invasion actor runs from `CLOCK_TIME(2, 30)`. Check timings and
|
|
1444
1599
|
rewards in the decomp (the Oceanside Spider House's wallet is chosen by the day it's paid out),
|
|
1445
1600
|
then name a walkthrough that agrees (2026-12-05).
|
|
1601
|
+
- **Stream a game's bitset word as `flagSets` bytes, low byte first, and check its numbering in a
|
|
1602
|
+
replay.** Body Harvest tests mission m as `word & (1 << m)` (the decomp's three-line bit helper
|
|
1603
|
+
says the order; read it, don't assume). Streamed as the word's bytes from its low end, mission
|
|
1604
|
+
m is `{ bit: { set, index: m >> 3, mask: 1 << (m & 7) } }`, and one helper builds both the
|
|
1605
|
+
stream and the pins' conditions. Then read the word across a TAS replay's snapshots: no bit
|
|
1606
|
+
should ever be set at or past the level's count (Greece's 23 missions never set bit 23), which
|
|
1607
|
+
shows the bits number the same things the pins do. Read the word only in modes where it's the
|
|
1608
|
+
current level's (each level clears it before loading; the frontend keeps the last one's). In
|
|
1609
|
+
loading and cutscenes, hold the last word read in play, and drop it when the level changes or the
|
|
1610
|
+
frontend shows. Otherwise a finished target comes back on every load screen. With nothing held,
|
|
1611
|
+
a `hiddenWhen` reads unknown and the pin shows. Build an expected bitset in a test from a list
|
|
1612
|
+
of bits, not from `toString(2)`: that string puts the highest bit first, and a README
|
|
1613
|
+
misnumbered two bits this way (gameslate-n64, 2026-12-06).
|
|
1614
|
+
- **Find when a save bit is written before you document a "saved at stage end" gap.** Kirby 64's
|
|
1615
|
+
README said a shard showed only once the stage saved on exit; the pickup routine calls the save
|
|
1616
|
+
helper (`func_800B9CB4`) at once, so the bits are live mid-visit. When the decomp leaves the
|
|
1617
|
+
helper as asm, disassemble it from the ROM (`llvm-objcopy-18 -I binary -O elf32-tradbigmips` on
|
|
1618
|
+
the slice, then `llvm-objdump-18 -d --adjust-vma=<vram>`), find its callers by searching the ROM
|
|
1619
|
+
for its `jal` word (`0x0C000000 | (addr & 0x0FFFFFFF) >> 2`, word-aligned), and watch the bytes
|
|
1620
|
+
change mid-stage across a TAS replay's snapshots. The routine is the publisher's code: keep the
|
|
1621
|
+
listing in your scratchpad, never in a repo or worktree, and take from it only addresses, offsets
|
|
1622
|
+
and bit numbering, as from an unlicensed decomp (data-licensing.md). A spawn's save index can name the bit as well
|
|
1623
|
+
as the stage (Kirby's `saveToEeprom` is stage ordinal × 3 + bit): census it on the ROM so a pin
|
|
1624
|
+
never guesses a bit (gameslate-n64, 2026-12-06).
|
|
1625
|
+
- **When placed spawns fall short of the game's count, the code spawns the rest.** Kirby 64's
|
|
1626
|
+
entity lists place 49 of its 66 shards; the other 17 come from code. Search the ROM for `jal`s
|
|
1627
|
+
to the spawn routine (Kirby's `func_800FCD14`: 11 callers) and to the save helper, and read
|
|
1628
|
+
each caller's save-index argument: an instruction immediate (Adeleine, the minibosses' drop) or
|
|
1629
|
+
a table row the routine indexes (the enemy-wave rooms' ovl18 table, row = the room entity's
|
|
1630
|
+
id). Read those values from the ROM in the extractor, checking each instruction word's top
|
|
1631
|
+
half, and census the total: every index once (gameslate-n64, 2026-12-06).
|
|
1632
|
+
- **A spawn-list mark can mean "out", not "gone".** Yoshi's Story writes -1 over a placed
|
|
1633
|
+
entry's word when its actor spawns and writes the word back when the actor leaves the screen,
|
|
1634
|
+
so -1 covers a live actor as well as an eaten fruit. Eaten is -1 with no live, unkilled actor
|
|
1635
|
+
pointing back at the entry (`Actor + 0x1D8`). The game spawns before it writes -1 and writes
|
|
1636
|
+
the word back before it kills, so read the list, then the pool, then the list again, and call
|
|
1637
|
+
an entry gone only when both lists say -1: read once, a melon coming on or going off screen
|
|
1638
|
+
flickers eaten. Count an actor that is spawned but not yet listed as holding its entry. When the
|
|
1639
|
+
object's behaviour is an overlay the decomp leaves unsplit, take its ROM range from the unit
|
|
1640
|
+
header and scan it for `jal`s into main. That lists every way out: Yoshi's fruit overlay has
|
|
1641
|
+
one of its own, which writes the word back, and eating it is Yoshi's code (gameslate-n64,
|
|
1642
|
+
2026-12-06).
|
|
1643
|
+
- **An entry's holder can be another object's child, in another pool.** Yoshi's Story's Shy Guys
|
|
1644
|
+
and bubbles spawn the melon they hold and share their entry with it, or hand it over when the
|
|
1645
|
+
melon is taken, and that melon lives in one of the actor manager's sub-pools, not the main
|
|
1646
|
+
actor pool. A reader that scans only the main pool calls the entry eaten while the melon is
|
|
1647
|
+
still out. Scan every pool an actor can live in, and stream nothing when one can't be read. A
|
|
1648
|
+
holder that spawns its prize with no entry leaves no record at all: pin it with no collected
|
|
1649
|
+
state and say so in Limitations. And a prize still attached as its holder's child dies with it:
|
|
1650
|
+
a kill that takes the children and puts no entry back leaves "out, no actor" for a prize
|
|
1651
|
+
nobody took. Track a holder only when every way it ends (its overlay's kills and the main
|
|
1652
|
+
code's) leaves its prize free or puts the entry back; Yoshi's Shy Guys didn't pass, the
|
|
1653
|
+
objects that spawn a free melon and then kill themselves did (gameslate-n64, 2026-12-06).
|
|
1654
|
+
- **"Freed" is "taken" only when every other way to free the object leaves a mark.** GoldenEye
|
|
1655
|
+
frees body armour and an untagged gun when Bond takes it (`objFree` sets `obj->prop` to NULL),
|
|
1656
|
+
and frees a destroyed object, a detonated mine and a recycled projectile the same way. Those go
|
|
1657
|
+
through `RUNTIMEBITFLAG_REMOVE`, which `objFree` never clears, so taken is "prop NULL without
|
|
1658
|
+
REMOVE", or "prop parented to Bond's" for what the game hands him (keys, tagged objects). List
|
|
1659
|
+
every caller of the free routine and of the flag's setters before trusting the split, and say
|
|
1660
|
+
in Limitations which frees leave no mark (a crate freed with its gun inside). "No object" is
|
|
1661
|
+
also "never set up": find a field the setup writes with the object and the free leaves alone
|
|
1662
|
+
(GoldenEye's `obj->model`) and give no flag without it. And list who reuses a freed record:
|
|
1663
|
+
GoldenEye's `weaponCreate`, out of slots, writes a new weapon over a setup record, so tell a
|
|
1664
|
+
reused record by the fields the setup gave it (model number, pad), keep taken taken for the
|
|
1665
|
+
visit, and forget it when the stage unloads. Pin only what the
|
|
1666
|
+
pickup routine accepts: GoldenEye's map pinned 44 `PROPFLAG_UNCOLLECTABLE` grenades, the
|
|
1667
|
+
stages' scripted explosions, as Hand Grenades. Offsets the probe gives for a struct that
|
|
1668
|
+
`inherits` another are short by the parent's size (clang drops the member): add it, and check
|
|
1669
|
+
the result in the compiled code (gameslate-n64, 2026-12-06).
|
|
@@ -18,7 +18,35 @@ one moment that's **not** gameplay (title or file select), so "no save loaded" i
|
|
|
18
18
|
|
|
19
19
|
## 2. Get to the moment
|
|
20
20
|
|
|
21
|
-
**
|
|
21
|
+
**Get there in this order: a TAS replay here, the attract demos on the PC, then a short list for a
|
|
22
|
+
person.** Don't play a game by screenshot → input → screenshot: it can't reasonably be played
|
|
23
|
+
that way, and on 2026-12-06 SM64 sat in its attract mode while an agent tried (the PC's RetroArch
|
|
24
|
+
had no network pad, so its presses went nowhere). Instead:
|
|
25
|
+
|
|
26
|
+
1. **TAS replays in the emulator on the dev machine** (`drive tas`, below) reach deep moments
|
|
27
|
+
frame-exactly. Use them for anything past the title. To check a pack on them, run its own
|
|
28
|
+
source over each snapshot's `rdram.bin` in a scratch vitest file (an `rdramMemory` like Mario
|
|
29
|
+
Golf's `source.test.ts`, the pack's build id) and project each state's `position`, `enemies`
|
|
30
|
+
and `npcs` through the layer's affine onto the map `extract-assets` built; set the drawing
|
|
31
|
+
beside `screen.png` for a few frames. `--watch` keeps snapshotting to the movie's end: once you
|
|
32
|
+
have the frames you need, `Stop-Process` its BizHawk and the snapshots taken stay.
|
|
33
|
+
2. **Attract demos on the PC:** launch the game with `gs-game`, send no input, and sample the
|
|
34
|
+
daemon's state and position while the demos play. SM64's demos alone covered seven courses.
|
|
35
|
+
Packs report a demo as `menu` or `cutscene` with no position, so read the same addresses
|
|
36
|
+
straight from RAM over RetroArch's command port (55355) with a small sampler on the PC, and
|
|
37
|
+
project them onto the drawn map. The PC's RetroArch (1.20) answers `READ_CORE_RAM`
|
|
38
|
+
(RetroAchievements addressing, little-endian words), not `READ_CORE_MEMORY` ("no memory map
|
|
39
|
+
defined"); `SCREENSHOT` saves the screen into `screenshot_directory` a few seconds later, for
|
|
40
|
+
comparing markers with the screen. Skip a slot whose floats read NaN (mid-write), and expect
|
|
41
|
+
one stale sample at a change of level (DKR's map id moves a poll before its racers).
|
|
42
|
+
Smash's How to Play and two VS demos, DKR's six attract races and three BK demos all
|
|
43
|
+
sampled this way on 2026-12-06. Never `pkill -f` a pattern your own ssh command line
|
|
44
|
+
contains: bracket a letter (`"gs-sampl[e]"`).
|
|
45
|
+
3. **A person** proves the rest with a few quick sanity checks: panel, label as the UI writes it,
|
|
46
|
+
expected value, and how to reach it in under a minute.
|
|
47
|
+
|
|
48
|
+
Scripted routes from boot to a menu or a first race (`verify/*-retroarch.json`) are still fine:
|
|
49
|
+
they are fixed inputs, not play. For an emulated console, the driving loop they use is
|
|
22
50
|
proven, and GameSlate's `gameslate drive` does each step (`docs/emulator-driving.md`):
|
|
23
51
|
|
|
24
52
|
```sh
|