-
-
Notifications
You must be signed in to change notification settings - Fork 141
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
DualSense Adaptive Triggers Support #757
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the contribution. No major objections to merging such a feature, just a few implementation details and style issues to be addressed.
@@ -150,6 +150,8 @@ These are miscellaneous controller-specific settings etc. | |||
- `dualsense_lightbar_brightness` Set LED lightbar brightness for Sony Dualsense controllers. Valid range [0-9] where 0=off, 1=min, 2-9=12.5-100% in 12.5% increments. | |||
- `dualsense_enable_player_leds` Enable/disable the white player indicator LEDs below the Dualsense touchpad. | |||
- `dualsense_vibration_intensity` Set Dualsense vibration intensity, 12.5% per increment. Valid range [1-8] where 1=12.5%, 8=100%. | |||
- `dualsense_enable_adaptive_triggers` Enable/disable adaptive triggers for Dualsense. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is no need for an additional enable option. You can just make the numbers run 0-10, where 0 is disabled.
@@ -150,6 +150,8 @@ These are miscellaneous controller-specific settings etc. | |||
- `dualsense_lightbar_brightness` Set LED lightbar brightness for Sony Dualsense controllers. Valid range [0-9] where 0=off, 1=min, 2-9=12.5-100% in 12.5% increments. | |||
- `dualsense_enable_player_leds` Enable/disable the white player indicator LEDs below the Dualsense touchpad. | |||
- `dualsense_vibration_intensity` Set Dualsense vibration intensity, 12.5% per increment. Valid range [1-8] where 1=12.5%, 8=100%. | |||
- `dualsense_enable_adaptive_triggers` Enable/disable adaptive triggers for Dualsense. | |||
- `dualsense_adaptive_triggers_resistance` Set Dualsense adaptive triggers resistance. Valid range [0-9] where 0=light, 9=heavy. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we can simplify this to dualsense_trigger_resistance
, since we are not using them in an "adaptive" manner.
@@ -26,3 +26,7 @@ | |||
;dualsense_enable_player_leds=false | |||
; Set Dualsense vibration intensity, 12.5% per increment. Valid range [1-8] where 1=12.5%, 8=100% [default 4(50%)] | |||
;dualsense_vibration_intensity=4 | |||
; Enable adaptive triggers [default true] | |||
;dualsense_enable_adaptive_triggers=true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In addition to what I wrote above about using a single config option, this option should be disabled by default (i.e. set to 0)
@@ -156,8 +156,8 @@ namespace ams::controller { | |||
|
|||
this->MapButtons(&src->input0x01.buttons); | |||
|
|||
m_buttons.ZR = src->input0x01.right_trigger > (m_trigger_threshold * UINT8_MAX); | |||
m_buttons.ZL = src->input0x01.left_trigger > (m_trigger_threshold * UINT8_MAX); | |||
m_buttons.ZR = src->input0x01.right_trigger > (std::min(m_trigger_threshold * UINT8_MAX, UINT8_MAX - 1.0f)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No need to wrap a function call in parethesis
float adaptive_trigger_threshold_end = (std::max(trigger_threshold - 80.0f, 0.0f)); | ||
float adaptive_trigger_threshold_start = (std::max(adaptive_trigger_threshold_end - 10.0f, 0.0f)); | ||
|
||
u8 force1 = static_cast<u8>(adaptive_trigger_threshold_start); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No need to cast these, you can just assign them as u8 above
// Start of resistance section | ||
// 0x00 = 0% | ||
// 0xFF = 100% | ||
report.output0x31.data[12] = force1; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would assign these directly, rather than creating intermediate force
variables
// (Mode Extra A & Extra B = Strength of effect near release state) | ||
// 0x00 = 0% | ||
// 0xFF = 100% | ||
report.output0x31.data[15] = 0x00; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No need to assign unused fields, report
is zero-initialised
|
||
u8 force3 = static_cast<u8>(config->misc.dualsense_adaptive_triggers_resistance / 9.0f * 255.0f); | ||
|
||
// --- Control flags --- |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These comments don't match the project style. Dont use things like ---
to separate sections. I usually label sections with a comment and separate them by blank lines
|
||
// --- Right trigger --- | ||
|
||
// [Mode] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Likewise with these. Don't use [ ]
. Prefer single line and/or inline comments if you must add them. I don't like multi-line comments within code blocks decreasing the amount of actual code I can fit on the screen. In this case a self-documenting enum might be a better choice. Or even just a url to where you found this info documented, in the event it might be needed in the future.
Was Adaptive Trigger support ever pushed to master? |
You can see the state of the pull request at the top. Requests show as merged rather than open if they have been merged. I have requested changes to this which are yet to be acknowledged. This is not really adaptive trigger support, btw. It just allows a user to set an initial trigger resistance. It won't respond to your gameplay. |
I see, would something like that ever be possible, or would it require the game to be designed/modded for it?
…________________________________
From: ndeadly ***@***.***>
Sent: Sunday, 27 October 2024 19:51
To: ndeadly/MissionControl ***@***.***>
Cc: panneff ***@***.***>; Comment ***@***.***>
Subject: Re: [ndeadly/MissionControl] DualSense Adaptive Triggers Support (PR #757)
You can see the state of the pull request at the top. Requests show as merged rather than open if they have been merged. I have requested changes to this which are yet to be acknowledged.
This is not really adaptive trigger support, btw. It just allows a user to set an initial trigger resistance. It won't respond to your gameplay.
—
Reply to this email directly, view it on GitHub<#757 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/BMCDG2VBUD2RCVTCKBTAP33Z5R5PBAVCNFSM6AAAAABQVIZX7GVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDIMZZHA3TQMRWGQ>.
You are receiving this because you commented.Message ID: ***@***.***>
|
The latter. You need something generated by the gameplay to drive it off, and outside of PS5 or maybe some specific PC games you're not going to have that. |
DualSense Adaptive Triggers Support
The changes introduced in this pull request aim to provide resistance to adaptive triggers before the ZR/ZL buttons are pressed, offering a more immersive and responsive gaming experience. I also resolved a bug for the DualSense controller, ensuring that setting
analog_trigger_activation_threshold
to 100% is now reachable.The adaptive triggers can be customized through the missioncontrol.ini file, and they are enabled by default. They perform best (by my opinion) when the
analog_trigger_activation_threshold
is set to 100%.Configuration
analog_trigger_activation_threshold
This existing property influences the end section of the adaptive triggers.dualsense_enable_adaptive_triggers
Enables or disables adaptive triggers for the DualSense controller.dualsense_adaptive_triggers_resistance
Allows the customization of the DualSense adaptive triggers resistance. Valid range is [0-9], where 0 represents light resistance and 9 represents heavy resistance.Future
In the future, it would be interesting to enable users to create scripts (or files with memory addresses) for specific game titles, which MissionControl can utilize to adjust the adaptive triggers according to the game's current state.
Credits
I would also like to thank Mxater for his valuable contribution of the DualSenseSupport project. His code served as an essential reference and inspiration throughout the development of this pull request.
Binaries
MissionControl-0.10.0-dualsense-adaptive-triggers-2e08477.zip