Login

ARM The Architecture For The Digital World  

ARM Community: Porting Games to Multiple Devices Made Easy - ARM Community

Jump to content

Porting Games to Multiple Devices Made Easy

Many times on my travels through the world of embedded GPUs I have come across someone asking “How easy is it to port my game to Mali™?” Well.....actually it’s not difficult at all, and this is reflected in the ARM® Mali™ Ecosystem. Let’s start by looking at the Ecosystem and its growth. Having now reached a massive half a million activations a day, Android is where it’s at! Especially now the Samsung Galaxy S2 has hit the market. The S2 is a dual core ARM® Cortex™ -A9 and an almighty quad core Mali-400MP.

Attached Image

The Samsung Galaxy S2 – Class Leading


Here in ARM’s Media Processing Division we have been diligently testing games on devices and have come to the conclusion that when you compare like for like with Android devices the pass rate is an equal affair. What I am saying here is that we found that all GPU architectures rolled in at virtually the same pass rate, within 2% of each other, on all the 300+ games we tested. So why is that a good thing? Well it means that a vast majority of developers are already writing scalable games across multiple platforms to maximise their profits, and also tells me that there is currently a level “Ecosystem” playing field.

Ok, let’s dig a little deeper into the potential challenges we’ve identified around porting and how they can be overcome. Firstly, if it seems that the game is a non-starter, this can be down to differing versions of Android, or even customised versions for specific devices. Differing platform configurations are also a concern, i.e. memory constraints, screen resolutions, control mechanisms, etc... Ensuring your game runs across all these platform configurations is a topic all on its own and I will cover this in another blog at a later date.

Next, exclusivity of certain games for certain devices, which is usually for a set period of time (six months for example), means the game will not run on any other platform.

We have found that, once past these hurdles, there is much that we can do to help the developer to get their game up and running. It may be that the game is trying to use an EGLConfig that is not supported by the device, many configurations are available and no one platform supports them all. The solution is simple, we have some sample code that any developer can take and implement to select the correct EGLConfig for your device, the code and documentation is available on malideveloper.com here.

And then we hit the most common issue, texture compression fragmentation. The game will run, and the geometry will be rendered, but with blank textures and with various shader effects being applied.

Attached Image

Texture Compression.....Which Format?


There are many texture compression formats available depending on the GPU architecture; Mali uses the Khronos adopted Ericsson Texture Compression (ETC) standard, in fact all the current OpenGL® ES 2.0 GPUs support ETC1 as this is a core component of the Khronos standard, so developers can choose to use ETC1 on all platforms if they wish. It’s a 4-bits/pixel texture compression and is the most convenient compression for game developers as it gives the best compromise between compression and visual quality. “What about the alpha channel?”, I hear you say. This is true; ETC1 does not support an alpha channel as is. However, you can use two textures to achieve RGBA, then extract and compress RGB and A into separate channels. Again we have created sample code, which is available on malideveloper.com here.

We are now starting to see a move away from proprietary texture compression, and here are a couple of examples. Firstly, let’s look at what Google are recommending on their Android Developer site to use for texture compression, and yes you guessed right....ETC (see here). There is also an interesting comment in the Apple Developer Guide, letting the developer know that their hardware may not support the current texture compression in the future. It advises developers to check for support and to use uncompressed textures if it’s not available (see here)....therefore keeping many platforms available for the developer with little or no changes to their game.

I think it is also worth noting how developers are using the 50MB download limit on Android to their benefit. Game data can be very large, in the region of 100–600MB of data depending on the game, and this can be multiplied at least 3x to support all the Texture Compression Formats. Therefore Developers are only putting the install file on the Android Market for download, this will be small (typically 2-5MB), when this is installed on your device it interrogates the device to see what graphics hardware you have, it then goes off to the developers own server and downloads the relevant data pack for your device with the correct texture compression. This allows developers to support multiple GPU architectures with the smallest download needed.

Attached Image

50MB Limit! But wait, there’s a way round that.


All in all, developers see porting their games to multiple platforms as a trivial task. They are more concerned with the performance of the devices on the market, which allows them to push the boundaries of both smooth gameplay and incredible graphics. To this end it is great to see a company like Samsung wanting to use the superior performance of the Mali-400MP to create the most visually stunning graphics in any handheld today....and this is only the beginning.

Simon Hickman, Ecosystem Partner Manager, Media Processing Division, ARM. Simon has been around at ARM for more than 10 years now, remembering being a part of the team that ported Quake2 to the ARM926, then moving into management leading the Applied Systems Engineering team, and on to a Marketing role in the Mobile Computing team. Simon is now enjoying working with some of the most creative Game and Game Engine Developers throughout the world as MPDs Ecosystem Partner Manager, ensuring their content is running optimally on the many devices coming to the market with ARM Mali GPU technology.
All company and product names appearing in the ARM Blogs are trademarks and/or registered trademarks of ARM Limited per ARM’s official trademark list. All other product or service names mentioned herein are the trademarks of their respective owners.

2 Comments On This Entry

Please log in above to add a comment or register for an account

Page 1 of 1

ellis2323 

