Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement some dedicated buttons for mouse+kb / gamepad #28

Merged
merged 9 commits into from
Aug 20, 2023

Conversation

NeonNyan
Copy link

@NeonNyan NeonNyan commented Aug 18, 2023

Implements dedicated buttons for:

  • alt switching: F / RB. Hold F and release to switch modes. Hold F, press the trigger to temporarily use the alt mode, and release to switch back. Both chords will trigger crouch toggling with the sniper rifle.
  • radial menu: G / LB
  • reloading: R / X

NeonNyan and others added 6 commits August 18, 2023 13:59
Introduce `JO_ACTION*` constants to use `player.bondreloadoractivate` as a bit
field.

Deviation from vanilla Mouse Injector behavior: hard seperation between
reload and activate. `B` will not reload just as `ALT1` will not
activate.
- switches immediately when releases L
- or whenevever L+Z is pressed. Will switch back when L is released.
F and G will switch modes and bringup the radial menu
@NeonNyan NeonNyan changed the title Implement some dedicated buttons Implement some dedicated buttons for mouse / keyboard Aug 18, 2023
@8sm32K4D1K5f3E
Copy link

Love this, was hoping exactly this kind change would be made, small change but such a big improvement.

I noticed the swap function does have a small bug with its display with weapons that have their function work while swap is held, if the button's held, the function doesn't show it's swapped at all, but it still works. If you merely press the button, the text does update, then stay on the swapped text, despite the weapon itself returning to its primary fire.

2023-08-18.22-56-06.webm

@NeonNyan
Copy link
Author

Thank you, good catch!

I'll check this. By the way, were you activating alt mode with holding E / B or by holding F / X?

@8sm32K4D1K5f3E
Copy link

That occurs when using the dedicated F key, when holding E the display functions as expected.

@NeonNyan
Copy link
Author

Love this, was hoping exactly this kind change would be made, small change but such a big improvement.

I noticed the swap function does have a small bug with its display with weapons that have their function work while swap is held, if the button's held, the function doesn't show it's swapped at all, but it still works. If you merely press the button, the text does update, then stay on the swapped text, despite the weapon itself returning to its primary fire.
2023-08-18.22-56-06.webm

Okay, see what you mean. TLDR it's a feature for the dedicated button because I discovered during testing it felt better.

long answer: An immediate mode switch felt best, but my muscle memory expected "one-off alt-mode behavior" when the dedicated button was held. Switching to the one-off mode when Z trigger is pressed but hard-switching it if the F button was released without pressing Z felt best during my testing.

@NeonNyan
Copy link
Author

If you merely press the button, the text does update, then stay on the swapped text, despite the weapon itself returning to its primary fire.

I need to look at xbla behavior but I think the laptop gun / dragon special cases aren't being handled here. But I agree, it's definitely odd. I should be able to fix it.

@fgsfdsfgs
Copy link
Owner

Should I merge this or wait for the fix?

@LanHikariDS
Copy link

I need to look at xbla behavior but I think the laptop gun / dragon special cases aren't being handled here.

XBLA just makes the Dragon/Laptop Gun Alt-modes act like other guns, where it just toggles into the new mode, no holding while firing required.

@NeonNyan
Copy link
Author

I need to look at xbla behavior but I think the laptop gun / dragon special cases aren't being handled here.

XBLA just makes the Dragon/Laptop Gun Alt-modes act like other guns, where it just toggles into the new mode, no holding while firing required.

Thank you for saving me the trouble of hooking up my xbox!

@NeonNyan
Copy link
Author

Should I merge this or wait for the fix?

I'll fix it. The laptop gun / dragon should switch but they're switching back on the next tick w/o updating the UI...which is neither vanilla or xbla behavior and just kind of feels weird.

@NeonNyan
Copy link
Author

NeonNyan commented Aug 19, 2023

