Download the PDF

Hidden SDK features transform iPhone into TV gaming device

By Erica Sadun | Published: December 05, 2008 - 01:08PM CT

Look what we found

What do you do after uncovering undocumented SDK features? I got in touch with Freeverse, makers of Moto Chaser, one of the top iPhone games in App Store. After a few back and forth e-mails, they agreed to try applying the MPTVOutWindow class to Moto Chaser (iTunes) to create a TV version of their game. A few hours later, they debuted their demo. Here is a video of the game in action:

Moto Chaser on TV

This version of Moto Chaser is a tech demo. It uses the iPhone's accelerometer for input and routes the game video out through a connected video cable to TV. Freeverse quickly found that the program played best on the second-generation iPod touch. The newer touch is built on a 532MHz CPU versus the original iPhone's 412MHz. This extra speed helps up the frame rate produced by the device, the key component for any first person interactive video game.

On the 2G touch, Moto Chaser can reach approximately 20 frames per second. This makes the game, in the words of Freeverse Producer Bruce Morrison, "nearly playable." Morrison manages the Freeverse product teams and was heavily involved in developing Moto Chaser; he designed all the levels in the game. The norm for commercial games is 30fps, a point at which motion becomes as smooth and watchable as normal TV video. For reference, the current iPhone release of Moto Chaser runs at 26fps and includes many optimizations to achieve even that on the iPhone's relatively slow processor and limited RAM memory.

For my testing, I hooked the first generation iPhone up to a 42-inch television. The widescreen video-out matched the television aspects, using 853-by-480-pixel output dimensions. (On the iPod touch, the same code produces 640-by-480-pixel output instead.) The game was easy to maneuver even with the tethered phone and while it was noticeably choppy at points, the actual game play remained fun and accessible. Although this is a highly subjective response, I much preferred the Wii-like approach of holding the remote in my hands and looking straight at the landscape to play rather than maneuvering the entire system on the iPhone itself.

The sound quality was noticeably improved. Instead of being piped through my phone's tinny built-in speakers, it arrived through my sound system. I could actually appreciate the sound design that went into the WAV and MP3 files for the game.

Developing the video out version

When Morrison approached senior programmer Mark Levin, he had basically one set of instructions. "Make it work before lunch." Freeverse had very little time to allocate to putting together the demo. In the end, the entire development effort took about three hours. And, of that time, nearly half was taken up dealing with Xcode provisioning issues, not technical demands from the porting. In the end, they created several build profiles in Xcode including a TV build in addition to their standard Debug and Distribution builds.

Morrison relates that the initial build to produce video output was up and going in minutes. They immediately noticed the landscape/portrait issues I pointed out in my earlier post. To fix this, they rotated the display to landscape. Then, Freeverse took a few shortcuts. In the demo video above, you'll notice that the program skips the main menu and goes directly into racing mode. In the normal game, the gas button is touch controlled to allow you to accelerate. In this demo, the same button is hardwired down so all you need to control is driving. These shortcuts allowed Freeverse to create a working tech demo within their time constraints and really show what the iPhone video out features were capable of.