Search Unity

How does Windows decide which joystick is 1, which is 2?

Discussion in 'Editor & General Support' started by bigkahuna, Apr 23, 2011.

  1. bigkahuna

    bigkahuna

    Joined:
    Apr 30, 2006
    Posts:
    5,434
    I'm trying to set up an application that uses two joysticks and I'd like to configure it so it works correctly without the user having to set up the input manager. I've got two joysticks plugged into my computer and I'm using the "Joystick1" and "Joystick2" settings in the editor's input manager settings. The problem is that each time I boot the computer, it chooses a different joystick for "Joystick1" and "Joystick2". Is this a bug in Windows*? Is there some way to configure this so it's always the same?

    *Edit: I'm using Windows 7 64 bit.
     
    Last edited: Apr 23, 2011
  2. bigkahuna

    bigkahuna

    Joined:
    Apr 30, 2006
    Posts:
    5,434
  3. bigkahuna

    bigkahuna

    Joined:
    Apr 30, 2006
    Posts:
    5,434
    *bump* - Still trying to find out why Unity doesn't see the same joystick configuration each time I boot my PC. I searched the net for info but found nothing. Anyone?
     
  4. nggs

    nggs

    Joined:
    Oct 23, 2009
    Posts:
    90
    This is a guess so take it with a grain of salt. Unplug both, plug them back in, the first one you plug back in should be joystick 1. If not.. *shrugs*

    Note: I'm assuming it's a windows issue.
     
  5. Jessy

    Jessy

    Joined:
    Jun 7, 2007
    Posts:
    7,325
    This is not a problem with Windows exclusively; it is a problem with computers not being designed for use by more than one person. It p.'d me o. to no end back when I used to play Stepmania on OS X, and is the reason I sold my dance mats. The best solution, I think, is to have a quick setup screen that has everyone press a button on their controller, when prompted for input number.

    Consoles FTW.
     
  6. bigkahuna

    bigkahuna

    Joined:
    Apr 30, 2006
    Posts:
    5,434
    @NGGS - Unfortunately that idea's a no-go. I can't ask people to plug and unplug their joysticks every time they play my app.

    @Jessy - That's an idea. I sort of assumed that since the standalone's input manager actually sees the specific model of the joystick that, at least in stand alones, it should work once they configure the input manager settings the first time. But I should definitely test that. The other -really irritating- problem is that every time I start the Unity editor, the joysticks are swapped, and if I want to unplug the joysticks, I have to re-start the editor. But I won't know which joystick is which until after I start the editor.... argh... :(
     
  7. emergki

    emergki

    Joined:
    Oct 15, 2007
    Posts:
    422
    @bigkahuna - I'm with the same problem, anyway, my app use 3 joystick, so, the unplug and plug is a very bad thing... Anyway, In some computers (all using the Windows 7 64bits) the problem doesn't occurs, so, what the F* is that?

    Do you already solve your problem?, If yes, can you share with us?

    And, Another problem with Unity Joystick... I Have created a hardware (Joystick) to support 8 axis, 60 buttons and 4 "POVs", anyway, in the 2.6 version of Unity, my hardware works well with the axis, but, in Unity3, the axis only read a little bit, something like this:

    This is the Correct (Working in the 2.6)
    -1--------0-------1


    And this is the same hardware working in Unity3
    |------ -1--0--1-----|


    As you can see, in the Unity3, the reading of the values of the axis are different, and this is a problem to me. And, another problem is the Unity support only 20 buttons, so, because this I need to use more than one joystick.
     
    Last edited: Jan 17, 2012
  8. bigkahuna

    bigkahuna

    Joined:
    Apr 30, 2006
    Posts:
    5,434
    I've spoken to UT about this issue and apparently there isn't a fix. It's related to a limitation in "DirectInput" which Unity uses under Windows for joystick input. A fix is available with XInput (the new joystick standard) but if Unity switches support to this it will loose support for 90% of the joysticks out there. I've tried some 3rd party utilities with limited success. One thing that baffles me is that for some reason in 3.5 public beta the joystick numbers swap. I've reported this to UT as a bug but they weren't able to reproduce the issue. Have you given 3.5 a try yet?
     
  9. emergki

    emergki

    Joined:
    Oct 15, 2007
    Posts:
    422
    I still don't install the new 3.5 version. I already contact the UT some days after the Unity3 are available, anyway, I never receive any answer. :(