xan1242 / NFS-XtendedInput

NFS (Black Box, MW & newer) - XInput Plugin
MIT License
101 stars 7 forks source link
game-controller game-input game-mod need-for-speed nfs-carbon nfs-most-wanted nfs-pro-street nfs-prostreet nfs-undercover nfs-world xinput

Need for Speed (MW & newer) - Xtended Input

This is a plugin for NFS games by Black Box (MW and newer only) which brings XInput support to the games!

Currently a work in progress, but fully usable and playable!

(NFS World currently at ALPHA stage!)

Also available for Underground and Underground 2 here

Features

Button mappings & configuration

NOTE: If the remaps don't have any effect, either disable UAC virtualization or run the game as Administrator!

You may remap the buttons in the NFS_XtendedInput.usermap.ini file found inside the scripts\XtendedInputMaps\<your save name> folder.

For secondary maps, use the sections [Events_Secondary] for gamepads and [EventsKB_Secondary] for keyboards.

Refer to the EventReference.txt file to see what's available.

(PROSTREET ONLY) You may also freely remap inside the game's settings menu. This feature will become available in other games soon.

You can configure other settings (such as deadzones, omni mode, etc.) in the NFS_XtendedInput.ini file found inside the scripts folder.

NFS_XtendedInput.default.ini contains default mappings for when a new profile is created or settings reset to default in the remap menu.

(MW ONLY) You cannot enter the "Controls" settings menu as it currently crashes the game, therefore it has been disabled. If you need to access it, disable this plugin.

The button remaps will change the textures as well according to what you set it to (only for gamepads).

Default mapping follows the Xbox 360 version of the games.

Default controller button mappings are:

Ingame

(Carbon only)

(Pro Street only)

One note about the World Map screen: during this screen and only then, you can control the mouse cursor with the right analog stick (and click with the Left shoulder button). If you're using the OS mouse, it will take control of it (and subequently confine the mouse wihin the game window).

FrontEnd

Please note that some menus may not advertise their functions properly, but they should be fully functional and controllable like in the console versions.

Debug camera

You must use a controller on the second port to use it. Invoke it with a debug camera plugin like Extra Options.

Keyboard controls

They're slightly changed from default.

By default it'll use GetAsyncKeyState (unbuffered) to read keys which might cause some issues with other hooks to the WndProc of this game, but will deliver the most optimal performance. A key's status is being read as it's being scanned in this mode.

Second mode is GetKeyboardState (buffered). This will store all keys in a buffer and read them during InputDevice::PollDevice() (which starts right before eDisplayFrame). Use this if you have some issues.

Ingame

(Carbon only)

(Pro Street only)

FrontEnd

They should be identical to the default game, with one exception: the navigation keys do not control the camera anymore. They were moved to their own buttons.

Debug camera

Windows 7 compatibility

To use in Windows 7 (and maybe Vista & XP), you need to use the "Win7" builds.

Requirements are:

This was tested on a Pentium 3 machine running Windows 7 and it is fully working.

These builds are made with SSE instructions enabled (and other extensions disabled), so it should also work on Athlon XP as well.

The release package comes with a special build of ASI loader which is made without any CPU extensions required. It is also patched to work in Windows XP.

These builds may or may not work in Windows XP with some hacks, YMMV as it wasn't tested. Follow the instructions found here to find out more. TLDR: "The last version of the Visual C++ Redistributable that works on Windows XP shipped in Visual Studio 2019 version 16.7 (file versions starting with 14.27)."

TODO list:

Credits