fix(mouse): the native mouse camera starts again from the game's angles across a map's load #2851
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
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
MagicBeanDev/Longshot!2851
Loading…
Reference in a new issue
No description provided.
Delete branch "HumanBean/Longshot:fix/mouse-camera-map-load"
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
With Mouse camera: Native, walking through a loading zone with forward held swings the camera 45 to 90 degrees after
the load, and further the more the view was turned away from Link as he left
(#1728; the controller reports there fit too when Native
is on, since it acts without the mouse moving).
The native mouse look (
game_core::camera::mouse) keeps its own yaw and pitch and puts them back into the player cameraat every update, so the game's follow camera never drifts the view. It starts again from the game's angles only for a
new camera, a stick turn, a camera state other than 3 or 4, or 150 ms without an update. A map change can pass none of
those, so the new map's camera, which the game puts behind Link, was turned back to the angles the mouse held in the map
left: a swing by however far the view stood from Link's facing as he went through.
Now, while a map loads, while its arrival's events play and for 30 updates after them, the camera's angles are the
mouse's start at each update. The mouse still turns them, and the new map's camera stays where the game put it. An event
with no load (Navi's words as Link walks, which this game plays during normal play) leaves the mouse's angles held, so
the follow camera's drift that the hold prevents does not come back.
On
mod-api(#2822), where the mouse look is the gameside's Rust. Read
MouseLook::settlingingame/crates/game-core/src/camera/mouse.rsfirst.Fixes #1728
Testing
Tested: On this PC (CachyOS Linux, RTX 3090), on
mod-api@aea64d3a.HOS_MOUSE_NATIVE=1, from themarket-entrancesave: Link walked out through the Market'sgate into Hyrule Field, with the player camera's fields read from memory each sample (
HOS_CONTROL_MEM=ro). Before(
mod-api) and after (this PR) the camera came out behind Link (the view's yaw 0 with his facing 0). After, itfollowed the game for the settle window and was held again after it. No faults in either log.
the load. Its yaw (+0x1a4) is kept in the map's own frame: the Market's view at -180 had yaw 0, and Hyrule Field's view
at 0 had -180. The camera kept updating in state 3 through the departure event. On this PC the camera then missed more
than 150 ms of updates during the load, which already resets the hold. A load over within 150 ms (a fast PC, as the
reporter's Ryzen 9 9900) keeps the old map's yaw, which points another way in the new map: the swing. That case is what
a_load_seen_only_by_the_map_changing_is_a_new_startchecks, and why the map's name is watched as well as the flag.cargo test -p game-core: 355 passed. The two new tests (a_new_maps_camera_is_the_games_not_the_last_maps_mouse,a_load_seen_only_by_the_map_changing_is_a_new_start) fail onmod-api(the camera held at the mouse's 90 degreesinstead of the new map's -30 and -180) and pass here. With the fix's
|| settlingtaken out they fail again.cargo clippy -p game-core --all-targetsandcargo fmt --check: clean.mise run test(before the rebase onto #2848): 821 passed, 17 failed, 11 skipped. Run one at a time after therebase, the 17 give the same results here as on
mod-api@aea64d3a: 14 pass, andtest_lifter.py,test_present_source_crop.pyandtest_text_keyboard_policy.pyfail on both. None of them reads the mouse look.motion, and this PC's loads leave the camera stale. It is in Still to test.
Still to test:
turned as you pass, expecting the camera behind Link after the load with no swing (by hand).
mod-api(by hand).Measurements
Nothing to measure: a fix in the mouse look's decisions; its cost is one flag read and the map's name per player camera update while Mouse camera is Native.
Risks
its placement) count, as they do while the stick turns the camera; the mouse still turns the view throughout.
longshot_options.ini.Checklist
Ready for review
mod-api; the title is a Conventional Commit.mise run testpasses (any failure that also fails onmainis named). (3 fail onmod-apitoo, named in Testing)main, or Measurements says why there is nothing to measure.third_party/untouched; nothing GPL-incompatible.When it applies
mainand passes here.tests/that reads changed source is updated, not weakened. (test_mouse_native.pyandtest_input_movie.pyread it: both pass unchanged)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
1877bedea84124dfa1b64124dfa1b65fbda6f779WIP: fix(mouse): the native mouse camera starts again from the game's angles across a map's loadto fix(mouse): the native mouse camera starts again from the game's angles across a map's load