Jump to content

How to fix horribly calibrated Joysticks in KSP (Workaround)


Ulair

Recommended Posts

WARNING: Windows Vista 7 & 8 64Bit Users will have to disable Driver Signature Enforcment for this Workaround. If you are not comfortable with that DO NOT try this. In general it shouldn't be a problem but you still need to disable a SECURITY FEATURE which makes your PC more vulnerable. You have been warned!

I wanted to try out playing KSP with a Joystick, a trusty, few years old Saitek one. But what i discovered was that it wasn't exactly behaving right. My spacecraft always wanted to move somewhere and the throttle, which i bound to the slider, could only be set between like 10% and 60%. What was happening was: The Joystick was not calibrated properly. So i recalibrated it with the Windows calibration tool but nothing changed. Even weirder: It worked perfectly fine in other games.

After many hours of investigation (holidays yay) i found out what was happening:

Unity simply does not give a tomato about joaystick calibration.

For those who don't know: There are 2 ways to read Joystick input on Windows:

1) Raw-Input: This is basicly the original signals the Joystick sends to Windows. If it doesn't need calibration it works fine, but if it does this input is pretty useless.

2) DirectInput: If the Joystick has never been calibrated it should effectively be the same as Raw-input. But if it has been calibrated, DirectInput will give you the correctly calibrated input.

For some stupid reason Unity uses Raw-Input. I've seen many Unity-developers complain about it in forums. It's pretty ridicculous. But this is why Joysticks in KSP (which uses Unity) are never properly calibrated.

So what can you do? Unfortunately the only way i got around this issue was using a Virtual Joystick as Proxy:

Here is what you need:

PPJoy - A virtual Joystick driver

Unfortunately this is not being developed any longer and i haven't found any "official" sources where you can still get it. But this tutorial here has a link to the download: http://wiki.mechlivinglegends.net/index.php?title=PPJoy_for_using_multiple_joysticks

Direct download link: http://uploaded.to/file/fzhe96kn (MD5 Hash: 5fcb06c790ec49b2ebb49a85394cae90)

I also uploaded the file again just to have another mirror: https://www.dropbox.com/s/5o059qka8hke3sw/ppjoysetup-0-8-4-6%285%29.7z

As the project is open source, someone put it on Github too apparently. But there aren't any binaries as far as i could tell: https://github.com/elitak/PPJoy

What do you need to do: (Note: I only tried this on Windows 8 Pro 64Bit)

1) Install the driver. Vista and Windows 7/8 64Bit users !!!WILL HAVE TO DISABLE DRIVER SIGNING!!! as the PPJoy drivers aren't signed and Windows will not allow the installation otherwise.

Here is a tutorial on how to do this and more importantly how you reenable it as it's technically a security issue: http://sixcolumns.com/t/how-to-disable-and-bypass-driver-signature-enforcement-in-windows-8/151

The PPJoy setup will PERMANENTLY disable driver signing and does not reenable it when you uninstall it. To reenable it yourself, open a CMD as Administrator and type (without ") "bcdedit -set loadoptions ENABLE_INTEGRITY_CHECKS" and then "bcdedit -set TESTSIGNING OFF"

2) Make sure your Joystick is plugged in and open the PPJoy "Joystick remixer"

3) Here you have to map ALL axis and buttons to your Joystick (in my case the Saitek - see image)

-2zTZkfetBZ-9pDh5Q3MzQp0j4KuihyvPZ3FsHo-j9c?size=800x600

4) Open KSP, go to settings and set the Joystick commands using your physical Joystick (Don't worry if they are named the same as before. You are actually using the Virtual Joystick. No idea why the name doesn't change)

5) Play and enjoy :)

Why does that work?

Simple: PPJoy actually uses the correctly calibrated input of the physical Joystick. And since the ONLY input the Virtual Joystick has, is already calibrated, Unity gets the correct values.

I hope that helped :)

- Ulair

Link to comment
Share on other sites

