MERLev / reVita

GNU General Public License v3.0
74 stars 8 forks source link

An idea: it might be possible with some games to map the sticks or gyroscope movements to pulse-width-modulated presses of digital keys #11

Open decadent opened 3 years ago

decadent commented 3 years ago

Some games don't support analog input where it would make sense, even on Vita or PS1 with the right analog stick available—e.g. for acceleration and braking in racing games. Instead, the player has to keep pressing and releasing a digital button. Pulse-width modulation would do exactly that, but in an automatic manner: in PWM, the time for which the digital signal is kept on is proportional to the value of the source analog signal. I.e. reVita would press-and-release a button in short cycles, and the presses would be longer when the analog input is tilted further.

The current ‘turbo’ option is essentially PWM with a fixed ‘on’ pulse length and adjustable total cycle time (if I'm not mistaken).

There are a few variables which probably need tuning for a particular game:

Alas, it seems that for my case of simulation-ish racing games like Gran Turismo and TOCA Race Driver, this idea won't fly due to car physics being sorta complex: releasing the accelerator is itself an input, and with short taps, the car won't even start. At least not in my attempts with the current ‘turbo’ mode. But it might work for less-finicky games, or with proper variation from 0 to 100%.

Of course, I also don't know if this would take too much CPU power—but if the turbo option works, I guess PWM is not much of a challenge for the processor.

decadent commented 3 years ago

I can envision difficulties with marginal values: when the input is minuscule, the button presses might be too short to register properly, and the same with button releases—if the analog resolution allows such precision. Or the opposite: if the resolution is coarse then jumping from no input to some input might feel janky, especially in the fixed-total-cycle variant. But my guess is, this would still beat having only digital input where analog can work.