Derail Valley Rail Driver integration

This mod allows you to control trains using the Rail Driver Desktop Train Cab Controller.

"RD controller" will be used to reference the controller from here on

The controller looks like this:

controller

Requirements

This mod requires Windows. This is not just a suggestion.

Different operating systems implement raw interaction with attached hardware in widely different manners. I only implemented the Windows way of doing it.

Connecting the RD Controller

The RD controller requires no special drivers. It uses the same protocol that a USB keyboard or mouse would use. Note however that it doesn't emulates a keyboard or mouse, and will not be usable as such in your system.

Connecting the power supply and the audio cable is optional. The power is only for the integrated audio amplifier and speaker. The speaker is used to make the device vibrate.

After plugging the USB cable in, the RD controller will briefly show USB in the display, and then switch over to rd, where it stays.

Calibration

Before you can use the RD controller you should calibrate it, otherwise it defaults to the values of my device.

You can download the calibration tool here

Simply extract it, and run CalibrationUtility.exe, then follow the on-screen instructions. It comes with a few added features that allow you to test all buttons and the display too. Once calibrated you can delete the tool if you want to.

Calibration data is saved in your user profile and not deleted when you uninstall Derail Valley or the mod. The calibration utility has an option to delete the data if you ever want to do that.

If the tool won't start

This tool requires .NET 6. You can get it for free from Microsoft.

https://dotnet.microsoft.com/en-us/download/dotnet/thank-you/runtime-desktop-6.0.16-windows-x64-installer

Mod Installation

Simply download the zip file and drag it onto the bottom section of the mod manager.

Run the game, and the RD control should show OFF in the display.

Usage

Enter a locomotive, and the display should show the speed (probably zero), which indicates that the mod has noticed that you're in a cab. The speed is shown as a negative number if you're going backwards.

Other display information

The mod returns to showing the speed when both conditions are resolved.

If you leave the locomotive, it will show OFF, at which point the controls cease working until you re-enter a cab.

Button map

The buttons in the top left section are mapped as follows:

The levers are mapped as follows:

The top row of 14 buttons (numbered from left to right) are mapped as follows:

The bottom row of 14 buttons (numbered from left to right) are mapped as follows:

Zoom (Up/Down) buttons:

D-Pad:

Emergency stop

This mod implements rudimentary emergency stop behavior. Pulling or pushing the E-Stop button, or moving the train brake into the 'EMG' setting will trigger the following:

This state is maintained until the speed drops below 1 km/h, at which point:

Limitations

Some of these limitations can be fixed by 3rd party mods.

Extending the mod

This is documented in the project readme on github

Should you buy this device?

As usual, this depends on whether you want more immersive controls, and how big your wallet is for what amounts to a niche device.

For what little it does it's really expensive. If you play a lot of train simulator games, and are unhappy with keyboard controls, you may want to consider it. It sells for around 220$ USD. For twice that amount you get into the price range where VR headsets start, which is the most immersive way to play Derail Valley.

Different simulators will have different button configurations, so you will have to swap the button labels a lot if you play many different train simulator games.

For Derail Valley

For Derail Valley alone it's probably less than optimal, because this game is quite different from other train simulator games in how it works and how you interact with the world. This means you can't really get rid of the keyboard and mouse for long times. Operating couplers, taking and handing in jobs, and changing switches are all frequent tasks that are difficult to do with the RD controller.

From a Hardware Viewpoint

The device appears fairly solid. It has a metal base plate, and the plastic top case won't flex when you press on it. It's fairly heavy and will not move on the table when you operate the controls.

The two bottom rows of 14 buttons each are covered by a plastic lid that simply clips into place. It can be removed to replace the paper strips with labels on them. There's no plastic window for the labels, meaning pressing the buttons often will eventually rub away the markings on the paper strips. I recommend you laminate the paper using sticky tape.

It connects via USB and doesn't requires any drivers. It has a 12V barrel connector on the back, but this is not needed for basic operation. The power supply is only needed for the audio amplifier.

The device has a built-in speaker that can be connected to the 3.5mm jack on your computer. The speaker causes the device to vibrate when the game creates loud, deep noises. A knob at the back can be used to adjust the volume of the speaker to your liking. The device itself also contains a 3.5mm jack. This is used to connect your speakers or headphones to the device. The forwarded audio signal is not affected by the amplifier or volume control in the device.

Replacement parts

Replacement parts aren't available, with a few exceptions. The vendor sells sticker sets and the train horn switch, but other controls cannot be bought. This means if a lever snaps, you have to toss the device or get creative fixing it. The levers are made of plastic and not metal.

From a Software Viewpoint

The RD controller is a weird piece of equipment. Windows has an existing joystick controller interface that could have been used and is suitably advanced to represent all controls on the RD controller, but the developers decided against doing this for some reason and implemented a custom way of transmitting the controller state.

When the device is activated, it simply starts spewing out data packets of 15 bytes. These bytes contain all button and lever states. The controller does this approximately 4 times a second regardless of whether the user is performing any inputs or not.

Doing this causes a few problems:

Another interesting decision was using analog inputs for the wiper and light controls, even though they have three distinct settings.

Each analog control has 256 possible positions it could be in (instead of the 65536 that you find on joysticks), and of those 256 possible states I found that up to half of them are not even reachable.

Copyright © 2022 by Kevin Gut 📧 | More services | Generated for 3.15.31.238