Good post. I ran into the exact same issues as you did when I tried to use my Sidewinder 2 and came to roughly the same solution as well (my problems and solutions are documented here: http://forum.kerbalspaceprogram.com/showthread.php/37651-What-s-the-best-way-to-set-up-a-Joystick-for-this-game).

Your steps seem to be even better though since it seems to eliminate the need to use GlovePIE. I'll have to give your method a shot!

Link to comment
Share on other sites

After messing around some, I found that GlovePIE is actually a little more flexible than PPJoy's Joystick Remixer. Both are good solutions depending on what kind of control stick you have though. Again, good guide either way. It's important to get this info out there to people with these problems!

Link to comment
Share on other sites

Oh, nice! I had to unplug my Logitech G940 stick/throttles/rudder setup because Unity doesn't read it correctly, and pull my old Sidewinder out of the basement for KSP. I'll have to see if this fixes the problem...

Link to comment
Share on other sites

It works with anything. You can also use your keyboard or mouse with it. For example: You press "E" and PPJoy presses Button 1 on the Virtual Joystick. Although that may not be very useful in this case.

GlovePIE uses PPJoy as far as i know and you can do much more things with it. I think you can even program Joystick macros right? It seems though their site was hacked and nobody cares about fixing it. Who knows what happened to the GlovePIE binaries hosted there :S. But you can get it from 3rd party download sites. Just google "GlovePIE 0.45". That's the newest version afaik. Here for example: http://download.chip.eu/en/GlovePie-0.30_174835.html

Link to comment
Share on other sites

I ran through all this and it was working, then went through the steps to re-enable the security and it broke again. turn it back off and good.

Any tips, am I doing something wrong and the security has to stay off for it to work?

Link to comment
Share on other sites

I had to manually edit my settings.cfg to make KSP take the axis inputs from the virtual stick vs my real one... Here's what my current pitch, roll, yaw, and throttle axes look like in my settings:

AXIS_PITCH
{
name = VirY
id = joy0.1
inv = False
sensitivity = 2.177017
deadzone = 0.05
scale = 1
group = 0
switchState = Any
}
AXIS_ROLL
{
name = VirZRot
id = joy0.2
inv = False
sensitivity = 2.197487
deadzone = 0.05
scale = 1
group = 0
switchState = Any
}
AXIS_YAW
{
name = VirX
id = joy0.0
inv = False
sensitivity = 2.197487
deadzone = 0.05
scale = 1
group = 0
switchState = Any
}
AXIS_THROTTLE
{
name = VirSlider
id = joy0.3
inv = True
sensitivity = 1
deadzone = 0.05
scale = 1
group = 0
switchState = Any
}

The important part is the ID field. The virtual stick is registered as my "first" joystick by default, and my real one second. So joy0.0 refers to the X-axis of my virtual stick, and joy1.0 would refer to the X-axis of the real one. So if you're having problems making things map in-game, go into the config file and try changing stuff manually and see if that helps.

Also note that the second number in the joyx.y pair depends on how you set up your virtual joystick's axes. By default it has 8 axes, but I set mine up to just have the same 4 that my real joystick does.

Edited by FenrirWolf
Link to comment
Share on other sites

Any tips, am I doing something wrong and the security has to stay off for it to work?

I'm afraid the driver signing has to stay off. When you enable it again, windows will not allow the PPJoy driver to function any longer.

Link to comment
Share on other sites

I've got the virtual joystick working but ksp won't detect it and keeps using raw input from my joystick.

Am i missing something?

Mine worked out of the box, but tbh I was surprised it did.

Assuming your Virtual Joystick really works properly you might try another program that comes with PPJoy called "Keyboard Joystick". It does the same thing as the Joystick remixer, but uses the keyboard instead. Just for configuring KSP.

The buttons aren't the problem i presume, as it doesn't matter if you use the "real" ones or "virtual" ones. I guess your main problem is the axes.

So you will have to map "up","down","left","right" (that's the x & y axis), and everything containing "axis" or "rotation". Basically everything but the buttons.

Now go to the KSP settings and try to set all axis using the keyboard. KSP won't accept any keyboard input here, so it should work just fine.

When you are done, close the "Keyboard to Joystick" window. Then the keyboard will work normally again.

If that doesn't work please verify a few things: (Sorry if i sound like a smartass here. But better to be sure and it might help others with problems aswell)

1) Is Driver signing still disabled? It has to be otherwise the PPJoy driver stops working.

2) Is the Joystick Remixer open? It has to be.

3) Press WINDOWS+R and type "joy.cpl" and enter. Do you see both your real Joystick and the Virtual one there? Select the virtual joystick, click "Properties" and then go to the "Test" tab. Move your real Joystick around and press a few buttons. Do they all work? If yes, then the Virtual Joystick does really work properly and I'm out of ideas. :S

-Ulair

Link to comment
Share on other sites

  • 2 weeks later...

