Unreal Engine on iPhone: the full story

Epic presents the tech to mobile devs.

Epic Games' senior console programmer Josh Adams officially introduced game developers to the new iPhone edition of Unreal Engine 3 at the Game Developers Conference this week.

While much of the presentation concerned how Epic's Windows-based tools interfaced with the Mac-based "XCode" workflow of the iPhone development kit, Adams also showed a working model of an Unreal Tournament level running on the Apple device, with the developer confirming that the demo refreshed at a rate of 25 to 30 frames per second.

Adams described the process of bringing UE3 to iPhone as a fun "can we do it?" project, based on Open GL ES 2.0, meaning it will only work on the newer Apple devices such as the iPhone 3GS, the iPad, and the third-generation iPod Touch. UE3 won't work on older iPod Touches and iPhones as they do not support the programmable pixel shaders that the engine requires, but, as newer, faster devices in the mobile Apple family appear, Epic's engine will obviously scale with them.

Interestingly, during the presentation Adams also revealed a range of unsupported platforms that Epic currently has Unreal Engine 3 working on: Linux, Mac,and NVIDIA Tegra 2 (potentially very interesting if the Nintendo DS 2 rumours turn out to be true).

Converting Epic's middleware to the iPhone was no mean feat. The engine itself consists of two million lines of code in a 16MB executable, with 90 per cent of that code being platform-independent, with the other 10 per cent tuned to the hardware it is running on.

Almost all of the core functionality of the engine remains in the iPhone iteration of the tech. The same gameplay, collision, math routines and even file formats are used. Game-makers used to the Unreal Engine editor use the exact same Windows-based toolset when developing for iPhone. Where Epic had to make changes was primarily in the Render Hardware Interface (RHI) - the "thin layer" between the engine's render thread and the host platform's API.

Josh Adams also described how Unreal Engine lights environments. The code gathers up static and dynamic lights decided upon by the artists and turns them into just one or two lights instead, with directional, ambient or spherical harmonic lights all supported. This is great for iPhone in that many lights set up by the artists or generated dynamically during gameplay have a very low rendering cost.

New code was created to cope with the iPhone's unique controls. Buffers are set up that store up the touch-screen inputs, which are then all processed as each new frame is rendered. Tilt functions are polled in a similar time period but without the buffering. Adams also talked about how the iPhone 3GS's magnetometer was considered as a means for enhancing turning information, but was dismissed owing to the fact that the input it generated turned out to be unusable while the CPU cost for accessing the function was prohibitively high.

Changes made to the core Unreal Engine renderer were twofold. First of all, the shift to Open GL ES 2.0 had to be accommodated (by expanding upon the existing Open GL driver) and secondly, the fact that the mobile chipsets are considerably less powerful than UE3's usual target platforms had to be taken into account.

Unreal's shader support was completely overhauled. The engine works with thousands of shaders, with between five and 20 of them being used for just one material. Epic's solution was to "auto-flatten" these shaders into a single texture while adding preview support to the PC editor so artists could see how the final art would look on-screen.

While precision is lost (as is support for specular and normal maps), the effect looks similar and as the final work is displayed on a very small screen, the diminished quality is not so apparent. Epic's normal art pipeline can still be used, there are fewer textures to load and it obviously runs faster on the mobile platform.

Another weakness Josh Adams identified was within Open GL ES 2.0 itself. Games optimise their rendering through occlusion culling - killing polygons that are invisible to the user. Occlusion queries aren't supported in ES at the moment, meaning that levels created with Unreal Engine have to be smaller as a result.

Going forward, Epic expects the iPhone, iPad and iPod Touch devices to get progressively more powerful as new hardware revisions hit the market. Newer hardware obviously means more power and the engine-maker expects support for specular and normal mapping to be included at some point, and for prominent "hero" artwork (for example, your main character) to get full material support.

Epic also expects the occlusion query issue to be solved in a later rendition of the Open GL ES 2.0 driver, which should allow for larger, more complex environments. UE3's integration with other middleware - for example, GameSpy and PhysX - will also be added to the iPhone engine as when they are ported across to the mobile format.

When the iPhone version of UE3 was first announced, Epic revealed that it would also support "another platform", which is obviously the recently announced iPad. Josh Adams told GDC delegates that Epic doesn't have access to iPad technology right now and that the firm was no real idea of just how much power the new hardware will bring to the table.

The iPad itself is widely believed to be running a 1GHz ARM A8 Cortex CPU, combined with a more highly clocked version of the same PowerVR SGX535 chip found within the iPhone 3GS. According to Epic, bottlenecks in performance with UE3 on the mobile platform are mostly down to the CPU and as a consequence, the graphics chip isn't really being stressed at all.

