Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
The Android Game Developer???s Handbook

You're reading from   The Android Game Developer???s Handbook Discover an all in one handbook to developing immersive and cross-platform Android games

Arrow left icon
Product type Paperback
Published in Aug 2016
Publisher Packt
ISBN-13 9781785885860
Length 368 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Author (1):
Arrow left icon
Avisekhar Roy Avisekhar Roy
Author Profile Icon Avisekhar Roy
Avisekhar Roy
Arrow right icon
View More author details
Toc

Table of Contents (15) Chapters Close

Preface 1. Android Game Development FREE CHAPTER 2. Introduction to Different Android Platforms 3. Different Android Development Tools 4. Android Development Style and Standards in the Industry 5. Understanding the Game Loop and Frame Rate 6. Improving Performance of 2D/3D Games 7. Working with Shaders 8. Performance and Memory Optimization 9. Testing Code and Debugging 10. Scope for Android in VR Games 11. Android Game Development Using C++ and OpenGL 12. Polishing Android Games 13. Third-Party Integration, Monetization, and Services Index

A game is not just an application

It is a very common practice for an application developer to switch to game development and vice versa. Many do not change their style, and approach game development accordingly. Every developer of games should keep in mind that a game is not just an application.

Games versus applications

A game can be termed an interactive entertainment system, in brief. The main objective of games is to provide fun, be it a software or physical exercise. On the other hand, the main objective of an application is to make life easier with a mechanical job. So the development approaches for these two are completely different. However, this still remains a point of discussion, as every game is an application. Any application can adapt the features of games in order to provide a better user experience.

It is difficult to differentiate between the complexities of development of a game versus an application. However, game development has an edge. Most of the application developers do not have to focus much on speed performance, whereas all game developers have to focus on speed and the frame rate of the game.

Every game is an application for sure, but every application is not a game. This statement itself conveys the message that on a single reference scale, game development has more parameters than applications, yet it has to have all the features of an application.

Application development is technology-oriented, whereas game development is fun-oriented. This increases the difficulties in game development. Fun is an emotion, there is no parameter to calculate that. So, while making games, a developer can never know what exactly the game is going to achieve in terms of fun. On the other hand, an application developer is very much certain that the application target can be achieved if all the specifications meet the requirement.

Game development very rigorously needs mathematics to work on the physics or graphics side; even AI needs a lot of mathematics for the low-level stuff. Applications are more technology driven, with limited use of graphics.

Any application that qualifies as a game must fulfill the following criteria:

  • It must entertain a set of users in terms of fun
  • There must be a set of milestones to achieve for the users of the application
  • It should reward the users for achieving a milestone
  • It should have a more dynamic user interface
  • There must be better visual impact
  • It should be performance driven rather than feature driven

Life cycle of Android application and games

The application life cycle applies to any game made on the same platform. But a game has more to the cycle, as you can see in the following diagram:

Life cycle of Android application and games

The application life cycle is simpler a game life cycle. The game cycle runs within the running phase of the application life cycle. This is typically termed the game loop. This will be discussed later in detail.

This game loop runs on game states. The application may have only one running state, but there are multiple game update states. In a typical system of game development, there are a minimum of two update states. One depends on the game loop execution, and the other depends on the time interval. The second one actually controls the frame rate.

Performance of games and applications

There are noticeable differences between the performance management systems for games and applications. Performance is one of the biggest requirements in game development, whereas it is only a recommended feature for an application, as the frame rate does not affect the quality.

It is an accepted truth that games are heavier than applications on the same scale. A game runs on repetitive frames—one set of tasks runs on one frame. This increases the instruction traffic for the processor. In an application, there are generally no loops; the state of the application depends on user action. In this case, the processor gets plenty of time to execute the instruction as no instructions are being sent repetitively.

Memory management of games and applications

Applications which are not games have different memory management than games. In case of games, multimedia assets are the main objects, which occupy a larger portion of the heap than class objects. But in the case of applications, it is just the opposite. Applications need to load only the object they require for the state, that is, class objects.

For any game developer, memory optimization is a must. Because of the extensive use of memory, a developer cannot afford to have unused objects loaded in memory, or any memory leakage caused by mishandled memory pointers. This has a direct effect on running games. For an application, memory optimization is obviously a good practice, but most of the time it has no direct or indirect effect on running the application. However, a good programmer should always have knowledge about memory optimization.

You have been reading a chapter from
The Android Game Developer???s Handbook
Published in: Aug 2016
Publisher: Packt
ISBN-13: 9781785885860
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image