PC Ts World Raildriver And Joystick Interface

Discussion in 'TSW General Discussion' started by CobraOne, Nov 8, 2022.

  1. CobraOne

    CobraOne Active Member

    Joined:
    Jun 3, 2022
    Messages:
    257
    Likes Received:
    198
    Sorry about that Rob, my fingers aren't always in sync with my brain when typing.
    You should be able to get to the Setup position, but you won't be able to get to the dynamic brake Off position until you add some Throttle.
    I reverted back to the original TSW PieHid64.dll and used my Raildriver controller and found that I had the same issue, I could not get to Off without applying some throttle. This means TSW has programmed it this way and I don't think I can do anything to fix it.
    With regards to the Fast Release for the Independant brake, the Raildriver has a extra position on the Ind Brake. If you move the lever to the right, it activates the Bail Off, this is obviously not available on a standard joystick. On testing though, I found that using my program, the time it takes to go from full brake to off i.e. brake pressure to go from 72 to 0.2 is 12 seconds. It takes exactly the same time using the original dll and the bail off on the Raildriver, so it appears the bail off makes no difference.
    I only have the Cajon Pass US Route, but I am also looking at making it easier to calculate the notches for the levers, the problem as you know is, the Throttle and Dynamic are on one lever in the game and I have to split them in two.

    Chris
     
  2. CobraOne

    CobraOne Active Member

    Joined:
    Jun 3, 2022
    Messages:
    257
    Likes Received:
    198
    Hi Rob
    See my last post, I am also adding code that will check if my dll is installed in the right place, if a users does a Verify Game Files, then my dll will be overwritten with the original one, and my program then won't work.
    Chris
     
  3. atledreier

    atledreier Member

    Joined:
    Aug 23, 2022
    Messages:
    88
    Likes Received:
    35
    I'm getting disconnects with 1.0.0.7 as well. Seems to happen when I move levers fast, or several simultaneously.

    They tend to happen at speed changes, where throttle goes off, brakes come on, maybe a SIFA pedal thrown in for good measure.
    I'll keep investigating to see if I can find a pattern somewhere.

    No errors though, just "can't connect to TSW - Retrying" in the status bar.
     
  4. bruno

    bruno New Member

    Joined:
    Apr 5, 2023
    Messages:
    1
    Likes Received:
    0
    Same problem here, the tool lost the connection to the game.
     
  5. extremomdx

    extremomdx New Member

    Joined:
    Mar 13, 2023
    Messages:
    3
    Likes Received:
    0
    I still have the same problem, when I start Raildriver.exe and TSW3 for the first time, the connection breaks off within 5 to 15 minutes.
    After restarting the two programs, everything runs for hours without interruption. Both programs run as administrator.
     
  6. karlack26

    karlack26 Well-Known Member

    Joined:
    Jul 6, 2022
    Messages:
    107
    Likes Received:
    390
    Did the latest TSW update break this, it was working fine on the weekend now it does not work at all. I should add i already tried replacing the dll with the one in rhe download, did not work
     
    Last edited: Apr 6, 2023
  7. karlack26

    karlack26 Well-Known Member

    Joined:
    Jul 6, 2022
    Messages:
    107
    Likes Received:
    390
    Okay so i had unplugged my throttle since the last time I used it last weekend, I was playing another game was not liking it plugged in at the same time as my gamepad.
    So I tried remapping the axis and that fixed it, also i had to unplug my game pad for this to work right as well.
     
    Last edited: Apr 6, 2023
  8. nonnosub#5391

    nonnosub#5391 New Member

    Joined:
    Mar 21, 2023
    Messages:
    10
    Likes Received:
    1
    Hello everyone.

    On the Master Joystick Assignment you link a certain number of TSW3 commands to a well defined group of external peripherals, by emulating levers and axis that are available on a Raildriver console. I defined a certain set of these devices by which I try to cover ALL the locos, by playing with the Asset files like ThrottleAndBrake, ThrottleAndDynamic, and so on.

    Let's assume that now I want to create a DIFFERENT Master Joystick Assignment file, where one or more external devices are OTHER peripherals that I own. Would it be possible? I mean, may I create a second assigment file, exactly like I do with Default_ButtonMapper.xml?

    The reason for this question is that after solving (more or less) my troubles with American freight train locos, now I'm trying to properly configure British Class 66, where the best device to emulate the brakes levers is a joystick with a centralizing return spring. In other words here I would assign to both brakes levers (local and train) a Thrustmaster joystick, and not a HC Bravo Throttle with its free range levers. How to manage these two different Master Joystick Assignment files?

    Thx in advance,
    rob

    P.S. Maybe by playing with a second LeverSettings.xml file?
     
    Last edited: Apr 7, 2023
    • Helpful Helpful x 1
  9. CobraOne

    CobraOne Active Member

    Joined:
    Jun 3, 2022
    Messages:
    257
    Likes Received:
    198
    Hi Rob
    I can certainly look into adding the option for alternative joystick arrangements, but in the meantime, your easiest solution is to make a copy of my program and run that copy for the class 66 config after changing the master joystick assignment.
    Chris
     
  10. CobraOne

    CobraOne Active Member

    Joined:
    Jun 3, 2022
    Messages:
    257
    Likes Received:
    198
    If you unplug your joystick and, when plugging it back in, you use a different USB port, windows will see this as a different joystick and assign it a different id number. My program uses this id number when assigning the levers so that the program knows which lever does what. This also allows you to use two of the same joysticks.
    Chris
     
    • Like Like x 1
  11. zappatime

    zappatime Well-Known Member

    Joined:
    Mar 19, 2020
    Messages:
    216
    Likes Received:
    375
    CobraOne, in your button mapper, would it be possible for you to add a button input, in an additional column, to act as a ‘shift’ button of sorts in order to extend the number of usable button inputs beyond (say) the 32 push button inputs available on a controller interface?
    Keith
     
  12. CobraOne

    CobraOne Active Member

    Joined:
    Jun 3, 2022
    Messages:
    257
    Likes Received:
    198
    Hi Keith
    I'll do my best to try and incorporate that too.
    Chris
     
    • Like Like x 1
  13. JPS

    JPS Member

    Joined:
    Feb 16, 2021
    Messages:
    36
    Likes Received:
    14
    Good thing someone posted in this thread today AND I looked at the forum as well. I've been using the TS version of this for forever, did not know there was a TSW version now :o
     
  14. zappatime

    zappatime Well-Known Member

    Joined:
    Mar 19, 2020
    Messages:
    216
    Likes Received:
    375
    Thanks Chris, that would be great if it’s do-able, the feature would be very useful in your TSC version too, where there’s an even bigger list of possible control inputs!
     
  15. atledreier

    atledreier Member

    Joined:
    Aug 23, 2022
    Messages:
    88
    Likes Received:
    35
    This!
    I've got several different controllers I'd love to use for different trains, so this functionality would be welcome.
     
  16. jensens

    jensens Member

    Joined:
    Mar 30, 2023
    Messages:
    19
    Likes Received:
    30
    I tried this interface yesterday with my Thrustmaster TCA throttle and it works like a breeze!
    Thank you for providing this gem of a software!
     
  17. atledreier

    atledreier Member

    Joined:
    Aug 23, 2022
    Messages:
    88
    Likes Received:
    35
    I have had the diconnect issues, as known.

    Yesterday I wan playing the game without the software running, hand I had hard freezed, where I had to kill the TSW process. This was consistent, freezes within 10 minutes.

    Switched to the stock PID DLL, and the crashes stopped. No idea if this is related to anything at all regarding the disconnects, but the PID DLL is doing SOMETHING without the software running.
     
  18. CobraOne

    CobraOne Active Member

    Joined:
    Jun 3, 2022
    Messages:
    257
    Likes Received:
    198
    When you start TSW, with the original dll, it is looking for the Raildriver hardware using the Windows HID.dll (Human Interface Device), if it doesn't find it, it will stop looking. Once you then plug the Raildriver in, the HID.dll notifies TSW that you have plugged in the Raildriver and the PieHis64.dll starts communicating with the Raildriver.
    Because my program is emulating the Raildriver and is not a physical hardware device, I cannot use the HID.dll. Instead, I have the PieHid.dll keep looking to see if my program is running. Unfortunately, if you then don't run my program and try to exit TSW, it does not shut down completely, hence you having to do a reset of your PC. I am trying to find another way of looking for my software without it continualy looking, but that's what I did in V1.0.0.1-1.0.0.4 and the disconnects were way more frequent.
    For the time being, those who are using my dll but do not run my software, once you exit TSW, running my software and then exiting will let TSW close completely without the need to reset your PC.

    Chris
     
    Last edited: Apr 19, 2023
  19. JPS

    JPS Member

    Joined:
    Feb 16, 2021
    Messages:
    36
    Likes Received:
    14
    So, basicly what you are saying is if you reset your PC, start your program and then start TSW and play, there should be no disconnect?
     
  20. CobraOne

    CobraOne Active Member

    Joined:
    Jun 3, 2022
    Messages:
    257
    Likes Received:
    198
    What I am saying is, if you want to use my dll in TSW, Whenever yo run TSW, you need to run my program at least once per session to stop TSW crashing when you exit it resulting in you having to reset your PC.
    The disconnects are a different problem.
    For most people, the random disconnects are either non existant or only one or two a session. Some though are having disconnects very frequently and this is what I am trying to figure out and fix at the moment.
    Chris
     
  21. CobraOne

    CobraOne Active Member

    Joined:
    Jun 3, 2022
    Messages:
    257
    Likes Received:
    198
    How to download the files
    i have noticed I am getting a lot of requests from DropBox for people to join the Beta Files folder where you download my program from.
    For security reasons, I will not share the folder as it will allow people to alter my files.
    To download the files, simply hover your mouse over the required file and to the right you will see the Download option appear. Click it to download the file.
    Chris
     
    Last edited: Apr 20, 2023
  22. dreamgame

    dreamgame New Member

    Joined:
    Apr 24, 2023
    Messages:
    1
    Likes Received:
    0
    Thanks CobraOne for sharing this tool. I was looking for something like this for months for the Airbus TCA pack.

    Maybe i miss something about calibration for throttles. Or maybe it's just me that i don't know how to do it. I have set up notches, but when i set up a Throttle & Brake lever, the center point is very large, leaving only a small part of the whiper to act as the throttle or brake area.
    Besides of that, it works nicely.

    I want to share my experience with the disconnection issues just in case is useful for you. In TSW 3 the disconnection happens mostly on 3 cases.
    1 When i do many small corrections to the throttle or brake in a short space of time, sometimes disconnects.
    2. If i pause the game for some minutes, when i return to the computer TSW3 is always disconnected.
    3. Always disconnects after 20 min or so of gameplay.

    But with TSW 2 nothing of this happen. I have not experienced a disconnection in TSW 2.

    Hope it helps.

    EDIT : Well, i just have a disconnection from TSW 2.
     
    Last edited: Apr 24, 2023
  23. CobraOne

    CobraOne Active Member

    Joined:
    Jun 3, 2022
    Messages:
    257
    Likes Received:
    198
    dreamgame
    To calibrate your controls, select the ThrottleAndBrake profile and click Start Callback. then in TSW, go to Settings - Controls - Advanced Controls. At the bottom right click on Calibrate and move your levers to the indicated position on the Raildriver image. clicking on the Accept button to move to the next position.
    For the ThrottleAndBrake which goes bottom - middle - top - middle, have the first middle just below halfway on your joystick and the other middle just above halfway. You need this small gap for TSW to ascertain where the lever splits the throttle/brake.

    That's sod's law for you :)
    Chris
     
  24. JDM_DSM

    JDM_DSM New Member

    Joined:
    May 13, 2023
    Messages:
    2
    Likes Received:
    0
    This is an awesome tool! Thank you Chris for all your time and effort you've put in to this!!

    One thing I noticed tonight is when I map a button to the default Automatic Brake key '
    KEY_APOSTROPHE seems to send ` instead of '
    I couldn't find a KEY_ that produced the correct keypress.

    I'm not sure if it's a difference in keyboard layouts or something? (I'm using a standard US keyboard)
     
  25. CobraOne

    CobraOne Active Member

    Joined:
    Jun 3, 2022
    Messages:
    257
    Likes Received:
    198
    Hi JDM_DSM
    Looking at the UK/US keyboards, the Apostrophe is in the same place.
    Can you download and run this keyboard scanner
    https://lateralus138.github.io/Key-ScanCode/
    which will look like this when run
    ScanCode.jpg

    Press the Apostrophe on your keyboard and tell me what code is displayed at the bottom of the program window, your keyboard should display the same as here, SC::28 VK::0xC0.
    Chris
     

    Attached Files:

  26. JDM_DSM

    JDM_DSM New Member

    Joined:
    May 13, 2023
    Messages:
    2
    Likes Received:
    0
    I get SC::028 VK::0xDE
    upload_2023-5-13_12-26-46.png

    Using that key scanner 0xC0 is the `~ key at the top left, above the tab key
     
    Last edited: May 13, 2023
  27. CobraOne

    CobraOne Active Member

    Joined:
    Jun 3, 2022
    Messages:
    257
    Likes Received:
    198
    • Like Like x 1
  28. CobraOne

    CobraOne Active Member

    Joined:
    Jun 3, 2022
    Messages:
    257
    Likes Received:
    198
    JDM_DSM
    If you downloaded the new exe file prior to seeing this message, can you download it again using the same link.
    I inadvertently posted V1.0.0.5 not V1.0.0.7.

    To all other users, I have now updated the full download of V1.0.0.7 with the same fix.
    Chris
     
    • Like Like x 1
  29. atledreier

    atledreier Member

    Joined:
    Aug 23, 2022
    Messages:
    88
    Likes Received:
    35
    I've had issues with disconnects with this, but just wanted to let you know I played for a few hours last night with zero disconnects.

    I need to work on my setups and assignments, but for once I finished several routes without disconnecting. :)
     
  30. lauriecooper85

    lauriecooper85 New Member

    Joined:
    Dec 26, 2018
    Messages:
    2
    Likes Received:
    0
    Thank you so much for your efforts in creating this interface. I've been using the TSC version with throttle quadrants for a few years now and am looking forward to being able to use the same controls in TSW.
     
  31. j.elkroc

    j.elkroc Member

    Joined:
    Mar 27, 2023
    Messages:
    61
    Likes Received:
    21
    I had v1.0.0.7 working fine and today it won't work for more than a minute before disconnect. I set both programs to run as admin, no help.
    I also elevated the controller to high priority, nope. Doesn't make sense to me why. Windows. Has to be Windows.

    EDIT: Removed the God mode plugin and now I can drive again. This plugin messes with things I guess, but it comes in handy to complete objectives when you mess up, yuk yuk.
     
    Last edited: Jun 3, 2023
  32. silain#4916

    silain#4916 New Member

    Joined:
    Jun 3, 2023
    Messages:
    1
    Likes Received:
    0
    Thank you so much Chris!
    I build a custom train controller about two years ago, but quit using it for tsw because I never managed to setup the lever axis, only the buttons.
    All works very well with your program now! Keep up the good work!
     
  33. atledreier

    atledreier Member

    Joined:
    Aug 23, 2022
    Messages:
    88
    Likes Received:
    35
    I thought I had it figured out, but it still disconnects occasionally.

    I can drive up to an hour and sometimes more now, but it's not bulletproof, and once it loses connection there's no getting it back.
    Keypresses still go through, so it's just the analog levers that stop working.

    What I did to reduce the disconnectrs from minutes to an hour was to unbind the unused axis.
    So, if I'm in a loco that uses throttle, dynamic and brake, I unbind throttleandbrake axis completely. If I keep the lever bound (it's a separate axis on a separate controller) it'll disconnect within minutes.

    If there's anything I can do to help diagnose the disconnects let me know, cause driving trains with the levers is so much better than binding keyboard commands.
     
    • Like Like x 1
  34. CobraOne

    CobraOne Active Member

    Joined:
    Jun 3, 2022
    Messages:
    257
    Likes Received:
    198
    That's an interesting point, I will connect a second controller and see if I can replicate the problem

    I am also working hard on the next version which I hope also helps with the disconnects. It will also allow you to have more than one Master Lever setting file as requested by Rob and what I call a 'Shift Button' as requested by Keith, that will allow you to select a button that, when pressed, will double the number of buttons on the controller. This is taking a little time to develope but I am pretty close to finishing.

    As this has meant changing quite a bit of the code, I will release it as a Beta version first for people who are willing to test it for me and report back.
    Chris
     
    • Like Like x 4
  35. atledreier

    atledreier Member

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

    I have lots of connected controllers, and a quite noisy USB environment due to some DIY controllers, so mine will probably be the real test of stability.

    I do know one of my lever setups is particularly noisy, as in, they have some phantom movement. This will probably strain the pipeline into the game a lot, as the levers seems to be constantly moving a tiny bit. Maybe some filtering or a threshold for value change before sending it to the game would be an idea? I'm sure there's a lot of noisy joysticks and lever setups out there.
     
  36. CobraOne

    CobraOne Active Member

    Joined:
    Jun 3, 2022
    Messages:
    257
    Likes Received:
    198
    Can you try increasing the number in the 'Raildriver Sensity' on the main page, this also applies to joysticks (I should have made that clearer).
    What it does is, if say you set it to 5, and the last read of the joystick was 20, a new reading will not be sent until it is 15 or less or 25 or more.
    As the value read from your joystick is set to 0 - 100 in my program for easier calculations, try increasing the value by 1 or 2 each time.
    Chris
     
  37. simcab67

    simcab67 New Member

    Joined:
    Jun 4, 2023
    Messages:
    1
    Likes Received:
    0
    Hi CobraOne I have a question for tsclassic rail driver and joystisk interface, I don't see all the controls names lines in the Data received from railworks window because the number of rows is limited to 199 or 200 rows. whereas my engine has about 350 lines.
    you have a solution for this thanks in advance.
    sorry for my english.
     
  38. CobraOne

    CobraOne Active Member

    Joined:
    Jun 3, 2022
    Messages:
    257
    Likes Received:
    198
    Hi simvab67
    The original idea behind the Data Received from railworks window was for you to ascertain the control names for the loco you are driving.
    It was not meant as a way to monitor the controls in real time. You can Alt + Tab back to my program and use the scrollbars to see all the hidden data.
    Chris
     
  39. atledreier

    atledreier Member

    Joined:
    Aug 23, 2022
    Messages:
    88
    Likes Received:
    35
    With the sensitivity at 5 I got through a full route, about 80 minutes. Set it to 2, got through a short route (20 minutes), but failed almost immediately on the third route.

    I'll keep experimenting with the sensitivity, we might be on to something.
     
  40. OldAlaskaGuy

    OldAlaskaGuy Well-Known Member

    Joined:
    Dec 12, 2016
    Messages:
    905
    Likes Received:
    723
    The last TSC update on some locos the Raildriver buttons no longer work but the levers do. Anyone else have issues? Version 3.3.0.3
     
  41. CobraOne

    CobraOne Active Member

    Joined:
    Jun 3, 2022
    Messages:
    257
    Likes Received:
    198
    Are you using the same buttonmapper for all the loco's?
    If not, can you edit one of the button maps for one of the non working loco's and make sure the buttons are actually assigned.
    If you create a new button map without the Raildriver plugged in, you will have a button map with nothing assigned to it.
    Chris
     
  42. j.elkroc

    j.elkroc Member

    Joined:
    Mar 27, 2023
    Messages:
    61
    Likes Received:
    21
    Yesterday I tried the sensitivity at 2. While driving I got pulled away for an hour with the sim in pause, and when I returned the controllers still worked! That is a first for me. Will keep testing. Seems my pots might have been noisy too, even though I have a Leo Bodnar interface installed.
     
  43. atledreier

    atledreier Member

    Joined:
    Aug 23, 2022
    Messages:
    88
    Likes Received:
    35
    One of my controllers is a LB board too. USB is far more sensitive than most people think.
     
  44. j.elkroc

    j.elkroc Member

    Joined:
    Mar 27, 2023
    Messages:
    61
    Likes Received:
    21
    I have a Saitek yoke and an extra throttle quadrant. The yoke is modded with the LB but most games still see the disconnected pots - I think that could have something to do with it. Will be driving a few trains this afternoon and will continue to keep an eye on the setting of "2" that has shown promise.
     
  45. atledreier

    atledreier Member

    Joined:
    Aug 23, 2022
    Messages:
    88
    Likes Received:
    35
    Been trying more, but it seems hard to find a setting that has no disconnects. I can't seem to find a reliable pattern, which is frustrating.

    I can play anything from 5 minutes to an hour and a half.

    A sensitivity of five seems the most stable, but then I have some resolution issues for some trains. The tap changers start to skip taps quite badly, for instance, and braking gets quite coarse with such a high sensitivity setting.

    Maybe you could look into some input filtering? Or even just some logging of values so we can see if we can spot some anomaly when the disconnects happen?
     
  46. atledreier

    atledreier Member

    Joined:
    Aug 23, 2022
    Messages:
    88
    Likes Received:
    35
    I will disconnect all my game controllers bar one that I know is very stable, and bind a single axis, and play for a while. That should eliminate noise and controller conflicts.
    Anything i can do to enable logging in the interface app?
     
  47. atledreier

    atledreier Member

    Joined:
    Aug 23, 2022
    Messages:
    88
    Likes Received:
    35
    Ok, tried disconnecting all other controllers, just the smoothest and less noisy controller I have as a single axis throttle, and still got disconnected about 30 minutes in.

    I think that rules out controller congestion as a cause.

    The search continues.
     
  48. CobraOne

    CobraOne Active Member

    Joined:
    Jun 3, 2022
    Messages:
    257
    Likes Received:
    198
    Can you download this zip file
    https://www.dropbox.com/s/5fwdom79vmzo3zr/TSW New Dll's.zip?dl=1
    It contains the following 2 files:-
    1. A new "WriteToPipe.dll" that needs placing in your 'TSClassic Raildriver and Joystick Interface' folder, replacing the current one.
    2. A new "PieHid64.dll" that need placing in your 'TSW game folder' as before.

    Also, see if you have a error.txt file in your 'TSClassic Raildriver and Joystick Interface' folder, the program writes this text file if there is an error received when sending the data. This will only work if I get the error back from TSW before the disconnect.

    Edit: Don't forget to right click on the downloaded zip file, select Properties and then check the Unblock box at the lower right, before extracting the files.
    Chris
     
    Last edited: Jun 7, 2023
  49. atledreier

    atledreier Member

    Joined:
    Aug 23, 2022
    Messages:
    88
    Likes Received:
    35
    Awesome, I'll get right on it when I get home from work.

    Sort of relieved it seems to be unrelated to the actual controllers involved, as that would be a pain to set up every time. :)
     
  50. j.elkroc

    j.elkroc Member

    Joined:
    Mar 27, 2023
    Messages:
    61
    Likes Received:
    21
    CobraOne Do you have any debug code for TSW3 controller v1.0.0.7 I am using? I tried the above and they obviously don't work with TSW3. I have luck one session and disconnects the next. Currently my exe's are NOT run as admin because I unchecked it after it still disconnected. Also tried running both exes at high priority. Didn't help.
    I am following along and trying everything I can think of.
    EDIT: Just remembered you saying you don't own TSW3. Fuggedaboudit.
     
    Last edited: Jun 7, 2023

Share This Page