5Feb/100

Promo trailer by Mr Jack

3Feb/109

Video (almost) direct from the iPhone by Mr Jack

Video of your game is kinda of a must have promotional tool but unfortunately there is no simple, sensible way to capture video from the iPhone. The earlier videos I posted where taken on a digital camera - but the quality just isn't there, even with a tripod and I don't fancy forking out for a flashy camera just to do that. Another alternative is to run it in the simulator and use software which will capture video from the Mac screen, trouble is with a game like Alien Swing that uses a lot of accelerometer control that doesn't quite work either. Still, making video can't be that hard, can it?

So I saddled up with OpenCV, and started capturing the screen with glReadPixels. Hmm... there's two problems here. The first is that the iPhone port of OpenCV doesn't include the video codecs needed. Bah, problematic, but not that critical - I can capture the screen, write it to the iPhone's flash memory and then knock up a command line tool on the mac to convert from this raw data into a sensible video format. Which leaves problem number 2: it's slow. Really, painfully slow. glReadPixels will capture the screen just fine but it knocks the frame rate down to an unplayably slow speed.

The solution: delta compression. We're fortunate in that most of the time most of the screen is unchanging in Alien Swing, this means I only need to capture and store the changes from the last recorded frame and save them off - a process known in the trade as delta compression. So, after a fair bit of effort I have video recorded from the iPhone device with the game running at 60fps (except during screen transitions and when it saves the captured data off). As you can see from the video below, it's not quite there yet - I've a few glitches to iron out - but the video should give you a decent impression of how the game plays.