I fixed the issue that @8sm32K4D1K5f3E reported but I found another issue: the sniper rifle doesn't respect F while aiming. And this, tbh is because this mod was originally for the mouse injector compatibility branch and the crouching was overridden by the memory injection shenanigans. The correct fix for that is to implement squatting and half-crouch buttons in the rom. I'll disable F for sniper rifle, as that's afaicr xbla behavior and what you'd expect if you had functioning crouch / half-crouch buttons.

@NeonNyan
Copy link
Author

I fixed the issue that @8sm32K4D1K5f3E reported but I found another issue: the sniper rifle doesn't respect F while aiming. And this, tbh is because this mod was originally for the mouse injector compatibility branch and the crouching was overridden by the memory injection shenanigans. The correct fix for that is to implement squatting and half-crouch buttons in the rom. I'll disable F for sniper rifle, as that's afaicr xbla behavior and what you'd expect if you had functioning crouch / half-crouch buttons.

actually no this feels awful I'll try to make it work with F

@NeonNyan
Copy link
Author

How do we feel about these bindings for the sniper rifle alt fire button?

  • F+trigger: half-crouch
  • F: full crouch

(or vice versa)

@LanHikariDS
Copy link

In the case of the XBLA port, the Sniper's alt-fire gets removed entirely, since crouch gets its own bind (LS)

@NeonNyan
Copy link
Author

How do we feel about these bindings for the sniper rifle alt fire button?

* F+trigger: half-crouch

* F: full crouch

(or vice versa)

In the case of the XBLA port, the Sniper's alt-fire gets removed entirely, since crouch gets its own bind (LS)

You're right, but people might be using 1 or more n64 controllers and might expect a dedicated alt button to work the n65 way.

@NeonNyan
Copy link
Author

How do we feel about these bindings for the sniper rifle alt fire button?

* F+trigger: half-crouch

* F: full crouch

(or vice versa)

I have f-to-crouch working, now for f+z-to-halfcrouch

@NeonNyan
Copy link
Author

NeonNyan commented Aug 19, 2023

@fgsfdsfgs can the different levels of alt-mode support (none, crouch-only, and crouch+halfcrouch) for the sniper rifle switch-able options be in an extended options menu later?

@LanHikariDS
Copy link

You're right, but people might be using 1 or more n64 controllers and might expect a dedicated alt button to work the n65 way.

Ah, I assumed these changes only applied when using a keyboard. Alternatively, why not just leave the alt-fire alone and give a dedicated Crouch cycle key (Again like 360)? N64 DOES have a standalone functionality for it as well, the Sniper Alt is just meant to be a more convenient way to trigger it

@NeonNyan
Copy link
Author

You're right, but people might be using 1 or more n64 controllers and might expect a dedicated alt button to work the n65 way.

Ah, I assumed these changes only applied when using a keyboard. Alternatively, why not just leave the alt-fire alone and give a dedicated Crouch cycle key (Again like 360)? N64 DOES have a standalone functionality for it as well, the Sniper Alt is just meant to be a more convenient way to trigger it

Right now only the keyboard bindings are added, but controller support is just a matter of mapping the inputs

@NeonNyan
Copy link
Author

NeonNyan commented Aug 19, 2023

You're right, but people might be using 1 or more n64 controllers and might expect a dedicated alt button to work the n65 way.

Ah, I assumed these changes only applied when using a keyboard. Alternatively, why not just leave the alt-fire alone and give a dedicated Crouch cycle key (Again like 360)? N64 DOES have a standalone functionality for it as well, the Sniper Alt is just meant to be a more convenient way to trigger it

Right now only the keyboard bindings are added, but controller support is just a matter of mapping the inputs

Because these are patches that I originally wrote for a 1964 compatibility mod. Crouching was handled by the plugin, these patches I had to write b/c the asm hacks needed to be in the decomp project.

Dedicated crouching / uncrouching buttons are coming, I promise! If not me then someone else will write it.

@fgsfdsfgs
Copy link
Owner

fgsfdsfgs commented Aug 19, 2023

@fgsfdsfgs can the different levels of alt-mode support (none, crouch-only, and crouch+halfcrouch) for the sniper rifle switch-able options be in an extended options menu later?

