teknogods / OpenParrot

Open Source version of TeknoParrot by NTA, avail and Reaver
GNU General Public License v3.0
230 stars 47 forks source link

[Taiko no Tatsujin Nijiiro Ver.] Fix input sensitivity (fixes drum rolls) #186

Closed shiibe closed 2 years ago

shiibe commented 2 years ago

This PR adds a function to randomly generate a value for input sensitivity of the drum. Since the arcade controller is analog, the game uses the raw values to determine a cooldown period. In it's current implementation, the input value sent by OpenParrot is 0xFFFF. Since the value is always the same, the game disregards notes that are close to one another. This is noticeable on drum rolls (especially if you're using a Taiko Force Lv5 controller):

https://user-images.githubusercontent.com/82057235/147324214-8dafac14-bb11-45d3-9e44-231c9b5c63d5.mp4

I added a function to randomly generate a value when a key is pressed. After a bit of testing I found the sweet spot that randomly generates values between ~40 to ~90 in the I/O Test menu:

https://user-images.githubusercontent.com/82057235/147324335-225eb8c5-756e-4c47-a506-be86ef6fe925.mp4

Which results in faster input (~30 more hits in the same roll):

https://user-images.githubusercontent.com/82057235/147324359-6b27f767-2e0a-4333-958c-2faa4d942fbd.mp4

I'm new to C++ so if this implementation seems sloppy, please let me know!

Poliwrath commented 2 years ago

Thanks for the contribution! Looks good to me. Thanks for the videos too. None of us have specialized Taiko controllers as far as I know, so we're not able to check this ourselves. Worst case scenario we can just revert or make it a toggle or adjustable.

shiibe commented 2 years ago

@Poliwrath Yeah I think adding a toggle for it would be good (like "Enable Analog Input Emulation" or something). Even the option to adjust the min/max values from the UI could be nice. I can try it out and create another PR if necessary.

I'm going to do some more testing just to make sure there aren't any issues, but so far so good!

Thanks for merging 😄

Poliwrath commented 2 years ago

Shouldn't be necessary unless there's issues with the current values. Thanks again.