I am having the same issues. I opened the mixer, set up a basic joystick: x and y axis, z rotation (the twist of the stick), and button for each button. No hat since I can't figure out what that'd be.... but I left it out out of simplicity. I saved the .ini as ppjoyff2.ini so I could relaod it anytime and loaded up KSP. I went into settings and tried to map the axes out in "Staging". Instead of saying "Sidewinder FF 2" on the button, it had a kind of garbage. So I figured it was reading from PPJoy now. I loaded up a simple plane to test the joystick with and none of the axes worked properly. They behaved as if nothing had changed. Am I missing something?

EDIT: If the driver signing is disabled, what is the best way to tell? If I did the joy.cpl and ran the test and configuring of the PPJoy1 virtual device using my Sidewinder... is that a good indication that the driver signing is disabled? If so, then I am still having issues. Not sure what to do at this point, either. However, if driver signing might still be enabled I will go that route... but I think it's off.

Edited by yithpistol
Link to comment
Share on other sites

Thanks for the great post. I've been struggling with very similar things thing for several weeks and *nearly* have everything sorted out.

I wanted to note that I'm using Universal Joystick Remapper (which leverages vJoy instead of PPJoy) because I've gotten the impression that it has been actively in development. For the most part I'm happy with it, easy to use. Still requires Test Mode. Does everything I need it to do (merge pedals into single axes, easily invert axes, change axis ids on the fly, and utilize/simplify multiple joysticks).

My 1st issue was to get my racing pedals to map the Clutch and Accelerator to one axis for use as a Rudder. This has been done now and UJR w/ vJoy made that easier than what I had been trying with PPJoy and GlovePie (not to mention that PPJoy stopped successfully installing, even in test mode, for some reason).

My 2nd issue is still nagging me, getting KSP to recognize the virtual joystick instead of the real one when setting inputs. I saw your tips in the thread and will give them a try. Thank you!

My 3rd issue is going to be that these ids seem to get all mix'n'matched when you unplug and replug in joysticks...I have quite a few that I change for racing, flying, controller-pad for action, etc...so this is going to be a problem. I could probably see if I can get everything onto the virtual joystick and somehow keep it's id as 0...but I'm not sure that covers everything. Unity could really use a huge boost here...

4th issue is pretty silly? Once I get these joysticks working, there isn't a follow mode while in atmosphere? So I'll have to take my hand off the stick to turn my view so I can follow a plane? I haven't gotten to this point so perhaps the answer is really simple and I've just overlooked it. If other's have ideas... EDIT: Nevermind, chase camera view works just fine. For some reason it wasn't working the way I had previously experienced but that must have been a mistake on my part, everything works as expected.

Joysticks need to come back to gaming... it would be fantastic if KSP helped that happen. :-) Glad to see all of you enjoying awesome setups.

**UPDATE - Nov. 27th, 2013**

1. Universal Joystick Remapper is still working perfectly for merging my racing pedals into a rudder

2. The latest version of Universal Joystick Remapper makes this a snap and I can simulate the axis during mapping very easily and it works very well.

3. KSP still seems to get confused (though I still think I could find a way to force a consistent joystick ID and that should solve the issue) BUT, for the most part this is easily resolved. Often I can even solve the problem by just changing some of the associated Joystick/Axes IDs in UJR and that'll get them back inline with KSP.

4. Was never a problem again. I have concluded that I just made a mistake in an under caffeinated moment.

5. *new* I can easily switch between roll for rockets on the pedals and yaw for planes just with an alt-tab and few clicks in UJR! Nice!

6. *new* I was having a problem with the merged rudder axes twitching out occasionally, but since evilC is actively working to improve the utility this was fixed and it works super smooth now!

- Talon

Thrustmaster HOTAS Warthog Joystick & Throttle

Fanatec Club Sport Petals

Universal Joystick Remapper!

Edited by Black-Talon
update to my latest experience with UJR
Link to comment
Share on other sites

  • 4 months later...

I had the same problem and then found this thread and fixed it. Mostly.

The one problem I still have is that my POV hat wont work. Im getting really frustrated.

Does anyone else have this problem? If not, what setting are you using so it worked fine?

Does anyone know how to fix it?

thanks

Link to comment
Share on other sites

  • 1 month later...

I'm in the midst of finishing up a script for the Steel Battalion controller, which was truly evil since I couldn't get PPJoy to work at all (yes, I had to decipher how Unity reads the joystick to make my own calibration in the setup. I'm not 100% sure that Kerbal supports POV but I can take a look with my XBOX controller later.

As for joysticks with KSP: yeah, it seriously is a pain, which is a complete shame. I haven't worked with plugins yet for KSP, but if I recall straight, KSP was made in C#, so I wonder why a substitute input plugin wasn't made yet. That will be a fun venture in my space time.

PS: This thread alone is the reason I made an account, and once I finish the SBC script, I hope to post a tutorial on how to set it up.

Link to comment
Share on other sites

  • 6 months later...
I wonder why a substitute input plugin wasn't made yet.

Then I am happy to introduce AltInput, an Alternate Input plugin for KSP, designed to add proper support for DirectInput game controllers... :)

