Ouya Unity Game Development

By Gary Riches
    What do you get with a Packt Subscription?

  • Instant access to this title and 7,500+ eBooks & Videos
  • Constantly updated with 100+ new titles each month
  • Breadth and depth in over 1,000+ technologies
About this book

Ouya is a microconsole running its own version of the Android operating system. The console features an exclusive Ouya store for applications and games designed specifically for the Ouya platform. It runs a modified version of Android 4.1 Jellybean, and is open to rooting without voiding the warranty. All systems can be used as development kits which allow any Ouya owner to be a developer without any licensing fee. Ouya Unity Game Development offers detailed, easy-to-follow, step-by-step instructions which will help you learn the ins and outs of Ouya development in Unity.

From connecting your device with Android Debug Bridge to publishing it on the Ouya Developer Portal, this book will explain the processes involved in creating a game from scratch. As you progress through the book, you will learn about scenes, prefabs, sounds, models, and animations. By the end of the seventh chapter, you will have a 3D game with multiple levels, the possibility of in-app purchases, and controller support that runs on both the Ouya and an Android phone.

Starting with an introduction to Ouya, you will learn how to set up an environment and render game levels on Ouya. You will learn how to change levels and how to save the current level. You will then dive into Ouya controller integration and character animation. This book will also teach you the workings of audio source components, and will show you how to add textures to prefabs. Finally, you will learn how you can monetize the game. By the end of this book, you will have the game running on Ouya and geared up to create games on your own.

Publication date:
October 2013


Chapter 1. What Is Ouya and Why Does It Matter?

Video games! From the bedroom developer to the video-game company, we can all create games that can inspire, educate, or are just plain fun. Let's look how video games got where they are and the history of indie game development till the current day with the Ouya.


The early years

It started on January 25, 1947. The United States Patent and Trademark office received a request for a patent on an invention described as a cathode ray amusement device. The patent was granted on December 14, 1948 and, while it was never marketed or sold to the general public, it was truly one of the first video games. The machine was a crude electromechanical device that did not use any memory or programming.

In the early 1950s, simple computer programs started to surface but they lacked interactivity, and with the limited accessibility of computers they would not be seen by many and were destined to be forgotten.

It wasn't until the 1970s that arcade machines as we know them came about. Nolan Bushnell and Ted Dabney created a coin-operated game named Computer Space. Nutting Associates bought the game and produced over 1,500 arcade machines. Computer Space had a steep learning curve, and because of this was unsuccessful, but it must still be remembered for being the first mass-produced video game offered for general sale.

Bushnell and Dabney went on to establish Atari in 1972 and assigned one of their employees, Allen Alcorn, with a training exercise. During that exercise, he created Pong, the virtual table tennis game we all know and love. Bushnell and Dabney were impressed with Alcorn's work and they decided to manufacture the game. Overall, Atari sold approximately 19,000 pong machines.

Creating a machine that could play a game was all well and good, but innovators were looking towards the future. What if a machine could play multiple games? This would truly give it the edge over its single-game relatives. Ralph Baer had begun work on such a machine in the late 1960s. He was demoing it in the early 1970s to companies including Sylvania, Sears, Magnavox, and General Electric. Magnavox licensed the system and produced the first video-game console in the world, the Magnavox Odyssey console. This console used cartridges containing jumpers that would alter the circuitry logic of the machine. A multigame device coupled with a strong marketing push meant that Magnavox sold over 100,000 Odyssey consoles in their first year. Over the lifetime of the console, the Odyssey console sold over 2,000,000 units.


The crash

By 1977, the market was flooded with cheap clones of Pong. Due to the sheer amount of cloned devices, none saw sustainable sales. Companies, faced with obsolete and aging stock, started to sell their systems at a loss causing a crash in the price of the devices and leading to many companies pulling out of the games market. Only two were able to weather the storm, Atari and Magnavox, but both reported losses in 1977 and 1978.

However, in 1978 a new game, Space Invaders, was released by a company named Taito. The game was a huge commercial success allowing Taito to create a US office and paving the way for a renaissance in video games. Atari licensed Space Invaders for their new machine, Atari 2600. This console revived the home video-game market, backed by the success of Space Invaders.


The recovery

