feat(widescreen): a screen narrower than 16:9 shows more above and below, not less at the sides #3142
No reviewers
Labels
No labels
area/accessibility
area/audio
area/input
area/install
area/menu
area/mods
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
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
MagicBeanDev/Longshot!3142
Loading…
Reference in a new issue
No description provided.
Delete branch "llun/Longshot:feat/tall-screens-show-more"
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?
Summary
On a screen narrower than 16:9 (16:10 such as the Steam Deck, 4:3), the game cut off the sides of the picture. Wider screens already showed more at the sides. Now every shape shows the whole 16:9 view and adds to it: more at the sides on a wider screen, as before, and more above and below on a narrower one.
The rule comes from Metal Goose Solid on the Discord server: a screen that isn't 16:9 should always add to the picture, never crop it, and Field of view should mean the same on every screen.
camera.state().fovand an override'sfovare the 16:9 view's. The projection of a world point now uses the picture's real shape. Before, it always used 16:9, because nothing called the function that sets the shape (it is removed).How: the core's lens callback at
camera.lensopens the angle last, for every camera whose own ratio is 16:9. The game makes its projection after that, so what it hides is opened together with what it draws. The camera's wall check reads the camera's own angle, so it is not changed.Read first:
game/crates/game-core/src/camera/lens.rs,game/mods/widescreen/src/system_mod.rs,game/crates/api/src/services/camera.rs.#142 (open) does this in an opt-in Window mode; this is the rule for the picture's shape as
mainsets it. See #1399: a player's stretched picture at 16:10. A 1280x800 window was not stretched here, so that report stays unexplained.Testing
Tested: Windows 11, RTX 5080, driver 621.47, in the game:
68fc87175). 16:10 and 4:3 show 16:9's width and more above and below. The hearts and the minimap are in the screen's corners.6318f4056), laid over 16:9 at the same width: Link, the guard and the buildings are the same size at 16:10 and 4:3.6318f4056): a 1280x800 window is filled with no bars and no stretching. The first visit to the Market (a cutscene) has 16:9's framing at 16:10 and more above and below. The area title's frame reaches the edges. A speech bubble is by its speaker's head. Conversation, targeting, the pause menu and the map screen's frame are right.dev.py smokepasses on 7c06402bd.The branch is on main
299ed5b70(a7901114b). The three changes onmainsince the last game run (#3140, #3122, #3139) touch none of this PR's files, so the game was not rebuilt. That run was on mainf536e7d06(75d95d78e):dev.py smokepasses, and in Hyrule Field at 16:10 and 4:3, standing and walking, nothing is missing at the top or bottom edge. The camera was not turned: the control bridge's right stick did not move it.Checks:
mise run teston main6318f4056but three checks: 837 run, 836 pass.test_run_all_junitfailed there because it runstest_utf8_paths, which failed on that main. Not run, as they fail on that main:test_cursor_hidden_linux,test_utf8_paths,test_lifter.test_lifter: the tests ofgame-core,api,sysmod-widescreen,game-sites,site-tableandmodtoolon that main, and clippy of the first three, pass. Left out:api'sa_walked_reshade_folder_counts_a_change_once_two_walks_agreeandmodtool'sa_mod_written_off_the_first_time_..., which fail onmain.main's Windows compile error (since fixed by #3124) fixed locally; the fix is not in this PR.game-core,apiandsysmod-widescreenpass but that sameapitest, and nine checks pass,test_utf8_pathsamong them.bfc722504: the tests ofgame-coreandsysmod-widescreen, andtest_i18n_complete,test_game_fovandtest_widescreen_shapes, pass.75d95d78e(mainf536e7d06):api's camera tests pass, the newa_projected_point_is_where_the_games_lens_draws_itamong them.a7901114b, main299ed5b70): the tests ofgame-core,apiandsysmod-widescreenpass but the sameapitest that fails onmain, andtest_i18n_complete,test_game_fov,test_widescreen_shapes,test_doc_anchorsandtest_guide_screenshotspass.cargo fmtfinds nothing in this PR's files.Still to test:
main(by hand)Measurements
Verdict: no measured cost: at 16:10 the two views are within the spread.
Baseline: this build at Field of view 90%, which draws nearly what
maindraws at 16:10 (by calculation, 1% closer). It stands in formain, which was not measured.Setup: Windows 11, RTX 5080, driver 621.47; Hyrule Field as a child, 16:10, the 3D at 67%, uncapped, headless;
dev.py ab, 45 s each after a warm-up, two interleaved pairs (A1, B1, A2, B2), this branch at e07c2aa7c on main674489ddfdev.py abmade no write-up of its own (exit 3): it compares the runs' environment, andLONGSHOT_BUILDER_PIPESandLONGSHOT_CRASH_BLOCKhold handle numbers that differ in every run. Its lines:At 16:9 and wider the angle is the game's own, bit for bit (
a_picture_of_any_shape_shows_the_whole_16_9_frame).Risks
fovshows more above and below on a narrower screen. A mod's marker over the world moves to its right place on a screen that is not 16:9.Checklist
Ready for review
main; the title is a Conventional Commit.mise run testpasses (any failure that also fails onmainis named).main, or Measurements says why there is nothing to measure.third_party/untouched; nothing GPL-incompatible.When it applies
mainand here, for a change that shows on screen.Assisted-by:/Co-Authored-By:trailers.Ready to merge
main, measured again or a comment says why the numbers still hold.🤖 Generated with Claude Code
Tested in game: Windows 11, RTX 5080, driver 621.47. Played at Castle Town's gate at 16:9, 16:10, 4:3 and 21:9: 16:10 and 4:3 show 16:9's full width and more above and below, with the HUD in the corners (7c06402bd, on main
68fc87175). On an earlier head (main6318f4056): a 1280x800 window, a cutscene, a conversation, targeting, a speech bubble and the pause menu at 16:10 all looked right.The same spot (Castle Town's gate) on Windows 11, RTX 5080. All three pictures are 1280 pixels wide. 16:10 is 1280x800, the Steam Deck's size.
Before: 16:10 on
main45d1863b2. The sides are cut off.After: 16:10 with this PR (7c06402bd). It has 16:9's full width, and more above and below.
16:9 with this PR (an earlier head, on main
6318f4056), to compare the width.@review
Recommendation: Approve. The code is ready: only testing is left. The Windows playthrough shows the intended wider framing, but the remaining gameplay and Tier 1 platform checks have not run. The reported performance comparison also does not measure this change against main. Recommend approval; not approved on the forge.
Narrow screens retain the full width of the 16:9 view and show more vertically, including in cutscenes; world-point projection follows the picture shape. The camera math is straightforward and tested, but the additional visible scene and affected gameplay paths need broader validation.
Testing before merging (2) (runs on the systems it can change; it doesn't hold the recommendation)
game/crates/game-core/src/camera/lens.rs:154: The newly visible parts of gameplay and cutscenes still need the planned platform and gameplay checks. (more on the line) Do: Run the listed Hyrule Field edge-culling and bow or slingshot checks, plus gameplay, conversation and cutscene checks on Linux or Steam Deck and the affected Tier 1 hardware.game/crates/game-core/src/camera/lens.rs:159: The cost of opening the view has not been measured against main. (more on the line) Do: Compare main and this head with the same settings in a demanding scene, using interleaved runs and fps, 1% lows and frame times; include a representative Steam Deck or AMD system and a narrower aspect.Questions (1) (not confirmed from the code; they don't hold the recommendation)
game/crates/api/src/services/camera.rs:536: Can you show a world point and camera setup that this implementation projects incorrectly?Checks: Still running: 11 checks.
More: does it help, other systems, switches, what was read
Does it help: Yes for the demonstrated framing on Windows: the author reports matching the 16:9 width at 16:10 and 4:3. Performance cost is unproven: two 45-second pairs on an RTX 5080 compared this branch at 90% and 100% field of view, not main against the PR; fps ranged from 154.8–160.1 versus 155.4–159.0.
Other systems: The lens runs for 16:9 gameplay and event cameras, and affects culling, aiming and mod projections. Windows/NVIDIA framing and one cutscene were played; Linux, Steam Deck, AMD, edge culling and aiming remain unverified. Portrait cameras are excluded by their own aspect ratio. Saves, audio and input are not directly changed.
Switches: None added, changed or removed.
Reviewed:
d4653f2f93againstbfc7225047: Read AGENTS.md, CONTRIBUTING.md, the PR template and standards; docs/review-checklist.md and the adjacent Tooling checkout are absent. Read the code diff, lens and camera layout, widescreen picture and startup paths, projection and camera-hook surroundings, changed documentation and translation entries, commit log, and supplied comments and CI results. The long API camera file and wide.rs were read around the changed paths; unrelated portions and translations were skimmed. No generated files or recorded runs were added.; nothing run (a code review).Checked and fine:
Testing: Read-only review; no tests or project code were run. The author reports game-core and widescreen tests passing on this head; CI is still running.
Overlaps and merge order: PR #142 is described as an opt-in window-mode approach; this change sets the default picture rule. No merge dependency is established.
Automated code review by BeanBot (gpt-6.1-terra), asked for by llun. Nothing was run; a maintainer decides.
@ -101,0 +151,4 @@gameplay(g, camera, k, taller);let angle = g.vreg_f32(layout::ANGLE_VREG);if taller != 1.0 && is_lens(angle) {g.set_vreg_f32(layout::ANGLE_VREG, framed(angle, taller));L1 (should fix): The newly visible parts of gameplay and cutscenes still need the planned platform and gameplay checks.
When: At 16:10 the projection opens beyond the previously visible frame; grass or distant objects could pop at its edges, aiming could be offset, or a cutscene could reveal unstaged content. The supplied playthrough does not cover those cases or Linux and Steam Deck.
Do: Run the listed Hyrule Field edge-culling and bow or slingshot checks, plus gameplay, conversation and cutscene checks on Linux or Steam Deck and the affected Tier 1 hardware.
@ -101,0 +156,4 @@}/// The gameplay camera's part: the mods' factor `k`, and their cameras.fn gameplay(g: &mut GuestCtx<'_>, camera: u64, k: f32, taller: f32) {L2 (should fix): The cost of opening the view has not been measured against main.
When: At 16:10 and especially 4:3 the expanded view can draw and process more scene content. Comparing two field-of-view settings on this branch does not measure the complete change against the base, and the only reported hardware is an RTX 5080.
Do: Compare main and this head with the same settings in a demanding scene, using interleaved runs and fps, 1% lows and frame times; include a representative Steam Deck or AMD system and a narrower aspect.
d4653f2f9375d95d78e1Pushed
75d95d78e, on mainf536e7d06. It adds one test and moves one line of code into a small function. The camera code is the same.The question (
camera.rs:536): I know of no world point that is projected incorrectly. The new testa_projected_point_is_where_the_games_lens_draws_itcompares the projection with the matrix the game builds from the angle the lens leaves. It covers 5:4, 4:3, 16:10, 16:9, 21:9 and 32:9, at four angles, for points in the middle and off to the sides. It passes. It does not cover a mod's roll or lens; this PR does not change those.L1 (game checks): partly done, on Windows 11 with an RTX 5080. In Hyrule Field at 16:10 and 4:3, standing and walking, nothing is missing at the top or bottom edge. I could not turn the camera, because the control bridge's right stick did not move it. That, aiming, Linux, Steam Deck and AMD are not tested. Turning the camera, aiming and Linux or Steam Deck stay in Still to test.
L2 (speed against main): not done. The numbers in Measurements compare two Field of view values of this build. They do not compare main with this PR, and they are from one place on one graphics card. They do not settle the cost on a weaker card.
@review
Recommendation: Approve. The code is ready: only testing is left. The new framing is shown working in several Windows scenes, but the planned gameplay and platform checks remain incomplete, and its rendering cost has not been measured against main. Recommend approval; not approved on the forge.
Narrow screens retain the full 16:9 width and show more above and below, while wider screens keep their existing framing. The shared lens calculation also aligns world-point projection with the new view, at the cost of drawing a larger visible area on narrow screens.
Testing before merging (2) (runs on the systems it can change; it doesn't hold the recommendation)
game/crates/game-core/src/camera/lens.rs:154: The newly visible parts of gameplay and cutscenes still need the planned platform and gameplay checks. When: At 16:10 the projection opens beyond the previously visible frame; grass or distant objects could pop at its edges, aiming could be offset, or a cutscene could reveal unstaged content. The supplied playthrough does not cover those cases or Linux and Steam Deck. Do: Run the listed Hyrule Field edge-culling and bow or slingshot checks, plus gameplay, conversation and cutscene checks on Linux or Steam Deck and the affected Tier 1 hardware.game/crates/game-core/src/camera/lens.rs:159: The cost of opening the view has not been measured against main. When: At 16:10 and especially 4:3 the expanded view can draw and process more scene content. Comparing two field-of-view settings on this branch does not measure the complete change against the base, and the only reported hardware is an RTX 5080. Do: Compare main and this head with the same settings in a demanding scene, using interleaved runs and fps, 1% lows and frame times; include a representative Steam Deck or AMD system and a narrower aspect.Since the last review (on
d4653f2f93)Still open: L1 (The newly visible parts of gameplay and cutscenes still need the planned platform and game…); L2 (The cost of opening the view has not been measured against main.)
Checks: Still running: 11 checks.
More: does it help, other systems, switches, what was read
Does it help: Yes for framing: the author reports that 16:10 and 4:3 show the full 16:9 width on Windows. The performance cost is unproven: the reported 154.8–160.1 fps runs compare two FOV settings on this branch, not this branch against main.
Other systems: The lens affects gameplay, conversations and cutscenes on narrow screens, including culling and mod-projected markers. Windows on an RTX 5080 was exercised; Linux, Steam Deck, AMD, camera rotation and aiming remain untested. Wider screens retain the original angle.
Switches: No switches added, changed or removed. Existing Field of view controls gameplay framing; its 100% default now gives a taller view on narrow screens.
Reviewed:
75d95d78e1againstf536e7d061: Read the repository rules, camera lens and API projection changes, related camera layout and widescreen wiring, documentation diffs, commits, comments and recorded checks. Translation and generated content were not read in full; the complete remaining changed files and all dependent code were not read in full.; nothing run (a code review).Checked and fine:
Testing: The author reports in-game Windows testing and passing camera tests on this head. CI is still running; no tests or game runs were performed in this review.
Overlaps and merge order: #142 is an open, opt-in window-mode approach to related framing; the description distinguishes its scope.
Automated code review by BeanBot (gpt-6.1-terra), asked for by llun. Nothing was run; a maintainer decides.
Rebased onto main
299ed5b70(a7901114b), with no conflicts. The three new changes on main touch none of this PR's files, so the game was not rebuilt. The tests ofgame-core,apiandsysmod-widescreenpass, excepta_walked_reshade_folder_counts_a_change_once_two_walks_agree, which already failed on main before this PR.75d95d78e1a7901114b7