Skip to content

Free look: mouse control, Free Look Everywhere, smoother orbit; Return skips dialogue - #668

Open
stavrin wants to merge 2 commits into
HarbourMasters:developfrom
stavrin:mouselook-pr
Open

stavrin wants to merge 2 commits into
HarbourMasters:developfrom
stavrin:mouselook-pr

Conversation

@stavrin

@stavrin stavrin commented Nov 8, 2026

Copy link
Copy Markdown

Free look

  • Free Look Mouse: turn the free look camera with the mouse. The mouse is captured while playing (menu or F2 frees it), with sensitivity and per-axis invert options. Any mouse movement enters free look, like the right stick past its threshold; a C-button camera control hands back.
  • Free Look Everywhere (default on): free look can also take over from the underwater camera and the camera-node (fixed/pivot) cameras, through two new hooks, VB_CAMERA_FIXED_NODE and VB_CAMERA_UNDERWATER.
  • The orbit no longer uses the follow camera's line-of-sight rescue (func_802BC84C): it kept jumping the camera beside the player, and free look pulled it straight back, so the view snapped back and forth.
  • Is located in Enhancements>Camera.

Frame interpolation

  • World matrices with no usable previous partner (unpaired, or turned more than 90 degrees) are now moved with the sub-frame's camera, the way the camera-relative fixups already are. Fast camera moves (free look orbit) made the player model jump against the rest of the world for a frame. The world pass in gsworld_draw is marked with WorldRelativePush/Pop.
  • GetInterpolationFPS falls back to 60 when the window reports a refresh rate of 0 (window saved off-screen), instead of dividing by zero.

Cutscenes

  • Return Skips Dialogue: Return skips the dialogue on screen up to the next question or the end, through the game's own skip (dialog state 6).
  • Is located in Enhancements>Cutscenes.

…n skips dialogue

Free look
- Free Look Mouse: turn the free look camera with the mouse. The mouse is
  captured while playing (menu or F2 frees it), with sensitivity and
  per-axis invert options. Any mouse movement enters free look, like the
  right stick past its threshold; a C-button camera control hands back.
- Free Look Everywhere (default on): free look can also take over from the
  underwater camera and the camera-node (fixed/pivot) cameras, through two
  new hooks, VB_CAMERA_FIXED_NODE and VB_CAMERA_UNDERWATER.
- The orbit no longer uses the follow camera's line-of-sight rescue
  (func_802BC84C): it kept jumping the camera beside the player, and free
  look pulled it straight back, so the view snapped back and forth.

Frame interpolation
- World matrices with no usable previous partner (unpaired, or turned more
  than 90 degrees) are now moved with the sub-frame's camera, the way the
  camera-relative fixups already are. Fast camera moves (free look orbit)
  made the player model jump against the rest of the world for a frame.
  The world pass in gsworld_draw is marked with WorldRelativePush/Pop.
- GetInterpolationFPS falls back to 60 when the window reports a refresh
  rate of 0 (window saved off-screen), instead of dividing by zero.

Cutscenes
- Return Skips Dialogue: Return skips the dialogue on screen up to the next
  question or the end, through the game's own skip (dialog state 6).
@JeodC

JeodC commented Nov 9, 2026

Copy link
Copy Markdown
Contributor

Hello, thanks for the PR! I am currently in the middle of a code refactor to better align with other ports and remove chunks of code from decomp files. I will get around to reviewing once those are complete.

@JeodC

JeodC commented Nov 16, 2026

Copy link
Copy Markdown
Contributor

Thanks for waiting on this. The refactor I mentioned is in (#671, #672, #674, #675), and it changes how port code hooks into decomp files. The features look good; these notes are about the hooks.

Rebase your branch first. You're branched off #666. Only FreeLookCamera.cpp conflicts. #672 renamed the port_ helpers after their modules, so port_freeLook_isEnabled() is now FreeLookCamera_IsEnabled(), and new helpers should be named the same way.

1. Put each VB on the vanilla check. The VB takes the vanilla condition as its default, with the original line commented above it. No extra if before the check, and no added || term. VB_CAMERA_CYCLE_ZOOM in ba_camera.c is an example. For your two camera VBs:

//  if(camera_node_index == -1 || !ncCameraNodeList_nodeIsValid(camera_node_index)){
    if(!EventSystem_Should(VB_CAMERA_FIXED_NODE, camera_node_index != -1 && ncCameraNodeList_nodeIsValid(camera_node_index))){
        func_80290BC0(0);
        return false;
    }
//  if(player_getWaterState() != BSWATERGROUP_2_UNDERWATER)
    if(!EventSystem_Should(VB_CAMERA_UNDERWATER, player_getWaterState() == BSWATERGROUP_2_UNDERWATER))
        return false;

Your listeners don't need to change. Update each VB's #### result in Events.h to match.

2. Same for Return Skips Dialogue. Put a VB on the B-skip check in dialog.c, and set *should = true from a listener in CutsceneSkips.cpp when Return was pressed. That takes the port_dialogueSkipPressed() declaration and the || term out of dialog.c.

//          if ((g_Dialog.u8_s.unk128_31 & 1) && controller_face_buttons[FACE_BUTTON(BUTTON_B)] == 1u) {
            if (EventSystem_Should(VB_SKIP_DIALOG, (g_Dialog.u8_s.unk128_31 & 1) && controller_face_buttons[FACE_BUTTON(BUTTON_B)] == 1u)) {

Give the key handler in Engine.cpp a CutsceneSkips_ name and declare it in CutsceneSkips.h.

3. Register listeners on their setting. Pass the CVar as the COND_VB_SHOULD condition and list it in RegisterShipInitFunc. If a listener has to stay registered regardless, like the swivel listener, keep true and add a comment saying why.

4. Minor

  • Drop the // [port] notes in ba_camera.c and gsworld.c. The commented original line marks the change.
  • If it's easy, split the commits by feature.

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.

2 participants