Skip to content
This repository has been archived by the owner on Feb 7, 2021. It is now read-only.

It's almost impossible to play Ori and the Blind Forest with non-XBOX gamepad: all buttons are messed up and Unity's built-in remapper doesn't work properly (you can't rebind jump button). This tool is intended to fix it.

Notifications You must be signed in to change notification settings

beatcracker/Ori-Controller-Remap

Repository files navigation

⚠️ Please note that Ori and the Blind Forest: Definitive Edition supports native controller remapping. Use this tool only if you have original, non-Definitive edition.


Info

As many of you know it's almost impossible to play Ori with non-XBOX gamepad: all buttons are messed up and Unity's built-in remapper doesn't work properly (you can't rebind jump button). This tool is intended to fix it.

How it works

The included PowerShell script will replace a part of the Ori's code contained in the Assembly-CSharp.dll file. This new code will query the Unity engine for the remapped buttons, instead of original ones, requested by game.

Technical details

The modfied code is in the MoonInput.GetButton(string buttonName) method in the Assembly-CSharp.dll.

Original:

public static bool GetButton(string buttonName)
{
    return Input.GetButton(buttonName);
}

Patched:

public static bool GetButton(string buttonName)
{
    // array of the remapped button's numbers, generated by PS1 script from ini file
    string[] strArray = new string[] { "1", "2", "0", "3", "4", "5", "8", "9", "10", "11", "6", "7" };
    Match match = Regex.Match(buttonName, @"^(Joystick\dButton)([0-9]|1[0-1])$", RegexOptions.Singleline);
    if (match.Success)
    {
        return Input.GetButton(match.Groups[1].Value + strArray[int.Parse(match.Groups[2].Value)]);
    }
    return Input.GetButton(buttonName);
}

How to apply patch

  1. Download JoystickTest application
  2. Go to https://github.com/beatcracker/Ori-Controller-Remap
  3. In the bottom right corner click Download ZIP
  4. Unblock ZIP file before unpacking
  5. Unpack downloaded ZIP file
  6. Go to the Ori-Controller-Remap-master folder
  7. Open Ori_Controller_Remap.ini file in Notepad. This file contains controller button mappings for known controllers (Cyborg Rumble Pad, Logitech Dual Action, etc.) and one for you to edit (Your Controller Name).
  8. Run JoystickTest application
  9. Punch buttons on your controller, note their numbers in JoystickTest, edit ini file accordingly
  10. Replace Your Controller Name with any text you like (your controller name, your pet name, your maiden name - it's all up to you).
  11. Save Ori_Controller_Remap.ini file
  12. Double-click Ori_Controller_Remap.cmd file, it will launch PowerShell script
  13. When asked, select configuration you've edited earlier in the ini file
  14. Press any key and wait for script to patch your Ori with new controller mapping

How to remove patch

  1. Go to the Ori instalation directory
    • Steam: right-click game in library → Properties → Local files → Browse local files
  2. Go to the ori_Data\Managed folder
  3. Delete Assembly-CSharp.dll
  4. Rename Assembly-CSharp.dll.bak to Assembly-CSharp.dll

— Or —

  1. Right-click game in library → Properties → Local files → Verify integrity of game cache

Troubleshooting


Q: I've got a red text message saying : Can't load Mono.Cecil.Reflexil.dll, press any key to exit...

A: Unblock ZIP file before unpacking


Q: I've got a red text message saying: Compiler executable file csc.exe cannot be found.

A: You have to install .Net Framework 3.5. For Windows 7 and higher you can do this via Windows GUI or command line:

Command line
  • Run cmd.exe or PowerShell.exe as Administrator
  • Copy/Paste text below and press Enter:
  • DISM /Online /Enable-Feature /FeatureName:NetFx3 /All
Windows GUI
  • Press Windows Logo + R keys on the keyboard.
  • Type appwiz.cpl in the Run command box and press ENTER.
  • In the Programs and Features window, click on the link Turn Windows features on or off.
  • Check if the .NET Framework 3.5 (includes .NET 2.0 and 3.0) option is available in it.
  • If yes, then enable it and then click on OK.
  • Follow the on-screen instructions to complete the installation and restart the computer, if prompted.

For Windows Vista and below you have to install it from Microsoft website: Microsoft .NET Framework 3.5 Service Pack 1


Q: Script worked for other buttons, but I stil can't use Triggers on my gamepad

A: I don't know why it happens, but some users reported that this could be fixed by using JoyToKey.

  • Quote from Steam user Interceptor: Open JoyToKey program and hit the RTrigger button on your controller, it will light up the corresponding line in Joy2Key where you can click this specific button and assign it to Shift on your keyboard. So essentially when you're pressing that button on your controller you're holding the shift button on your keyboard (and thus allowing you to grab/slide)

Q: I've changed input settings in Unity's built-in remapper (held Shift while starting Ori), but now I want to reset it to default. How can I do it? There's no option to reset.

A: Just delete all keys starting with __Input in this registry key: HKEY_CURRENT_USER\Software\Microsoft Studios\Ori And The Blind Forest.


Q: Script can't find my Ori installation (Assembly-CSharp.dll file)

A: Are you running non-Steam version of Ori? Script uses registry keys created by Steam to locate Ori installation folder. If it can't find it, it looks for the required files in the script folder. So you have to copy those files in the script folder:

  • Assembly-CSharp.dll
  • mscorlib.dll
  • System.dll
  • UnityEngine.dll

Those files are located in the X:\Ori_Installation_Directory\ori_Data\Managed\. After the patch, you have to copy and replace Assembly-CSharp.dll file back to ther Ori installation folder. Three other files are required to build the patch code, but not modfied.


Q: Script doesn't work, produces red text and warnings not mentioned above, etc.

A: Run script, right-click window title, select Edit->Select All, press Enter. This will copy all text on screen. Then post it to the Steam Community or GitHub issues and I'll try to help you.

Final note

If the tool works for you, please, post your Ori_Controller_Remap.ini file and controller name to the Steam Community or GitHub issues, so I can update my script with it.

About

It's almost impossible to play Ori and the Blind Forest with non-XBOX gamepad: all buttons are messed up and Unity's built-in remapper doesn't work properly (you can't rebind jump button). This tool is intended to fix it.

Topics

Resources

Stars

Watchers

Forks