Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletter Hub
Free Learning
Arrow right icon
timer SALE ENDS IN
0 Days
:
00 Hours
:
00 Minutes
:
00 Seconds
OUYA Game Development by Example
OUYA Game Development by Example

OUYA Game Development by Example: An all-inclusive, fun guide to making professional 3D games for the OUYA console

eBook
€17.99 €25.99
Paperback
€32.99
Subscription
Free Trial
Renews at €18.99p/m

What do you get with eBook?

Product feature icon Instant access to your Digital eBook purchase
Product feature icon Download this book in EPUB and PDF formats
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
OR
Modal Close icon
Payment Processing...
tick Completed

Billing Address

Table of content icon View table of contents Preview book icon Preview Book

OUYA Game Development by Example

Chapter 2. Installing Unity and the OUYA ODK

In the previous chapter, we briefly explained the Unity3D engine, which we'll be using to create games for the OUYA console. In this chapter, you'll link your OUYA to your computer and the Unity development environment, and create a simple workspace to make sure you can deploy and test your coded prototypes using the console.

In this chapter, we will cover the following topics:

  • Installing the game engine

  • Downloading and configuring additional packages

  • Modifying the PATH variable

  • Installing packages with the Android SDK

  • Configuring the USB connection

Installing the game engine


The first thing we'll do is install the game engine itself. It's a good idea to install Unity first because you'll have to link every other package as and when you download it.

Time for action – setting up Unity


You'll be spending most of your time throughout the course of this book working in the Unity environment, so it's important to get it set up correctly and acclimate yourself with every element of the workspace layout. Perform the following steps to set up Unity:

  1. To begin installing Unity, download the installer from http://unity3d.com/ by clicking on the Download tab.

  2. Once the download completes, run the installer. It may prompt you with some optional packages to install, including an example project, a web player, and a code editor called MonoDevelop.

    The example project and web player aren't necessary as they apply to non-OUYA games, so you can leave them checked or un-check them depending on whether or not you want to explore games on other platforms. However, you'll want to leave MonoDevelop checked, as shown in the following screenshot:

    If you're using Windows and already use Visual Studio for coding projects, you can also configure Unity to use that...

Downloading and configuring additional packages


Right now, your Unity installation can only build and run games that are playable on your standalone PC/Mac client. Feel free to exit Unity for now—we'll come back to it when we've downloaded all of the required packages.

Time for action – downloading Java, the Android SDK, and the ODK


The first component we'll need is the Java Development Kit (JDK) and Java Runtime Engine (JRE) to handle the Java-side of the OUYA console. Because these are common packages, you may already have them installed on your computer; to check this, open a command line (Command Prompt in Windows or Terminal in Mac) and type the command javac -version. If a version number is displayed, skip over step one of this section and move on to downloading the Android ADT bundle. If you receive an error message that reads "command not found", continue with these steps to install the JDK and JRE.

  1. Download and install the JDK and JRE, both of which are available on the Oracle website at http://www.oracle.com/technetwork/java/javase/downloads/index.html.

    The download links will be in the middle of the page, as shown in the following screenshot, with a Server JRE download button between them that you can ignore:

  2. Once you've downloaded and run the...

Modifying the PATH variable


Before you issue commands to OUYA from your command line or terminal, you'll need to make sure your system recognizes those commands. To do this, you'll be editing your PATH variable to include the location of the Android SDK you downloaded.

Note

The PATH variable is a string of directory locations, or paths, that your command line looks through when it's checking for commands. Any commands in directories that are included in your PATH variable can be run from any working directory instead of having to be run from the folder they're stored in.

Mac OS and Windows both have PATH variables, but they're edited differently; the upcoming tutorials will cover both the operations step by step.

Time for action – editing PATH on Mac OS


If you're using Mac OS, your PATH variable can read paths from your .bash_profile script. If you aren't familiar with it, you may not have one yet; so in that case, you'll need to create it by performing the following steps:

  1. Start up the Terminal and enter cd ~/ to navigate to your home folder.

  2. Type touch .bash_profile to create it.

  3. Enter open -e .bash_profile to open it for editing.

Once you have your bash profile open, add the following lines to it:

export ANDROID_HOME="~/Development/adt-bundle-mac-x86_64"
export PATH=$PATH:$ANDROID_HOME/sdk/tools
export PATH=$PATH:$ANDROID_HOME/sdk/platform-tools

Tip

If you've changed your default shell from bash to a different shell, your profile may be named differently. For instance, if you're using zsh, you'll want to edit ~/zshrc instead of ~/.bash_profile. Check your shell's documentation for the exact name and location of the profile file.

Now that you've edited your PATH variable, you'll want to refresh it by...

Time for action – editing PATH on Windows


Perform the following steps to edit the PATH variable on Windows:

  1. To edit the PATH variable on Windows, right-click on Computer and select Properties. In the left panel of the Properties window, select Advanced system settings and click on Environment Variables….

  2. In the new window, in the topmost table labeled User variables, look for a variable called Path or PATH. If it exists, click on Edit… and add the following code to the end. If it doesn't exist, click on New… and create a variable called Path with the following code in it, but omit the preliminary semicolon:

    C:/Development/adt-bundle-windows-x86-64/sdk/tools;
    C:/Development/adt-bundle-windows-x86_64/sdk/platform-tools
  3. Accept the changes and exit the Environment Variables window. To prepare for the next step, open the Android SDK manager by navigating to C:\Development\adt-bundle-windows-x86_64 and running SDK Manager.exe.

What just happened?

The PATH variable on your computer tells your command...

Time for action – installing Android packages


The SDK manager will give you a list of packages that you can check and install by performing the following steps:

  1. Check the following packages:

    • Android SDK Tools

    • Android SDK Platform-tools

    • Anroid 4.1.2 (API 16) platform (except Google APIs)

    • Android Support Library (in the Extras folder)

    • Google USB Driver (in the Extras folder)

    • The following screenshot depicts these packages:

  2. After checking all of the packages listed previously, click on Install 12 packages… (the total number may vary) and let the SDK manager run its course.

    Tip

    The future versions of the OUYA software may use a later version of the Android platform. For updated version numbers and instructions, refer to the documentation found at https://devs.ouya.tv/developers/docs/setup.

The packages include almost everything we need, but we need to manually configure the Android USB driver before it's ready to use, which is what we'll do next.

What just happened?

The Android SDK Manager is a...

Configuring the USB connection


Now is a good time to connect your OUYA to the computer and establish a connection between the two. Use a micro USB-to-USB cable to connect them together and press the power button on the top of the OUYA to turn it on.

You can verify that the device is connected by running the following three commands in succession:

android update adb
adb kill-server
adb devices

If the OUYA is powered on and connected, you should see it represented as a string of seemingly random characters in the device list. However, because the OUYA is a unique device, the driver information that you downloaded with the SDK manager may not have everything it needs to properly detect the OUYA when it's connected to your computer. To fix this, we'll have to manually insert an entry for OUYA into the driver file. Note that this step is only necessary if you're running a Windows operating system; if you're developing for OUYA on a Mac, this won't be an issue and your OUYA will connect without...

Time for action – configuring the USB driver on Windows


The file we need to edit on Windows operating systems is found at C:\Development\adt-bundle-windows-x86_64\sdk\extras\google\usb_driver\android_winusb.inf. Perform the following steps to edit the driver file:

  1. Double-click on the file to open it in Notepad and find the section that begins with [Google.NTx86]. You'll see a list of devices already below this header; after the last device, add the highlighted text shown in the following screenshot:

  2. Add the same block of text in the same place under the similar section [Google.NTamd64], then save the document, and close Notepad.

    Tip

    The values that you entered shouldn't have a blank space after them, including any spaces or returns. Make sure that each line ends with the final character to avoid errors.

  3. Next, open the Windows Command Prompt and run the following commands:

    adb kill-server
    echo 0x2836 >> "%USERPROFILE%\.android\adb_usb.ini"
    adb start-server
    
  4. Close the command prompt and right...

Time for action – exporting OUYA packages from Unity


