News

How Unity 1.5 lets you push iPhone 3GS and make the most of 3G

Support the future with fallbacks for the present

How Unity 1.5 lets you push iPhone 3GS and make the most of 3G
|

Last week, Danish middleware company Unity Technologies released version 1.5 of its Unity iPhone game development environment.

We caught up with COO Nicholas Francis to find out how it had managed to boost the technology's performance, and what we should be looking out for in future.

Pocket Gamer: You're claiming Unity iPhone v1.5 offers a threefold increase in performance, so how have you managed that?

Nicholas Francis: Sheer geekery.

Our engineers spent a lot of time looking at the assembly code inside Apple's drivers so we could identify which code paths to avoid as well as clever ways to bypass unoptimised sections of the driver.

We also did a bunch of low-level assembly optimisations in the core source code. The iPhone has a vector co-processor that very few people are using. We moved our skinning code on to that so we can get better parallelism.

Finally, we do a some processing of level geometry so that we can group meshes together even though they're separate objects. Since we're doing this from code, we can optimise the drawing so that even though we render all objects in one batch, we can still remove objects that are occluded or outside the view.

We can produce examples that run 20 times faster than just about anyone else, but that's cheating.

At what point will you hit diminishing returns?

It's hard to say. There's always a bit more power to be found somewhere. But I think we're getting pretty close now. Thankfully, Apple is pushing out new models with new and interesting hardware, so we get to do this all over again.

How does 'access to native iPhone functionality via Unity scripts' improve developers' productivity?

The main productivity increase comes from the ability use Unity for all other parts of your games. With this, it's easy to drop down into core iPhone API calls so you can do more flexible stuff than would otherwise be possible.

Version 1.5 has specific support for iPhone 3GS as well as automatic fallbacks for iPhone 3G, so do you think Unity will be able to abstract these fragmentation issues in future?

Definitely. It's something we already do in the main Unity technology, since that needs to make good use of everything from gamer rigs to your mum's second-hand laptop. Basically, we have all the infrastructure in place - and have shipped quite a bit of stuff in this release.

Can you explain the anti-piracy protection features?

I'm not gonna get into too much detail about how it works, but basically, we can detect if Apple's DRM has been removed and provide a simple value for developers to check.

How they deal with it is up to them; they can limit the number of levels, have the game break, or maybe get creative and think, "Well if the player's not playing, I'll recoup my cost by serving them ads instead".

What other types of features are developer demanding?

We just asked our beta testers this, and while there was nothing conclusive, there were some clear trends:

Full shader support for 3GS. I think with Unity's backend, this will be quite easy to deliver. People can develop content with high-end shaders that then automatically fall back to simpler versions on older devices.

Better editing tools.

Profiling tools. When you're developing games for a device that's really a phone, you need to eke out every bit of performance, so a tool that helps people find hotspots in their code was high on the wishlist.

Do you know what percent of Unity users are developing on iPhone?

I'd say around 20 percent. We've got about 2,000 developers using Unity in total, so it's something along those lines.

Thanks to Nicolas for his time.

There are two versions of Unity for iPhone available: Unity iPhone Advanced and Unity iPhone Basic.

Licensing starts from $399 and there's an unlimited 30 day trial version of the full technology available for evaluation purposes.

You can follow details of Unity's ongoing support for iPhone via the blog posts of its dev team.

Jon Jordan
Jon Jordan
A Pocket Gamer co-founder, Jon can turn his hand to anything except hand turning. He is editor-at-large at PG.biz which means he can arrive anywhere in the world, acting like a slightly confused uncle looking for the way out. He likes letters, cameras, imaginary numbers and legumes.