OUYA Unity Videos

24

Comments

  • gribblygribbly Posts: 80Member
    @bronergames - make sure you have the OuyaGameObject in your scene
  • bronergamesbronergames Posts: 13Member
    Still nothing, i am getting alot of obsolete warnings of gameobject.active in the tons of NGUI files.Is that killing it?

    I put some debug logs into the inputbuttonlistener area and its not even running the debug, likes its skipping it. 
  • tgraupmanntgraupmann Posts: 2,869Administrator, Team OUYA
    Can you start a new thread on this? I wanted to keep this thread about the videos.
    ~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].
  • HashbangGamesHashbangGames Posts: 96Member
    @bronergames  I would suggest you start over.  

    Step 1: Create New Project
    Step 2: Bring your files to the project ( including your NGUI version )
    Step 3: Import the Plugin and Uncheck the NGUI folder.  If you deleted the NGUI examples in your project you may need to keep the NGUI Fantasy Atlas Assets. 
    Step 4: Complete configuration as per videos and other helpful tips on this forum.

    That should get rid of your errors.   I know it's a pain,  I will work with Tim in future versions to clean up the NGUI stuff.  Right now there is a reference to NGUI in the OuyaGameObject.cs  OnGUI  and that makes the dependancy.. if you remove that entire functions,  then the plugin examples won't work, but your dependancy is gone from the atlas and you can safely remove the NGUI examples.

    Hope that helps,
    Marco
    Marco Williams
    Hashbang Games

    Gravi is available on the OUYA look for it in the store!

    Steam Greenlight Vote yes on Gravi
    Purchase our Gravi on Desura
    Desura Digital Distribution
  • tgraupmanntgraupmann Posts: 2,869Administrator, Team OUYA
    Anybody working with Unity has seen both scenes and prefabs. With Force Text you can have an easier time merging your scenes and prefabs.

    ~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].
  • RandroidRandroid Posts: 13Member
    edited January 2013
    Here's a step by step of mapping the 360 A button from the 'Setting up controller input for the IDE" video. 

    1. Plug in Xbox 360 Controller and notice it appears in the console log
    2. Open the OuyaShowController.cs script
    3. Move the #region Initialize Ouya line down into the try{} (About line 72)
    4. Add an #if ANDROID line immediately after the #region Initialize Ouya line. Add the #endif line immediately before the #endregion line (About line 132)\
    5. Add #region Handle Input for the IDE and then #endregion in the first two lines of the UpdateController() method
    6. Add #if UNITY_EDITOR and then #endif inside #region Handle Input for the IDE that you just created
    7. Inside the #if Unity_EDITOR that you just created add:
    if(Input.GetButton("360_A_Button"))
    Debug.Log ("360_A_Button");
    m_keyEnum = OuyaSDK.KeyEnum.BUTTON_A;
    m_inputAction = OuyaSDK.InputAction.KeyDown;
    else
    {
    if(m_keyEnum == OuyaSDK.KeyEnum.BUTTON_A)
    {
    m_keyEnum = OuyaSDK.KeyEnum.NONE;
    }
    }
    8. Edit > Project Settings > Input then expand Axes
    9. Change size to 18
    10. Expand the new Jump item and rename it "360_A_Button"
    11. Change Descriptive Name to "Controller A Button"
    12. Change Positive Button to "joystick button 0"
    13. Run the game and press A. You should see the virtual A button turn green.


    Edit: I had a typo so this wasn't working for me. The above should now work just fine. I'll do the steps for the trigger as well.
    Post edited by Randroid on
  • RandroidRandroid Posts: 13Member
    0.0.5.1 is great! I does work with an Xbox 360 controller in the IDE right out of the box.

    My question is, is it mapped to work with Android tablets as well? Or do I need to do Java key events to handle Android input?

    Things to note with the current IDE mappings and an Xbox 360 Controller:
    1. No mappings for RS and LS buttons
    2. In the multiplayer example, the Right Thumbstick doesn't have any functionality (ideally it would rotate the player)
    3. In the multiplayer example, the D-Pad doesn't have any functionality (ideally it would move the player)
    4. In the multiplayer example, the Left Thumbstick behaves as follows:
      • Holding left rotates counterclockwise
      • Holding right rotates clockwise
      • Holding up walks forward (sometimes with no animation)
      • Holding down walks backwards (sometimes with no animation)
  • tgraupmanntgraupmann Posts: 2,869Administrator, Team OUYA
    Yes the mappings should work on standalone, on android unity ide, on android, and on ouya.

    I'll check on the LS and RS mappings. The buttons should be there, maybe just not used in the example. I need to add something to the xbox 360 controller model to show it was pressed. I guess it could go up and down.

    yep
    ~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].
  • RandroidRandroid Posts: 13Member
    Ah, it must be my connection.
    I'm going Wired USB 360 Controller > Female to Female  USB Extender > USB to Micro USB Cable.

    For the record, that doesn't seem to work. I just ordered the adapter, so hopefully that solves my issue.
  • tgraupmanntgraupmann Posts: 2,869Administrator, Team OUYA
    On Windows at least, I had to shutdown Unity and replug the wired controllers, then relaunch Unity when weird things happen. Like two button down events for one button down.
    ~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].
  • HicsyHicsy Posts: 177Member
    [OT]
    @Randroid i don't think it works like that. USB has "a" or "b" plugs... im pretty sure some new tablets get around it with fancy firmware to become a "USB host" - it's my understanding that you can't do it with just any device
    [/OT]
    Can't find aapt.exe? Temp fix: Copy another one from 'android_sdk/build-tools/17.0.0' back to your 'platform-tools'
           -=Hicsy=-
    PM me        Facebook

  • HashbangGamesHashbangGames Posts: 96Member
    @Randroid  The  LS & RS  ( aka L3 & R3 ) stick button press do work and are mapped in the 0.0.5.1  build.  But I do not have them linked up in the OuyaShowController  Example. 
    Marco Williams
    Hashbang Games

    Gravi is available on the OUYA look for it in the store!

    Steam Greenlight Vote yes on Gravi
    Purchase our Gravi on Desura
    Desura Digital Distribution
  • HashbangGamesHashbangGames Posts: 96Member
    edited January 2013
    Here are some new videos I just created.. for out of the box startup and scripting 

    OuyaSDK Unity Package(0.0.5.1) Import and Setup 


    Ouya Unity Package - Getting Started (0.0.5.1) 


    Update:  In second video..  the Y axis is supposed to be "LY" not "LX" .. have not finished my morning rockstar .. lol 

    Hope it helps you guys!
    -Marco
    Post edited by HashbangGames on
    Marco Williams
    Hashbang Games

    Gravi is available on the OUYA look for it in the store!

    Steam Greenlight Vote yes on Gravi
    Purchase our Gravi on Desura
    Desura Digital Distribution
  • tgraupmanntgraupmann Posts: 2,869Administrator, Team OUYA
    Thanks @HashbangGames looks good.

    In 4.X it logs an error when loading the input settings, but you can ignore the error.

    After importing the package, reload the project and the input should be good to go.
    ~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].
  • TomPendergrassTomPendergrass Posts: 14Member
    This is great, Thank you @HashBangGames and @tgraupmann for converting this nightmare into a dream. I'd hug you both if I could :D
  • burtonposeyburtonposey Posts: 8Member
    I'm actually not getting the error on the input settings load. Nothing's happening. I switched projects to something else and back to the one I'm targeting Ouya. No luck. I shut Unity down entirely. No luck.

    I'm using Unity 4.0.1f2 and targeting Android. Thanks for all of your hard work and efforts and thank you for any further help you can possibly provide.
  • tgraupmanntgraupmann Posts: 2,869Administrator, Team OUYA
    Did you plug and unplug your controller? Restart Unity? Did you click in the game view to see the controller input?
    ~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].
  • burtonposeyburtonposey Posts: 8Member
    I'm actually not getting the error on the input settings load. Nothing's happening. I switched projects to something else and back to the one I'm targeting Ouya. No luck. I shut Unity down entirely. No luck.

    I'm using Unity 4.0.1f2 and targeting Android. Thanks for all of your hard work and efforts and thank you for any further help you can possibly provide.
    To update: I started hacking around the OuyaMenuAdmin.cs file. I started looking at the path and felt like maybe the path wasn't quite right. I first tried Application.dataPath as a prefix to the InputManager.asset path. I took the "Assets\" off of the front of the string since Application.dataPath already has that. I then realized that the Application.dataPath value had slashes that were going opposite the way they were written in the MenuAdmin file. So I gave it a shot and switched them. Now it appears that I load the file, but nothing is really happening. Before I wasn't even getting into the fi.Exists conditional. Here's where I'm at. Thanks for any additional help.

    (line 49, OuyaMenuAdmin.cs)

    #elif UNITY_4_0

            string src = Application.dataPath + @"/Ouya/ProjectSettings/4.X/InputManager.asset";

            FileInfo fi = new FileInfo(src);

            if (fi.Exists) //it gets here in with my tweaks

            {

                fi.CopyTo(dest, true);

                Debug.Log(string.Format("{0} Succesfully restored: {1}", DateTime.Now, dest));

                AssetDatabase.Refresh();

            }

    #endif


    Every now and then I'll get the error "You are trying to import an asset which contains a global game manager. This is not allowed." from the AssetDatabase.Refresh() line.


    Thanks again.

  • tgraupmanntgraupmann Posts: 2,869Administrator, Team OUYA
    And the OuyaGameObject prefab is in your scene?
    ~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].
  • burtonposeyburtonposey Posts: 8Member
    A little closer! I had to reverse the slash on the string dest on line 39 as well. I have all of the inputs, but now I need to figure out why my input is no longer reading in at all. At least before it was bizarre and some buttons were working :). It might be a Mac/PC difference of mapping? Anyone else using Mac here?
  • tgraupmanntgraupmann Posts: 2,869Administrator, Team OUYA
    I tested wtih a Mac, but on 3.5.7.
    ~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].
  • burtonposeyburtonposey Posts: 8Member
    Cool. I'm at the point now where I have a wireless controller being detected in the application, but there are no button inputs coming in as far as I can tell (I'm logging Event.current). I wasn't able to get my wired 360 controller detected (despite the tattiebogle seeing it) and fortunately I bought a wireless xbox controller adapter the other day and it is at least acknowledging the controller.
  • HashbangGamesHashbangGames Posts: 96Member
    @burtonposey   take a look at the  OuyaMultiController example,  i believe the file is OuyaInputHandlerExample.cs   

    You'll see the following code: 

    What i've done is allowed you to put in custom controller types if your controller input is not being recognized in the IDE.   

    The code in the top of that is to help you detect what the codes are being reported from your controller.
    The bottom part allows you to append a custom mapping  for your controller.

    Hopefully it will help you debug your controller.   Also note:  If your XBOX controller name that unity is reporting is NOT one of the following then send us the Controller Name so we can add it to the list of supported controllers.

                case "XBOX 360 WIRELESS RECEIVER":
                case "CONTROLLER (AFTERGLOW GAMEPAD FOR XBOX 360)":
                case "CONTROLLER (XBOX 360 WIRELESS RECEIVER FOR WINDOWS)":
                case "MICROSOFT X-BOX 360 PAD":
                case "CONTROLLER (XBOX 360 FOR WINDOWS)":
                case "XBOX 360 FOR WINDOWS (CONTROLLER)":

    Unfortunately there is no easy way to support all the different controllers as we never know exactly which controllers names are reported in Unity.   We've been adding them as we see or find them.

    You can add your controller name to line: 444 of the OuyaInputManager  and 370 of OuyaGameObject


    Hope that helps!

    --Marco
    Marco Williams
    Hashbang Games

    Gravi is available on the OUYA look for it in the store!

    Steam Greenlight Vote yes on Gravi
    Purchase our Gravi on Desura
    Desura Digital Distribution
  • burtonposeyburtonposey Posts: 8Member
    I'm taking a look at this all now. I'll let you guys know if I have any further questions, but I think this is the missing link in my knowledge. Does/Can the Ouya controller ever work on your computer for testing?

    My controller name being reported (down the left side of the Game Window) is "Microsoft Wireless 360 Controller".

    Still trying to get back to being able to deploy. I actually had to change line 120 of OuyaMenuAdmin to:
    m_pathUnityEditor = EditorApplication.applicationPath;//new FileInfo(EditorApplication.applicationPath).Directory.FullName;

    It was not getting the Unity.app in the path as it needed to find the jar file. I've got to switch gears to actually making a game for a while, hehe, but thank you for the help guys!
  • brianbraatzbrianbraatz Posts: 12Member
    Hmm.. I installed the latest and followed the instructions in the email. I have the most recent unity firmware and NOTHING..

    I have tried all the scenes.. I can get the controller scene to respond- but it acts strange. I hit a button and the whole controller lights up green!.

    Ack!

    Anyone having the same problem(s)? 

    I have a day job and I am HOPING to be able to integrate Ouya controllers over the weekend, but this latest sdk is not working for me :(

  • burtonposeyburtonposey Posts: 8Member
    Yep, same here. Might want to take a look at some of the tips Marco & Tim have been giving me. I'm getting much closer (note some of my findings as well). I don't have any more time to look into it today. I'll probably put 3-4 hours into tomorrow. Let us know what you find @brianbraatz
  • tgraupmanntgraupmann Posts: 2,869Administrator, Team OUYA
    The users that are having trouble seem to be on Unity 4.X, and I'm not sure what the issue is?  I had success importing to Unity 3.5.7 and then upgrading the project. Vs. importing directly into 4.X.
    ~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].
  • HashbangGamesHashbangGames Posts: 96Member
    We'll check 4.0 sometime tonight or tomorrow and find the bugz.   However, @burtonposey  do you have the latest version of the Unity Package 0.0.5.1  if not make sure to PM tgraupmann and he will send it to you.
    Marco Williams
    Hashbang Games

    Gravi is available on the OUYA look for it in the store!

    Steam Greenlight Vote yes on Gravi
    Purchase our Gravi on Desura
    Desura Digital Distribution
  • burtonposeyburtonposey Posts: 8Member
    We'll check 4.0 sometime tonight or tomorrow and find the bugz.   However, @burtonposey  do you have the latest version of the Unity Package 0.0.5.1  if not make sure to PM tgraupmann and he will send it to you.
    I do have it. thanks for checking. There are a few lingering NGUI files in one of the packages that I missed (not the NGUI package itself). I have the full version, so it borked my NGUI for a few minutes. Just figured I would point it out. I was thinking I'd just avoid the NGUI package, but some NGUI files were in one of the two others.
  • bronergamesbronergames Posts: 13Member
    I had same issue as Brian but noticed the window on the right that says what button ur presses is accurate so I'm ignoring the lights. With 0.0.5.1 and hash's new videos I was able to apply everything to skeleton character in unity 4.0
Sign In or Register to comment.