don't click here

SADX Input Mod - Fixed XInput & DInput!

Discussion in 'Engineering & Reverse Engineering' started by SF94, Jan 1, 2015.

  1. CheatFreak

    CheatFreak

    Catgirl expert. Member
    Hey, I noticed that on some XInput Controllers- the rumble isn't powerful enough- the mod seems to work okay on the original 360 controller- but on others, like Logitech F710s, the rumble isn't enough to get it to move at all. Would it be possible to have scale number in the xinput.ini that makes the rumble more intense based on the input number?
     
  2. SF94

    SF94

    Tech Member
    Yeah, I can do that. I already have the infrastructure set up anyway, and it would certainly be easier than tuning the rumble to be perfect on all controllers (I only have a (dying) 360 controller and a DS4). I'll add it to my to do list.
     
  3. SF94

    SF94

    Tech Member
    Version 1.6:
    • Implemented configurable rumble multiplier (1.0 by default). Add the field RumbleFactor to your configuration file to change it.
    • Re-implemented per-controller rumble by detecting the enabled state of the controller.
    • Fixed a bug (with a hack1) which caused slow acceleration when running diagonally from a complete stop.
    1 This is implemented by intentionally scaling the axis out of range, then clamping back down to the proper range. The game does this normally to some degree, but I intend to fix the issue ingame which causes the bug in the first place (assuming I can find it). This is configurable if you want to disable it, for example. Just add the ScaleFactor field to your configuration file. The minimum value is 1.0 (disabled, pre-hack behavior), and the default is 1.5 (post-hack default).
     
  4. SF94

    SF94

    Tech Member
    New version time! Before updating, there's a few things you should know. The mod has been renamed, so this will not overwrite the old installation of the mod. I recommend deleting it (after backing up xinput.ini) before continuing. If you have any configuration in xinput.ini, you should grab that, rename it to config.ini and put it somewhere safe. Once you've downloaded the newly named mod, you can place config.ini into the mod's folder and it will load just as it did before. It's also using Visual C++ 2015, so you'll have to grab the new redist (linked in the first post) before it will work.

    Version 1.7:
    • Renamed from 'xinput-mod` to 'input-mod'.
    • Switched from pure XInput to SDL2 for simultaneous DirectInput and XInput usage.
    • Removed analog scale hack and fixed underlying problem.1
    • Allowed use of keyboard/mouse when no controllers are connected.2
    • Increased theoretical maximum number of controllers from 4 (but sometimes 8) to 8.
    • Allowed loading of SDL controller databases for controllers that behave incorrectly.3

    1 The problem as described in the last release seemed to be caused by the way SADX normalizes analog sticks. I've hacked around that and replaced it with the value that's calculated per controller poll which fixes the issue.

    2 When no controllers are connected, the controller polling loop in the mod doesn't run. It lets the original DirectInput polling loop do its thing which allows you to use the keyboard and mouse again. Convenient, but still a cover up for the underlying problem: I need to implement it myself.

    3 Say your right stick is causing the camera to rotate into oblivion, or your triggers make you run, or some other weird thing. You can create an SDL2 controller definition to be loaded by the mod. It looks for 'gamecontrollerdb.txt` in the mod directory. For more information, as well as a great starting point, check out this repo. There's also an example in the Remarks section of this API documentation.

    Edit: Oops. If your mod's folder name is "sadx-input-mod", drop "sadx-" from the name, as that will be how it is from now on.
     
  5. CheatFreak

    CheatFreak

    Catgirl expert. Member
    I don't seem to be able to get rumble to work at all on my F710 still, even setting the rumble multiplier to be like- 5 doesn't seem to have any effect.
    I know the rumble in my controller works, it has a button on the front that vibrates the motors when you press it, (it also turns rumble on/off but that's not the issue here, I always keep rumble on)
    I also tested my rumble with Xpadder and it seems to work fine with that as well.

    Any way we could bugtest this sometime?
    F710s are pretty common gamepads, so not having it work with those is rather annoying, especially because I much prefer it to the standard Xbox 360 pad.

    Edit: After setting the rumble factor to like 50, it now has very slight rumble, and increasing it beyond that seems to do nothing.
     
  6. SF94

    SF94

    Tech Member
    A new version has been released that refactors the way rumble works. I was parsing what was actually the rumble duration as the rumble magnitude which is obviously wrong, but it has now been fixed. It's also leveraging the game's object infrastructure, so I don't have to do any more timer shenanigans. As a result, the rumble is also automatically halted when paused, and resumed when unpaused, which is pretty nice.

    Full changelog and download here (Version 1.8).

    Edit: And yeah, CheatFreak and I did some debugging on IRC. I'm not just ignoring him I swear =P
     
  7. SF94

    SF94

    Tech Member
    Version 1.9 has been released, although it's mostly a compatibility update. It has such features as rumble during cutscenes, rumble enabled by default when you make a new save, minimum rumble time, and "mega rumble", which fires both motors any time a rumble function is called. Click the link for details on these changes. Too lazy to write them here. :v:
     
  8. SF94

    SF94

    Tech Member
    Bugfix update Version 1.9.1 has been released. It removes the CutsceneRumble field because as it turns out, that was actually for demo playback, and fixes some rumble inconsistencies. See the link for more details.
     
  9. BlazeHedgehog

    BlazeHedgehog

    A "Community Enigma"? Oldbie
    1,467
    11
    18
    So I may have run in to a bug, but there's a problem: I don't know how I triggered it, or if it was just a temporary conflict with the other mods I'm using along with the Input Mod.

    https://www.twitch.tv/blazehedgehog/v/111730790?t=59m

    I destroyed all the Kikis driving go-karts in Twinkle Park, but the last one, in the blue kart, hit me before I could kill him. Once I killed him and jumped in his kart, I could not accelerate. Upon pausing and restarting the level, everything worked as it should. Mods I am using, in the order they are listed in the Mod Manager:

    I've tried recreating the conditions and I can't get it to trigger again. For all I know, it might not even be an Input Mod bug!
     
  10. SF94

    SF94

    Tech Member
    Good news: the fact that you could pause and restart means the input mod was working fine.
    Bad news: I have no idea how that happened :v:

    edit: p.s. mipmapped textures mod is no longer necessary since the mod loader can automatically generate mipmaps
     
  11. BlazeHedgehog

    BlazeHedgehog

    A "Community Enigma"? Oldbie
    1,467
    11
    18
    Right, I figured the Mipmap mod didn't do anything once I found the option in the Mod Manager, I just forgot to delete/disable it
     
  12. SF94

    SF94

    Tech Member
    New version.

    The biggest highlight here will likely be keyboard/mouse support for many. Controls for it are still not rebindable, as I just haven't had the motivation to implement it (seeing as I've been sitting on this half-finished stuff for basically a year).

    Download here. Note that it requires the latest MSVC++ redistributable. The main post has been updated with a link.

    Automatic updates have also been enabled, so any quick fixes can be deployed without people having to come check the thread or whatever. :v:

    edit: and would you look at that! I forgot to enable the keyboard by default.