So while the short Unreal Tournament demo we had on the iPhone 3GS looked impressive, potentially the iPad architecture could see some fairly radical performance increases - even after factoring in the enormous resolution boost of the iPad's screen.

It took Epic four man-months of work with a two-man team to bring Unreal Engine 3 to the iPhone, and based on the surprise reveal of Tegra 2 work, it's clear that the company is very interested in bringing its middleware to a wide range of mobile platforms. Asked whether UE3 would be heading to Android, Josh Adams pointedly declined to comment...

Comments (36) Latest comment 2 years ago

Comments threads automatically close after 30 days, but please feel free to continue chatting on the forum!

  • funkateer #1 2 years ago

    Interesting article.
    UE on iPhone is really quite an achievement!
    It would be interesting to see what kind of UE powered games would be viable on iPhone (I can't see Unreal Tournament being very playable with only a touch screen)
  • nikobe #2 2 years ago

    Would love to see a video of it running
  • Jackface #3 2 years ago

    Interesting rading.

    But it's not a *proper* EG/GI.biz article about Apple hardware without an enthusiastic anti-Apple fanboy making a load of pointless vitriolic remarks like "APPLELOL" or "iPOINTLESS".

    Must try harder.
  • Raya #4 2 years ago

    Amazing - they couldn't do a Wii port because of the Wii's lack of power but they manager to get it on an iPod!
  • andromeda #5 2 years ago

    shame that first person shooters are a total waste of time on the iphone/ipod touch.
  • Venkman90 #6 2 years ago

    Shadow Complex on the iPhone plox
  • ph0b0z #7 2 years ago

    Damn Raya was faster! No Wii UE3.. haha..
  • schnide #8 2 years ago

    I would've quite liked to see even a screenshot of this too!
  • MENTAL1ST Verified Senior Software Engineer, Picsel UK Ltd. #9 2 years ago

    Amazing - they couldn't do a Wii port because of the Wii's lack of power but they manager to get it on an iPod!

    Wii doesn't do programmable pixel and vertex shaders, and iPhone 3GS does, I suspect it's as simple as that. A simple look at raw numbers would suggest that iPad (and things like the Nexus One, Samsung Wave and the base platform MS have set as a requirement for Windows Mobile 7 series) are roughly as powerful as a Wii, with the added advantage of more modern, flexible rendering architectures.

    As for an Android port, I believe the SDK which lets one access OpenGL ES 2.0 from C code on Android 2.x devices was officially released the day before yesterday. So Epic are only now free to start their Android port, if they feel that way inclined.
  • dfooster #10 2 years ago

    to be honest the better the games get on the iphone the more disappointed i get that they are a dog to control using just the touch screen.

    i think its time that apple brought out a new phone with control buttons. to be fair to them they probably never expected the format to be such a success for gaming but the lack of buttons for games is really starting to hurt its long term appeal now.
  • MENTAL1ST Verified Senior Software Engineer, Picsel UK Ltd. #11 2 years ago

    I would've quite liked to see even a screenshot of this too!

    [link url= http://www.anandtech.com/gadgets/showdoc.aspx?i=3695
    ]http://ww w.anandtech.com/gadgets/showdoc...[/link]

    even including a video.
  • Jackface #12 2 years ago

    i think its time that apple brought out a new phone with control buttons. to be fair to them they probably never expected the format to be such a success for gaming but the lack of buttons for games is really starting to hurt its long term appeal now.

    The entire appeal of the iPhone is the lack of buttons. Personally I couldn't really care less about most of the games on the iPhone. The only ones I enjoy playing are those that don't take a button-centric control scheme and shoe-horn it onto the iPhone. Stuff like Angry Birds and Drop7, simple stuff. I've got consoles for my button-based games.

    And Apple couldn't really care less about making it easier for games to be controlled. It's not their problem.
  • FogHeart #13 2 years ago

    It was actually UE3 on Linux that made me doubletake. I suppose souping up the OpenGL driver made it feasible. Sure, there are many good-as-Windows apps for Linux for lots of things you do with a PC, but proper, honest-to-gosh games aren't available.
  • cheesymangav #14 2 years ago

    All these big title games shoehorned into the iPhone are invariably terrible anyway. I bought GTA:CW and COD:Zombies, both cost £5.99, both sucked balls. I bought Doodle Jump for 59p and couldn't put it down for a week.
  • JohnnyWashnGo #15 2 years ago

    Hey, if its based on OpenGL ES 2.0 then they can put that sucka on Android 2.1 phones now.

    Google released the OpenGL ES 2.0 NDK for Android a couple of days ago and it works really well. I am no games developer and profess to having zero knowledge about 3D games development (what a shader?) but everything looks to be present and correct.

    So, come on Epic, fess up. Where is the Android version?
  • TonyHarrison #16 2 years ago

    "Amazing - they couldn't do a Wii port because of the Wii's lack of power but they manager to get it on an iPod!"

    Wii: [link url=http://www.wiisworld.com/images/screenshots/res ident-evil-4-1.jpg
    ]http://ww w.wiisworld.com/images/screensh...[/link]

    iPhone: [link url=http://lh5.ggpht.com/_ 4i_szoP4U5s/SmAcC-AxmsI/AAAAAAAAA3I/bqul0ktwjjM/img_2021%5B1 3%5D.jpg
    ]http://lh 5.ggpht.com/_4i_szoP4U5s/SmAcC-...[/link]

    Enough said. Don't believe everything you're told.
  • altitude2k #17 2 years ago

    I would've quite liked to see even a screenshot of this too!

    [link url=http://ww w.anandtech.com/gadgets/showdoc...
    ]http://ww w.anandtech.com/gadgets/showdoc...[/link]

    even including a video.


    That control mechanism is ugly. The graphics are not.
  • hahayou #18 2 years ago

    Haven't they effectively cut down UE3 to something less advanced than UE2? UE2 had normal maps and detail textures. At what point does it stop being the same engine?
  • Pac-man-ate-my-wife #19 2 years ago

    shame that first person shooters are a total waste of time on the iphone/ipod touch.

    Play NOVA.
  • mukki #20 2 years ago

    interesting

    videos anywhere?

    ok... should read other comments first :)
    Edited by 1 at 10/03/10 @ 12:54
  • Bander #21 2 years ago

    NOVA is a very impressive accomplishment on iPhone, but still a pig to control. It'd be unplayable if the enemies were as aggressive as they usually are in console and PC FPSs (even in their easy modes), but fortunately they are not. Gameloft are experienced enough with phone games to usually get difficulty balances right.

    The Tegra 2 support is interesting; should be good for Windows 7, and Courier if it goes ahead. You have a somewhat weird situation if the next Nintendo handheld uses it though. Tegra 2's performance looks like it leapfrogs the Wii easily, so they'll end up with a portable more powerful than their home console!

    http://www .youtube.com/watch?v=PpGtu_ZkwqA
  • Skurmedel #22 2 years ago

    Jackface: There is no enthusiastic Apple fanboy defending any flaw pointed out with no abandon either.

    And what do you mean by not their problem? Of course it's their problem. They design the hardware, they dictate the limitations. If they care, probably not. But it's not really outrageous to wish it had some simple buttons, frankly I wish it had sometimes too.
    Edited by 2 at 10/03/10 @ 14:26
  • UncleLou #23 2 years ago

    NOVA is a very impressive accomplishment on iPhone, but still a pig to control. It'd be unplayable if the enemies were as aggressive as they usually are in console and PC FPSs

    That goes without saying though. Console FPS games often have auto-aiming and are slower-paced and/or have less vertical level design than pure PC shooters to compensate for control differences.

    I thought NOVA controlled well enough, it just isn't the type of game I want to play on a portable platform, really.
  • Josh128 #24 2 years ago

    TonyHarrisson posted:
    ------------------------------------------------------------ ------------------------------------------------------------ ---------------
    "Amazing - they couldn't do a Wii port because of the Wii's lack of power but they manager to get it on an iPod!"

    Wii: [link url=http://ww w.wiisworld.com/images/screensh...
    ]http://ww w.wiisworld.com/images/screensh...[/link]

    iPhone: [link url=http://lh 5.ggpht.com/_4i_szoP4U5s/SmAcC-...
    ]http://lh 5.ggpht.com/_4i_szoP4U5s/SmAcC-...[/link]

    Enough said. Don't believe everything you're told.
    ------------------------------------------------------------ ------------------------------------------------------------ --------------------------------

    Good post. While people tend to slam the Wii for its lack of horsepower compared to X360/PS3, truth is its a very capable non-HD system in its own right. Furthermore-- one must consider RE4 is a GAMECUBE game, with absolutely no graphical changes other than a true 16:9 mode when released for Wii. So contrary to all the fun speculation, even GC's rendering horsepower still far surpasses the iPhone 3G. With the Wii having 50% faster CPU, 50% faster GPU, double the RAM and 3x the storage space on game discs as GC, iPhone cannot touch it graphically.

    That said, like someone posted earlier, the (speculated) lack of pixel and vertex shaders in the Wii GPU is likely what stopped Epic from running UE3 on Wii. Even if the iPhone hardware is way slower than Wii, if it contains the shader functionality that is likely the difference.

    I do agree however that iPad and almost certainly the DS2 (IF it does run a Tegra 2) currently / will surpass Wii, but even then I doubt it will be by a very large margin. Fun to speculate though!
    Edited by 1 at 10/03/10 @ 14:31
  • UncleLou #25 2 years ago

    NOVA is a very impressive accomplishment on iPhone, but still a pig to control. It'd be unplayable if the enemies were as aggressive as they usually are in console and PC FPSs

    That goes without saying though. Console FPS games often have auto-aiming and are slower-paced and/or have less vertical level design than pure PC shooters to compensate for control differences. :)

    I thought NOVA controlled well enough, it just isn't the type of game I want to play on a portable platform, really.
  • UncleLou #26 2 years ago

    Its a Telephone for fucks sake just a telephone.

    Nope. It's a quite powerful mini-computer with a touchscreen that also happens to have a phone function. At least that's how I use it.

    /shrug
  • Les #27 2 years ago

    "Jackface: There is no enthusiastic Apple fanboy defending any flaw pointed out with no abandon either."

    Was there really the need for playing the fanboy card? Happens a bit too much over here IMHO. There can be rational reasons for preferring the products of a particular company. E.g. because their functionality suits your personal wishes best.
  • UncleLou #28 2 years ago

    There can be rational reasons for preferring the products of a particular company. E.g. because their functionality suits your personal wishes best.

    Exactly. I never have owned a Mac, hell, not even an iPod (before the Touch) in my life. I am not a fan of the company, I just think the iPhone is a great gadget that serves me incredibly well for all kinds of purposes. Besides, I see a lot - a lot more anti-Apple nonsense on these boards than posts from "Apple fanboys". I don't wear turtlenecks, I don't go to Starbucks, I am not a designer, I just happen to like the iPhone - an allround multimedia device that's fun to use, has a few great apps, and means I only need to carry around one device instead of 3. And I couldn't care less if competitor's brand new model xy 6868 has a screen that's half an inch bigger and has tech-nerd function z that I'll never need.
  • MENTAL1ST Verified Senior Software Engineer, Picsel UK Ltd. #29 2 years ago

    The Resident Evil screenshot comparison is not especially fair.

    (a) It's a port up to iphone of a version of the game originally released for some less-powerful Japan-only BREW phone.

    (b) Even the iPhone version runs on the original-spec iphone hardware, not the 3GS-spec hardware that is the subject of this article.

    (c) The Resident Evil game is subject to the problem that top-flight game developers are not working to get the most out of the iPhone as a hardware platform. As I understand it, original iPhone has about half the poly throughput of PSP, and 3GS has about the same as PSP (and therefore probably less than Wii), plus the advantage of programmable shader pipelines. Ironically, in this way iPhone's situation is quite comparable to the Wii's, in that very few devs are seriously pushing the machine, and proportionally very few of its games even match the graphical fidelity of the best Gamecube games.
  • Caimbeul #30 2 years ago

    No good without pics or vid :-(
  • morriss #31 2 years ago

    I wonder if it'll work on Android phones?

    I don't care, as I don't play mini games, but it's interesting to know if it'll run on them.
  • freakzilla #32 2 years ago

    UE PSP?

    Yes, I know there aren't many games being made for PS
  • TonyHarrison #33 2 years ago

    "The Resident Evil screenshot comparison is not especially fair."

    Your complaint seems to be that the iPhone version is a port of the game from a less powerful phone, and that it doesn't show the iPhone in the best light.

    Am I missing something, or is the same not true for the Wii version? It's a port from the less powerful GC, and it certainly is not the best we've seen on Wii by a large distance.

    As such, it's a perfectly fair comparison, unless it goes against what you want to believe. An unfair comparison would be something like RE4 iPhone v Monster Hunter Tri or Mario Galaxy...
  • Kerome #34 2 years ago

    Until they comment on pricing the whole thing is moot anyway. The economics of games on iPhone are so different that Epic's traditional licensing models are not going to cut it, and their whole setup is not exactly aimed at rapid development on the scale of most mobile projects.... the overhead of learning the interface to a 2m lines-of-code engine is considerable.

    Then there's the question of do you actually need all that functionality loading up the CPU. I'm sure it'll find its uses in some games (movie licenses come to mind), but I'd be surprised if they become a common technical solution.
  • metroid455 #35 2 years ago

    epic i love your games but this is honestly a waste of time and resources. you should be putting your talent into the ps3, 360 ,pc
    nont some silly phone
  • MrFooknuts #36 2 years ago

    Archetype is, or will be when more modes are added the iPhone answer to unreal tournament, and it is very playable and easy to use, just not as good as UT, I would love to see HL 1 engine and Unreal engine FPS come out on iPhone, imagine having counter strike and day of deafeat 10v10 or even 5v5 on your iPhone, even if the controls took some tweaking and getting used to the possibilities are amazing, that's why I love the iPhone, and the more people slag it off the more it keeps proving people wrong.

    I recently read an article suggesting the source engine could be ported to iPhone, of course it would be years before games of the same standard as HL2 come out but it will happen eventually, the iPhone gaming market is becoming massive and more and more developers are starting to take it seriously.