KSP, Linux and Joysticks
If you know anything about my video game habits you’ll know that over 90% of my time is spent playing Kerbal Space Program.
Over the year and a half that I’ve been playing KSP I’ve logged over 2100 hours, landed on every planet and done all manner of crazy missions.
One of the most important pieces of equipment that helps me play this type of game is my joystick. It’s nothing special; frankly it’s a cheap joystick. For a few hundred dollars I could be all kitted out, and I might even consider doing so for games like Elite Dangerous. For now though I just use a basic Logitech Extreme 3D Pro joystick for flight controls. (The name falsely advertises the qualities of one of the cheapest joysticks on the market. "Our do-ma-hicky is more extremier and major pro because our new battery technology includes an anode AND a cathode!")
In the linux version of KSP there is one quirk with the joystick throttle that has been particularly annoying to me. If the game initializes the device with the throttle physically set to <50% then the physical throttle can only control the upper 50% of the throttle in game. The converse happens too, only the lower 50% of the throttle can be reached in game when the device is initialized with the throttle above the 50% line. With trial and error I managed to figure out that if the throttle is set close enough to the middle when the game initializes the device then the throttle will work correctly in the game.
Luckily there is a package in Fedora called linuxconsoletools (I’m using version 1.4.8-1 right now) that includes the tool jstest. The jstest tool reads the input axis on the joystick device and prints it to the screen. To see the inputs from my joystick I needed to run the command:
sudo /usr/bin/jstest /dev/input/js0
Pro-Tip: The device path likely depends on the linux distribution you are using. For the Logitech USB joystick that I have, combined with Fedora 22, the joystick appears under /dev/input/js0.
When executed the jstest command will print the value returned by the inputs on the joystick. To center the throttle I first move it back and forth to discover which axis it corresponds to (axis 3 is throttle for me). On my joystick the throttle centers on 0 with an equal amount of negative and positive range on either side, so I try to set the throttle as close to zero as I can. I don’t have access to other hardware so this is just a guess on my part but take a look at the extreme values returned by the limits of the throttle. Find the median value of that range, I would guess that the median is the target value that will work the best for you in KSP.