Assigning Controls To Game Controllers

Discussion in 'TSW General Discussion' started by atledreier, Aug 26, 2022.

  1. atledreier

    atledreier Member

    Joined:
    Aug 23, 2022
    Messages:
    88
    Likes Received:
    35
    Hi!

    I've done some searching around, but it seems there's no way to bind train controls to custom controllers? Am I missing something somewhere?
     
    • Like Like x 1
  2. DefaultGateways

    DefaultGateways New Member

    Joined:
    Aug 24, 2022
    Messages:
    9
    Likes Received:
    10
    Check out my post from a few days ago
    Cheap Tsw2/3 Controller
     
  3. Whitsim

    Whitsim Member

    Joined:
    Dec 26, 2020
    Messages:
    53
    Likes Received:
    64
    JoyToKey may help.
    It maps keystrokes to game controllers.
     
  4. Lokomotiv

    Lokomotiv Active Member

    Joined:
    Jul 30, 2022
    Messages:
    94
    Likes Received:
    137
    You can also map any game controller to x360ce and use the Raildriver XInput dll to emulate a Raildriver device in TSW2. The advantage of this is that you can map joystick axis to loco throttle and brake levers which is really nice.

    For further customization you can use FreePIE to script axis remapping, axis inversion, emulate joystick-to-key presses etc. I'd suggest mapping 2 vJoy devices to x360ce controller 1 and 2 and script against the vJoy interface in FreePIE to keep things simple. The first x360ce controller is the gamepad recognized by TSW2, and the other one is the Raildriver.

    The entire solution is far from perfect, but it's flexible and somewhat an enjoyable process if you're up for a challenge :D
     
    • Like Like x 2
  5. atledreier

    atledreier Member

    Joined:
    Aug 23, 2022
    Messages:
    88
    Likes Received:
    35
    I am already using vJoy and Joystick gremling, so I'll look into emulating a Raildriver controller! Thanks!
     
  6. karlack26

    karlack26 Well-Known Member

    Joined:
    Jul 6, 2022
    Messages:
    107
    Likes Received:
    390
    There isn't any direct input support.
    only hacky ways to do it.
    They have said they been planing to add direct input support since tsw1.
    Perhaps train world sim 5 will get it.

    Imagine flight sims or racing/driving games not having direct input support.

    There is rail driver support but that thing is like 300 ish dollars.
     
  7. atledreier

    atledreier Member

    Joined:
    Aug 23, 2022
    Messages:
    88
    Likes Received:
    35
    Well.

    The actual analog controls work great with X360CE and the Raildriver XInput emulator.
    The problem is the game gets confused when it sees a controller, and mouse/keyboard, so controlling the map and some levers and dials is more or less impossible.
    So, partial success, but not a workable one.
     
  8. Lokomotiv

    Lokomotiv Active Member

    Joined:
    Jul 30, 2022
    Messages:
    94
    Likes Received:
    137
    That's the catch and something I noted in my feedback post in the XInput thread here. The workaround for me is that I have an unsupported Logitech gamepad plugged into my PC that maps to X360CE controller 1. With the gamepad I interact with the locomotive switches, walk around, navigate through game menus etc. In essence I swapped out the keyboard with a gamepad. This way there will be no issue in regard to the keyboard/gamepad confusion and the experience is smooth again.

    Edit: Note that if you have official Xbox or PlayStation controllers then you obviously don't need to map the gamepad to controller 1 in X360CE because they will work in TSW out of the box.

    However, I do use the mouse sometimes because the mouse makes it easier to place the cursor over switches that I want to interact with. Then for the actual switching process I use the gamepad which would be pressing the (A) button and moving the thumbstick left or right.

    I still use the XInput solution in TSW2 and TSW3 because controlling throttle and brakes directly is really nice. Also, with the other tools I mentioned in my previous post I can split and remap my hardware levers to the Raildriver axis so that they match 1:1 with the loco I'm driving. For example, the Raildriver has throttle and brake on the same lever which is not the case for all locos like in the BR 185.

    With a couple of throttle quadrants (from playing flight sims) and FreePIE scripting I can map levers individually and fully to control AFB, throttle, train brake, electric brake, hand brake, all depending on the loco. Yes, I mainly drive German trains :D

    It takes a little bit of work and changes (swap keyboard with gamepad) but for me it's 100% worth it.

    Image of one of the throttle quadrant I'm using, don't mind the text and arrows:
    saitek1.jpg
     
    Last edited: Sep 7, 2022
  9. atledreier

    atledreier Member

    Joined:
    Aug 23, 2022
    Messages:
    88
    Likes Received:
    35
    I was thinking of just getting an actal XBox 360 controller for the other things, and have that as controller 1. Good to see that will be a solution.

    I have the same throttle quadrant, and having used them a bit I'm definitely hungry for more! :)
     
    • Like Like x 1
  10. Fabrice

    Fabrice Member

    Joined:
    May 14, 2022
    Messages:
    30
    Likes Received:
    12
    • Like Like x 1
  11. atledreier

    atledreier Member

    Joined:
    Aug 23, 2022
    Messages:
    88
    Likes Received:
    35
    Thank you, Fabrice. I'll have a look.

    I bought an XBox controller today, and tried using that as the primary controller, with the emulated Raildriver as controller 2. It's still glitchy and not really great.
    Also, how people play any game with a controller is beyond me. The controls and zillion combinations of buttons and sticks feels incredibly limiting and awkward.
    I'll live with keyboard controls for now, and possibly until DTG write a new engine, there's little hope of DirectX controls anytime soon it seems.
     
  12. Lokomotiv

    Lokomotiv Active Member

    Joined:
    Jul 30, 2022
    Messages:
    94
    Likes Received:
    137
    They're a different breed for sure! Luckily train simming is not as fast paced as FPS games are which is how I've come to terms with using a gamepad. The console approach is just different and takes a little longer that's all. And TSW is a little clunky compared to flight sims where you can just click something and it's set. TSW is doing it the TSW way.

    Crossing fingers here as well for native control support. Let's make it happen DTG :)
     
  13. Lokomotiv

    Lokomotiv Active Member

    Joined:
    Jul 30, 2022
    Messages:
    94
    Likes Received:
    137
    Btw, if you have an official Xbox gamepad then it's going to be recognized by TSW as an XInput device by default. If your Xbox gamepad is assigned to controller 1 in X360CE, and then you enable it... then I have a feeling you'll get double inputs and glitchy behavior. You're basically emulating an Xbox controller AND using an officially supported device at the same time which sounds like trouble to me :o I'd try disabling controller 1 in X360CE and see what happens.

    By design the XInput dll uses controller 2 for the Raildriver so that people like me (with a Logitech gamepad) can emulate an Xbox controller in controller 1.
     
    Last edited: Sep 7, 2022
  14. atledreier

    atledreier Member

    Joined:
    Aug 23, 2022
    Messages:
    88
    Likes Received:
    35
    I have the official XBox controller as gamepad 1, and the emulated "raildriverXinput" as emulated controller 1, which is then read as gamepad 2.

    This works great, it's the mixing of any gamepads and mouse/keyboard that is the problem, and lead to controller fighting.

    Anyway, I've settled this for now, I'll either get a raildriver, or just use keyboad.
     
    • Like Like x 1

Share This Page