While the Magnavox Odyssey console could play multiple games, the software was embedded on chips in the console; the cartridges would simply modify the circuitry inside the console with jumpers. The configuration of the jumpers would define which game you played. This meant that no software changes could occur on the device but hardware changes only. If a new game was created you'd have to buy a new device to attach to your television.

A new breed of console had been conceived and was starting to arrive, one that would allow new circuitry to be added easily and allow new games to be played without the need to buy a new machine. The trick was to have microprocessors inside the video-game cartridge. When the cartridge was plugged in to the device, it became part of the console, running whatever program was stored in Read Only Memory (ROM) on the cartridge.

While the system for running games had improved, video-game production itself was still very basic with most development being carried out by one person. They would create the concept, write the code, draw the graphics, and make the sound, much like one-man developer teams.

In 1979, four developers from Atari realized that the games they had created for meager pay were earning Atari around $60,000,000 a year. They decided to leave and set up their own company. Activision , the first third-party developer was founded.

After the success of Space Invaders, video games started to become mainstream. Arcade machines entered shopping malls, restaurants, and convenience stores bringing about an explosion in video-game usage. Space Invaders sold over 360,000 arcade machines worldwide and generated over $2,000,000,000 in quarters. From 1978 to 1981, the sales of arcade machines went from $50,000,000 to $900,000,000.

By 1982, video games generated more revenue than both pop music and Hollywood films combined.

It was around this time that a debt-ridden toy company named Nintendo turned around its fortunes, by firstly, securing the rights to distribute the Magnavox Odyssey console in Japan and secondly, creating their own games for arcades and on the Atari 2600 machine, Intellivision, and ColecoVision video-game systems. In 1985, Nintendo released Nintendo Entertainment System (NES) and the system was a huge success.


Home computers

Alongside the video-game consoles, home computers started to arrive on the scene. Notable entrants were the Commodore 64 , the Sinclair ZX Spectrum , the BBC Micro , and the Acorn Electron machines. These machines allowed their operators to program their own software. Magazines would print reams of code, to be hand typed to produce a game. There were mailing lists and, at some locations, even local shops selling a programmer's wares on their shelves in the form of floppy discs, tapes, or cartridges.

By 1984, computer gaming had overtaken the console gaming market. While not as simple to use, the ability to create programs for them was appealing and the software was more readily available.

The Commodore 64 machine was launched in 1982 and shipped with a Beginners' All-purpose Symbolic Instruction Code (BASIC) programming environment. This spawned a generation of bedroom programmers. They would work on software to show off their coding prowess, which could achieve the most impressive effects within the memory constraints of the machine, and are largely credited for creating the demo scene as it is today.

In 1985, the Atari ST and the Commodore Amiga machines arrived. While expensive initially, these machines became more affordable within a few years. The power of home computers was coming on in leaps and bounds, and both computers excelled in certain areas.

Home computers were ahead of contemporary game consoles in terms of graphical performance. The Amiga machine had many hardware revisions and the PC was improving with dedicated graphics and sound cards.

None of the game consoles allowed any hobbyist development, they all were closed systems. If you wanted to program, you would need to get a computer and learn how to code for it.

It was around this time that many small game companies were founded in the UK; Bitmap Brothers, Psygnosis, and Team 17 to name a few. While these companies started off small, the success of their games led to rapid expansion. While some have now ceased to exist and others have been bought out by larger companies, games based on their intellectual property and franchises still exist and are available for sale today. Some of the Bitmap Brothers games are available on Xbox Live Arcade, and Sony has just announced a remake of Shadow of the Beast, an early game from Psygnosis.


Advancement of game consoles

In 1995, the PlayStation console was launched. The hype around the launch and the fact that the machine could produce incredible 3D graphics for the time and output CD quality music meant the console was an instant success. Whereas developers for the PC would have to worry about hardware fragmentation, with the PlayStation all consoles had a standard set of specifications. There was a vibrant console modification scene that set about getting the PlayStation to run programs it wasn't intended to via chipping, a process that involved soldering chips on to the main PlayStation circuit board to circumvent its copy protection schemes. While Sony tried to clamp down on console modification by releasing new hardware revisions, they also acknowledged that there was a real desire to program for their machine.


