diff --git a/.github/release-games.json b/.github/release-games.json index 80e7d18..868fea1 100644 --- a/.github/release-games.json +++ b/.github/release-games.json @@ -9,7 +9,7 @@ "title_id": "010015100B514000", "game_version": "1.2.1", "build_id": "FF773E90972D544EB79406EAA65396D53C43EFB9", - "layout_count": 126 + "layout_count": 127 } } } diff --git a/super-mario-bros-wonder/AGENTS.md b/super-mario-bros-wonder/AGENTS.md index 2d866d1..3f038df 100644 --- a/super-mario-bros-wonder/AGENTS.md +++ b/super-mario-bros-wonder/AGENTS.md @@ -6,9 +6,9 @@ Read the root [`../AGENTS.md`](../AGENTS.md) first. This file is the **source of - Title ID `010015100B514000`, **version 1.2.1 only**, build ID `FF773E90972D544EB79406EAA65396D53C43EFB9`. - Tested on Eden (yuzu family) with Graphics > Aspect Ratio > **Force 4:3**, on Windows (where agents can probe memory and take screenshots) and on the tester's Retroid Pocket Nova (Android). Other emulators and console are untested. -- Mod folder: `mod/Native 4x3 Aspect Ratio/` = `exefs/1.2.1.pchtxt` + `romfs/Layout/*.Nin_NX_NVN.blarc.zs` (115 changed archives) + `romfs/BancMapUnit/*.bcett.byml.zs` (11 stage edits: Course152_Sub4, Course411_Course, Course415_Course, Course417_Course, Course403_Course, Course400_Course, Course401_Course, Course408_Course, Course407_Course, World001, Course022_Main) + `README.txt` (ships with the mod; holds no install steps, only the link to `README.md#install`, the one install guide). Named "Nova Aspect Ratio 4x3 Native" before v1.0.0; don't rename it again. +- Mod folder: `mod/Native 4x3 Aspect Ratio/` = `exefs/1.2.1.pchtxt` + `romfs/Layout/*.Nin_NX_NVN.blarc.zs` (115 changed archives) + `romfs/BancMapUnit/*.bcett.byml.zs` (12 stage edits: Course152_Sub4, Course411_Course, Course415_Course, Course417_Course, Course403_Course, Course400_Course, Course401_Course, Course408_Course, Course407_Course, World001, Course022_Main, Course853_Main) + `README.txt` (ships with the mod; holds no install steps, only the link to `README.md#install`, the one install guide). Named "Nova Aspect Ratio 4x3 Native" before v1.0.0; don't rename it again. - Installed for testing at `%APPDATA%\eden\load\010015100B514000\Native 4x3 Aspect Ratio`. Sync with the game closed: `robocopy "mod\Native 4x3 Aspect Ratio" "%APPDATA%\eden\load\010015100B514000\Native 4x3 Aspect Ratio" /MIR` (mirror: deletes archives the build no longer ships). -- Releases: tag prefix `smbw` (`.github/release-games.json`); procedure in the root AGENTS.md "Releasing". `layout_count` there counts every file under `romfs/` (115 layouts + 11 stage files = 126); bump it when that number changes. +- Releases: tag prefix `smbw` (`.github/release-games.json`); procedure in the root AGENTS.md "Releasing". `layout_count` there counts every file under `romfs/` (115 layouts + 12 stage files = 127); bump it when that number changes. ## Local inputs (outside the repo) @@ -97,6 +97,7 @@ Shipped patch `exefs/1.2.1.pchtxt`: 11 hooks (`verify_pchtxt.py`). Includes area 10. `Course407_Course` (Break Time! Watery Wonder Tokens), **approved in Eden on 2026-11-07**: revert `DVWaKaiganFarIwaA02`; adjust `DVWaKaiganFarIwaA01` (Hash `3373664933504165692`) from Translate $(23.5, 48.0, -167.5)$ / Scale $(0.7, 0.7, 0.7)$ to Translate $(23.5, 49.5, -167.5)$ / Scale $(0.82, 0.82, 0.82)$. 11. `World001` (Pipe-Rock Plateau world map), **confirmed in Eden (2026-11-09: the tester reached the lost Toad)**: subregion 22 (underground area: sign, ? block, courses 9/10, KO arena) has a fixed camera on `WorldMapCameraLookAtTag` obj479 (Hash 2929358336); its X moves 87.25 -> 91.25 so the hidden warp pipe obj513 (x 103, to the lost-Toad room) and Mario beside it are on screen (4:3 view about x 76.5-106.0; entry pipe obj29 kept). An earlier subregion 17 limit-area edit targeted the wrong area and was reverted. All nine world maps surveyed for fixed or boxed cameras cropping objects 16:9 showed (2026-11-09); only the World006 (Fungi Mines) pipe from Sunbaked Desert beside Captain Toad was a real candidate, and the tester checked it fine in game. Details: DEVELOPMENT.md section 46. 12. `Course022_Main` (W2 Outmaway Valley, Wonder autoscroll), **seed fix confirmed in Eden (2026-11-09)**: the finish Wonder Seed (obj8927, GravityOn at x 693.5) is created by `CourseDisplayBoxSwitch` obj8878 when it enters the view, timed to drop onto the tip of the goal pole carried round by the rolling snow hill. The left-aligned 4:3 scroll view (21.0 wide at G 15.75) reached the box 6.5556 blocks of scroll late, so the seed missed the pole and fell out of the course (reported 2026-11-09). All three display-box switches of the section move X -6.5556 (obj8878 715.5 -> 708.9444; the Mini Lucky Coin switches obj8931 574.5 -> 567.9444, obj8932 596.5 -> 589.9444) so they fire at the stock scroll position. The tester confirmed the seed lands on the pole; the coin switches were not separately reported. Details: DEVELOPMENT.md section 47. +13. `Course853_Main` (Sunbaked Desert Special: Pole Block Allure, autoscroll), **confirmed in Eden (2026-11-09)**: `RAIL_EDITS` on autoscroll rail `1776580222928036096`. Points 0-3 lowered in Y (17.0/17.0/25.5/41.0 -> 14.5/14.5/22.75/36.0) so the camera stays near the poles and the Wonder Flower is on screen. Final point 12 X 226.75 -> 231.335 (rail X is the view's left edge, rail Y its top) so the finale cannon `ObjectBalloonKillerHodaiLeft` (stock position 251.5, `IsFirstInCamera`) enters the 4:3 view and fires; the pole's first 0.8 blocks fall off the left edge as a trade-off. No actor edits. The tester confirmed the cannon fires and the Wonder Seed is reachable. Details: DEVELOPMENT.md sections 44-45 (section 45 corrects section 44's camera model). **Layouts (`build.py`, built from the 1.2.1 originals since 2026-10-30):** 115 of the game's 235 archives ship (114 changed top-level layouts incl. the 1.2.1-only `AmiiboReadWindow`, plus `LCursor`); the other 120 are unchanged and fall back to the game's copies. top-level RootPane scale y 0.75 (`ROOT_SY`); HUD/header/footer edge-anchored (+/-180 root-local units, TransY keys shifted too); full-screen layers grown x4/3 (captures and fades height only, artwork uniform); parts layouts untouched; curated per-screen tables `FORCE_SHIFT`, `NO_SHIFT_SUBTREE`, `NO_SHIFT_LAYOUT`, `NO_FILL`. 638 float writes, 46 fill panes, `verify.py` clean. Until 2026-10-30 the mod was built from won-aar's older cache and shipped all 234 archives, so 30 screens (incl. Pause, MainMenu, Title, CourseList, talk windows, button icons) carried pre-1.2.1 layouts; the 1.2.1 rebuild applies identical edits. **Play-tested after the 1.2.1 rebuild (2026-10-31): menus, HUD, pause, maps, transitions, course clear, cursor and amiibo look good.** @@ -127,7 +128,7 @@ Shipped patch `exefs/1.2.1.pchtxt`: 11 hooks (`verify_pchtxt.py`). Includes area Boss/fixed-room table (all delta 0): Course150_Sub4 607466214 G 21.0; Course151_Sub2 101336182, Course152_Sub4 1778226157, Course153_Sub3 1019598315, Course411_Course 1607468536, Course415_Course 3684305666, Course417_Course 2579434623, Course403_Course 177084102, Course008_Sub2 3214359175, Course400_Course 2214662437, Course401 1219170747, Course404_Main 1725897490, and Course407 2395215932 G 20.6667 (152's own zoom actor 17.5 multiplies the base); Course408 1474562704 uses G = 18.5, delta = 0.0 with its stock-height CameraArea and horizontal X lock. Course401, Course408, Course404, and Course407 are approved in Eden on 2026-11-07; Course409 is stock and remains on the TODO list. Course403, Course415 and Course417 visual framing is user-approved with gameplay checks still open. Course400 visual framing approved; Hoppo spawn elevation fix awaiting retry. Course411's earlier framing fix is user-confirmed; regression on the current build is not yet reported. Autoscroll end stops table (`TABLE_ENDS` after `BOSS`, surveyed by `scan_autoscroll_ends.py`): areas with intermediate pauses >= 120 frames (Course002_Main 885847797, Course022_Main 2740185052, Course062_Sub1 3839196513, Course102_Main 4167497323, Course290_Main 2931365200, Course857_Main 3856421716) mapped to rail end X + 13.7778; camera unlocks only when |fixed X + delta - key| <= 0.05. Optional lines commented after `@stop` (zone-lock disable, fixed zoom-outs 17-20) are not needed. -**Confirmed in game:** Outmaway Valley Wonder Seed landing on the goal pole (Course022_Main display-box switch moved -6.5556), World001 underground area hidden warp pipe (subregion 22 look-at x 91.25), badge houses and one-screen rooms, pause/menu blur, course-entry iris, HUD and key glyphs vs stock, Select a User card, Poplin shop, kingdom map, Pipe-Rock Plateau Palace arena + pipes, wide-level base 15.75 (Outmaway Valley), airship autoscroll + Wonder Flower (Course101, re-checked with the [0, 2*delta] cave G on 2026-11-03), Piranha Plants on Parade (Course002_Main: camera stays locked during mid-scroll singing pause and unlocks at the final stop to reach the Wonder Seed, issue #1), Puffy Lifts seed (Course021), course-clear photo and View photo, menu pointer, Badge Challenge restart wipe, W4 Bowser Jr. (Course152_Sub4: water tint plane Scale Y 1.5, cave Y fight camera at 3.25, Royal Seed reachable, cave K swim AI, wall terrain to y = -10.0 for corner voids). +**Confirmed in game:** Pole Block Allure (Course853_Main autoscroll rail: framing and finale cannon), Outmaway Valley Wonder Seed landing on the goal pole (Course022_Main display-box switch moved -6.5556), World001 underground area hidden warp pipe (subregion 22 look-at x 91.25), badge houses and one-screen rooms, pause/menu blur, course-entry iris, HUD and key glyphs vs stock, Select a User card, Poplin shop, kingdom map, Pipe-Rock Plateau Palace arena + pipes, wide-level base 15.75 (Outmaway Valley), airship autoscroll + Wonder Flower (Course101, re-checked with the [0, 2*delta] cave G on 2026-11-03), Piranha Plants on Parade (Course002_Main: camera stays locked during mid-scroll singing pause and unlocks at the final stop to reach the Wonder Seed, issue #1), Puffy Lifts seed (Course021), course-clear photo and View photo, menu pointer, Badge Challenge restart wipe, W4 Bowser Jr. (Course152_Sub4: water tint plane Scale Y 1.5, cave Y fight camera at 3.25, Royal Seed reachable, cave K swim AI, wall terrain to y = -10.0 for corner voids). **Not yet checked in game:** the Mini Lucky Coins on Outmaway Valley's rolling hill (Course022_Main coin display-box switches moved -6.5556); Course061_Sub2 (Chase Killers) seed after its stopped autoscroll (x 595.0, rail end 570.75: the pre-fix reach was only 0.03 past it); Course857_Main short scroll stops (104 and 100 frames, under cave G's 120-frame hold, so a `CourseDisplayBoxSwitch` at x 211.5 fires later than stock); whether 151/153 also release their arena area after the cutscene; Course150 arena since its delta became 0; Bowser Jr. rooms 151-153 (extra height; alternate zoom path when subject+0x1BE != 0 bypasses caves B/F1); WipeTo*/WipeWarp; pits, level ends and Wonder zooms at 15.75; last boss and airship boss rooms; multiplayer; Android flashing bars (WipeCourseIn's kept-fill capture reads 180 rows past the frame). diff --git a/super-mario-bros-wonder/docs/DEVELOPMENT.md b/super-mario-bros-wonder/docs/DEVELOPMENT.md index 91c9901..218e2c5 100644 --- a/super-mario-bros-wonder/docs/DEVELOPMENT.md +++ b/super-mario-bros-wonder/docs/DEVELOPMENT.md @@ -457,7 +457,8 @@ In Course408 (Break Time! Floating Wonder Tokens), the maintainer requested zoom **Build and verification:** - Stage build wrote mod/Native 4x3 Aspect Ratio/romfs/BancMapUnit/Course408_Course.bcett.byml.zs. - uild_stage.py --verify reports 0 problems (7 bytes differ, all inside 3 edits). -- Verified with erify_pchtxt.py (291 lines, 11 hooks, 0 errors). +- Verified with +erify_pchtxt.py (291 lines, 11 hooks, 0 errors). ## 39. 2026-11-06: Course407 top-right background void coverage @@ -520,6 +521,47 @@ The maintainer play-tested the current build in Windows/Eden and approved Course The mod now ships 124 romfs files (115 layouts + 9 stage archives). Patch SHA-256: `636492eb2b6a2bac8098d70f409aaf4b38ca1109d4ff3e842791e83e5962aadf`. Stage verification covers all nine stage files with 0 problems; `scripts/check_repo.py` passes. +## 44. 2026-11-09: Course853_Main (Pole Block Allure) autoscroll rail repositioning + +**Context & Findings:** +In *Sunbaked Desert Special: Pole Block Allure* (`Course853_Main`, RootAreaHash `2118979906`), the camera autoscroll is driven by `AutoScrollControlSignalFrame` (`6045299945089365584`) bound to Rail `1776580222928036096` with `setYfree = False`. The stock rail points were authored to climb rapidly: Pt 0 `(0.0, 17.0)` -> Pt 1 `(13.0, 17.0)` -> Pt 2 `(38.0, 25.5)` -> Pt 3 `(63.0, 41.0)` -> Pt 4 `(96.0, 55.0)`. +In 4:3 (height 15.75, width 21.0), this climb lifts the camera far above Mario and the gameplay poles (which sit at $Y \in [4.5, 15.5]$): +- At Pt 3 ($X = 63.0, Y = 41.0$), the camera bottom edge reaches $Y = 33.12$. The Wonder Flower (`ItemWonderHole` 4542071052577928248) sits at $X = 71.50, Y = 25.50$ inside `EnemyBalloonKiller` at $Y = 28.50$, placing it **7.62 blocks below the bottom edge of the screen**, completely off-screen and nearly impossible to hit. +- Lower poles (Pole 1 at $Y = 8.5$, Pole 2 at $Y = 14.5$, Pole 3 at $Y = 15.5$, Snake Pole 2 at $Y = 21.5$) suffer severe bottom clipping and poor tracking. +- An initial experiment with global zoom override ($G = 20.67$) was evaluated and rejected: zooming out only expands the view around the high rail center, failing to bring the camera down to Mario's eye level. + +**Solution (`RAIL_EDITS` in `tools/build_stage.py`):** +Lowered Rail `1776580222928036096` points 0–3 in Y to an intermediate vertical profile: +- Pt 0: `(0.0, 17.0, 0.0)` -> `(0.0, 14.5, 0.0)` ($-2.5$) +- Pt 1: `(13.0, 17.0, 0.0)` -> `(13.0, 14.5, 0.0)` ($-2.5$) +- Pt 2: `(38.0, 25.5, 0.0)` -> `(38.0, 22.75, 0.0)` ($-2.75$) +- Pt 3: `(63.0, 41.0, 0.0)` -> `(63.0, 36.0, 0.0)` ($-5.0$) +- Pt 4+: Kept at stock `(96.0, 55.0, 0.0)` for the upper post-wonder platform. + +**Verified Framing Results in Native 4:3 ($G = 15.75$):** +- Start Platform ($Y = 4.5$): ground clearance $-2.12\text{ blk}$ from camera bottom (centered view). +- Pole 1 ($Y = 8.5$): $+1.88\text{ blk}$ above bottom. +- Pole 2 ($Y = 14.5$): $+5.40\text{ blk}$ above bottom, $+10.35\text{ blk}$ below top. +- Pole 3 ($Y = 15.5$): $+1.78\text{ blk}$ above bottom. +- Snake Pole 2 ($Y = 21.5$): $+2.65\text{ blk}$ above bottom. +- Wonder Flower ($Y = 25.5$): $+4.00\text{ blk}$ above bottom, $+11.75\text{ blk}$ below top (solid margin with ample upper headroom). +- Balloon Killer carrier ($Y = 28.5$): $+5.94\text{ blk}$ above bottom ($+9.81\text{ blk}$ below top). +- **Wonder Finish Balloon Killer Cannon Framing (`ObjectBalloonKillerHodaiLeft`):** + At the Wonder sequence finale, Mario arrives on the lower snake pole ($X \in [230.5, 240.5], Y = 133.5$) beneath the Wonder Seed (`ItemWonderFinishWonderSead` at $X = 240.5, Y = 144.24$). The green cannon (`ObjectBalloonKillerHodaiLeft` 15389084515446315917) sits atop the sand platform Wall 5 ($X \in [247.0, 252.0]$) at $X = 251.5, Y = 134.0$, firing a purple balloon creature to the left for Mario to bounce up to the Wonder Seed and upper pole. + In stock 16:9 ($W = 27.56$), the cannon sat $+2.75\text{ blk}$ inside the right screen edge ($X = 254.25$). In 4:3 ($W = 21.0$), when Mario stands at the end of the pole ($X = 240.5$), the right screen edge only reaches $X = 251.0$. Because `ObjectBalloonKillerHodaiLeft` has `'IsFirstInCamera': True`, sitting off-screen at $X = 251.5$ prevented it from ever triggering its firing cycle, softlocking the player with no balloon creature spawned. + Shifted the cannon left by $3.0$ blocks in X via `EDITS` ($X = 251.5 \to 248.5$). The cannon remains securely planted on Wall 5 ($[247.0, 252.0]$) and enters the 4:3 viewport with $+2.50\text{ blk}$ of margin when Mario is at $X = 240.5$, triggering its shot immediately upon approach. +Stage verification passes with 0 problems (5 bytes modified, passes all BYML invariants). + +## 45. 2026-11-09: Course853_Main finale camera stop moved right (corrects section 44's cannon cause) + +**Correction to section 44:** the camera model there (rail point = view centre) is wrong for SMBW autoscrolls. As in section 22, rail X is the view's left edge (the game adds the current half-width) and rail Y is the view's top edge (section 22: fixed Y = rail Y - half-height). The finale confirms it: the last rail point (226.75, 147.0) is the left edge of the authored room (`CameraArea` 12037923009706981632 spans X 226.75..254.25), and with Y as the top edge the pole (133.5), cannon (134.0) and Wonder Seed (144.24) all fit between 147.0 and 131.25; Y as the centre would put the pole off-screen in stock 16:9. The Y numbers quoted in section 44 ("camera bottom 33.12", "+4.00 blk above bottom") therefore do not hold; the Y retune itself was play-tested and stays. + +**Cause of the dead cannon:** the stock stop leaves the 4:3 view left-aligned at [226.75, 247.75]. After 2 s still, cave G pans towards Mario inside [0, 2 delta], but Mario at the pole end (X 240.5) only pulls the view to [230.0, 251.0], so `ObjectBalloonKillerHodaiLeft` (X 251.5, `IsFirstInCamera: True`) is never inside the camera and never starts firing. A cannon-only shift (section 44, 251.5 -> 248.5) would still leave it 0.75 blocks outside the left-aligned view, so it was dropped. + +**Fix (`RAIL_EDITS`):** final point 12 of rail `1776580222928036096`, `(226.75, 147.0, 0.0)` -> `(231.335, 147.0, 0.0)`. Earlier candidates 232.0 and 233.3056 were derived from the stock 16:9 offsets and were never loaded in Eden (it still held the section 44 build, SHA-256 prefix 121bbf30...). The final value comes from two Eden captures of that build (1440x1080, 21.0 blocks wide = 68.571 px per block): capture 1 shows the stock stop, with the pole end block at pixel 942 = X 240.49, so the view is [226.75, 247.75] and the shifted cannon (248.5) is off-screen; capture 2 shows the view 1.59 blocks further right, [228.34, 249.34], with the cannon body 0.335 blocks inside the right edge, already fired. `InsideCameraMarginX` is not stored in the cannon's AI graph, so that observed margin is the reference. With the stock cannon (body right edge 252.0) the same margin gives 252.0 + 0.335 - 21.0 = 231.335, view [231.335, 252.335]. Y is unchanged (bottom 131.25, pole 133.5, cannon 134..136, seed 144.24). Trade-off: pole start to cannon centre is exactly 21.0 blocks, the 4:3 width, so the pole's first 0.8 blocks (ball at X 230.5) fall off the left edge; the capture-2 framing (pole ball visible) is only possible with the cannon shifted left 3.0. Other effects to watch: the last segment (pt 11 -> 12, 180 frames) now covers 11.3 blocks in X instead of 6.75, and cave G's stopped-scroll pan can reach a right edge up to about 258.9. + +**Status:** built; `build_stage.py --verify` 0 problems (Course853_Main 5 rail edits, no actor edits), 16 unit tests, `verify_pchtxt.py` and `check_repo.py` OK. **Confirmed in Eden on 2026-11-09:** at the new stop the cannon fires and the Wonder Seed is reachable; the maintainer also play-tested the section 44 Y retune. The section 44 cannon shift (`EDITS`) was removed at the maintainer's request, so the cannon is back at its stock position (251.5, 134.0); the camera stop is the only finale change. + ## 46. 2026-11-09: World 1 map, hidden warp pipe off-screen (World001 subregion 22 look-at moved) **Report:** on the Pipe-Rock Plateau map, an area with a sign, a ? block, two course nodes and the KO arena hides a warp pipe behind the right-hand rock wall (it leads to the room with the lost Toad, "Lost? Me?"). At 4:3 the pipe and Mario's silhouette next to it are off-screen. diff --git a/super-mario-bros-wonder/mod/Native 4x3 Aspect Ratio/romfs/BancMapUnit/Course853_Main.bcett.byml.zs b/super-mario-bros-wonder/mod/Native 4x3 Aspect Ratio/romfs/BancMapUnit/Course853_Main.bcett.byml.zs new file mode 100644 index 0000000..4544b5e Binary files /dev/null and b/super-mario-bros-wonder/mod/Native 4x3 Aspect Ratio/romfs/BancMapUnit/Course853_Main.bcett.byml.zs differ diff --git a/super-mario-bros-wonder/tools/build_stage.py b/super-mario-bros-wonder/tools/build_stage.py index 67fbf5a..ec6bad6 100644 --- a/super-mario-bros-wonder/tools/build_stage.py +++ b/super-mario-bros-wonder/tools/build_stage.py @@ -172,6 +172,38 @@ ('Course152_Sub4', 1, 2, 0, (79.0, -7.0, 0.0), (79.0, -10.0, 0.0)), ('Course152_Sub4', 1, 2, 21, (92.0, -7.0, 0.0), (92.0, -10.0, 0.0)), ] +# (course, rail_hash, point_idx, orig_xyz, new_xyz) +# Course853_Main (Sunbaked Desert Special: Pole Block Allure - Autoscroll rail intermediate vertical centering): +# In 4:3 (height 15.75, width 21.0), the authored autoscroll rail 1776580222928036096 climb (Y = 17 -> 25.5 -> 41) +# lifts the camera far above Mario and the poles (which sit at Y = 4.5..15.5). At pt 3 (X = 63, Y = 41), the camera +# bottom reaches Y = 33.12, causing the Wonder Flower (ItemWonderHole at Y = 25.5) and lower poles to be cut off +# below the screen by 7.62 blocks. +# Lower points 0-3 vertically to an intermediate 50% position between stock and the low-profile tuning: +# - Pt 0: (0.0, 17.0, 0.0) -> (0.0, 14.5, 0.0) (-2.5) +# - Pt 1: (13.0, 17.0, 0.0) -> (13.0, 14.5, 0.0) (-2.5) +# - Pt 2: (38.0, 25.5, 0.0) -> (38.0, 22.75, 0.0)(-2.75) +# - Pt 3: (63.0, 41.0, 0.0) -> (63.0, 36.0, 0.0) (-5.0) +# This keeps the Wonder Flower (Y = 25.5) +4.00 blocks above the bottom edge while preserving plenty of upper +# headroom for climbing Snake Pole 1 (Y = 29.5) and Snake Pole 2 (Y = 21.5). +# Pt 12 (final stop): rail X is the view's LEFT edge (docs/DEVELOPMENT.md section 22, SetAutoScrollPos adds the current +# half-width), so the stock stop (226.75) frames [226.75, 247.75] in 4:3 versus [226.75, 254.31] in 16:9. The finale +# cannon ObjectBalloonKillerHodaiLeft (X = 251.5, body 251..252, IsFirstInCamera) was therefore 3.75 blocks past the +# 4:3 right edge and never started firing. The camera-margin value it tests is not stored in its AI graph, so the stop +# is taken from an Eden capture of a build with the cannon at X = 248.5 (body 248..249): there the cannon sat 0.335 +# blocks inside the right edge (view [228.34, 249.34], measured from screenshots calibrated on the pole end block at +# 240.5) and had fired. The stock cannon body ends at 252.0, so stop X = 252.0 + 0.335 - 21.0 = 231.335 frames +# [231.335, 252.335]: whole cannon and Wall 5 (247..252) in view, pole end (X = 240.5) and Wonder Seed +# (240.5, 144.24) in view. The pole's first 0.8 blocks (ball at X 230.5) fall off the left edge: pole start to +# cannon centre is exactly 21.0, the 4:3 width, so both cannot be fully framed with the stock cannon. +# Y = 147.0 is untouched (rail Y is the view's top edge, so the pole at 133.5 and the cannon at 134.0 stay in frame). +RAIL_EDITS = [ + ('Course853_Main', 1776580222928036096, 0, (0.0, 17.0, 0.0), (0.0, 14.5, 0.0)), + ('Course853_Main', 1776580222928036096, 1, (13.0, 17.0, 0.0), (13.0, 14.5, 0.0)), + ('Course853_Main', 1776580222928036096, 2, (38.0, 25.5, 0.0), (38.0, 22.75, 0.0)), + ('Course853_Main', 1776580222928036096, 3, (63.0, 41.0, 0.0), (63.0, 36.0, 0.0)), + ('Course853_Main', 1776580222928036096, 12, (226.75, 147.0, 0.0), (231.335, 147.0, 0.0)), +] + def bcett(romfs, course): @@ -181,11 +213,13 @@ def bcett(romfs, course): def edits_by_course(): out = {} for e in EDITS: - out.setdefault(e[0], {'actors': [], 'bg': [], 'gyaml': []})['actors'].append(e) + out.setdefault(e[0], {'actors': [], 'bg': [], 'gyaml': [], 'rails': []})['actors'].append(e) for b_edit in BG_EDITS: - out.setdefault(b_edit[0], {'actors': [], 'bg': [], 'gyaml': []})['bg'].append(b_edit) + out.setdefault(b_edit[0], {'actors': [], 'bg': [], 'gyaml': [], 'rails': []})['bg'].append(b_edit) for g_edit in GYAML_EDITS: - out.setdefault(g_edit[0], {'actors': [], 'bg': [], 'gyaml': []})['gyaml'].append(g_edit) + out.setdefault(g_edit[0], {'actors': [], 'bg': [], 'gyaml': [], 'rails': []})['gyaml'].append(g_edit) + for r_edit in RAIL_EDITS: + out.setdefault(r_edit[0], {'actors': [], 'bg': [], 'gyaml': [], 'rails': []})['rails'].append(r_edit) return out @@ -280,6 +314,28 @@ def apply(d, course_edits): for eslot, _ in b.vec3(p, 'Translate'): allowed.update(range(eslot, eslot + 4)) + rails_slots = b.array_slots(root['Rails'][2]) if 'Rails' in root else [] + all_rpts = [] + for s in rails_slots: + rdict = b.hash_entries(s[2]) + if 'Points' in rdict: + for ps in b.array_slots(rdict['Points'][2]): + all_rpts.append(b.hash_entries(ps[2])) + for course, rhash, pidx, orig, new in course_edits.get('rails', []): + matching_rails = [b.hash_entries(s[2]) for s in rails_slots if b.hash_of(b.hash_entries(s[2])) == rhash] + assert len(matching_rails) == 1, f'{course} rail {rhash}: {len(matching_rails)} matches' + rdict = matching_rails[0] + pts = b.array_slots(rdict['Points'][2]) + p = b.hash_entries(pts[pidx][2]) + node = p['Translate'][2] + sharers = [pt for pt in all_rpts if pt['Translate'][2] == node] + assert len(sharers) == 1, f'{course} Rail {rhash} Pt {pidx}: Translate shared by {len(sharers)} points' + cur = [v for _, v in b.vec3(p, 'Translate')] + assert cur == list(orig), f'{course} Rail {rhash} Pt {pidx}: {cur}, expected {orig}' + b.set_vec3(p, 'Translate', new) + for eslot, _ in b.vec3(p, 'Translate'): + allowed.update(range(eslot, eslot + 4)) + for course, hashes, original, replacement in course_edits.get('gyaml', []): allowed.update(replace_actor_gyaml(d, hashes, original, replacement)) return allowed @@ -324,7 +380,7 @@ def verify(orig_romfs, mod_romfs): elif bytes(ship) != bytes(ref): problems.append(f'{course}: edited values differ from the edit tables') elif diff: - n_total = len(edits.get('actors', [])) + len(edits.get('bg', [])) + len(edits.get('gyaml', [])) + n_total = len(edits.get('actors', [])) + len(edits.get('bg', [])) + len(edits.get('gyaml', [])) + len(edits.get('rails', [])) print(f'{course}: {len(diff)} byte(s) differ, all inside {n_total} edit(s)') for p in problems: print('PROBLEM:', p)