Wednesday, August 28, 2013

TexturePacker - The smart solution of Image Asset Management

No matter which programming languages or IDE you are using for creating Android games (in fact, not just Android game), handling images is always a nightmare if you are using a naive way. Even though a graphic non-intensive-game like Quoridor Board Game, a better approach of image asset management is necessary to ensure a consistently great performance and a developer friendly code maintenance. Here, the TexturePacker is highly recommended for the rescue.

Before mentioning about how the TexturePacker works, let's recall what is the underlying process if a naive way of handling image is used, aka treating each image separately and embedding them one by one in the code. With this, the GPU is heavily burdened as it has to load all the graphic assets naively to the primary memory. Here, the number of calls to load the images matters. The most ideal way is to have the call as less as possible. And a new concept is introduced - Sprite sheet.

To briefly describe, a sprite sheet consists of a big image containing numerous smaller images. Here's the example of my sprite sheet used in the Quoridor Board Game:


The idea is that, with only a single piece of image file, the overhead of asset loading is significantly reduced.

The next question is: How to construct such a big image file?
Having said that, TexturePacker is the smart solution for this. Here's a quick review of the TexturePacker UI (we will come back with more details in future)

There are a number of advantages of using TexturePacker:
  • Intuitive Image Assets handling - it features a drag and drop method. Adding or removing an image is very convenient.
  • User-friendly Interface - With a single publish button, you would be able to have your image ready for production within 5 minutes!
  • Customizable  options - Alright, not just Android games, it applies to almost ALL data format (AndEngine, LibGdx, Unity3D, etc) Pretty cool ar! 

Notes:
  • To use a full-fledged TexturePacker, you need a license.
  • To obtain the license, you may purchase it, or request one from the owner Andreas through an email (terms and conditions)
  • I personally requested one from Andreas. He is really a nice samaritan offering me the priceless license. :)

No comments:

Post a Comment