Experiment: MonoGame for Ouya for First Time

Recently, I ordered Ouya at Amazon.com to try developing for it (and play Towerfall). So far, everything about the hardware and its included software are okay. My main complaint is that it doesn’t have a huge library of worth-playing games. Well, Ouya is still in its infancy. It may take a while before there are more cool games out. I’ll try making games for it after I finish my own research & development for Ouya. Okay, enough about Ouya itself. My main purpose for writing this post is to talk about my experience with developing a test app for Ouya.

Before I started developing for Ouya, I followed the setup instructions in the documentation at Ouya’s developer site. All I had to do was install the necessary packages in Android SDK Manager and manually add Ouya to the list of USB devices in a hidden file. In case if I make updates to the SDK, I would have to manually add Ouya to the list again.

My first attempt at Ouya development is through compiling and testing MonoGame examples. The included examples are In-App Purchases, SetResolutions and VirtualController. I decided to compile them on my Mac partition. My only choice of IDE so far is Xamarin Studio, since I read that the current MonoGame for MonoDevelop template package does not work on MonoDevelop 4.x. Before I can compile them, I needed these following things: ODK Bindings in C#, Xamarin.Android (already included in Xamarin Studio, but I must log in to my account), and MonoGame source code in GitHub (had to compile this into .Net assembly). So far, I encountered minor issues. One particular issue I found out was that KeyEventArgs property is not available in the current (develop) version of MonoGame framework. I encountered a compile-time error when I tried to build SetResolutions application. However, when I tried linking to pre-built MonoGame framework assembly that was included in the In-App Purchases project folder, I compiled the program successfully. It seems the developers of MonoGame have decided to remove KeyEventArgs from the latest version for some reason. I could have gone with the master version in their repository, but that doesn’t contain the framework for Ouya. I might have to suck it up with their latest development version anyway.

My second Ouya development attempt is by writing and compiling my own “first game” from scratch. This project only consists of one phrase using a font I borrowed from one of the examples. When I compiled the program for the first time, I did not encounter any compile-time errors. However, when I ran it, my application threw an exception and terminated itself. So, I spent a long time trying to resolve this issue by tweaking the code multiple times. But, my program still threw the same exception. Sometime around the last minute, I took a peek at my project file’s options. I found that my project was using Android 2.1 SDK, which it shouldn’t. Therefore, I changed it to Android 4.1, the version Ouya runs on. When I recompiled and ran the application, it no longer threw an exception. I realize that MonoGame’s framework for Ouya may be incomplete. The people behind it probably forgot to correctly set the target SDK to version 4.1.

So far, I only touched the surface of MonoGame for Ouya development. I haven’t tried using my own content yet. Since MonoGame’s content pipeline is still under development as of now, I would have to use XNA Game Studio 4.0 to compile my assets to optimized and recognizable formats. I would have to switch to Windows partition in order to use XNA Game Studio.

Since there is going to be a Unity to Ouya tutorial at Cipher Prime Studios this Thursday, I will hold off on MonoGame stuff and jump to Unity for Ouya development as soon as possible to familiarize myself with it. I’ll see other Philly-based developers there. I’ll bring my Ouya too.

List of links to necessary pages for MonoGame for Ouya development:
https://devs.ouya.tv/
http://monogame.codeplex.com/
https://github.com/slygamer/ouya-csharp
http://xamarin.com/monoforandroid
https://github.com/mono/MonoGame
https://github.com/ouya/ouya-sdk-examples