Xbox 360 Controller Support

krightonkrighton Posts: 41
edited April 2014 in Mod Showcase
Torchlight II Gamepad Software: XInput Mapper

First things first, here's the software. A detailed description with usage and configuration instructions follows.

Download Current Version (1.2.2)

Last updated: 03.05.2013
* Fixed an issue that sometimes caused the player to stop moving after attacking.

About:

XInput Mapper (for lack of a better name), is an application written solely for the purpose of enabling Xbox 360 support for Torchlight II. I may extend this to support other games in the future, hence the generic name.

The original purpose and motivation behind this was to allow my 7 year old son to play the game with me, as he's much more comfortable using a gamepad than a keyboard and mouse. I looked into using existing third party apps, such as xpadder and a few others, but they either did not do everything I wanted them to or they were too complex to set up. I decided it would be easier to start from scratch and roll my own.

This is a stand-alone tool written exclusively for Torchlight II, which means I'm able to tweak more than you normally could using more generic controller mapping software. I've also provided a default (and customizable) configuration out of the box. Just launch the app (it sits in the system tray - no UI) and your Xbox360 controller is ready to use.

There is nothing magic or dangerous about this application, it simply intercepts gamepad events and forwards them to the Torchlight II window as input events.

Installation:

Simply unzip to a directory of your choice and run XInputMapper. Connect your Xbox controller and that's all there is to it.

The zip contains the following files:
  1. XInputMapper.exe - the application
  2. t2.mappings - controller mapping configuration
  3. t2mappings.jpg - an image of the default mapping configuration
  4. changelog.txt - revision history

Configuration:

The t2.mappings file contains all of the configurable controller mappings. If you open this file with a text editor (i.e. notepad), you can read descriptions of all supported configuration options. If you change this file, simply restart XInputMapper for the changes to take effect.

The default controller mappings are shown below. These went through a few iterations and I'm fairly happy with the current mappings. Almost every action in the game is mapped, including 8 of the 10 quickslots. There are actually a few unused button combinations that I didn't bother mapping with this default configuration (such as DPad+Modifier), so you could easily map any remaining actions to them if you like.

vbdownloads.php?do=file&action=screenshot&screenshotid=1883&d=1365323616

Tips and Troubleshooting:
  • If your controller is not working at all in Torchlight II, chances are that Torchlight II is running at a higher privilege level than XInputMapper. The easiest way to fix this is to run XInputMapper.exe as Administrator.
  • If the left analog stick is not moving your player (or if any other default controls are not working), most likely there was no key mappings file for XInputMapper to parse. Try going into Settings->Controls within Torchlight II and clicking the green checkmark (accept button). This forces creation of your KeyBindings.dat within the Torchlight II save folder. Restart XInputMapper or select the 'Refresh Mappings' menu option to (hopefully) resolve your problems.
  • If you get an error when starting XInput Mapper stating "Unable to load Torchlight II key bindings (failed to lookup Documents folder)", try manually specifying the path to your Torchlight II "save" folder via the T2SavePath option in t2.mappings.
  • The default player control mappings (which rely on a 'move circle' in the middle of the screen) assume a fully zoomed out camera. This will be just fine for most players. However, if you decide to change the camera zoom, the move circle size may need to be increased for movement to work smoothly. You can update the default move circle size by changing the 'MoveCircleSize' setting in t2.mappings. You can also update the move circle size on the fly while playing, using the 'Set Move Circle' and 'Reset Move Circle' actions (see controller image above for default mappings).
  • If you change your control settings from within Torchlight II or your t2.mappings file while XInputMapper is running, right click the system tray icon and select 'Refresh Mappings' to have the tool pick up your changes.
  • XInputMapper will currently only work with Torchlight II when the game is on your primary monitor.
  • Use the Quickbar for your most frequently used attacks and skills, since the buttons are easier to press. Assign less frequently used skills to the left and right shoulder buttons (Left and Right mouse buttons in default T2 controls).

