Boomslangnz / FFBArcadePlugin

Plugin to add force feedback and rumble effects to various arcade games
GNU General Public License v3.0
107 stars 21 forks source link

Single motor mode #33

Closed ckeisc closed 1 year ago

ckeisc commented 1 year ago

I am using the ffb plugin with a PC modded arcade 1up Ridge Racer cab. I am using a 360 controller to drive the single rumble motor embedded in the stock diving wheel.

Is it possible for ffb plugin to combine the left and right rumble motor signal and funnel them to a single motor? I hooked the wheel up to left motor currently and I am missing out on half of the rumble events.

Boomslangnz commented 1 year ago

Yeah would require some changes to code though. How good is the effects like that?

ckeisc commented 1 year ago

Thanks for responding - I am hacking it to find out. The cab comes with only a single rumble motor so the rumble fidelity is limited. My goal is for the PC mod to make the most of the cabinet’s modest hardware. I can understand that single rumble motor may be a rarity instead of a common need.

Boomslangnz commented 1 year ago

Well it will be limited is all compared to a standard force feedback motor. Wheel wont turn etc with effects. If you are enjoying it then great

Boomslangnz commented 1 year ago

FFBPluginSingleMotorTest.zip

Ive added 2 different tests for you to try out and see what works best.

There is x86 & x64 dll here and you will need to rename depending on game if it's not dinput8 already on old version.

Only perform 1 at a time, but in FFBPlugin.ini under [Settings]

SingleRumbleMotorTest1=1 for test 1 and see if its any good then try SingleRumbleMotorTest2=1 (Make sure you set SingleRumbleMotorTest1=0) to disable that

Ive set it to use the Low Frequency Motor so depending on which motor you are hooked up too, you may potentially need to reverse rumble to get new effects

ckeisc commented 1 year ago

I will test this out!

ckeisc commented 1 year ago

Test1 - works functionally, now getting rumble on the single rumble motor from signals to both motors.

Test2 - seems any rumble is dialed to maximum strength (a very high min force or similar?). Some games have very slight but constant road feedback would now cause the rumble to go full strength all the time (tried and noticed this on Ace Driver).

But I do like the stronger strength from Test2 though.

I have been thinking how to merge signals from both motors. I think it can work similar to how min force works where we start with motor1 and the motor2’s frequency % would be applied to the remaining dynamic range.

Examples ( left motor / right motor => combined), assuming min force = 0

100% / 0% => 100% 50% / 50% => 75% 10% / 20% => 28% (10% + 90*20%)

Boomslangnz commented 1 year ago

Hm i can check test2 again, perhaps ive made an error. It shouldnt be max all the time.

Test1 code is just in rumble trigger code

If (highmotor && highmotor > lowmotor) lowmotor = highmotor;

Meaning if high frequency motor has value and its larger than low then it will use high instead of low, else uses low

Test2 was something like

lowmotor = (lowmotor + highmotor) / (lowfrequency + highfrequency);

usually max value of lowmotor and highmotor is 0xFFFF / 65535 each and lowfrequency and highfrequency should be max 1.0 each as double value

Meaning if they were both max at same time we would be getting

131070 / 2.0 = 65535

Boomslangnz commented 1 year ago

FFBPluginSingleMotorTest2.zip

ok try this, fixed up Test2

Boomslangnz commented 1 year ago

FFBPluginSingleMotorTest3.zip

Sorry here is one more test which includes the way you wanted to try

Add SingleRumbleMotorTest3=1 to FFBPlugin.ini

let me know which works best across the 3 different tests and that can become the permanent

ckeisc commented 1 year ago

I think I like test3 the best, then test1. Test2 now works but much weaker than test3 throughout. Thank you so much for taking time to looking into this. The plugin is really the key piece that allows me to complete my PC mod and keep the stock wheel and rumble motor on the A1U Ridge Racer cab! Works really well over a range of games and emulators.

ckeisc commented 1 year ago

And one thing to add - I would suggest perhaps apply the “merged” rumble value to both motors so there is more flexibility for people wiring a single motor to a controller with 2 motor outlets. But the current scheme of only outputting to one (low motor) and use reverse to toggle if necessary also accomplish the same goal.

Boomslangnz commented 1 year ago

ok cool will keep test3 then. Thanks

hyongju commented 1 year ago

Hi. Is this implemented in the newest release? If so, will I need to add ‘’’SingleRumbleMotorTest3=1’’’ to FFBPlugin.ini ? Thanks for all your work🙏

Boomslangnz commented 1 year ago

Hi

yes but it’s just SingleRumbleMotor=1 now

hyongju commented 1 year ago

Awesome. Thanks for letting me know 😀