andrei-drexler / ironwail

High-performance QuakeSpasm fork
GNU General Public License v2.0
480 stars 43 forks source link

DualSense Adaptive Triggers #309

Open xDShot opened 3 months ago

xDShot commented 3 months ago

Presenting DualSense Adaptive Triggers feature support. Includes cvars and menu configuration entries. Allows switching trigger modes and parameters.

I added separate thread for HIDAPI interface to query triggers status to not affect main thread and keep performance. SDL2 doesn't provide such info, so using this workaround. This allows altering trigger pressure status depending on applied effect.

Also added enhanced LED. Currently provides setting up color, copies screen flashes, reacts to weapon firing.

LED changes requires SDL 2.0.14. Trigger effects require SDL 2.0.16. Extended trigger pressure (read from HID input report) is possible from SDL 2.0.18. Otherwise, estimated pressure is calculated.

Completely resolves #163 (the triggers part)

Would like to hear a feedback, what to improve and what to document.

sndein commented 2 weeks ago

I finally tried this PR out today. It works just fine but I'm personally not a fan of how it is implemented. You expose all the functionality of the triggers and just let the player go nuts with it. What I'd rather expect from an implementation for adaptive triggers are largely hard-coded effects, different for each weapon that fit them well. So for example a heavy thump every time you fire the double shotgun, a low frequency rumble when the nailguns are fired and a high-frequency one for the lightning gun. There could still be some settings exposed like a toggle of course as well as strength of the effect and such. This also would cut down on the current bloat in the settings menu. That's a lot of sliders just for this one feature.

I will say though, having the entire functionality exposed in the settings like this makes for a great playground to come up with fitting effects. The pulse effect of the LEDs when firing is also really neat.