28 September 2011 - 10:15 PM
ETC1 can't be an universal solution. For alpha textures, it is not usable.

Use compressed texture has two goals:
  • Memory bandwidth (so Performance)
  • Loading Time
For our games, we tried many solutions with only ETC1. Some numbers for 1024x1024 texture (SGS2, Xperia Play, SGS, Tegra2):
  • 32bits RGBA: 4Mo and 1s loading
  • 16bits RGBA: not usable if alpha isn't 0 or 1. RGBA4 is just ridiculous in many cases. 2Mo and .5s loading (SGS2 or XperiaPlay)
  • ETC1 + uncompressed alpha texture: 1.5Mo and .375s loading
  • ETC1 + ETC1 alpha: 1Mo and .25s loading not usable to many artefacts.
  • PVRT 4Bits: 512Ko and .125s loading
  • ATC: 1Mo and .25s loading
  • DXT5: 1Mo and .25s loading

In our last product, we have 100Mo of uncompressed textures... if we use uncompressed textures, that's a such long loading screen... On many GPUs (Andreno 205, 220 or PowerVR), performance of ETC1 + uncompressed alpha is bad. At the end, we have implemented 4 loaders: PVR, ATC, DXTC and uncompressed texture for alpha textures. For opaque, we use ETC1. The SGS2 (mali 400) is so fast that we don't need optimisations for performance (only for loading time).

[Content Edited out by ARM Blog Administrator]. The mali 400 is probably the faster GPU but it lacks many extensions (OpenGL ES 2.0).

Ps: you're saying that just 2% of games doesn't work with the SGS2 but in the 2% there are many great games (coming from iOS or tegra zone). I have worked with Chainfire to fix shaders with its OpenGL ES 2.0 interceptor.

Ps 2: many developers doesn't have network bandwidth to host their assets. So in 50Mo you must all your ATC, PVRT, ECT1.... or use the new multi apks models.
0

Simon Hickman 

06 October 2011 - 01:56 PM
Thanks for your comments on the above blog, you have made a lot of points so please bear with me whilst I respond. You have certainly done your research into texture compression, I see that you are saying that if other architectures use ETC, they have slower loading times than Mali...therefore this shows that the other architectures did not necessarily optimise their hardware for ETC and instead focused on their own proprietary texture compression formats therefore contributing to the fragmentation issues that are plaguing Android today. As to ETC missing the alpha channel, you have to remember that we stuck to the Khronos, OpenGL ES2.0, specification when designing the Mali-200 and 400, and intentionally didn’t introduce another proprietary texture format. The next generation of Mali will have hardware support for open standards which do have alpha channel.

You also mention that we lack many extensions, this comes back to us designing around the core OpenGL ES2.0 specification. You have to remember if developers write their apps/games to the core specification then it will run on any OpenGL ES2.0 compliant core. And again, by adding in these extensions, you are adding to OpenGL ES fragmentation.


I fully understand that some developers do not have the bandwidth to host their assets and appreciate all the difficulties, however my intention was to point out one way that developers have been overcoming the size issue, and yes you can now use the multi-apk model.

ellis2323, on 28 September 2011 - 11:15 PM, said:

ETC1 can't be an universal solution. For alpha textures, it is not usable.

Use compressed texture has two goals:
  • Memory bandwidth (so Performance)
  • Loading Time
For our games, we tried many solutions with only ETC1. Some numbers for 1024x1024 texture (SGS2, Xperia Play, SGS, Tegra2):
  • 32bits RGBA: 4Mo and 1s loading
  • 16bits RGBA: not usable if alpha isn't 0 or 1. RGBA4 is just ridiculous in many cases. 2Mo and .5s loading (SGS2 or XperiaPlay)
  • ETC1 + uncompressed alpha texture: 1.5Mo and .375s loading
  • ETC1 + ETC1 alpha: 1Mo and .25s loading not usable to many artefacts.
  • PVRT 4Bits: 512Ko and .125s loading
  • ATC: 1Mo and .25s loading
  • DXT5: 1Mo and .25s loading

In our last product, we have 100Mo of uncompressed textures... if we use uncompressed textures, that's a such long loading screen... On many GPUs (Andreno 205, 220 or PowerVR), performance of ETC1 + uncompressed alpha is bad. At the end, we have implemented 4 loaders: PVR, ATC, DXTC and uncompressed texture for alpha textures. For opaque, we use ETC1. The SGS2 (mali 400) is so fast that we don't need optimisations for performance (only for loading time).

[Content Edited out by ARM Blog Administrator]. The mali 400 is probably the faster GPU but it lacks many extensions (OpenGL ES 2.0).

Ps: you're saying that just 2% of games doesn't work with the SGS2 but in the 2% there are many great games (coming from iOS or tegra zone). I have worked with Chainfire to fix shaders with its OpenGL ES 2.0 interceptor.

Ps 2: many developers doesn't have network bandwidth to host their assets. So in 50Mo you must all your ATC, PVRT, ECT1.... or use the new multi apks models.
0
Page 1 of 1
Maximise
Minimise
» 

My Blog Links

» 

ARM Onsite

» 

Search My Blog