Added support for extra buttons to be used as walk speed modifiers#449
Added support for extra buttons to be used as walk speed modifiers#449dcvz merged 39 commits intoHarbourMasters:developfrom
Conversation
briaguya0
left a comment
There was a problem hiding this comment.
this seems really cool! a couple things come to mind
- not sure how i feel about the
BTN_MODIFIERnaming. i like thegWalkModifiernaming, theBTN_MODIFIERstuff just leaves me asking "modify what?" - allowing players to set the modifier to over 1.0x speed kind of puts this in a strange place where it can be both a QoL thing and a cheat, part of me thinks the move is to just limit the slider to have a max of 1.0 but idk
|
I have no problem renaming the buttons or moving the sliders to the cheats menu, since even the slow movement was specifically requested to be able to easily set up glitches like ESS. Any recommendation for what to name the buttons? There's no equivalent N64 button, which is why since I was using them as walk modifiers, I named them "modifier", but maybe something more generic like UTILITY or EXTRA would be better? |
|
It looks like I didn't post here yet, but this is waiting on the controller binding UI to be merged. |
|
Ah, that makes sense. I wondered if we were also waiting for Rachael. |
…D-pad as equips use simultaneously
|
Also, a lot of these changes are game specific. I don't know yet how I want to handle game specific controller changes. The PR to invert axis controls is also waiting in the same limbo. |
If it helps, I'd be happy to split this into a change to just add the buttons to the mapping, since any game could then use the extra buttons, and then a separate change to use the new buttons for the walk speed modifiers. |
| profile->Mappings[SDL_CONTROLLER_BUTTON_LEFTSTICK] = BTN_MODIFIER1; | ||
| profile->Mappings[SDL_CONTROLLER_BUTTON_RIGHTSTICK] = BTN_MODIFIER2; |
There was a problem hiding this comment.
might be nice to add a comment explaining why the modifiers are being mapped to the sticks
There was a problem hiding this comment.
Funny enough, the real reason isn't even relevant anymore! Back when I first made this PR, the C buttons had that commented out double-mapping that also took up the X, Y, Right Shoulder, and Select buttons (I believe), so the two stick buttons were the only ones left unmapped! The default mapping has since removed that entirely, but because people might still be using some version of that mapping (hint hint ME, lol), I didn't want to potentially conflict with them. I'm curious if you think people will be more likely to already have something mapped to the stick buttons though, since I know I've seen some people put Up C on right stick click.
Plus, in my testing, it actually ended up being kind of useful to just click and then aim the left stick with a single finger, kind of like Metroid Dread ended up doing, and I've never felt like the imprecision of the stick buttons lent themselves well to use as actual items.
Potentially closes #178.
It's been discussed before that we shouldn't be held to the limitations of the N64 controller, and that previous mods that have tried to add a walk speed modifier have been limited by the number of buttons available on the standard N64 controller. Therefore, I decided to go ahead and add two more buttons to the default controller bindings to serve the purpose of walk speed modifiers, although now that they're there, they could be used for anything else in the future.
The enumeration of N64 buttons had space for two more buttons in its 16-bit field, so I added two buttons and called them MODIFIER1 and MODIFIER2. On a standard Xbox controller, there were also room for 2 more buttons in the default mapping, if the C buttons are assumed to use standard buttons and not the right stick. These new buttons are mapped to the left stick button and the back button respectively. On a keyboard, these are mapped to left and right shift respectively.
As implemented, holding these buttons while walking will multiply the walk speed by the value shown in the slider. I'm open to suggestions as to the range of the sliders, particularly if one slider is desired to have greater granularity. These modifiers are also not controller type-agnostic; they apply to both keyboard and standard controller, even though the initial issue only specified wanting them for keyboard. You can even hold the keyboard button while walking with a controller joystick if the controller type is set to "auto", as is the default.
Currently, the speed modifier is limited only to when walking without targeting, which mirrors the behavior of the Bunny Hood speed enhancement. Additionally, the Bunny Hood speed enhancement will take priority if that option is enabled and the Bunny Hood is currently being worn. If there are more situations where having speed modification would be helpful, I will gladly add them. For example, it doesn't work in buildings when certain buttons are disabled since I didn't disable the disabling.
Example behavior (plays fine offline in VLC):
capture0002.mp4
Additionally, since the Game Control Editor window that the modifier button mapping UI lives in is brand new and has other PRs out for it, this PR fixes some white space formatting and an issue with tooltips not working instead of using another PR in order to prevent merge conflicts.