Skip to content

Leave the right flank to the main frame while the Character page slides - #212

Open
nicoNaeg wants to merge 1 commit into
TheMoonPeople:masterfrom
nicoNaeg:fix/character-backout-flank
Open

nicoNaeg wants to merge 1 commit into
TheMoonPeople:masterfrom
nicoNaeg:fix/character-backout-flank

Conversation

@nicoNaeg

Copy link
Copy Markdown

Summary

At wide aspects, entering or leaving the Character page shows a hard vertical seam at the right edge of the 4:3 area. For the whole slide, the strip right of it shows a mirrored piece of the Character backdrop instead of the main menu's frame. This is the "weird artifact on the right side" reported in #56.

  • While the Character page slides, the right flank now keeps the main frame's artwork, so the frame and its lens run on past the 4:3 edge.
  • The settled Character page and the other pages' slides draw as before.

Part of #56. Its floor-map report was fixed by bd0bef8 (#88).

Cause

  1. Menu backdrops are mirrored into the flanks. At wide aspects, DrawBackdrop (port/src/menudraw_primquad.cpp) draws bg16 (the main frame) and the page backdrops (chr_bg, inv_bg, op_bg) with reflections into the window's sides.
    • Since 2dd99c0, a backdrop that has slid away from a side still reflects into that side's flank, with the phase attached to its artwork.
    • Inside the 4:3 frame, the field it uncovers is left alone.
  2. The Character page slides beside the main frame.
    • MENU_MAIN_FRAME_LEAVE_RIGHT / RETURN_RIGHT move bg16, and chr_bg moves with it: the page's right edge is the frame's left edge.
    • In the town menu's exit, 14 frames in, bg16 spans logical x 283–983 and chr_bg −229–283. The window shows −85.3 to 597.3 at 16:9.
  3. The page is drawn after the frame. chr_bg has left the right edge, so it reflects into the right flank (512 to 597.3) about its own edge at 283. That covers bg16's artwork, which really is there. The seam sits at 512, where the reflection starts.

Change

  • DrawBackdrop (port/src/menudraw_primquad.cpp) records the span bg16's artwork covers in the current frame (mgPortFrameCount).
  • A page reflection that would fill a flank the page has slid away from is skipped when that recorded artwork already fills the flank, across the reflection's whole visible height.
  • A settled page, at its edge within 2 units as the existing joins allow, keeps its reflection. So does a vertical slide, where bg16 does not cover the page's height.
  • MglibAspect.CharacterSlideLeavesTheRightFlankToTheMainFrame (port/src/tests/mglib_aspect_test.cpp) draws bg16 and then chr_bg in one frame, at the exit's frame-14 positions and settled.

Testing

Environment: macOS 26.6.2 arm64 (M4 Pro), Homebrew LLVM 23.1.5, MoltenVK 1.4.2, presets macos-arm64 (Debug) and macos-arm64-release. PAL data (data_version 20) for the replays.

Replay (Release, 1280x720): --jump town:10 --fast-load with Triangle at 400, Down at 470, Cross at 520 (Character) and Circle at 700 (back). Seam measure: the share of rows whose luminance step between x 1119 and 1120 is over 25 above the mean step of the columns around it.

Check Without change With change
New unit test, sliding pose: right flank at x 530, 560, 590 FAIL: red 160 (the page's mirror) PASS: red 80 (the frame)
New unit test, settled pose PASS: red 160 PASS: red 160
Exit, rows with a step at x 1120, frames 706 / 710 / 714 / 718 / 722 / 726 22.5% / 19.2% / 66.5% / 62.8% / 41.2% / 56.5% 0.3% / 0.0% / 1.8% / 2.6% / 1.0% / 1.4%
Settled Character page (frame 690) and main menu after the exit (frame 730) 0.0% / 1.9% 0.0% / 1.9%
Dungeon menu (--jump event:26010, same input), exit frames 714 / 722 46.0% / 31.2% 2.1% / 1.2%
Main menu → Character / Make / ??? / Options / Help and back, 12 frames per page across both slides, plus 5 frames of the Character entry: 65 screenshots compared with the parent commit Only the 14 frames of the Character slides differ, and only at x ≥ 1120
MglibAspect.*, Debug not rerun 45/45 PASS
MenuReplay.* with data (8 replays), Debug not rerun 8/8 PASS

"Without change" for the replays used a Release build of the parent commit (bcd1967).

Not covered

  • The flank changes at the slide's ends.
    • At rest, the Character page still mirrors itself into the right flank.
    • When a slide starts or ends, that flank switches between the page's mirror and the main frame's artwork in one frame. I kept the settled look rather than show the frame's left edge next to the page at rest.
  • Platforms and builds: the Windows build (the reporter's platform) and Linux were not tested, and neither were other window sizes in game. The unit test runs at 1920x1080.

At wide aspects the menu backdrops are mirrored into the window's
flanks (DrawBackdrop). Entering or leaving the Character page slides
its backdrop (chr_bg) to the left with the main frame (bg16) right
beside it. The menu draws the page after the frame, and while the page
slid its mirror kept filling the right flank over the frame's own
artwork. For the whole slide the right side showed a mirrored piece of
the Character backdrop, cut off from the main frame at the 4:3 edge
(TheMoonPeople#56).

A page that has slid away from a flank now leaves that flank to the main
frame's artwork when that artwork, drawn earlier in the frame, fills it.
Settled pages, and the Make, ???, Options and Help slides, draw as
before.

MglibAspect.CharacterSlideLeavesTheRightFlankToTheMainFrame draws both
backdrops where they are 14 frames into the exit: the right flank showed
the page (red 160) and now shows the frame (red 80). Settled, it still
shows the page's mirror.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant