For a while now I’ve wanted to develop a version of my Old Testament adventure game for the iPhone / iPod Touch using the Unity game engine. But it requires so much initial upfront investment that I’ve been endlessly putting off the decision, particularly since I had no idea exactly what an iPhone was really capable of – would it be able to handle a bunch of animated 3D characters without grinding to a halt? Well, in the end I took the plunge, and here are my findings!
Firstly, though, let’s just sum up exactly what an upfront investment we’re really talking about here. It turned out to be rather more expensive than I’d anticipated!
Total cost: $1,398 (minimum $498 if you already have a Mac and an iPhone).
The first big surprise for me when firing up Unity iPhone was the extent to which it is an entirely separate product from the normal Unity. This may be a versioning thing – I’ve only ever seen the latest version of Unity – and the iPhone version may just be a version or two behind, perhaps. For now, at least, many of the interface elements are quite different if you’re used to the standard Unity. For example, the widgets for rotating game objects work differently – not necessarily worse, just differently. The whole thing just looks a lot blockier and more old-fashioned, for some reason.
Secondly, as I’ve already hinted at in the costs section, the workflow isn’t entirely what I’d expected. There’s a great little summary of this on GameDev, but here’s a brief outline:
In case you missed the small print, there are a number of important pieces of .NET (C#) functionality that are not available in Unity iPhone:
(Update: Unity 1.6 was released today that actually fixes all of that – you can now use .NET 2.1 functionality and System.dll)
Unity iPhone also has no support for programming in Boo, for reasons that I’m not sure of.
For me, at least, the million dollar question was regarding the hardware capabilities of the iPod Touch/iPhone – especially the first generation ones. The iPhone 3GS is a seriously powerful computer, but if you make your game so that it only runs on the latest hardware then you’re ruling out a large proportion of your potential audience. I deliberately bought myself a first generation iPod Touch off eBay – apparently the first generation iPhone has very similar specs in terms of CPU speed.
I have to say, my expectations were not very high when I finally got to the point of being able to test. Since I’m developing an adventure game, I need to be able to have a good number of animated characters on screen at the same time, and I’d feared that the iTouch just wouldn’t cope, particularly by the time you’d added in a few particle effects and background scenery.
But I was totally wrong – these devices are remarkably capable, and the guys from Unity have clearly done a great job of optimising their software to squeeze out every last drop of speed.
For testing purposes I used a character model with 738 vertices and 692 faces. The armature featured about 30 bones, and here you can see the frame rates I was getting as I added more and more of these characters on screen, all running the same animation but out of sync (just in case Unity tries to do any clever optimisations for characters at the same frame of the same animation):
Characters | Total Faces | Total Bones | Frames Per Second |
---|---|---|---|
1 | 692 | 30 | 30 |
5 | 3,460 | 150 | 25 |
15 | 10,380 | 450 | 8.5 |
Even with 15 characters, running just above 8 FPS, it didn’t look so jerky as to be unplayable – at least not for an adventure game like mine. Exactly what framerate you need probably depends on how important fast responses are to your game.
The scene below with 5 characters, a relatively simple environment mesh and a particle simulation ran quite happily at about 22 FPS.
All told I’m immensely positive about what Unity iPhone is capable of, and have high hopes for what I’m going to be able to achieve with it. The engine is a real joy to work with, and the capabilities of the hardware far exceed what I’d expected from it. The Unity community is incredible, and help is always available when you need it.
If you’re thinking about taking the plunge, I hope you’ve found this article helpful. Feel free to Twitter me if you want to ask any further questions, or check out the UnityAnswers website.