It's still fairly beta, but it should work well enough to remove the need for all the stopgap solutions exposed above. Of course, since it's DirectInput based, it's Windows-only.

Once the module is installed, a simple .ini file, such as this one is all you need to get full benefit of your controller, including POV and throttle/slider support.

For more info, please take a look at the README from the github project page. Or you can try the pre-compiled binaries from the latest version, which are available here.

I just hope that this module can be useful to a few more people besides myself, as having decent joystick control sure does improves the game...

Link to comment
Share on other sites

  • 4 months later...

Hi Akeo I'm trying to use your ALtInput but am finding the set up process somewhat confusing. I am only using MS notepad for any editing. The config.ini file was saved into a locaction for me it was c:\KSP-win\plugins\plugindata\altinput\

I read through all the instructions and added button and controler names etc. Tried it and it would not configure.

I'm running windows 8 or 8.1 and I have a very old joy stick. it doesn't have a z axis (or twist handle) but has a throttle slider (which doesn't seem to ever be picked up by devices) Windows identified it through the USB port and gave it it's very long name. I am also using a USB to parrallel port converter for the stick which has 4 different modes on it as does the stick as well .. all set to the same.

The biggest problem I am having is that the joystick is actually working but... the axis are always way out of kilter to the point that I have lots of right aileron and practically no left. So I use a combination of trim on the hardware and in the KSP trim ... but it gets really bad for elevator as it sometimes is all lift and no downward.

Also my POV hat uses combinations of buttons 1234 to represent POV directions... how do you handle that in the config file?

Any ways I have a screen shot of the result... any advice please?

I removed all the "; " lines to show my settings.

JSconfig.jpg

Link to comment
Share on other sites

  • 2 weeks later...
I had the same problem and then found this thread and fixed it. Mostly.

The one problem I still have is that my POV hat wont work. Im getting really frustrated.

Does anyone else have this problem? If not, what setting are you using so it worked fine?

Does anyone know how to fix it?

thanks

I had a POV hat problem with my Logitech Wingman Extreme joystick. Here's how I resolved it:

What I first noticed was that I was unable to assign the hat directions as a valid 'key/button binding.' But what I then discovered was that I could assign it as an 'axis binding' input.

In my case, I was trying to assign the hat to the Camera view up/down/left/right buttons, ending up using camera horizontal/vertical axes.

Hope this helps you and others.

Link to comment
Share on other sites

  • 3 months later...

I am having many of the same issues addressed in this thread. Specifically, I am experiencing joystick input delay - probably close to one second. I am using Saitek X45 joystick/throttle combo. Just downloaded KSP_1.0.2, but I don't think the issue has been fixed since it wasn't fixed in KSP_1.0. I installed vJoy and UJR to get the throttle and joystick to both work together, but i noticed that I was still experiencing a huge input delay. I was going to try installing AFBW mod but it isn't appearing on CKAN and probably won't work if I downloaded and installed it manually since all of the input setting have been changed in the 1.0 version of KSP. Akeo's plugin AltInput seems like it was a promising solution almost 9 months ago but I am not sure if it will work with the KSP 1.0 versions since all input settings in KSP have been altered - primarily because I don't know how AltInput really works. I tried to follow the instructions on the README file from the github project page on how to install AltInput,but I haven't been able to locate the AltInput.dll file and am not sure what to use to compile the project after changing the KSPPath and ultimately failing to install it. If someone could provide a better set of instructions on how to install AltInput (or any insight into whether it will work with KSP 1.0 versions at all) or possibly a completely different solution to the input delay, your help would be greatly appreciated.

I specifically got the joystick for KSP 1.0, hoping the developers would have already resolved the issue, but they didn't. I really don't see myself playing KSP without a joystick now that I've got a taste of it. If I knew how to code in C# and how to write a plugin like AltInput, I definitely would spend my time doing it (that's how badly I want to use a joystick in this game). If I don't find a solution soon I just might have to resort to learning just that - even if it takes me the whole summer, unless of course my patience runs dry.

Link to comment
Share on other sites

This thread is quite old. Please consider starting a new thread rather than reviving this one.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...