The last thing you need before you can link everything you've downloaded to Unity is the Unity OUYA plugin. This can be downloaded directly from the developers at https://github.com/ouya/ouya-unity-plugin. Perform the following steps to install the plugin:

  1. Click on the button on the page that says Download ZIP and put it in a location that's easy to find. When it has downloaded, unzip the archive and open Unity.

  2. In the Unity window, navigate to File | Open Project…, browse the unzipped folder, and click on Open. On Mac OS, you may need to click on Open Other… to access the folder's location.

    Depending on the latest versions of Unity and the plugin, you may be prompted to upgrade the project to work with the latest version of Unity. If it does, then accept the prompt; if you don't receive the prompt, it will work fine as it is.

    After opening the plugin files as a project, two new drop-down lists will appear on the top toolbar of Unity: OUYA...

Time for action – importing packages into a new workspace


Now that you have all of the packages required for OUYA development, you can import them into the Unity workspace by performing the following steps:

  1. Start a new project in Unity and double-click on the core package you exported to import it into your workspace. Unity will prompt you with a list of possible items to import; make sure they're all checked and click on Import. The OUYA menu will re-appear along the top toolbar as soon as the import completes.

  2. Open the Window menu along that toolbar and click on Open OUYA Panel.

  3. This window is where we'll finally link all of the packages we've downloaded so far to the engine. The panel also has a space to link an NDK, which we will download and link to last.

  4. The Unity tab will automatically contain what it needs, so first click on the Java JDK tab and browse to the location of your JDK, as shown in the following screenshot:

  5. Next, click on the Android SDK tab and do the same. Note that it may...

Summary


At long last, the linking is complete! Give yourself a pat on the back for getting through the dull part. Even though you haven't done any development yet, all of the packages that you downloaded, configured, and linked to Unity will allow you to deploy your code to run on your OUYA console natively at any time, which is an important step in creating software for an external device. Save the project as it is so that you have a linked project ready to go for the next chapter where you'll begin programming and testing.

Left arrow icon Right arrow icon

Description

The OUYA console and development kit gives you the power to publish video games for the players, creating a console marketplace of the gamers, for the gamers, and by the gamers. Using the OUYA developer kit and the Unity3D game engine, even beginners with a captivating game idea can bring it to life with a hint of imagination. OUYA Game Development by Example uses a series of feature-based, step-by-step tutorials that teach beginners how to integrate essential elements into a game engine and then combine them to form a polished gaming experience.

Who is this book for?

Using this book, you can get started with creating games without any game development experience. This book is perfect for anyone that wants to make video games but is unsure of where to start. It covers elements of game design, art, and programming comprehensively, and the engine used throughout all of the tutorials is very beginner-friendly. No prior knowledge is assumed or required for the tutorials in this book.

What you will learn

  • Control camera functions, lighting, and appearance in a 3D game engine
  • Script gameplay in Unity3D in the C# programming language
  • Use the OUYA API to process input from controllers
  • Create longer games by coding, saving, and loading systems
  • Configure your computer to deploy code directly to the OUYA console
  • Improve the appearance of games with materials and textures
  • Implement inapp purchases in the game in order to monetize the game in a more effective manner

Product Details

Country selected
Publication date, Length, Edition, Language, ISBN-13
Publication date : May 20, 2014
Length: 268 pages
Edition :
Language : English
ISBN-13 : 9781849697231
Languages :

What do you get with eBook?

Product feature icon Instant access to your Digital eBook purchase
Product feature icon Download this book in EPUB and PDF formats
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
OR
Modal Close icon
Payment Processing...
tick Completed

Billing Address

Product Details

Publication date : May 20, 2014
Length: 268 pages
Edition :
Language : English
ISBN-13 : 9781849697231
Languages :

Packt Subscriptions

See our plans and pricing
Modal Close icon
€18.99 billed monthly
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Simple pricing, no contract
€189.99 billed annually
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just €5 each
Feature tick icon Exclusive print discounts
€264.99 billed in 18 months
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just €5 each
Feature tick icon Exclusive print discounts

Frequently bought together


Stars icon
Total 103.97
Mastering Unity 2D game development
€45.99
OUYA Game Development by Example
€32.99
Ouya Unity Game Development
€24.99
Total 103.97 Stars icon

Table of Contents

