iPhone development*
By John Carmack, Technical Director, Id Software
I had been frustrated for over a year with the fact that we didn't have any iPhone development projects
going internally at Id. I love my iPhone, and I think the App Store is an extremely important model for
the software business. Unfortunately, things have conspired against us being out early on the platform.
Robert Duffy and I spent a week early on starting to bring up the Orcs & Elves DS codebase on the
iPhone, which would have been a nice project for a launch title, but it wasn't going to be a slam dunk.
The iPhone graphics hardware is a more capable superset of the DS hardware (the driver overhead is far,
far worse, though), but the codebase was fairly DS specific, with lots of Nintendo API calls all over the
place. I got the basics drawing by converting things to OpenGL ES, but I was still on the fence as to
whether the best approach to get all the picky little special effects working would be a complete GL
conversion, or a DS graphics library emulation layer. Coupled with the fact that the entire user interface
would need to be re-thought and re-tested, it was clear that the project would take several months of
development time, and need artists and designers as well as coding work. I made the pitch that this
would still be a good plan, but the idMobile team was already committed to the Wolfenstein RPG
project for conventional Java and BREW mobile phones, and Anna didn't want to slip a scheduled
milestone on the established, successful development directions there for a speculative iPhone project.
After thinking about the platform's capabilities a bit more, I had a plan for an aggressive, iPhone specific
project that we actually started putting some internal resources on, but the programmer tasked with it
didn't work out and was let go. In an odd coincidence, an outside development team came to us with a
proposal for a similar project on the Wii, and we decided to have them work on the iPhone project with
us instead. We should be announcing this project soon, and it is cool. It is also late, but that's software
development...
Late last year, the mobile team had finished up all the planned versions of Wolfenstein RPG, but EA had
suggested that in addition to the hundreds of customized versions they normally produce for all the
various mobile phones, they were interested in having another team do a significant media quality
improvement on it for the iPhone. While Wolf RPG is a very finely crafted product for traditional cell
phones, it wasn't designed for the iPhone's interface or capabilities, so it wouldn't be an ideal project,
but it should still be worth doing. When we got the first build to test, I was pleased with how the high
res artwork looked, but I was appalled at how slow it ran. It felt like one of the mid range java versions,
not better than the high end BREW as I expected. I started to get a sinking feeling. I searched around in
the level for a view that would confirm my suspicion, and when I found a clear enough view of some
angled geometry I saw the tell-tale mid-polygon affine swim in the texture as I rotated. They were using
the software rasterizer on the iPhone. I patted myself on the back a bit for the fact that the
combination of my updated mobile renderer, the intelligent level design / restricted movement, and the
hi-res artwork made the software renderer almost visually indistinguishable from a hardware renderer,
but I was very unhappy about the implementation.
I told EA that we were NOT going to ship that as the first Id Software product on the iPhone. Using the
iPhone's hardware 3D acceleration was a requirement, and it should be easy -- when I did the second
generation mobile renderer (written originally in java) it was layered on top of a class I named TinyGL
that did the transform / clip / rasterize operations fairly close to OpenGL semantics, but in fixed point
and with both horizontal and vertical rasterization options for perspective correction. The developers
came back and said it would take two months and exceed their budget.