OutRun2006Tweaks icon indicating copy to clipboard operation
OutRun2006Tweaks copied to clipboard

[Bug] Car "backfire" effect missing when using controllers

Open lance8765 opened this issue 1 year ago • 12 comments

I apologize in advance since the only evidence of this bug is from the FXT forums, but a real solution was never implemented as it was reported probably years after the author stopped working on it.

Basically, the cars are missing the backfire effect when upshitting using controllers. It's not missing when playing with a keyboard.

This issue happens on both vanilla and modded versions of the game.

Apparently, it's a bug related to the use of Direct Input devices. Using external programs such as XInput Plus fixes the issue. Or, as the other person said, by assigning accelerate/brake to face buttons (not triggers)

I wonder if there's a way to fix this issue without having to use external programs and/or without having to reassign the controls.

lance8765 avatar Jun 12 '24 09:06 lance8765

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

emoose avatar Jun 19 '24 10:06 emoose

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

DonelBueno avatar Jun 19 '24 13:06 DonelBueno

@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 avatar Jun 20 '24 05:06 emoose

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 avatar Jun 20 '24 11:06 emoose

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 avatar Jun 20 '24 18:06 emoose

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

emoose avatar Jun 20 '24 18:06 emoose

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.

Dekaid0011 avatar Jul 06 '24 12:07 Dekaid0011

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:

  • rename tweaks dinput8.dll to winmm.dll
  • extract xidi Win32\dinput8.dll file to game folder
  • create xidi.ini with the following
[Mapper]
Type=OutRunMapper

[CustomMapper:OutRunMapper]
Template=XInputNative

[Workarounds]
ActiveVirtualControllerMask=1
  • open OutRun2006Tweaks.ini, set ControllerHotPlug to false
  • run game, start race
  • at this point the accelerator pedal should be stuck, pressing LT will decelerate and apply brake at the same time
  • pause game > controls > configuration
  • the first page should be Xidi Virtual Controller, and it should list Accelerate Axis/Brake Axis/etc
  • move down to Accelerate axis, press A, then press/release RT a few times until it mentions "will be assigned to: Axis 2 Z", then press A
  • when it asks for minimum/rest position, press RT and release it a few times, until the bars are empty, then press A
  • when it asks for maximum/full, press RT and release, then hold RT until bars fill, then press A
  • do the same for Brake Axis
  • once Accelerate & Brake are set, press B to exit out, then see if triggers work ingame

emoose avatar Aug 24 '24 16:08 emoose