Common optimization mistakes

The gaming industry is now one of the fastest growing industries. To keep up with the speed and to stand in the market, many companies plan a shorter development period with limited optimization. In this scenario, the developer often commits the following mistakes knowingly or unknowingly:

  • Programming mistakes
  • Design mistakes
  • Wrong data structure
  • Using game services incorrectly

Programming mistakes

Programming is a manual process, and to err is human. So, it is obvious that there is no bug-free and completely optimized programming for games. However, there are few ways in which a programmer can minimize mistakes to have an optimized game code base. Let's discuss the major mistakes a programmer commits while developing a game in Android.

Programmers often create many temporary variables and forget to keep track of them. Often, these variables occupy unnecessary memory and increase processing calls.

Sorting is widely used in game development for many purposes. There are several sorting algorithms. Most of the time, the developer chooses convenient techniques rather than efficient ones. For large arrays or lists, this may cause a serious lag in process flow.

Using too many static instances for accessibility ease is another bad practice. Using static may help in faster processing, but is not a good idea to make many static instances, as it blocks a lot of memory space during its lifetime. Many programmers even forget to manually free this memory.

Creating abstract layers and using them extensively makes the process slower. However, it is a good programming practice generally, but for game programming, it only helps in limited cases.

Convenient loop use is another bad programming practice for games. There are several ways to work with loops. A programmer should first determine what goes best with the algorithm.

Game programming is mostly about logical development than technical. It may take time to build up the perfect logic for certain tasks. Many game programmers do not consider multiple ways of doing one task. Most of the time, it leaves a great scope of optimization unexplored.

Design mistakes

Designers often make mistakes when defining the hardware range and the game scope. Both are very important factors to create an optimized game design.

Another mistake is to target the wrong target resolution. The target resolution has a direct effect on the art asset size. Targeting the wrong resolution leads to unnecessary scaling, causing extra processing overhead.

Wrong game data structure

Data structure is an inevitable part of game programming. Android supports dynamic array initialization. Yet, many developers prefer lists to store data. Lists are much slower than arrays. Lists should only be used when it is absolutely necessary.

It is the developer's responsibility to figure out the perfect data structure for data-driven games. Proper technical design should include a data structure model and its use.

Using game services incorrectly

Services are very useful at times. In the modern day gaming industry, services are used for download/upload of data, for push notifications, for deep linking in games, or for server connectivity. However, services come at a huge cost of processing and memory consumption. Running services causes significant amount of power consumption as well.

So, using services should be mandatory only when there is no other way around.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.118.139.224