Ori and the Blind Forest

Ori and the Blind Forest

Vis statistikk:
BLiTZ 3. juli 2015 kl. 17.39
[Tool] Remap controller buttons on non-XBOX gamepads
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

  • Download JoystickTest application[www.planetpointy.co.uk]
  • Go to https://github.com/beatcracker/Ori-Controller-Remap
  • In the bottom right corner click Download ZIP
  • Unblock ZIP file[blogs.msdn.microsoft.com] before unpacking
  • Unpack downloaded ZIP file
  • Go to the Ori-Controller-Remap-master folder
  • 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).
  • Run JoystickTest application
  • Punch buttons on your controller, note their numbers in JoystickTest, edit ini file accordingly
  • Replace Your Controller Name with any text you like (your controller name, your pet name, your maiden name - it's all up to you).
  • Save Ori_Controller_Remap.ini file
  • Double-click Ori_Controller_Remap.cmd file, it will launch PowerShell script
  • When asked, select configuration you've edited earlier in the ini file
  • Press any key and wait for script to patch your Ori with new controller mapping

How to remove patch

  • Go to the Ori instalation directory
    • Steam: right-click game in library → Properties → Local files → Browse local files
  • Go to the ori_Data\Managed folder
  • Delete Assembly-CSharp.dll
  • Rename Assembly-CSharp.dll.bak to Assembly-CSharp.dll
— Or —
  • Right-click game in library → Properties → Local files → Verify integrity of game cache

Troubleshooting

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[www.microsoft.com]

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[joytokey.net].
  • 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[github.com] 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[github.com], so I can update my script with it.
Sist redigert av BLiTZ; 15. juli 2017 kl. 4.17
< >
Viser 1630 av 69 kommentarer
Daedalos 29. juli 2015 kl. 4.44 
Unblocking the zip did the trick. Thanks for the help :)
Andrellibus 12. aug. 2015 kl. 4.25 
I used this with win7 and it worked flawlessly but i'm having a problem with win10, basically the A button that is used by default to jump also shoot, and the D-pad doesn't work correctly (when i press left ori crouchs)
Sist redigert av Andrellibus; 12. aug. 2015 kl. 10.56
lnterceptor 13. aug. 2015 kl. 5.29 
Thank you for this amazing PS script ! I found it last night on PCWiki after many hours of searching and honestly you made me hit that Purchase button in the Store.

There is no way I'm using the (subjectively) terrible Xbox design when there are perfectly fine controllers out there that last a lifetime. Once again thank you for this :) I hope the Devs are able to incorporate this into the game because it truly is a neccesity to have somewhat customizable controls.

This is the one I use for the Nintendo Classic Controller Pro.
It's basically the same as the generic one you put in except I put RStick on the 'home' button since the CCPro doesn't have a RStick button (LStick is supposed to be on this button but I have yet to find use for it so I took it out. RStick however can be used to activate a cheat code so if anyone wanted to try that, you can now)

[Classic Pro]
A = 2
B = 1
X = 3
Y = 4
LShoulder = 5
LStick = 12
LTrigger = 7
RTrigger = 8
RStick = 11
RShoulder = 6
Select = 9
Start = 10


