Jump to content
  • 0

Unable to assign second joystick


Question

Hi,

I am unable to assign second joystick. I have two T.16000M, the first works ok but the second I can't bind axes. When assigning the axis in the popup dialog I can see it detecting the correct one (joy1.1) but when I accept it it just assignes the same axis but from the first joystick (joy0.1). I am able to assign buttons ok though.

Dual joystick setup:

settings.cfg

output_log.txt

Dual joystick and Dual gamepad setup:

settings.cfg

output_log.txt

Here I have assigned the second joysticks axis and the second gamepads axis - this I saw in the popup dialog -  but it assigned the first joysticks and the first gamepads axis. I also have assigned 1 button from all 4 hardware just so its visible there are 4 different hw. (they all have the correct name - joystickXbuttonY)

EDIT:

I have added full logs and added another case where this happens. This case can be simulated easily with two identical gamepads as well.

Edited by cartman
added full log and another case.
Link to post
Share on other sites

5 answers to this question

Recommended Posts

  • 0

@cartman: not sure how many in the community have multiple joysticks to test how KSP works with them all. I have one (and a bunch of other input devices) and know of noone else having more among KSP testers.

You may be the first to have found that issue; but to let KSP developers know more and possibly find a fix, would be better if you could fill a report on the public tracker (http://bugs.kerbalspaceprogram.com/projects/ksp/issues). Please include the whole of settings.cfg and output_log.txt with the report.

Link to post
Share on other sites
  • 0

Hi @cartman, Unity3D enumerates the controllers it can detect when the engine is started, unfortunately a controllers number can change if it is unplugged or the PC is restarted, even if only one controller is present.

This is a major issue on Windows where controllers can be enumerated by Unity differently each time, less so on Linux and OSX where controllers are labelled by the operating system as js0, js1 etc.

This meant of course that your bindings would not work if the controller was 1 this time, but 0 before, as Unity treats the keycodes from each joystick separately.

Unity3D offers a way to deal with this though, via the controllers name, however as you have found this fails with two identical controllers, and there is no method in Unitys Input class to get a controllers unique identifier.

This is fine for basic games where all 8 joysticks in Unity's input manager can be treated the same, or a few popular controllers can be set up and detected via their name, for example the X-Box and Playstation gamepads.

It's not good for games where the player could use any number of flight sim sticks, especially where the player can bind those sticks to suit their tastes, the developer has to write an intervening layer to translate the players custom bindings to the ones baked into the game when the project is built.

That only gets around one problem though, there's plenty of others such as the hard limit on fire buttons and axis, the lack of hot-swapping, the detection limit of 4 controllers and complete lack of access to the UID.

None of this is news to a developer using Unity for their game, people have been complaining about all of these issues since at least 2012.

So the controllers enumeration cannot be used because this can change, the controllers name can be used but there are limitations, and using both the name and the controllers number in the enumerated list doesn't work as you have the same issue as using the number alone, T.16000M#0 can be T.16000M#1 the next time you play, so none of your bindings would apply.

There's 3rd party controller plugins for Unity, though incorporating them at such a late stage in KSP's development isn't going to be trivial it's something I've been asking for for a while.

A more immediate option might be PPJoy, letting you combine both sticks as one device with twice the axis and buttons but watch out for Unity's hard limit of 20 fire buttons per controller, or set up one of the T.16000M's as a virtual stick with another name.

Hope this helps.

Link to post
Share on other sites
  • 0

@sal_vager Thank you for the extensive explanation! Its a shame because I love to have translation and attidute on 2 sticks. I had the feeling that its bec. of unity. I vaguely remember something about those IDs getting mixed up. It happened to me before but it was rather rare, if it happend I just replaced the IDs with the new ones. I will try the PPJoy stuff.

Link to post
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
Answer this question...

×   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...