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...
You may also like...
-
Digital Foundry: PS3 Skyrim Lag Fixed?
-
Face-Off: The Darkness 2
-
Metal Gear Solid: The "Lost" HD Remasters
-
Face-Off: SoulCalibur 5
-
Eurogamer.net Podcast #99: FF13-2 and Amalur RPG Special
-
Retrospective: Star Wars Episode I Racer
-
Why Devs Owe You Nothing
-
Game of the Week: Catherine
-
App of the Day: Ascension: Chronicle of the Godslayer
-
Gotham City Impostors Review
-
Who Killed Rare?
-
Kingdoms of Amalur: Reckoning Review
-
EA evaluating FIFA Street features for FIFA 13
-
App of the Day: Sir Benfro's Brilliant Balloon
-
Grand Slam Tennis 2 Review
-
Ultimate Marvel vs. Capcom 3 Vita Review
-
Sony admits "dropping the ball" with Demon's Souls
-
Catherine Review
-
The Darkness 2 Review
-
One Piece: Unlimited Cruise SP Review
-
CD Projekt: Witcher 2 intro cinematic "the most expensive asset we ever created"
-
Skyrim patch 1.4 now live for Xbox 360
-
King Arthur 2 Review
-
Catherine launch trailer is looking saucy
-
Skyrim patch 1.4 performance tip: make a new manual save









Comments (36) Latest comment 2 years ago
Comments threads automatically close after 30 days, but please feel free to continue chatting on the forum!
Comment below viewing threshold Show
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)
Comment below viewing threshold Show
Comment below viewing threshold Show
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.
Comment below viewing threshold Show
Comment below viewing threshold Show
Comment below viewing threshold Show
Comment below viewing threshold Show
Comment below viewing threshold Show
Comment below viewing threshold Show
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.
Comment below viewing threshold Show
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.
Comment below viewing threshold Show
[link url= http://www.anandtech.com/gadgets/showdoc.aspx?i=3695
]http://ww w.anandtech.com/gadgets/showdoc...[/link]
even including a video.
Comment below viewing threshold Show
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.
Comment below viewing threshold Show
Comment below viewing threshold Show
Comment below viewing threshold Show
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?
Comment below viewing threshold Show
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.
Comment below viewing threshold Show
[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.
Comment below viewing threshold Show
Comment below viewing threshold Show
Play NOVA.
Comment below viewing threshold Show
videos anywhere?
ok... should read other comments first
Comment below viewing threshold Show
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
Comment below viewing threshold Show
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.
Comment below viewing threshold Show
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.
Comment below viewing threshold Show
------------------------------------------------------------ ------------------------------------------------------------ ---------------
"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!
Comment below viewing threshold Show
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.
Comment below viewing threshold Show
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
Comment below viewing threshold Show
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.
Comment below viewing threshold Show
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.
Comment below viewing threshold Show
(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.
Comment below viewing threshold Show
Comment below viewing threshold Show
I don't care, as I don't play mini games, but it's interesting to know if it'll run on them.
Comment below viewing threshold Show
Yes, I know there aren't many games being made for PS
Comment below viewing threshold Show
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...
Comment below viewing threshold Show
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.
Comment below viewing threshold Show
nont some silly phone
Comment below viewing threshold Show
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.