Yellow Keycard

Game development shenanigans. Personal tumblr fpiesche, twitter @ektoutie.

Ren'py, the OUYA and you

UPDATE: as renpytom kindly pointed out, this elaborate workaround is no longer really needed as recent versions of Ren'py include the ability to build to the OUYA and Amazon’s Fire TV out of the box. I’m not sure about general Android support though, and some of you may want to stick with older Ren'py builds because of reasons, so I’ll keep this all in place.

So I made OUYA builds of some of @bentosmile’s lovely visual novels the other week. The good news is that the OUYA gamepad maps to menu controls in Ren'py without a hitch - up/down/left/right navigate through menu choices, the O button selects. You need to do nothing at all to make this work.

In general, making an OUYA build of a Ren'py game works exactly like a normal Android build - follow the RAPT tutorial, make an Android build and upload it to the OUYA developer site for submission to the store. However, for the OUYA store to accept the .apk that you get out of RAPT, you first need a little extra data in the build.

Thankfully, this extra data does not affect any of the normal Android functionality, so you can submit the same build to both the OUYA store and Google Play. Adding this extra data is quite simple; it just entails a couple of minimal changes to your RAPT directory. 

The metadata

This is needed for the OUYA launcher to know whether your game should go into the “Play” or “Make > Apps” section. You only need to add this information once; it will from then on be applied to all builds you make with that installation of RAPT.

To give it this information, open AndroidManifest.tmpl.xml in the “templates” subfolder of your RAPT directory and find the <intent-filter> section.

Edit this to include the following line:

<category android:name=“tv.ouya.intent.category.GAME”/>

As an example, this is how my intent-filter section looks:

<intent-filter>

<action android:name=“android.intent.action.MAIN” />

<category android:name=“android.intent.category.LAUNCHER” />

<category android:name=“tv.ouya.intent.category.GAME”/>

</intent-filter> 

The icon

This is just a 732x412 .png file, saved as

<your RAPT directory>/res/drawable-xhdpi/ouya_icon.png

The drawable-xhdpi directory does not exist by default, so you’ll probably want to create it. Just overwrite the .png with the icon for whichever game you’re building before you run android.py configure mygame (as per Step 3 of the RAPT tutorial).

Custom load screen

By default, the OUYA build will show a standard ren'py load screen on startup. You can change this, too - it’s a 640x480 image stored in

<your RAPT directory>/templates/renpy-presplash.jpg

Again, if you’ve customised this once it will automatically apply to all games you build from then on. If you want a unique one for a game, just change it to the one you want before you run android.py configure mygame (Step 3 of the RAPT tutorial).