Also for anyone wondering, currently you cannot rebind the RTrigger button (at least I couldn't and I read online that others are unable to either). Best way to solve this is just to download Joy2Key http://joytokey.net/download/JoyToKey_en.zip, open this 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)


A question to you OP would be, is there any way to remap the D-Pad using this Powershell ? When I tried x360ce it would reocgnize my controller but was unable to map the controls, however the D-Pad worked fine and that is not the case anymore after applying your reconfiguration. Is there any way to make this work again ? I come from games like Super Metroid so D-Pad movement for platforming is something that I'd really love.
BLiTZ 13. aug. 2015 kl. 10.52 
Opprinnelig skrevet av Andrellibus:
I used this with win7 and it worked flawlessly but i'm having a problem with win10, basically the A button that is used by default to jump also shoot, and the D-pad doesn't work correctly (when i press left ori crouchs)
Check if your gamedpad's button numbers are the same as they were in Windows 7 (use JoystickTest app). If they're not, just edit ini file again and reapply script.
BLiTZ 13. aug. 2015 kl. 11.19 
Opprinnelig skrevet av lnterceptor:
A question to you OP would be, is there any way to remap the D-Pad using this Powershell ? When I tried x360ce it would reocgnize my controller but was unable to map the controls, however the D-Pad worked fine and that is not the case anymore after applying your reconfiguration. Is there any way to make this work again ? I come from games like Super Metroid so D-Pad movement for platforming is something that I'd really love.
I'm not familiar with your controller, so let me clarify:
  1. Without x360ce, you're only able to use left analog stick for movement, not D-Pad. My patch fixes other buttons, but D-Pad doesn't work.
  2. With x360ce, D-Pad works, but you can't remap anything else.
Is this correct?

If you run JoystickTest and press D-Pad, does it detects it as "Hat Switches" (upper right corner of the app) or it detects it as numbered buttons? My best guess is that your controller's D-Pad is presented to OS as a set of buttons, not axes. I can probably make a custom patch for you if this is the case.

Also, you can try this fix with x360ce. It disables RawInput and fixes Ori's XInput mappings:
  1. Download fix.
  2. Rename Assembly-CSharp.dll to Assembly-CSharp.patch
  3. Edit Patch.bat so the second line is: xdelta3.exe -f -d -s Assembly-CSharp.patch ori-controller-patch.xdelta Assembly-CSharp.dll
  4. Run Patch.bat

P.S. Thanks for INI file, I'll add it to the script.
Sist redigert av BLiTZ; 13. aug. 2015 kl. 11.21
lnterceptor 13. aug. 2015 kl. 13.26 
Opprinnelig skrevet av BLiTZ:

I'm not familiar with your controller, so let me clarify:
  1. Without x360ce, you're only able to use left analog stick for movement, not D-Pad. My patch fixes other buttons, but D-Pad doesn't work.
  2. With x360ce, D-Pad works, but you can't remap anything else.
Is this correct?
Without x360ce I dont think anything worked iirc. After putting x360ce in the folder it started responding to input but it was set to default and I couldn't change anything despite my efforts in x360ce.

I was able to move with D-Pad back then.

After your update everything works as intended except D-Pad left and right no longer work. D-Pad Down corresponds to D-Pad Left and D-Pad Up responds to D-Pad Right

Opprinnelig skrevet av BLiTZ:
If you run JoystickTest and press D-Pad, does it detects it as "Hat Switches" (upper right corner of the app) or it detects it as numbered buttons? My best guess is that your controller's D-Pad is presented to OS as a set of buttons, not axes.

It appears to be both ? This is what it shows http://i.imgur.com/VubIrIo.png




Opprinnelig skrevet av BLiTZ:
Also, you can try this fix with x360ce. It disables RawInput and fixes Ori's XInput mappings:
  1. Download fix.
  2. Rename Assembly-CSharp.dll to Assembly-CSharp.patch
  3. Edit Patch.bat so the second line is: xdelta3.exe -f -d -s Assembly-CSharp.patch ori-controller-patch.xdelta Assembly-CSharp.dll
  4. Run Patch.bat

When I try to apply the patch I get this error http://i.imgur.com/gFhsqA5.png (I also tried putting the patch files and edited Assembly-CSharp.patch file in the "Managed" folder but had the same result)


Either way thanks again for your efforts !
Sist redigert av lnterceptor; 13. aug. 2015 kl. 13.28
BLiTZ 13. aug. 2015 kl. 14.00 
Opprinnelig skrevet av lnterceptor:
It appears to be both ? This is what it shows http://i.imgur.com/VubIrIo.png
Yep, that's uncommon. I have to think about this.
Opprinnelig skrevet av lnterceptor:
When I try to apply the patch I get this error http://i.imgur.com/gFhsqA5.png
Make sure that you're using original Assembly-CSharp.dll, and not one that is already patched by my script. Restore it from script's backup (Assembly-CSharp.dll.bak).
lnterceptor 13. aug. 2015 kl. 14.27 
Opprinnelig skrevet av BLiTZ:
Make sure that you're using original Assembly-CSharp.dll, and not one that is already patched by my script. Restore it from script's backup (Assembly-CSharp.dll.bak).

Ahh yes that did it. However none of the input works using this except the left analoge stick.

Thanks for thinking about this situation and you really don't have to spend too much time trying to figure it out haha ! I'm already very happy just having proper buttons now :)
Sist redigert av lnterceptor; 13. aug. 2015 kl. 14.28
Ishiirou 28. aug. 2015 kl. 8.46 
Thanks a lot for this.
But, it only partially worked. I can't use right trigger at all. No matter what I do or how I set my buttons, the game ITSELF does not have a right trigger.
I even changed it to where A/B/Y/X normally are, thinking my controller may be broken (it isn't) but that makes no difference.

No matter what I do or what I press, the game does not accept me pressing right trigger, and thus I continue being stuck at the beginnign when you first have to move a rock.
Gilneyhuskie 17. sep. 2015 kl. 14.50 
I've got the message "WARNING: Can''t load Mono.Cecil.Reflexil.dll"

I've edited the .ini according to my controller. Its an Twin USB Joystick (PSX/PS2 Controllers USB for PC adapter), but when I use the "Ori_Controller_Remap.cmd" I receive the above message. Please, if anyone could make the file for me, here's the configuration:

[Twin USB Joystick]
A = 3
B = 2
X = 4
Y = 1
LShoulder = 7
LStick = 11
LTrigger = 5
RTrigger = 6
RStick = 12
RShoulder = 8
Select = 9
Start = 10

Thanks in advance. ;)
BLiTZ 17. sep. 2015 kl. 15.44 
Opprinnelig skrevet av huskie:
I've got the message "WARNING: Can''t load Mono.Cecil.Reflexil.dll"
Try to unblock ZIP file[blogs.msdn.com] before unpacking.
Gilneyhuskie 17. sep. 2015 kl. 16.14 
I managed to apply the patch downloading some missing DLL's, but the only thing that doesn't work it's the L&R trigger (for charge jump and to use the Koro's feather). It's still on Right analog Up (RTrigger) and Down (LTrigger). :(