The first indie console

In 1997, Sony made a new console available, the Net Yaroze console. A Net Yaroze console purchase included an Software Development Kit (SDK), a cable to connect it to your PC and some documentation. You would also have access to an online community of other Net Yaroze programmers. No other console manufacturer had offered such a device before. It wasn't a full development kit, but it would allow any member of the public to purchase one via mail order and start creating games. The Official PlayStation Magazine guide would regularly feature demos that had been created by Net Yaroze enthusiasts. A few of them were made into commercial PlayStation games and one game, Time Slip, was even updated and released on Xbox Live Arcade in 2012.

This kind of console manufacturer interaction with the enthusiast developer community was not repeated with PlayStation 2 or PlayStation 3 by Sony, or the Xbox or Xbox 360 by Microsoft. While they offer indie developer programs, they were often relegated to deep menu sections and poorly publicized over their more elaborately produced arcade games.

By the time these later consoles were established, the cost of games' development had sky-rocketed, a result of the complexity needed in modern games and the graphical detail could now be displayed. For example, Grand Theft Auto IV which was released on PlayStation 3, Xbox 360, and PC had over 150 developers working on it and cost more than $100,000,000 to produce. A far cry from the one man teams of the late 1970s and early 1980s.


Cellular games

While consoles and computers were well established, cell phones were still quite basic in comparison. In 1998, you would be happy with a Nokia phone that could display two colors. A brand new game was now coming installed on every new Nokia phone, Snake!. The game was simple but it was played by a massive audience as there were few alternatives. In 2003, with the success of Nintendo's Game Boy line of handheld consoles, Nokia tried to capitalize on cellular gaming and released the N-Gage game. The N-Gage game was not well received by the press or general public, but Nokia persisted with the idea until 2005 before relegating the N-Gage brand to a software service that was to slowly die.

Meanwhile, Microsoft had been producing Windows Mobile for cell phones. These devices offered true multitasking, the software you could purchase online and install from an SD card, advanced calendar syncing, and document viewing among other features. Many of them also offered resistive touch screens. Unfortunately, the complexity of the devices and a poor user experience hampered general uptake of the devices.

Cellular development was not in a good position. There were myriad processor speeds, screen sizes, memory amounts, and phone abilities. Any development, usually in Java for Nokia's Symbian platform, had to cater for the lowest common denominator, meaning game development was not being pushed forward on cellular devices.


The iPhone

This was about to change. On June 29, 2007 Apple released the iPhone device. This device was far ahead of all its competitors at the time. The iPhone device supported multitouch, capacitive screens which allowed more accuracy, and new types of gestures that hadn't been seen before, such as pinching a screen to zoom in or out. Apple's attention to user experience was evident throughout the device. Scrolling and animations were executed with a fluidity not previously seen in a cell phone. Shortly after, the iPod Touch device was released. It used the same operating system and had the recognisability of the already ubiquitous iPod name. Like the PlayStation before it, there was suddenly a very popular device with only one hardware configuration. Developers were very quick to try and find a way to create software for the device. Apple, responding to developers while hesitant to open up their platform to third parties, provided documentation and help on how to build HTML 5 apps for their device. These apps, as Apple called them, couldn't offer a full range of functionality as they were unable to access much of the hardware on the iPhone.

Things went on that way for a year but Apple had been working in the background. They had created a new phone, the iPhone 3G phone, and a new version of the iPhone OS to run on it. There were multiple new features, but most revolutionary was the App Store feature. Released on June 10, 2008, the App Store feature promised a store front for everyone's apps, all on an equal footing. Apple would handle all the financial transactions and the file hosting, and take a 30 percent cut. This is now what most app stores offer but the amount given to a developer prior to this was considerably less.

While the phones were quite powerful, a user's expectations of what a handheld game was hadn't been defined yet. If you were upgrading from Snake then these were absolute power houses, but as they were handheld devices no one expected Grand Theft Auto on them. It meant that developers were free to experiment with all types of games. It enabled bedroom development again. One developer with a computer and an iPhone was able to create a game to their specification and could have it on sale alongside titles from Sega, EA, Square Enix and other large, professional game companies.


The competitors