9 Chapters
Experiencing the OUYA Chevron down icon Chevron up icon
Installing Unity and the OUYA ODK Chevron down icon Chevron up icon
Diving into Development Chevron down icon Chevron up icon
Moving Your Player with Controller Input Chevron down icon Chevron up icon
Enhancing Your Game with Touch Dynamics Chevron down icon Chevron up icon
Saving Data to Create Longer Games Chevron down icon Chevron up icon
Expanding Your Gameplay with In-app Purchases Chevron down icon Chevron up icon
Polishing and Prepping Your Game for Deployment Chevron down icon Chevron up icon
Blazing Your Own Development Trail Chevron down icon Chevron up icon

Customer reviews

Rating distribution
Full star icon Full star icon Full star icon Full star icon Empty star icon 4
(3 Ratings)
5 star 0%
4 star 100%
3 star 0%
2 star 0%
1 star 0%
W Boudville Jun 10, 2014
Full star icon Full star icon Full star icon Full star icon Empty star icon 4
At first I thought Ouya [I'm not going to capitalise it all] was a software engine; not being a hardcore gameboy. But it is hardware! Wow! So used to reviewing books on software that this makes a refreshing change. What the text suggests is that getting the Ouya gives you a leg up in developing games of professional quality. A hardware IDE. On top of this sits the Unity3D engine and the book takes you into coding with C#.The first chapter is really more important than in some other books, because it orients you in the Ouya environment. Where the store that you can browse for games does not list prices! Quickly the book explains that for a game to make it into the store, it needs at least one free element. Like free play credits.There is an immediate dynamic tension here. You after all are likely reading the book to want to code successful games. That people will pay money to play. So really seeing the game store with no prices is not exactly encouraging.Now for the game store, the book cautions that "the games are often smaller and less expensive... because of the abundant indie presence". What this translates to is that a typical game is simply not as impressive. The book does not come right out and say this, but reading between the lines, that is what you get. The indie developers [and you aspire to be one of them] just don't have the financial wherewithal to underwrite a sophisticated and complex game.The book is somewhat pitched towards a new programmer. Because in part it introduces object oriented programming as a new concept. And I am not really sure why they chose C# instead of java or C++. But that's not a big deal. If indeed you don't know any of those languages, learning C# will certainly help you if you have to migrate to the others.The game development environment explicated later in the book looks simple enough. Like using the IDE to pick a shader and then having the means via a GUI to vary the shininess and specular colour. Very easy and intuitive. Plus, learning Unity's classes greatly speeds up the coding of your game.The text takes you all the way through to submitting a game to the Ouya store. What it does not discuss is the top level decision about whether you want to deal with Ouya in the first place. Professionally, Ouya is likely not where the money is; not where the big time is. Just be aware of that, once you parse thru all the book.
Amazon Verified review Amazon
Damir Arh Jul 28, 2014
Full star icon Full star icon Full star icon Full star icon Empty star icon 4
One could easily say, this book is more than a bit from my usual field of expertise. I’m no game developer (the stuff I was doing while still in school doesn’t count) and I don’t own an OUYA. Well, at least I know a lot about C# which was used as the scripting language in the book. One could also say that because of that I am the target audience for the book.Still, even with my lack of previous experience, the book starts out really slow; too slow in my eyes. Though this should make it all that more suitable for complete beginners who have never programmed before. C# is explained from the very basics which is quite a challenge considering the small number of pages dedicated to this topic. As a side effect, there are a couple of inaccuracies and over-simplifications, but hopefully readers will grab a more in/depth book about C# and programming afterwards.Of course, most of the book focuses on Unity and gives a quite thorough overview of the basics through examples which make a lot of sense by the end of the book. The author’s experience with game development definitely shines through in these sample games. There’s also not much OUYA or Android specifics, except for the obvious setup of development environment and instruction on publishing and monetization options. I did get the feeling though, that the book focuses too much on step by step instructions and lacks a bit on the bigger picture, explaining why we’re actually doing all these things and how it works under the cover. Obviously, the reader will again have to find this information in a more advanced book.I liked a lot, how throughout the book there are many calls to action, giving the reader challenges to complete on his own. But still, this book can really serve only as the first step on the path to becoming a game developer, albeit a good one. The author is aware of that and therefore concludes with a couple of more advanced topics, such as development methodologies, source control, and architectural patterns; probably hoping to make the reader craving for more. I can sincerely recommend the book to anyone, trying to get a glimpse into the world of game development. It’s enough to see if that’s something for you and worth exploring further.
Amazon Verified review Amazon
Sai Sep 25, 2014
Full star icon Full star icon Full star icon Full star icon Empty star icon 4
Ouya as a game console was dead as soon as it was launched despite being one of the hottest Kickstarter programs in the day. But this book isn't about the hardware, it is about teaching or guiding you and me to the world of game development. Being a rockstar game developer has always been one of my dreams and this book would just be a good read, a stepping stone in the right direction.C# is the main language used for writing scripts for Unity. If you were a intermediate programmer, you'd probably want to skim through a few chapters covering the basics. For a beginning developer, it is a great book. The tasks/challenges at the end of the chapter are interesting and wold make you want to try them out. (atleast it did that to me). The instructions in the book are very concise and detailed but sometimes it leaves you feeling like a kid being told the same thing by a parent over and again. But again, the is no such thing as too much information.Overall this is a good beginners book to learn game development.
Amazon Verified review Amazon
Get free access to Packt library with over 7500+ books and video courses for 7 days!
Start Free Trial

FAQs

How do I buy and download an eBook? Chevron down icon Chevron up icon

Where there is an eBook version of a title available, you can buy it from the book details for that title. Add either the standalone eBook or the eBook and print book bundle to your shopping cart. Your eBook will show in your cart as a product on its own. After completing checkout and payment in the normal way, you will receive your receipt on the screen containing a link to a personalised PDF download file. This link will remain active for 30 days. You can download backup copies of the file by logging in to your account at any time.

If you already have Adobe reader installed, then clicking on the link will download and open the PDF file directly. If you don't, then save the PDF file on your machine and download the Reader to view it.

Please Note: Packt eBooks are non-returnable and non-refundable.

Packt eBook and Licensing When you buy an eBook from Packt Publishing, completing your purchase means you accept the terms of our licence agreement. Please read the full text of the agreement. In it we have tried to balance the need for the ebook to be usable for you the reader with our needs to protect the rights of us as Publishers and of our authors. In summary, the agreement says:

  • You may make copies of your eBook for your own use onto any machine
  • You may not pass copies of the eBook on to anyone else
How can I make a purchase on your website? Chevron down icon Chevron up icon

If you want to purchase a video course, eBook or Bundle (Print+eBook) please follow below steps:

  1. Register on our website using your email address and the password.
  2. Search for the title by name or ISBN using the search option.
  3. Select the title you want to purchase.
  4. Choose the format you wish to purchase the title in; if you order the Print Book, you get a free eBook copy of the same title. 
  5. Proceed with the checkout process (payment to be made using Credit Card, Debit Cart, or PayPal)
Where can I access support around an eBook? Chevron down icon Chevron up icon
  • If you experience a problem with using or installing Adobe Reader, the contact Adobe directly.
  • To view the errata for the book, see www.packtpub.com/support and view the pages for the title you have.
  • To view your account details or to download a new copy of the book go to www.packtpub.com/account
  • To contact us directly if a problem is not resolved, use www.packtpub.com/contact-us
What eBook formats do Packt support? Chevron down icon Chevron up icon

Our eBooks are currently available in a variety of formats such as PDF and ePubs. In the future, this may well change with trends and development in technology, but please note that our PDFs are not Adobe eBook Reader format, which has greater restrictions on security.

You will need to use Adobe Reader v9 or later in order to read Packt's PDF eBooks.

What are the benefits of eBooks? Chevron down icon Chevron up icon
  • You can get the information you need immediately
  • You can easily take them with you on a laptop
  • You can download them an unlimited number of times
  • You can print them out
  • They are copy-paste enabled
  • They are searchable
  • There is no password protection
  • They are lower price than print
  • They save resources and space
What is an eBook? Chevron down icon Chevron up icon

Packt eBooks are a complete electronic version of the print edition, available in PDF and ePub formats. Every piece of content down to the page numbering is the same. Because we save the costs of printing and shipping the book to you, we are able to offer eBooks at a lower cost than print editions.

When you have purchased an eBook, simply login to your account and click on the link in Your Download Area. We recommend you saving the file to your hard drive before opening it.

For optimal viewing of our eBooks, we recommend you download and install the free Adobe Reader version 9.