Skip to content

Fix tank mouse aiming - #116

Open
mrfox-1 wants to merge 6 commits into
SunJaycy:mainfrom
mrfox-1:agent/fix-tank-mouse-aim
Open

Fix tank mouse aiming#116
mrfox-1 wants to merge 6 commits into
SunJaycy:mainfrom
mrfox-1:agent/fix-tank-mouse-aim

Conversation

@mrfox-1

@mrfox-1 mrfox-1 commented Jul 24, 2026

Copy link
Copy Markdown

What changed

  • Detects the game's authoritative mounted-tank state instead of inferring it from Bond's equipped weapon.
  • Routes horizontal raw-mouse movement to the native tank turret target and smoothed orientation values.
  • Uses the XBLA build's own turret-smoothing reciprocal rather than assuming the N64 build's timing constant.
  • Suppresses the ordinary on-foot yaw write while mounted, while retaining the existing vertical mouse path.

Root cause

The existing mouse hook writes Bond's ordinary camera yaw. While Bond is mounted, GoldenEye rebuilds that yaw every simulation tick from the tank body and turret orientation, so horizontal mouse movement is immediately overwritten. Vertical movement is handled separately and therefore continued to work.

This patch shifts the turret target and current smoothed orientation by the same mouse delta. The native tank update remains responsible for steering, collision rollback, controller input, and final camera orientation.

User impact

Mouse and keyboard players can aim the tank turret horizontally and vertically without holding Aim. W/A/S/D driving remains functional at the same time.

Fixes #93.

Validation

  • Built successfully with the Windows 1.2.4 compatibility toolchain.
  • Tested in Runway with the tank ignition key and mounted tank.
  • Confirmed horizontal and vertical mouse aiming work.
  • Confirmed keyboard driving remains functional.
  • git diff --check passes.

@mrfox-1
mrfox-1 marked this pull request as ready for review July 24, 2026 01:07
jeffory added a commit to jeffory/GoldenEye-Recomp that referenced this pull request Aug 2, 2026
GoldenEye's ordinary mouse hook writes Bond's camera yaw. While Bond is
mounted, the game rebuilds that yaw every simulation tick from the tank
body and native turret orientation, so horizontal mouse movement was
immediately overwritten. Vertical movement is handled separately and
already worked.

Detect the game's authoritative mounted-state flag and shift the native
turret target and its smoothed current value by the same mouse delta,
back-solving the accumulator from this build's own smoothing reciprocal.
The native tank update stays responsible for steering, collision
rollback, controller input, and the final camera.

Ported from mrfox-1's community fix (v2.1.0), submitted upstream as
SunJaycy#116 (fixes upstream issue SunJaycy#93) and still
awaiting review there.

Fork-specific adaptations vs. the upstream patch:

- Driven from cdx (the ge_mouse_smooth EMA output) rather than upstream's
  raw mdx, because our camera/crosshair/sway paths all consume cdx. Tank
  aim therefore gets the same feel as on-foot aim under the user's
  smoothing setting instead of a discontinuity on mount/dismount. At the
  default ge_mouse_smooth=0 this is identical to upstream.
- Only the camera-yaw and gun-sway reads are switched to the suppressed
  delta. The menu cursor stays on raw mdx, and the aim-mode-1 crosshair
  stays on cdx -- upstream suppresses the yaw write, not the crosshair.
- Upstream's second camera hunk has no counterpart here: it rewrites the
  Goldeneye1.2.4 aim-mode rework, which this fork never took (our
  merge-base is three upstream releases earlier and we reimplemented
  mouse-look independently).

Inert on Android, where ge_app.h forces ge_mouselook_enable off.

Co-authored-by: mrfox-1 <noreply@github.com>
jeffory added a commit to jeffory/GoldenEye-Recomp that referenced this pull request Aug 2, 2026
Ports mrfox-1's GoldenEye-Recomp-Watch-Music-Fix v2.1.0 (upstream PRs
SunJaycy#114 and SunJaycy#116) with fork-specific adaptations:
guest-context clobber safety around the XACT cue wrappers, the tick
placed above the ge_mouselook_enable gate so it runs on Android, and the
tank path re-expressed against our EMA-smoothed mouse delta.
zZeck added a commit to zZeck/GoldenEye-Recomp that referenced this pull request Aug 4, 2026
While Bond is mounted, the game rebuilds the camera yaw from the tank body +
native turret orientation every simulation tick, so the on-foot mouse-look yaw
write is immediately overwritten and mouse-X couldn't turn the tank. Detect the
mounted-state flag and shift the native turret target + its smoothed current
value by the same mouse delta instead, back-solving the accumulator from this
build's smoothing reciprocal; the native tank update keeps steering, collision,
controller input, and the final camera. Vertical aim already worked.

Ported from mrfox-1's community fix (v2.1.0), via jeffory's fork; upstream PR
SunJaycy#116 (issue SunJaycy#93). Driven from our EMA-smoothed cdx so
tank aim matches on-foot feel under ge_mouse_smooth (identical to upstream at
smooth=0).

Co-authored-by: mrfox-1 <noreply@github.com>
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.

Mouse aim not working on tanks

1 participant