The A, B, X, Y, Select and Start buttons are ok now.
Sist redigert av Gilneyhuskie; 17. sep. 2015 kl. 16.29
Stormspark 20. sep. 2015 kl. 16.37 
Opprinnelig skrevet av BLiTZ:
Opprinnelig skrevet av #sixty:
How safe is this to use?
Could you elaborate, what are you meaning by "safe"? This is a PowerShell script, so 99% of the code is free for anyone to look into. I had to use Mono.Cecil.Reflexil.dll for the 1% percent part, but it's code available too[github.com]. There is no malicious code in this tool.

If you're asking about VAC, then it's safe - Ori doesn't use it (check it's SteamDB page[steamdb.info]). I've played about six hours with this patch, and made a lot of hex-editing during it's development and everything is fine.

Will this let you use an Xbox One controller? Right now this game only works with x360 controllers.
Ori 23. sep. 2015 kl. 7.33 
The tool made the action buttons work fine, however I still have the problem with the triggers not having a response mapped (Right stick Axis-X zooms in and out of map and use actions while triggers don't). I read it may have something to do with NVIDIA Shadowplay and requires a restart, so I'll check later and edit this post accordingly.

Config:

[Knup KP-3121 USB Joystick]
A = 3
B = 2
X = 4
Y = 1
LShoulder = 5
LStick = 11
LTrigger = 7
RTrigger = 8
RStick = 12
RShoulder = 6
Select = 9
Start = 10

EDIT: Looks like restarting doesn't really help with the axis issues. Hm. I guess this already helps a lot though.
Sist redigert av Ori; 30. sep. 2015 kl. 15.06
BLiTZ 23. sep. 2015 kl. 16.06 
Opprinnelig skrevet av Saerydoth:
ill this let you use an Xbox One controller? Right now this game only works with x360 controllers.
I'm not sure, it depends on the controller/driver combo. What issues do you have with Xbox One controller, i.e.:
  • Does Ori detects Xbox One controller at all?
  • Is buttons/axes assigment wrong?
Sist redigert av BLiTZ; 23. sep. 2015 kl. 16.06
< >
Viser 1630 av 69 kommentarer
Per side: 1530 50

Dato lagt ut: 3. juli 2015 kl. 17.39
Innlegg: 69