Xbox wireless controller dpad conflicts with buttons

Hey guys, I just started playing with Ouya development and this is my first post so I apologize if this is something that's already been well discussed, but I couldn't find it when I searched, so here I go: When testing with the SceneShowUnityInput scene in the Ouya Unity Plugin I discovered that xbox 360 wireless controllers connected with the wireless receiver have a pretty big conflict between the dpad and face buttons.

The A button and dpad left both map to button 0
The B button and dpad right both map to button 1
The X button and dpad down both map to button 3

Clearly this is not ideal, as it means that if you want your game to support the xbox wireless controller you have to choose between using the face buttons and the dpad. The xbox wireless controller's dpad and buttons seem to work fine (and separately from each other!) in the Ouya menus and in several games I've tried that support them, which leads me to think it's either an issue with Unity or with the Ouya Unity Plugin.

Comments

  • Killa_MaakiKilla_Maaki Posts: 504Member
    edited August 2013
    Could be an issue with Ouya Unity Plugin. I would actually advise NOT to use the included OUYA input stuff, and use the OuyaInput provided on these forums. It is way better and work on all platforms (not just OUYA) and automatically maps between all major controller types.
    Post edited by Killa_Maaki on
    You didn't remember the plot of the Doctor Who movie because there was none; Just a bunch of plot holes strung together.
  • skatebordenskateborden Posts: 6Member
    I'm actually using InControl, which seems to have a similar goal to the OuyaInput library, but doesn't seem to support wireless xbox 360 controllers on Ouya. I was writing a device profile for wireless xbox controllers on Ouya for InControl when I discovered the issue, and traced it back to the Ouya Unity Plugin.
  • skatebordenskateborden Posts: 6Member
    edited August 2013
    I just did some digging in the OuyaInputFramework and found these comments in OuyaInput.cs indicating it has the same issue:

    private static bool GetButton(OuyaButton button, ButtonAction buttonAction, OuyaPlayer player) {
    ...
    switch (mapType)
    ...
    case OuyaMapType.XBOX360_ANDROID_wireless:
    ...
     // d-pad buttons
     // these buttons are very strange as they run on the same KeyCodes as O U (Y) A buttons
     // so if we eant to work fine on Android we can't really use the d-pad
     // that's why we partly deactivate these buttons via a flag
     // pressing a d-pad button will still lead to [O U Y A] action button events
     // this can't be helped – at leas we won't fire d-pad input when pressing action buttons

    Edited because I was getting some strange formatting with the code I copied and pasted.
    Post edited by skateborden on
  • tgraupmanntgraupmann Posts: 2,869Administrator, Team OUYA
    edited August 2013
    There are a bunch of input systems and you are free to use what you want. Recommending against using it is ..... (grrrrrrr) not a good recommendation.  As the other input systems are just based on what I originally did. My example already is multiplatform. @Killa_Maaki prefers using an alternative input system which is fine. The example is an example for you to learn from. I'm working on moving support into the OuyaSDK.

    In my design, I decouple game logic from your input logic. Some projects may have assigned an axis with a game logic name like "Super Rapid Fire Button". And so when they use the Unity Input example they have to rename their GetAxis calls to use a different call, and so they don't like it.

    If you are starting from scratch, I recommend you do it my way where axises are named like "Joystick 1 Axis 1", and using my OuyaSDK for mapping and use the Unity Input API for input. It's multiplatform and works on Ouya/Windows/Mac/Linux.

    Now your original issue, some controllers are coming into Unity with odd mappings. This is a Unity issue and happens before it gets to my plugin. I recommend you use the latest Unity 4.2 if you can. If it's still an issue, shoot me a link to the controller spec and I'll get it to the Unity programmers to fix in the next Unity version.

    To be fair I should list all the input systems in the docs, and you can pick between the PROs and CONs.
    Post edited by tgraupmann on
    ~Tim Graupmann
    OUYA Inc | Android Developer
    Skype: tgraupmann_prey

    http://github.com/ouya/docs
    http://github.com/ouya/ouya-sdk-examples

    Check out the latest docs for your game engine: [setup] [adobe air] [android] [clickteam fusion] [construct 2] [corona] [libGDX] [game maker] [html5] [marmalade] [monogame] [unity] [unreal]

    Use caution when setting [persistent wireless mode].
  • skatebordenskateborden Posts: 6Member
    @ tgraupmann thanks for the response. I am using Unity 4.2. I'm not sure what you mean by the controller spec, but it's the standard Microsoft xbox 360 wireless controller using the USB wireless receiver.

    Also, I don't have any issue with your input API, I just heard from some developers that InControl was really good so I started with that.
  • tgraupmanntgraupmann Posts: 2,869Administrator, Team OUYA
    I also use an xbox wireless receiver with a wireless xbox controller. I have a white and black wireless xbox 360 controllers. And I think one of the axises are flipped depending on which one I use.
    ~Tim Graupmann
    OUYA Inc | Android Developer
    Skype: tgraupmann_prey

    http://github.com/ouya/docs
    http://github.com/ouya/ouya-sdk-examples

    Check out the latest docs for your game engine: [setup] [adobe air] [android] [clickteam fusion] [construct 2] [corona] [libGDX] [game maker] [html5] [marmalade] [monogame] [unity] [unreal]

    Use caution when setting [persistent wireless mode].
  • skatebordenskateborden Posts: 6Member
    Strange. I have several white xbox 360 controllers and they all report the same mappings. Are you seeing the dpad/face button conflict I mentioned?
  • tgraupmanntgraupmann Posts: 2,869Administrator, Team OUYA
    edited August 2013
    I can reproduce the same issue.

    For the XBOX Wireless receiver and a white wireless XBOX 360 controller.

    Unity reports that DPAD_DOWN and BUTTON_U are the same.
    Unity reports DPAD_LEFT and BUTTON_U are the same
    Unity reports DPAD_RIGHT and BUTTON_A are the same.

    I'll have to talk with the Unity folks....

    Corona can tell the buttons apart for this controller, so Unity must have a bug.
    Post edited by tgraupmann on
    ~Tim Graupmann
    OUYA Inc | Android Developer
    Skype: tgraupmann_prey

    http://github.com/ouya/docs
    http://github.com/ouya/ouya-sdk-examples

    Check out the latest docs for your game engine: [setup] [adobe air] [android] [clickteam fusion] [construct 2] [corona] [libGDX] [game maker] [html5] [marmalade] [monogame] [unity] [unreal]

    Use caution when setting [persistent wireless mode].
  • skatebordenskateborden Posts: 6Member
    Thanks Tim! I hope Unity fixes the issue.
  • tgraupmanntgraupmann Posts: 2,869Administrator, Team OUYA
    I relayed the message to Unity.
    ~Tim Graupmann
    OUYA Inc | Android Developer
    Skype: tgraupmann_prey

    http://github.com/ouya/docs
    http://github.com/ouya/ouya-sdk-examples

    Check out the latest docs for your game engine: [setup] [adobe air] [android] [clickteam fusion] [construct 2] [corona] [libGDX] [game maker] [html5] [marmalade] [monogame] [unity] [unreal]

    Use caution when setting [persistent wireless mode].
Sign In or Register to comment.