fix(wide): NPC speech bubbles stay over their speaker at every picture shape #1191

Merged
HumanBean merged 2 commits from CraftyCorvid/Longshot:fix/wide-speech-bubble into main 2026-11-16 17:42:47 +00:00
Contributor

Type: fix · Risk: low · Tested on: CachyOS Linux, RTX 5090 · Needs: none

Why

On a screen wider than 16:9 (21:9, 32:9), the speech bubbles NPCs show over their heads ("That thunder was LOUD.") are
pulled toward the middle of the screen, away from the NPC who says them. The further out the NPC stands, the further off
the bubble is. On a screen narrower than 16:9 (4:3, 5:4), where the HUD is drawn smaller, they would also sit too high or
too low. No issue for it was found (searched "bubble", "BalloonMessage", "speech").

How to reproduce

Seen on: CachyOS Linux, RTX 5090, nvidia-open 620.70.06
Settings and switches: Aspect ratio at the monitor's shape (the default) on a 3440x1440 screen, or HOS_OUTPUT_RES=2560x1080
Steps: walk past NPCs who say something on their own (a town's villagers), standing so that one is towards a side of the screen
Expected: the bubble over the NPC's head
Actual: the bubble between the NPC and the middle of the screen

What changed

The game places a bubble at the NPC's spot on the screen times the 2D canvas's half size (x × 1920, y × 1080), but the
bubble is drawn through the HUD's projection, which Longshot scales so the HUD keeps its 16:9 shape. A new site divides the
anchor by the same scales, so the bubble lands on its NPC. The site is the one the ultrawide IPS mod for this game patches
(main+0x20C2B0, 1920 / squeeze there); here y is divided too, because Longshot also draws the HUD smaller up and down on a
narrower screen.

  • lift: BUBBLE in nx2/oot_wide.py, after fmul s1, s2, s1 at main+0x20c2c8 (the anchor's x in s0, y in s1, just
    before stp s0, s1 stores them to the bubble): divides them by hos_ui_qx and hos_ui_qy (host/hos_wide_ui.c), the
    scales the HUD site applies to the UI projection. Both are 0 at 16:9, where the game runs as shipped.
  • test: tests/test_oot_wide_bubble.py runs the game's seven instructions at main+0x20c2b0..0x20c2c8 in C with
    whatever oot_wide.py adds after them, as the lifter places it, draws the anchor through the scaled projection, and
    checks it lands on the NPC at 16:9, 21:9, 32:9, 16:10 and 4:3. It also checks each site's instruction word there.

Measurements

Verdict: fixed. The game-free test fails on main (at 21:9 an NPC at x = 0.5 gets its bubble at 0.37) and passes
here. In the game at 3440x1440 the bubbles sit over their NPCs, including one well outside the middle 16:9, where main
puts them between the NPC and the middle; at 4:3 they sit over their NPCs too (screenshots below).

Hardware: CachyOS Linux, RTX 5090, nvidia-open 620.70.06
Scene: a town with NPCs talking, 3440x1440 (21:9) and a 4:3 window
Method: python -I -B tests/test_oot_wide_bubble.py; in the game, a pack built over main's base (scripts/dev_build.py pack, rt), looked at by eye
How to reproduce: the test as above; in the game, the steps under How to reproduce

Before: main @ 55e8fbd5 After: this PR @ 5203dd9d
tests/test_oot_wide_bubble.py fails passes
in the game, 3440x1440 the bubble left of its NPC, toward the middle (main @ 71b1edd8) the bubbles over their NPCs
in the game, 4:3 not run the bubble over its NPC
Before: main @ 55e8fbd5
FAIL: 21:9: a speaker at (0.5, -0.25) gets its bubble at (0.372093, -0.25)
After: this PR @ 5203dd9d
PASS: the speech bubble's anchor lands on its speaker at 16:9, 21:9, 32:9, 16:10 and 4:3

Baseline: the in-game runs were of main @ 71b1edd8 and a292f464 (this PR's two commits on it), a pack and the bare base
from one dev_build.py base. main moved to 55e8fbd5 since; the rebase had no conflict and nothing in between touches the
widescreen code.

After: this PR @ 5203dd9d (run as a292f464), 3440x1440, an NPC to the right, outside the middle 16:9:

After: this PR @ 5203dd9d, 3440x1440, an NPC to the right

After: this PR @ 5203dd9d (run as a292f464), 3440x1440, two NPCs to the left:

After: this PR @ 5203dd9d, 3440x1440, two NPCs to the left

Before: main @ 71b1edd8, 3440x1440, the same NPC as the first shot: the bubble pulled toward the middle:

Before: main @ 71b1edd8, 3440x1440, the bubble left of its NPC

After: this PR @ 5203dd9d (run as a292f464), 4:3, the same NPC: the bubble over her head:

After: this PR @ 5203dd9d, 4:3, the bubble over its NPC

Flags and settings

None.

Testing

Tested: tests/test_oot_wide_bubble.py, failing on main and passing here; it also fails with x divided alone (the IPS
mod's fix) at 4:3. The checks that read the changed files (run_all.py --changed: test_wide_ui, test_hud_layout,
test_oot_wide_save_picture, test_oot_jitter, test_lift_cache, byte_compile_tracked) pass. python -I -B tests/run_all.py
on CachyOS: 584 passed, 17 failed, 83 skipped; the same 17 fail on main 55e8fbd5 and none read a file this PR changes
(test_audio_output_devices, test_bug_report_defaults, test_crt_options, test_dlss_feature_size,
test_failed_compile_keeps_objects, test_guest_imported, test_lift_lookups, test_linux_preflight, test_linux_update, test_make_game_cache, test_missing_nup, test_mods_size_table,
test_pending_guest_import, test_run_all_changed, test_vk_occlusion_queries, test_walk, test_walk_key). In the game: the
lift took the site (the lifted C has it); at 3440x1440 and at 4:3 the bubbles sit over their NPCs, and at 3440x1440 on
main @ 71b1edd8 the same NPC's bubble is pulled toward the middle (RTX 5090, nvidia-open 620.70.06, CachyOS).

Not tested: 32:9 and 4:3 on main in the game. A Windows build: the site's C is the same kind as the HUD site's beside it (memcpy on c->vreg, extern volatile float).

Must be tested: None.

Risks

What could break: where the speech bubbles are drawn at a shape other than 16:9. A bubble for an NPC outside the
middle 16:9 is now drawn out there; if the game keeps some bubbles inside the canvas's edges later, those were not seen.

Turning it off: revert the commit. At 16:9 nothing changes.

Compatibility: the game is translated again (a new site in the lift); saves, options and the shader and pipeline caches
are not affected.

Checklist

Everyone

  • One topic.
  • The title is a Conventional Commit (type(scope): description) of the status line's type.
  • Why gives the reason plainly and links the issues that fit (the tracker searched).
  • Measurements has a verdict, or one line saying why there is nothing to measure.
  • Testing names what was tested, what wasn't, and what must still be tested, where and how.
  • Rebased on current main.
  • python -I -B tests/run_all.py passes (any failure that also fails on main is named).
  • No game files, dumps, build output or generated files.
  • third_party/ untouched (a new folder with a PROVENANCE.md instead).
  • The license is OK: GPL-3.0-or-later, nothing incompatible and nothing decompiled.

When it applies

  • AI assistance recorded with Assisted-by: / Co-Authored-By: trailers.
  • Screenshots of the same spot, captioned like the Measurements columns, for a change that shows on screen.
  • A game-free test added for the fix, failing on main and passing here.

🤖 Generated with Claude Code

**Type:** fix · **Risk:** low · **Tested on:** CachyOS Linux, RTX 5090 · **Needs:** none ## Why On a screen wider than 16:9 (21:9, 32:9), the speech bubbles NPCs show over their heads ("That thunder was LOUD.") are pulled toward the middle of the screen, away from the NPC who says them. The further out the NPC stands, the further off the bubble is. On a screen narrower than 16:9 (4:3, 5:4), where the HUD is drawn smaller, they would also sit too high or too low. No issue for it was found (searched "bubble", "BalloonMessage", "speech"). ## How to reproduce **Seen on:** CachyOS Linux, RTX 5090, nvidia-open 620.70.06 **Settings and switches:** Aspect ratio at the monitor's shape (the default) on a 3440x1440 screen, or `HOS_OUTPUT_RES=2560x1080` **Steps:** walk past NPCs who say something on their own (a town's villagers), standing so that one is towards a side of the screen **Expected:** the bubble over the NPC's head **Actual:** the bubble between the NPC and the middle of the screen ## What changed The game places a bubble at the NPC's spot on the screen times the 2D canvas's half size (x × 1920, y × 1080), but the bubble is drawn through the HUD's projection, which Longshot scales so the HUD keeps its 16:9 shape. A new site divides the anchor by the same scales, so the bubble lands on its NPC. The site is the one the ultrawide IPS mod for this game patches (`main+0x20C2B0`, 1920 / squeeze there); here y is divided too, because Longshot also draws the HUD smaller up and down on a narrower screen. - lift: `BUBBLE` in `nx2/oot_wide.py`, after `fmul s1, s2, s1` at `main+0x20c2c8` (the anchor's x in s0, y in s1, just before `stp s0, s1` stores them to the bubble): divides them by `hos_ui_qx` and `hos_ui_qy` (`host/hos_wide_ui.c`), the scales the HUD site applies to the UI projection. Both are 0 at 16:9, where the game runs as shipped. - test: `tests/test_oot_wide_bubble.py` runs the game's seven instructions at `main+0x20c2b0..0x20c2c8` in C with whatever `oot_wide.py` adds after them, as the lifter places it, draws the anchor through the scaled projection, and checks it lands on the NPC at 16:9, 21:9, 32:9, 16:10 and 4:3. It also checks each site's instruction word there. ## Measurements **Verdict:** fixed. The game-free test fails on `main` (at 21:9 an NPC at x = 0.5 gets its bubble at 0.37) and passes here. In the game at 3440x1440 the bubbles sit over their NPCs, including one well outside the middle 16:9, where main puts them between the NPC and the middle; at 4:3 they sit over their NPCs too (screenshots below). Hardware: CachyOS Linux, RTX 5090, nvidia-open 620.70.06 Scene: a town with NPCs talking, 3440x1440 (21:9) and a 4:3 window Method: `python -I -B tests/test_oot_wide_bubble.py`; in the game, a pack built over main's base (`scripts/dev_build.py pack`, `rt`), looked at by eye How to reproduce: the test as above; in the game, the steps under How to reproduce | | Before: main @ 55e8fbd5 | After: this PR @ 5203dd9d | |---|---|---| | `tests/test_oot_wide_bubble.py` | fails | passes | | in the game, 3440x1440 | the bubble left of its NPC, toward the middle (main @ 71b1edd8) | the bubbles over their NPCs | | in the game, 4:3 | not run | the bubble over its NPC | ``` Before: main @ 55e8fbd5 FAIL: 21:9: a speaker at (0.5, -0.25) gets its bubble at (0.372093, -0.25) After: this PR @ 5203dd9d PASS: the speech bubble's anchor lands on its speaker at 16:9, 21:9, 32:9, 16:10 and 4:3 ``` Baseline: the in-game runs were of main @ 71b1edd8 and a292f464 (this PR's two commits on it), a pack and the bare base from one `dev_build.py` base. main moved to 55e8fbd5 since; the rebase had no conflict and nothing in between touches the widescreen code. After: this PR @ 5203dd9d (run as a292f464), 3440x1440, an NPC to the right, outside the middle 16:9: ![After: this PR @ 5203dd9d, 3440x1440, an NPC to the right](https://git.magicbean.dev/attachments/15f53b13-c107-4517-98f6-82746d377e54) After: this PR @ 5203dd9d (run as a292f464), 3440x1440, two NPCs to the left: ![After: this PR @ 5203dd9d, 3440x1440, two NPCs to the left](https://git.magicbean.dev/attachments/f7fc2f98-9af8-438d-81d0-d8c614a4d14f) Before: main @ 71b1edd8, 3440x1440, the same NPC as the first shot: the bubble pulled toward the middle: ![Before: main @ 71b1edd8, 3440x1440, the bubble left of its NPC](https://git.magicbean.dev/attachments/c2ad2e60-0893-4049-9af9-d6b4602d82d4) After: this PR @ 5203dd9d (run as a292f464), 4:3, the same NPC: the bubble over her head: ![After: this PR @ 5203dd9d, 4:3, the bubble over its NPC](https://git.magicbean.dev/attachments/00f22ea7-abe4-4de8-bb08-d7e0b1c3c521) ### Flags and settings None. ## Testing **Tested:** `tests/test_oot_wide_bubble.py`, failing on main and passing here; it also fails with x divided alone (the IPS mod's fix) at 4:3. The checks that read the changed files (`run_all.py --changed`: test_wide_ui, test_hud_layout, test_oot_wide_save_picture, test_oot_jitter, test_lift_cache, byte_compile_tracked) pass. `python -I -B tests/run_all.py` on CachyOS: 584 passed, 17 failed, 83 skipped; the same 17 fail on main 55e8fbd5 and none read a file this PR changes (test_audio_output_devices, test_bug_report_defaults, test_crt_options, test_dlss_feature_size, test_failed_compile_keeps_objects, test_guest_imported, test_lift_lookups, test_linux_preflight, test_linux_update, test_make_game_cache, test_missing_nup, test_mods_size_table, test_pending_guest_import, test_run_all_changed, test_vk_occlusion_queries, test_walk, test_walk_key). In the game: the lift took the site (the lifted C has it); at 3440x1440 and at 4:3 the bubbles sit over their NPCs, and at 3440x1440 on main @ 71b1edd8 the same NPC's bubble is pulled toward the middle (RTX 5090, nvidia-open 620.70.06, CachyOS). **Not tested:** 32:9 and 4:3 on main in the game. A Windows build: the site's C is the same kind as the HUD site's beside it (`memcpy` on `c->vreg`, `extern volatile float`). **Must be tested:** None. ## Risks **What could break:** where the speech bubbles are drawn at a shape other than 16:9. A bubble for an NPC outside the middle 16:9 is now drawn out there; if the game keeps some bubbles inside the canvas's edges later, those were not seen. **Turning it off:** revert the commit. At 16:9 nothing changes. **Compatibility:** the game is translated again (a new site in the lift); saves, options and the shader and pipeline caches are not affected. ## Checklist ### Everyone - [x] One topic. - [x] The title is a Conventional Commit (`type(scope): description`) of the status line's type. - [x] Why gives the reason plainly and links the issues that fit (the tracker searched). - [x] Measurements has a verdict, or one line saying why there is nothing to measure. - [x] Testing names what was tested, what wasn't, and what must still be tested, where and how. - [x] Rebased on current `main`. - [x] `python -I -B tests/run_all.py` passes (any failure that also fails on `main` is named). - [x] No game files, dumps, build output or generated files. - [x] `third_party/` untouched (a new folder with a `PROVENANCE.md` instead). - [x] The license is OK: GPL-3.0-or-later, nothing incompatible and nothing decompiled. ### When it applies - [x] AI assistance recorded with `Assisted-by:` / `Co-Authored-By:` trailers. - [x] Screenshots of the same spot, captioned like the Measurements columns, for a change that shows on screen. - [x] A game-free test added for the fix, failing on `main` and passing here. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Runs the game's seven instructions that anchor BalloonMessage_00 (main+0x20c2b0..0x20c2c8: x * 1920, y * 1080) in C
with whatever nx2/oot_wide.py adds after them, then draws the anchor through the UI projection scaled by hos_ui_qx and
hos_ui_qy. Fails on main: at 21:9 a speaker at x 0.5 gets its bubble at 0.37, pulled toward the middle.

Assisted-by: Claude Code (Claude Opus 5.5)
Co-Authored-By: Claude Opus 5.5 <[email protected]>
fix(wide): NPC speech bubbles stay over their speaker at every picture shape
Some checks are pending
CI / Conventional Commit title (pull_request) Blocked by required conditions
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Blocked by required conditions
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Blocked by required conditions
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Blocked by required conditions
CI / Workflow lint (actionlint) (pull_request) Blocked by required conditions
Guide screenshots / Guide images and local UI source review (pull_request) Blocked by required conditions
Third-party parts / As their notes say (pull_request) Blocked by required conditions
Third-party parts / The same as upstream (pull_request) Blocked by required conditions
Website / Website on Cloudflare (pull_request_target) Has been skipped
PR description / Description follows the template (pull_request_target) Successful in 3s
5203dd9d22
The game anchors the bubble at the speaker's place on the screen times the canvas's half size (x * 1920, y * 1080), but
its screen draws through the HUD's projection, scaled across by hos_ui_qx (and up by hos_ui_qy on a screen narrower than
16:9): on a wider screen the bubble was pulled toward the middle. A site after fmul s1, s2, s1 (main+0x20c2c8) divides
the anchor by them. The site is the ultrawide IPS mod's (1920 / squeeze there); y is new here, for the narrower shapes.
At 16:9 both are 0 and the game runs as shipped.

Assisted-by: Claude Code (Claude Opus 5.5)
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Author
Contributor

Tested in game: RTX 5090, nvidia-open 620.70.06, CachyOS: 3440x1440 (21:9), walking past NPCs who talk in a town: the speech bubbles sit over the NPCs instead of being pulled toward the middle of the screen, also for an NPC well outside the middle 16:9. Run of a292f464, the same change before its rebase onto 55e8fbd5. 4:3 not run in the game yet.

Tested in game: RTX 5090, nvidia-open 620.70.06, CachyOS: 3440x1440 (21:9), walking past NPCs who talk in a town: the speech bubbles sit over the NPCs instead of being pulled toward the middle of the screen, also for an NPC well outside the middle 16:9. Run of a292f464, the same change before its rebase onto 55e8fbd5. 4:3 not run in the game yet.
Author
Contributor

Added the in-game screenshots at 3440x1440 (After). A Before shot at the same spots on main and a run at 4:3 are still to come; the PR stays WIP until then.

Added the in-game screenshots at 3440x1440 (After). A Before shot at the same spots on main and a run at 4:3 are still to come; the PR stays WIP until then.
Author
Contributor

Added the Before shot (main @ 71b1edd8, 3440x1440: the bubble pulled toward the middle) and a run at 4:3 on this PR (the bubble over its NPC). Nothing left under Must be tested.

Added the Before shot (main @ 71b1edd8, 3440x1440: the bubble pulled toward the middle) and a run at 4:3 on this PR (the bubble over its NPC). Nothing left under Must be tested.
CraftyCorvid changed title from WIP: fix(wide): NPC speech bubbles stay over their speaker at every picture shape to fix(wide): NPC speech bubbles stay over their speaker at every picture shape 2026-11-16 17:26:45 +00:00
HumanBean deleted branch fix/wide-speech-bubble 2026-11-16 17:42:47 +00:00
Some checks are pending
CI / Conventional Commit title (pull_request) Blocked by required conditions
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Blocked by required conditions
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Blocked by required conditions
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Blocked by required conditions
CI / Workflow lint (actionlint) (pull_request) Blocked by required conditions
Guide screenshots / Guide images and local UI source review (pull_request) Blocked by required conditions
Third-party parts / As their notes say (pull_request) Blocked by required conditions
Third-party parts / The same as upstream (pull_request) Blocked by required conditions
Website / Website on Cloudflare (pull_request_target) Has been skipped
PR description / Description follows the template (pull_request_target) Successful in 3s
Some workflows are waiting to be reviewed.
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
MagicBeanDev/Longshot!1191
No description provided.