Changelog:

* See download link above for changelog.

Please post any bugs or feedback.

-Krighton
«1345

Comments

  • i like what the left trigger does, amazing work men, much better than xpadder and all that kind f software.

    anyway, its only playable in easy or normal, or maybe veteran but with A LOT of practice...

    ps: if u need inspiration look how ascaron games port Sacred 2 to the xbox 360, amazing port and control use i must say
  • Hi like this so far the only thing i was wondering is my quick slots wont work for some reason, and is there a way to speed up the mouse movement on the right stick? thank you
  • ZiddersZidders Posts: 14,342 ✭✭✭
    Wow..so, this is fantastic but my main question is, is there a way you can maybe make a video showing how this all works? Not featuring your son, of course but i'm curious as to how well this works with the interface and especially the hotbar. I believe that the game is already pretty controller friendly-much of their current UI work came about because of work they'd done on Torchlights Xbox port but there are still a lot of gamepad-unfriendly features, I would think?
    ItfooQF.png
  • Hi like this so far the only thing i was wondering is my quick slots wont work for some reason, and is there a way to speed up the mouse movement on the right stick? thank you

    Did you enable the quickslot mappings in the t2.mappings file? If so and it still doesn't work, I might have missed testing these. I'll take a look when I get home tonight and upload a new version if they are broken.

    For the right stick. you can change up the sensitivity by changing the "CursorSensitivityX" and "CursorSensitivityY" settings in the t2.mappings file.
  • Zidders wrote:
    Wow..so, this is fantastic but my main question is, is there a way you can maybe make a video showing how this all works? Not featuring your son, of course but i'm curious as to how well this works with the interface and especially the hotbar. I believe that the game is already pretty controller friendly-much of their current UI work came about because of work they'd done on Torchlights Xbox port but there are still a lot of gamepad-unfriendly features, I would think?

    I considered making a video - I'll look into it.

    FWIW, my son and I have put in about 20-30 hours of co-op so far. He's been using the controller exclusively during this time and he's been really happy with it. TBH, I still play with a keyboard/mouse, but that has more to do with the fact that I'm just a keyboard/mouse kind of guy (I'm a programmer, what can I say)...

    Also, after playing the game more, I've come to the realization that I would probably put more emphasis on mapping quickslots instead of some of the more infrequently used actions that are currently mapped. Thankfully this is configurable, so anyone can make this mapping change to suit their play style. At any rate, I'll consider making that video.
  • PorshaPorsha Posts: 97
    This honestly just made my day. I'm a console player at heart. While I love Torchlight 2 it was a dagger through my heart when I read they wouldn't support an Xbox controller especially after Torchlight was such a big hit on Xbox Live Arcade (and worked better with a controller IMO). Funny enough, Blizzard was also quoted as saying D3 plays as good or better with a controller.

    For me personally, I hate working on a PC all day and then having to come home to "relax" on a KB/Mouse. No thank you.


    Can't wait to try this out. Thanks again!!!!
  • Thanks for doing this, I'll be sure to try it out soon to give feedback.
    背景音楽主義
    !jrpg
  • I've updated the OP with more a more detailed description and structure, which I can update as I make changes.

    There's also a new version for download that includes support for many more actions by default, including most of the Quickslots.
  • 0x442E472E0x442E472E Posts: 23
    edited December 2012
    Well, maybe i should have advertised my own tool better
    T2Gamepad - Play T2 with a gamepad!
  • "Awesome! Maybe not suited for Elite, but sure worth checking out to see how it... oh, wait, my Razer Onza's analog sticks are not working right." :|||

    From the looks of it (as I can't test), great job there. I'm gonna try it out as soon as I get my Onza fixed (riiiight...) or get a new gamepad :)
    "Welp, we're boned!"
    --Bender the Robot
  • Super nice of you to post all that info. And I mean no offense by this by why would someone want to go to all that hassle just to play the game with an inferior control scheme? Seems odd to me but each to their own, I guess.
  • Wytefang wrote:
    Super nice of you to post all that info. And I mean no offense by this by why would someone want to go to all that hassle just to play the game with an inferior control scheme? Seems odd to me but each to their own, I guess.

    As mentioned above, I went to all the hassle so my kid could play the game. Personally, I still play with a keyboard and mouse, although I do enjoy messing around with the controller from time to time as I can just sit back and relax while playing the game on an easier difficulty setting.
  • D'oh! Shoulda read more carefully. Very nice of you to do that, though! :)

    I just always prefer K/M for RPGs on PC. So much easier to manage inventory and such.
  • I wanted to let you know that I've been loving your app, and I've passed it around to friends on F-Book.

    I am curious if there is a way to disable the zoom functions for the camera and map? Those ones get accidentally modified when I'm Alt+Pressing. It's a small issue, but I can't seem to find a way to disable/change it.
  • Anyone having any success in getting this to work? It doesn't seem to recognize my controller at all. It's a generic GameStop Xbox controller.
    EAA3n.jpg
  • I wanted to let you know that I've been loving your app, and I've passed it around to friends on F-Book.

    I am curious if there is a way to disable the zoom functions for the camera and map? Those ones get accidentally modified when I'm Alt+Pressing. It's a small issue, but I can't seem to find a way to disable/change it.

    Glad to hear you're liking it.

    I've uploaded a new version (1.1.2) that adds support for two new config settings: ZoomCameraEnabled and ZoomMapEnabled. You can find them in the t2.mappings file - they are still on by default. Set them both to "0" to disable it.
  • Drascoll wrote:
    Anyone having any success in getting this to work? It doesn't seem to recognize my controller at all. It's a generic GameStop Xbox controller.

    I only have official MS xbox controllers, although I don't see why yours would not work.

    Is it wired or wireless? And does it work fine with other xbox 360 controller enabled windows games? I could possibly add some logging to help troubleshoot the issue (to see if the issue is your controller not being recognized, or if it's something else about your setup).
  • wired, the driver show's up as "Xbox 360 controller for Windows" in my Device Manager. It works fine with all games that support game pads.
    EAA3n.jpg
  • Drascoll wrote:
    wired, the driver show's up as "Xbox 360 controller for Windows" in my Device Manager. It works fine with all games that support game pads.

    Turned out to be a permissions issue for those who also encounter this problem.

    It was fixed by running the app in Administrator mode. I've updated the post and included a troubleshooting menu option in the app now with this information.
  • OmnifasOmnifas Posts: 3,442 ✭✭✭
    Would it be possible to make an option so Attack doesn't change the behavior of the left analog from the move circle to free mouse(like the Right Analog)?

    Other than that little peeve, I'm enjoying TL2 with a gamepad. Thank you for the tool.
  • Omnifas wrote:
    Would it be possible to make an option so Attack doesn't change the behavior of the left analog from the move circle to free mouse(like the Right Analog)?

    Other than that little peeve, I'm enjoying TL2 with a gamepad. Thank you for the tool.

    Sure, this is easy enough to add. I'll post an update in the next day or so with that option.
  • LozzleLozzle Posts: 41
    I just want to start by saying thank you for doing the grunt work and getting this up. I tried an xpadder config that someone did and while I give him kudos or manually setting up all the controls, it still didn't feel right. I'm guessing he never played Torchlight 1 on Xbox(which is where I actually started my TL experience before getting 1 later on pc and now 2) so it was hard to adapt. I will be testing your setup later in the day and see how well it matches up to that. From the looks of the config it seems similar so maybe I can finally sit back with my controller and play Tl2. If you did a direct copy of the Tl1 controls from the 360 version I would be super pleased but I don't expect any special treatment on my account. :p Thanks a ton though for this, I can already tell it will be helpful.
  • Lozzle wrote:
    I just want to start by saying thank you for doing the grunt work and getting this up. I tried an xpadder config that someone did and while I give him kudos or manually setting up all the controls, it still didn't feel right. I'm guessing he never played Torchlight 1 on Xbox(which is where I actually started my TL experience before getting 1 later on pc and now 2) so it was hard to adapt. I will be testing your setup later in the day and see how well it matches up to that. From the looks of the config it seems similar so maybe I can finally sit back with my controller and play Tl2. If you did a direct copy of the Tl1 controls from the 360 version I would be super pleased but I don't expect any special treatment on my account. :p Thanks a ton though for this, I can already tell it will be helpful.
    You can always rebind the controls in the config file :)
    "Welp, we're boned!"
    --Bender the Robot
  • Thank you so much for the update! Do you have a paypal account for tips?
    Lozzle wrote:
    I just want to start by saying thank you for doing the grunt work and getting this up. I tried an xpadder config that someone did and while I give him kudos or manually setting up all the controls, it still didn't feel right. I'm guessing he never played Torchlight 1 on Xbox(which is where I actually started my TL experience before getting 1 later on pc and now 2) so it was hard to adapt. I will be testing your setup later in the day and see how well it matches up to that. From the looks of the config it seems similar so maybe I can finally sit back with my controller and play Tl2. If you did a direct copy of the Tl1 controls from the 360 version I would be super pleased but I don't expect any special treatment on my account. :p Thanks a ton though for this, I can already tell it will be helpful.

    Just switch the commands for X and Left Shoulder, and you'll be just about golden. Season to taste.
    krighton wrote:
    Omnifas wrote:
    Would it be possible to make an option so Attack doesn't change the behavior of the left analog from the move circle to free mouse(like the Right Analog)?

    Other than that little peeve, I'm enjoying TL2 with a gamepad. Thank you for the tool.

    Sure, this is easy enough to add. I'll post an update in the next day or so with that option.

    <3 <3 <3
  • Omnifas wrote:
    Would it be possible to make an option so Attack doesn't change the behavior of the left analog from the move circle to free mouse(like the Right Analog)?

    I posted version 1.1.4 tonight, which has a new config option in t2.mappings to disable this behaviour. Set FreeCursorWhileAttacking=0 to turn it off.
  • OmnifasOmnifas Posts: 3,442 ✭✭✭
    Thanks for the feature. I'll try it out after I get home and get a long long rest.
  • OmnifasOmnifas Posts: 3,442 ✭✭✭
    So far I'm loving the function, it works very well with the weapons with arcs(Swords, Polearms, axes, cannons and Shotgonnes). I think I'm gonna attempt and make a UI and when GUTS releases I might add Box triggers to all NPCs so you can walk by them and they'll activate, or add an invisible clickable box that covers the move circle.
  • How do you get the left analog stick to move your character around correctly? No matter which direction I move the stick my character goes to the left of the screen. Wireless 360 controller.

    Note that zoom is all the way out and the controls are default. Everything else works fine...just this one important detail!

    Thanks
  • SogetsuSogetsu Posts: 462
    I did this a loonnnggg time ago using XPadder, but honestly I couldn't use the stick properly, there is nothing good as the mouse, but the rest of commands were pretty good

    I was wondering the last Sunday when I restarted to play TL2, if I could find some fashion to use Mouse + Joypad, but I didn't find any good combination...

    Yeah, I sux using the Analog on the Joypad, I always use the standard directional arrows

    PD: Obviously using XPadder you can configure any Joypad, regardless if it's for XBOX or not

    GSFirmaEfectos.jpg
  • OmnifasOmnifas Posts: 3,442 ✭✭✭
    Decado2 wrote:
    How do you get the left analog stick to move your character around correctly? No matter which direction I move the stick my character goes to the left of the screen. Wireless 360 controller.

    Note that zoom is all the way out and the controls are default. Everything else works fine...just this one important detail!

    Thanks

    What resolution do you use? It's probably an aspect ratio issue.
«1345
Sign In or Register to comment.