Menkaura81 / Anyshift

A python app to convert joystick inputs into key strokes so you can play vintage driving games with a H-Shifter
GNU General Public License v3.0
3 stars 0 forks source link

Doesn't work in Need for Speed: Porsche Unleashed + unampped controller buttons sending keystrokes #4

Closed itais closed 3 months ago

itais commented 3 months ago

Happy to find this clever software. Unfortunately, it doesn't work for me in Need for Speed: Porsche Unleashed. The keystrokes are not detected by the game. Works fine while testing in notepad.

Menkaura81 commented 3 months ago

I´m going to install the game and see if i can find a solution.

Menkaura81 commented 3 months ago

I got it working with NFS Porsche. I used the version of the game provided by this reddit post (I don´t personaly know the creator of the repack, also don´t support him on anyway): https://www.reddit.com/r/abandonware/comments/1774km2/need_for_speed_5_porsche_unleashed_download_link/?share_id=UUA8Qf6m28E7iRoKr4hIA

The game is a little bit unstable, but when working well, anyshift works ok. I had to reset to default the controls because at first try they were not working (even when trying to change gears with the keyboard), also you have to set gearbox to manual before enter the race.

These are my Anyshift settings (detect neutral is important to be marked, and also set 'a' for upshifts because default Anyshift value is 's') image

itais commented 3 months ago

I've matched your Anyshift settings, reset the game's controls to keyboard defaults and still Anyshift's keystrokes are not detected by the game. When I manually press a/z the game shifts as expected.

I may be running a different version than you are. I am using Verok's patch on top a retail copy of the game. Compared to the repack you linked to, nfs5.exe is identical (I checked CRC) so it appears to be using the same patch. However porsche.exe is not identical - though I'm not sure it used.

Side note: For compatibility with modern controllers I normally use dinput8 and devreorder, but I disabled them to make sure there's no conflict with Anyshift. Ahh, the joys of getting old games to run with modern hardware :) It is stable however in this configuration and runs beautifully.

itais commented 3 months ago

I got it to work :) Anyshift needed to run in Administrator mode, I assume since I run the game as Administrator mode as well (this is needed for the game patch). Edit: I granted my user write permission to the game's folder so Administrator mode isn't needed anymore for both the game and Anyshift.

Also, a possible bug: If "Detect Neutral" is active and I press any button on the shifting controller which is not mapped in Anyshift to a shifting action, Anyshift sends some gear up/down keystrokes. If "Detect Neutral" is disabled these keystrokes are not sent, however if "Clutch" is active the "miss shift" sounds still play when pressing one of those buttons.

Menkaura81 commented 3 months ago

I´m really happy that you get it to work. NFS Porsche was one of the games Anyshift was aimed to.

I don´t own a shifter with buttons for testing, but I will modify source code trying to fix it. Thank you!

Menkaura81 commented 3 months ago

Release an updated version. I think the bug of miss shift sounds playing when pressing buttons not mapped to a shifting action must be corrected. Also updated the profiles for some games with better values. The "Detect Neutral" bug will take more time to fix. As i told you i can´t test the updates as i don´t own a shiter with extra buttons, so please give it a try and report.

Thank you.

itais commented 3 months ago

Thanks. Yeah, NFS Porsche is magical, especially with a shifter for the first time ever :)

So with version 1.0.7 the unmapped buttons issue is not fixed: Detect Neutral disabled, Clutch disabled: No issues. Detect Neutral enabled, Clutch disabled: When not in neutral and pressing any button on the shifting controller which is not mapped in Anyshift to a shifting action, Anyshift sends gear down keystrokes which shift to neutral. Detect Neutral enabled, Clutch enabled: Same, with gear grinding sounds if clutch is not depressed. Detect Neutral disabled, Clutch enabled: When not in neutral and pressing any button on the shifting controller which is not mapped in Anyshift to a shifting action, gear grinding sounds play (no keystrokes are sent)

If you don't have extra buttons on the shifter maybe you could try to "un-map" one of the gears or re-map two gears to the same position? This should give you an unmapped "button" for testing.

.

Menkaura81 commented 3 months ago

Thank you for your testing. New release uploaded, i think i hunted the bug this time. Can you give it a try, please?.

itais commented 3 months ago

The unmapped buttons issue is now fixed while in gear. However, if Clutch is enabled, while the shifter is in neutral, pressing any button on the shifting controller which is not mapped in Anyshift to a shifting action, causes gear grinding sounds to play. No keystrokes are actually sent. This happens regardless of the state of Detect Neutral.

Menkaura81 commented 3 months ago

I think it´s all fixed now. I´m going to release the fixed version. Hope works fine for you

itais commented 3 months ago

Version 1.0.9 indeed fixed all the unampped buttons issues. Thank you :)