emoose / OutRun2006Tweaks

Turning and spinning and spinning and turning, woah!
MIT License
311 stars 0 forks source link

. #10

Closed lance8765 closed 1 week ago

lance8765 commented 3 months ago

.

emoose commented 3 months ago

Might have found a fix for this, seems code for backfiring was checking for full pedal/trigger press by seeing if value was 255 or above, but some reason dinput code only returned max value of ~253 for the triggers.

Some other code in game just checked if it was 250 or above instead, so added some stuff to make anything 250 - 254 register as 255 instead.

Seems to let it work on my end but not sure if other controllers might use even lower values, let me know if this works for you: OutRun2006Tweaks-0.2.5-FixFullPedalChecks.zip Haven't really tested it that much yet though, hopefully this change won't affect any other controls...

E: minor update, should now only apply to accelerate/brake inputs: OutRun2006Tweaks-0.2.5-FixFullPedalChecks-v2.zip

DonelBueno commented 3 months ago

It worked fine here, but I also have an Xbox Series controller.

emoose commented 3 months ago

@lance8765 you can probably remove x1nput fine if you're just using x360 controller, in future this might have something like it built in but it'll be optional, do you know if the backfire fix is working with it removed?

emoose commented 3 months ago

Ah seems the new vibration code made it depend on xinput1_4.dll, looks like that's only available in win8+ for some reason.

Seems I can change it to use xinput9_1_0.dll which win7 should include apparently, maybe see if this build works for you: OutRun2006Tweaks-0.2.5-FixFullPedalChecks-v3.zip

emoose commented 3 months ago

Hm it might be something up with the win7 x360 directinput driver, apparently that might map triggers different to how win10+ maps them.

Guess win7 way might not be compatible, weird though since you'd think a game released around the same time would have supported it fine...

Xidi might be able to change the mapping: https://github.com/samuelgr/Xidi/releases/tag/v4.2.0

If you rename the outrun2006tweaks dinput8.dll to winmm.dll, you can extract dinput8.dll from xidi zip and use the xidi.ini from https://github.com/emoose/OutRun2006Tweaks/issues/7#issuecomment-2166208309

Not really sure if xidi has win7 support or not though, but worth a try. Will try seeing if there's anything we could do on the game side for it as well.

emoose commented 3 months ago

Hm, maybe one of the other mappers could help, you can change the XInputSharedTriggers in xidi.ini to ExtendedGamepad or XInputNative, hopefully one might work better There's a couple others at https://github.com/samuelgr/Xidi#built-in-mappers too but those might disable analogs

Dekaid0011 commented 2 months ago

Another issue with triggers:

When using an xinput controller with triggers as gas and brakes holding both at the same time cancels both inputs out, the game treats it like neither are pressed. The expected result has the brake lights lighting up which is currently not the case atleast using xinput triggers, using buttons instead allows for both gas and brakes at the same time. I tested this with a wired xbox 360 controller and a ds3 using dshidmini in xinput mode.

On xbox c2c atleast this worked with triggers, I tried xidi with the ini set as ExtendedGamepad to see if dinput would work and it did, but gas and brake axis were also halved in travel, they only started registering midway through. XInputSharedTriggers had the same result as normal XInput and XInputNative had the same result as ExtendedGamepad until it crashed the game when I tried to reconfigure.

emoose commented 1 month ago

E: this still has the half-travel issue that Dekaid mentioned above, been trying to look into the dinput code but it's layers on top of layers of stuff...

Think I found where it's reading the dinput value and converting it to a game value, some reason that conversion only starts giving value above 0 once trigger is half-way but I did see the raw dinput value was being updated before that, so must be something wrong with this conversion code.

(there's also some weird check that the converted value has to be above 30 to register, removing that check didn't really make any difference though since issue seems to be before this, but that's another layer of wtf)

Funny sidenote: dinput uses values in range -32767 - 32768, but the conversion code is dividing by 32786, so could be losing some precision there - not really that easy to patch though since their compiler changed the divide into a weird inverse multiply, don't know how to change that properly yet.


Was able to use Xidi to fix the shared triggers, not sure if this will work for everyone though:

[Mapper]
Type=OutRunMapper

[CustomMapper:OutRunMapper]
Template=XInputNative

[Workarounds]
ActiveVirtualControllerMask=1