fix(wide): NPC speech bubbles stay over their speaker at every picture shape #1191
No reviewers
Labels
No labels
area/accessibility
area/audio
area/input
area/install
area/menu
area/renderer
area/saves
area/tooling
area/upscaling
beanstalk: approved
beanstalk: failed
beanstalk: needs approval
beanstalk: running
beanstalk: tested
ci: approved
good first issue
gpu/amd
gpu/igpu
gpu/intel
gpu/nvidia
help wanted
kind
bug
kind
chore
kind
docs
kind
feature
kind
performance
kind
question
needs measurements
platform/linux
platform/macos
platform/steam-deck
platform/windows
preview
priority
critical
priority
high
priority
low
regression
risk
high
risk
low
risk
medium
status
blocked
status
confirmed
status
duplicate
status
invalid
status
needs-info
status
wontfix
ci: approved
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
MagicBeanDev/Longshot!1191
Loading…
Reference in a new issue
No description provided.
Delete branch "CraftyCorvid/Longshot:fix/wide-speech-bubble"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
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=2560x1080Steps: 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 anarrower screen.
BUBBLEinnx2/oot_wide.py, afterfmul s1, s2, s1atmain+0x20c2c8(the anchor's x in s0, y in s1, justbefore
stp s0, s1stores them to the bubble): divides them byhos_ui_qxandhos_ui_qy(host/hos_wide_ui.c), thescales the HUD site applies to the UI projection. Both are 0 at 16:9, where the game runs as shipped.
tests/test_oot_wide_bubble.pyruns the game's seven instructions atmain+0x20c2b0..0x20c2c8in C withwhatever
oot_wide.pyadds after them, as the lifter places it, draws the anchor through the scaled projection, andchecks 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 passeshere. 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 eyeHow to reproduce: the test as above; in the game, the steps under How to reproduce
55e8fbd55203dd9dtests/test_oot_wide_bubble.py71b1edd8)Baseline: the in-game runs were of main @
71b1edd8and a292f464 (this PR's two commits on it), a pack and the bare basefrom one
dev_build.pybase. main moved to55e8fbd5since; the rebase had no conflict and nothing in between touches thewidescreen code.
After: this PR @
5203dd9d(run as a292f464), 3440x1440, an NPC to the right, outside the middle 16:9:After: this PR @
5203dd9d(run as a292f464), 3440x1440, two NPCs to the left:Before: main @
71b1edd8, 3440x1440, the same NPC as the first shot: the bubble pulled toward the middle:After: this PR @
5203dd9d(run as a292f464), 4:3, the same NPC: the bubble over her head: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 IPSmod'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.pyon CachyOS: 584 passed, 17 failed, 83 skipped; the same 17 fail on main
55e8fbd5and 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 @
71b1edd8the 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 (
memcpyonc->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
type(scope): description) of the status line's type.main.python -I -B tests/run_all.pypasses (any failure that also fails onmainis named).third_party/untouched (a new folder with aPROVENANCE.mdinstead).When it applies
Assisted-by:/Co-Authored-By:trailers.mainand passing here.🤖 Generated with Claude Code
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.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 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.WIP: fix(wide): NPC speech bubbles stay over their speaker at every picture shapeto fix(wide): NPC speech bubbles stay over their speaker at every picture shape