iPhone Development

After over six months, I’ve finally got my act together (and waited for Apple to get its act together) and can build my own iPhone apps. So far I’m using Unity’s iPhone Advanced tool rather than the “bare” SDK (Unity essentially builds an iPhone project for you, you still need to build the final app in XCode).

Using Apple’s tools, and I don’t think I’m violating any remaining components of the NDA by saying this, makes it clear that the SDK was released on a highly accelerated schedule. The amount of silliness involved in getting “Hello World” working on your iPhone is pretty amazing. It’s all a consequence of Apple wanting to make the iPhone world as safe and secure as possible.

In essence you have to jump backwards through a bunch of hoops to produce encrypted digital signing certificates and registering all your developers, testers, and so forth and their iPhones and iPod Touches before you can do anything. I won’t go into gory details because it probably is covered by the vestiges of the NDA and it’s boring, but take my word that the process involves a lot of non-obvious (even with a step-by-step checklist) steps that involve telling your left hand what your right hand is doing (i.e. stuff that should be automatic). It’s all very reminiscent of using Lotus Notes. (If you don’t know me, that’s worse than comparing it to Blender 2.3.)

The purpose of all this is to prevent people from installing “any old app” on their iPhone, and to allow Apple to flip a “kill switch” and disable any app which proves to be toxic to users (e.g. steals/destroys data or violates user privacy) or violates Apple’s unstated rules (e.g. don’t build anything vaguely related to web browsing or email) or Apple’s relationship with AT&T (e.g. don’t facilitate people using their iPhone as a cellular modem/base station). I have no objection to the purpose served by all this annoying cruft, but I do think the annoying cruft should be much easier to handle. Basically, all I should need to do is associate my iPhone with my developer account and click OK to have all the necessary crap stored in my keychain and I am done. Instead it’s 25 steps disguised as 12.

Unity’s iPhone tool is simply amazing. (This is amazing above and beyond Unity itself, which is plenty amazing.) During testing you can run your app in the Unity IDE as normal and use your iPhone as a tethered controller/display — Unity sends compressed video to the iPhone and receives the iPhone’s state over USB via a small app that comes with the dev tools. The only downside to testing this way is that your app is running on your Mac, so you don’t see the actual performance you’ll get on the iPhone, and the video can be a little artifacty (woohoo new word!).

So far it looks like you can have around 7,000 triangles visible and still get action game performance, or up to 25,000 triangles for more sedate games. The shader support on the iPhone is limited so blowing out the video hardware’s performance with fancy shaders isn’t really an option, so expect to see a lot of lightmapped scenery.

Anyway, MANTA (which I conceived of as an iPhone game) weighs in at 100-150k triangles visible on screen right now, so it’s not going to be running on the iPhone without some major surgery. I would still like to get it out this year, but my original planned Nov 30 release is impossible. (I’ll try to release the Mac version on time.)

  • cak

    How do you find Unity? I have heard bad things about it, but you don’t seem to have too much trouble.

  • I wonder where you’ve heard bad things? First of all, Unity for iPhone is in a somewhat more primitive state than Unity itself. Unity has undergone radical improvement since 2.0, which itself was pretty darn nice (and Unity iPhone resembles 2.0 with iPhone-incompatible features ripped out). I haven’t shipped an iPhone app yet — mainly owing to lack of time — but the Unity development experience is pretty wonderful with the single (important) exception that it doesn’t have a proper “stop, watch, step, and continue” debugger. (I believe that’s on the roadmap.) It does have some remarkable debugging facilities beyond what I’ve had in the past, but it would be nice to have a “real” debugger as well.

    My experience developing games and multimedia spans Object Pascal, C and Assembler (vicariously), C++, Director, mTropolis, Flash, Blitz3D, BlitzMax, Torque, and Unity — among others. Of all of these, Unity is the hands-down winner. But I can’t compare it to some of the latest Microsoft stuff (XNA or whatever) because I haven’t touched those. I imagine Microsoft offers tighter integration with DirectX technologies for obvious reasons and a very robust coding environment, but I seriously doubt they can match Unity’s workflow.