Eventually probably. Ideally I'd want all enhancements to be switchable, but for some that might be too awkward.

@Graslu
Copy link

Graslu commented Aug 19, 2023

IMO radial menu should be on Q instead of G - closer to WASD and it's what most modern shooters seem to use nowadays (DOOM 2016, Eternal, Quake remasters). Once the dedicated button for crouch and half crouch is added I assume the crouch option for the sniper won't be required. Can't crouch in the original with the FarSight unless you crouched beforehand.

I assume that in the future we'll also have custom bindings so it won't be a big issue. Also native N64 support with Raphnet hopefully for the true 1:1 experience. :P

F to crouch with sniper
F + Z to crouch with sniper
@NeonNyan
Copy link
Author

NeonNyan commented Aug 19, 2023

IMO radial menu should be on Q instead of G - closer to WASD and it's what most modern shooters seem to use nowadays (DOOM 2016, Eternal, Quake remasters). Once the dedicated button for crouch and half crouch is added I assume the crouch option for the sniper won't be required. Can't crouch in the original with the FarSight unless you crouched beforehand.

I assume that in the future we'll also have custom bindings so it won't be a big issue. Also native N64 support with Raphnet hopefully for the true 1:1 experience. :P

I added new issues b/c resolving @Graslu's issue is out of scope b/c crouch/half-crouch/back-switch buttons are missing.

@NeonNyan
Copy link
Author

F-Trigger to half-crouch w/ sniper is nontrivial enough to be out of scope for this PR as well as being a purely non-vanilla idea I had in this thread.

I filed issues for the unimplemented features that people here have mentioned. @fgsfdsfgs I think this is ready to merge.

@NeonNyan NeonNyan changed the title Implement some dedicated buttons for mouse / keyboard draft: Implement some dedicated buttons for mouse / keyboard Aug 20, 2023
@NeonNyan NeonNyan marked this pull request as draft August 20, 2023 00:50
@NeonNyan NeonNyan changed the title draft: Implement some dedicated buttons for mouse / keyboard Implement some dedicated buttons for mouse+kb / gamepad Aug 20, 2023
@Phnod
Copy link

Phnod commented Aug 20, 2023

Could the Radial menu button also be on the Middle Mouse button or Mouse5 (VK_MOUSE_X2)? it's a little less awkward to input the directional keys for selecting a weapon when you don't have to hold a key right next to them. For instance trying to select the bottom left option in the radial menu is a little awkward holding down Q, A and S combined.

@NeonNyan
Copy link
Author

NeonNyan commented Aug 20, 2023

Could the Radial menu button also be on the Middle Mouse button or Mouse5 (VK_MOUSE_X2)? it's a little less awkward to input the directional keys for selecting a weapon when you don't have to hold a key right next to them. For instance trying to select the bottom left option in the radial menu is a little awkward holding down Q, A and S combined.

Yes!

Also mouse movement within the menu can be added in another PR. This PR is just about porting / upstreaming relevant decomp-side 1964 patches.

map implemented buttons to xbla positions

map radial menu to middle the mouse button
@NeonNyan
Copy link
Author

Could the Radial menu button also be on the Middle Mouse button or Mouse5 (VK_MOUSE_X2)? it's a little less awkward to input the directional keys for selecting a weapon when you don't have to hold a key right next to them. For instance trying to select the bottom left option in the radial menu is a little awkward holding down Q, A and S combined.

Yes!

Also mouse movement within the menu can be added in another PR. This PR is just about porting / upstreaming relevant decomp-side 1964 patches.

I added an alternate mapping to middle mouse for the radial menu. Moving Q doesn't make sense until there's a dedicated back-switch button which is out of scope for this PR.

@NeonNyan NeonNyan marked this pull request as ready for review August 20, 2023 07:02
@fgsfdsfgs fgsfdsfgs merged commit 3da1fd4 into fgsfdsfgs:port Aug 20, 2023
2 checks passed
@munguitox munguitox mentioned this pull request Dec 14, 2023
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.

None yet

6 participants