• Like
  • Save
Introduction to Ouya for unity3D Developers
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

Introduction to Ouya for unity3D Developers

  • 1,080 views
Published

Accompanying slides for the talk I did at London Unity Usergroup on June 27th 2013. Introducing the OUYA to Unity3D developers

Accompanying slides for the talk I did at London Unity Usergroup on June 27th 2013. Introducing the OUYA to Unity3D developers

Published in Technology
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Be the first to comment
No Downloads

Views

Total Views
1,080
On SlideShare
0
From Embeds
0
Number of Embeds
0

Actions

Shares
Downloads
0
Comments
0
Likes
2

Embeds 0

No embeds

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
    No notes for slide

Transcript

  • 1. OUYA for Unity3D Devs
  • 2. What is OUYA? • New games console • Costs £99 • Tegra 3 Mobile Chipset • Runs on Android • Every device is a devkit • Has its own app store (no Google Play)
  • 3. Designed for TV • HDMI Out • HD resolutions: – 1080p (1920 x 1080) default – 720p (1280 x 720) also supported
  • 4. Designed for TV • Controller Input Scheme – Some games are just not designed for a controller – On Screen Buttons Behave Differently – Consider Xbox 360 support
  • 5. Designed for TV • Overscan affects UI design
  • 6. Free to Try • All games must have a free part – Up to developers how they do that • All purchases use IAP – No prices displayed on store – Up to developers how they monetize – But adverts are discouraged • Not all monetization models will work – Low install base (vs. mobile/PC) – App prices higher on average
  • 7. Let’s get Technical 1. Download ODK from ouya.tv 2. Install Drivers – Windows/Mac/Linux Supported – Works with ADB. Acts like any other Android device 1. Clone OUYA-Unity packages from github – https://github.com/ouya/ouya-unity-plugin
  • 8. Build Packages 4. Open OUYA-Unity git clone as a unity project 5. Use “OUYA” menu to export OUYA packages 6. Import OuyaSDK-Core to existing project
  • 9. Android Settings 7. Edit > Project Settings > Player > Android 8. Default Orientation > Landscape Left 9. Min API Level > Api 16 (Jellybean)
  • 10. OUYA Panel 10.Window > Open OUYA Panel 11.Set Android SDK / NDK / JDK paths 12.Set package name & Sync Bundle IDs 13.Compile in reverse order : NDK > Plugin > Java > Compile 14.Make sure OUYA is only android device connected 15.Build & Run Pro only. Otherwise, File > Build Settings > Switch to Android
  • 11. Most Important • Only 1 OuyaGameObject per game/app • Must be in first scene • Accessed statically from other scenes
  • 12. Input Handling public class ouyaInputExample : MonoBehaviour { void Awake(){ OuyaInputManager.OuyaButtonEvent.addButtonEventListener(HandleButtonEvent); } void OnDestroy(){ OuyaInputManager.OuyaButtonEvent.removeButtonEventListener(HandleButtonEvent); } private bool isDown = false; public string nextScene = "ouyagametest"; private void HandleButtonEvent(OuyaSDK.OuyaPlayer p, OuyaSDK.KeyEnum b, OuyaSDK.InputAction bs){ if(b==OuyaSDK.KeyEnum.BUTTON_U){ if(bs==OuyaSDK.InputAction.KeyUp){ if(isDown){ // button released isDown = false; GameObject.Find("text1").guiText.text = “U up"; // Application.LoadLevel(nextScene); } } else if(bs==OuyaSDK.InputAction.KeyDown){ if(!isDown){ // button pressed down isDown = true; GameObject.Find("text1").guiText.text = “U down"; } } } } }
  • 13. Get Axis Input public class ouyaGetAxisValues : MonoBehaviour { public GUIText text4; public GUIText text3; private float mSensitivity = 0.005f; void Update () { float LS_X = OuyaInputManager.GetAxis("LX",OuyaSDK.OuyaPlayer.player1); float LS_Y = OuyaInputManager.GetAxis("LY",OuyaSDK.OuyaPlayer.player1); float stickMagf = stickMag(LS_X,LS_Y); if(!isStickCentred(stickMagf)){ float speed = stickMagf * mSensitivity; text4.transform.Translate(LS_X*speed,LS_Y*speed,0); } text3.text = "LS_X:" + LS_X.ToString() + " LS_Y:" + LS_Y.ToString(); } private float stickMag(float axisX, float axisY) { float stickMagf = (float) Mathf.Sqrt(axisX * axisX + axisY * axisY); return stickMagf; } private float c_minStickDistance = 0.35f; private bool isStickCentred(float stickMagf) { return !(stickMagf >= c_minStickDistance); } }
  • 14. If All Else Fails Copy/Paste The Example App 1. Create new project 2. Import Package > Custom Package > OuyaSDK-Examples 3. OUYAPanel > Build Settings > SceneShowUnityInput > Switch to Example 4. Scene Hierarchy > OuyaShowUnityInput.cs
  • 15. End • Dedicated OUYA-Unity team: – Tim Graupmann @tgraupmann • Google Hangouts Every Week • Lots of youtube videos • Active Community
  • 16. End Main forums: • http://forums.ouya.tv/categories/unity-on-ouya Docs: • https://github.com/ouya/docs General Android Primer: • http://gamedev.tutsplus.com/articles/how-to- learn/how-to-learn-ouya-gamedev/
  • 17. Performance • Roughly equivalent to Nexus 7 • Drawcalls kill performance – Texture Atlassing – BEAST Lightmapping • Mobile Unlit Shaders • Consider manual culling • If desperate, use 720p http://forums.ouya.tv/discussion/comment/12291/ http://forums.ouya.tv/discussion/1520/making-3d-games-performant-on-ouya/p1