Not wanting to miss out on the new cellular gold rush, Google announced its Android operating system in 2007 and the first Android phone was released in October 2008. Android's unique selling point was its openness. While Apple was allowing third-party development for its iPhone and iPod touch devices, the developers were restricted in what their apps could do. Apple provided access to high level methods in iPhone OS while Android allowed almost any aspect of the operating system to be modified or augmented as the developer saw fit.

Android was essentially free for any cell phone manufacturers to install on their devices, so uptake of Android grew massively. Some just installed a basic, unmodified version of Android while others, such as Samsung and HTC, installed their own version of Android for better or worse. Others, such as Amazon, have taken Android, forked, and modified it beyond all recognition. That's the beauty and flaw of Android, you have the ability to do whatever you want with the operating system. Sometimes the results are stunning but other times the results are a disaster. This is what Apple is trying to avoid by limiting software access and producing their own hardware.


Current day situation

As of writing this text, it's 2013 now, and while indie games are big business they can still be created by small teams. The large publishers have invaded the app stores and are doing what they do best, making money by releasing already established IP and buying anyone who does well, but the smaller teams are competing and in some cases outdoing the larger companies. Minecraft, a game initially created by one man, has pulled in over $80,000,000, and Angry Birds, created by Rovio with a team of twelve developers, has made over $100,000,000.

If you are lucky enough to create a successful app you'll earn very good money, but the pool to be selected from has grown massively since 2008. There are now an estimated 900,000 apps on the app store for iOS alone with a similar amount for Android.


History of Ouya

On June 10, 2012 a new kind of game console was imagined. With its support for four controllers and output to the TV, it was to try and capture the glory days of console gaming; you and your friends sitting on a sofa together, having fun playing games. It used a crowd-funding website named Kickstarter to announce itself and generate funds. The Ouya development team was asking for $950,000. Backers would receive access to the device when it was released. The Kickstarter fund-raising goal was raised within 8 hours. Ouya holds the record for the best first day performance of any project on Kickstarter to date. Ouya became the most quickly funded project on Kickstarter to reach one million dollars, and went on to become the eighth project in Kickstarter history to raise more than a million dollars. At the end of the funding, the development team had received $8,596,474. The cost of the device was $99 and it ran Android. This meant there was a large library of games available to easily port across to Ouya. Developers heavily backed the Ouya as the consistent hardware specification is a boon to Android developers who normally have to contend with device specification fragmentation.


Ouya's release

Suddenly the Ouya is in the world's press. Events are unfolding very similar to the iPhone release and developers want to get in to the Ouya development while it's still fresh and new.

While it runs Android, it's a complete visual change. Special consideration needs to be taken to implement the controller support and in-app purchase. All games on the Ouya need to offer a demo version or be free. The games are monetized by creating unlockable content that can be enabled via an in-app purchase.

The Ouya already has a some good games, but there is plenty of space for new ideas to make their mark. Some of the current games are exclusive to the platform, some of them are ports from large publishers, such as Square Enix, but all of them receive equal footing on the Ouya, yours will too.

It's all new territory again and anything can be a success!



There are parallels between the early days of the video-game industry and where indie game development is now. While it had mostly been viewed as a niche area previously, Sony, Microsoft, and Nintendo are all embracing indie developers for the next generation, and there is huge interest in the market now. We're here as we want to capitalize on the current interest for indie development. In Chapter 2, Setting Up Unity and the Ouya Plugin, we're going to go through the steps required to set up Unity for Ouya development.

About the Author
  • Gary Riches

    Gary Riches is a longstanding member of the iOS developer community. He has a keen interest not only in established sections of the industry such as gaming but also in emerging technologies such as Ouya, GameStick, and others. Filled with a passion to program on new systems, he has just become a registered Wii U developer and will also create content for Xbox One and PlayStation 4. To target so many platforms he uses Unity, which he learned while working on the Augmented Reality SBook for Saddington Baynes. When not building software for other companies, he builds his own business by creating photo manipulation apps such as Zombify Me, games such as Aztec Antics and Amazed, and also works on educational apps and games such as Nursery Rhymes: Volume 1, 2, and 3.

    Browse publications by this author
Ouya Unity Game Development
Unlock this book and the full library FREE for 7 days
Start now