Book Image

The Android Game Developer's Handbook

By : Avisekhar Roy
Book Image

The Android Game Developer's Handbook

By: Avisekhar Roy

Overview of this book

Gaming in android is an already established market and growing each day. Previously games were made for specific platforms, but this is the time of cross platform gaming with social connectivity. It requires vision of polishing, design and must follow user behavior. This book would help developers to predict and create scopes of improvement according to user behavior. You will begin with the guidelines and rules of game development on the Android platform followed by a brief description about the current variants of Android devices available. Next you will walk through the various tools available to develop any Android games and learn how to choose the most appropriate tools for a specific purpose. You will then learn JAVA game coding standard and style upon the Android SDK. Later, you would focus on creation, maintenance of Game Loop using Android SDK, common mistakes in game development and the solutions to avoid them to improve performance. We will deep dive into Shaders and learn how to optimize memory and performance for an Android Game before moving on to another important topic, testing and debugging Android Games followed by an overview about Virtual Reality and how to integrate them into Android games. Want to program a different way? Inside you’ll also learn Android game Development using C++ and OpenGL. Finally you would walk through the required tools to polish and finalize the game and possible integration of any third party tools or SDKs in order to monetize your game when it’s one the market!
Table of Contents (20 chapters)
The Android Game Developer's Handbook
Credits
About the Author
About the Reviewer
www.PacktPub.com
Preface
Index

Choosing the target device configuration


As mentioned earlier, Android has a variety of device configurations. So, it is very important for an Android game developer to choose the target very carefully. The general approach should have these parameters:

  • Game scale

  • Target audience

  • Feature requirement

  • Scope for portability

Game scale

This is basically the scale on which the game is being made. The larger the scale, the better the configuration that it'll need. This includes mainly the game size, which means the amount of memory it will consume on a device. Many Android devices are configured with very low RAM and internal memory storage. If the targeted device does not have the required configuration, the game will not run. Even if the game is fully optimized, it can fail depending on the hardware platform it is running on.

Every game requires a set of processes to be executed recursively, which requires processor speed. If a game is process-heavy, and the targeted device has a slow processor, the game will experience some horrible frame rate issue, or crash.

Every Android game developer must be aware of the requirements of memory, processor, and other constraints when choosing the target device.

Let's take the example of an Android game which requires at least 120 MB of disk space to install, 512 MB of RAM to run, and a 1.2 GHz processor speed to achieve a decent frame rate. Now consider a mobile device which matches these specifications exactly, but being a developer, one must not assume that the device will not have any other application installed or running in parallel. So, in this case, there is a fair assumption that the game will not have the required support even if the device meets its requirement. Hence, for this example game, the target device must have a higher configuration than the minimum requirement.

Now, let's take a look at the opposite scenario. Assuming the same game requirements, consider a device having 8 GB of available storage, 2 GB of RAM, and a 2 GHz multicore processor. There is no doubt that the game will run on that device with maximum performance, but the device could have supported a larger-scale game. So the resource utilization is not efficient in this scenario. This is where porting comes in. A game developer should upscale the game quality, and create a different build for those high-end configuration devices.

It is a very common practice in the industry to exclude a few devices from the targeted device list to make the game run properly. In a few cases, the game developer creates separate game builds to support most of the devices and maintain the game quality.

Target audience

The target audience is the particular group for which the game is made. It is assumed that a particular set of people will have most fun from the game, or that they will play the game more than other people.

Every game design has its target audience. The set of target devices are the direct consequence of the set of target audience. For example, if the target audience is working professionals between the ages of 25 to 40, it makes no sense to create the game for an Android TV no matter what the game scale is. This is because this specific audience will mostly use mobile devices, as they have less time to sit in front of a television set. So, the list of target devices should contain mobile devices for this target audience.

We can see a lot of difference between devices in the same category. For now, let's take the example of Android mobile phones, as this is the most-used Android category. We can see a range of Android devices available in the market. Most of the Android phones are comparatively cheaper, and have fewer features. A major section of the target audience that uses such phones belongs in particular to Asia or the third world countries. So while making a game for this target audience, the developer should consider the minimum configuration target.

Feature requirement

Feature requirement depends completely on the game design. When we talk about games on Android, the major focus is on mobile and tablet platforms. Mostly, Android games are made for these devices.

If we consider other platforms like watches, TVs, or consoles, the feature set varies. Televisions provide a bigger display with less user control, watches have limited display area and minimum configuration, consoles have better graphic quality with dedicated controls, and so on. It is very important to identify the feature list which is required to recognize the hardware devices.

There might be a scenario where an accelerometer, Bluetooth, Wi-Fi, or some other special feature is being used in a game, so the selected hardware platform must have those features. However, common mobile and tablet devices have almost the same set of features that a game developer might generally use. This feature dependency becomes very specific when Android games are made for some particular hardware platform like consoles or VR devices.

Scope for portability

While choosing the target hardware device, every game developer must consider the scope for portability of games. The more portable a game becomes, lesser the effort required to select or choose the target hardware.

The portability of games always depends on the vision of the game developer. Porting can take two different approaches: platform porting and hardware porting. We will only focus on hardware porting here, as we have already fixed the platform to be Android.

A game developer should focus on the following points to increase the portability of a game:

  • Creating different sets of assets

  • Designing different sets of controls

  • Finding and listing alternatives for a feature

  • Controlling memory usage

  • Controlling the frame rate

A good portable game is a balanced combination of all of these preceding points. Most of the time, the target hardware is chosen first depending on the other parameters, and only then does the developer work on the portability of the game.