Essential tips and tricks

We employ a bunch of tricks for our game to be supported on all devices that are explained as follows:

  • For startup images, we show the iOS default image when the game launches for the period of initializing the new texture atlas and remove it once the menu launches.
  • The background of all the scenes except the game scene is set to stretch and fit. This will distort the image, but will make sure there is no letter boxing black areas. Choose the better evil.
  • We use 2048-based texture assets to make sure most of the current devices won't have any quality loss for images.
  • The ground layer is modified to draw grass tiles to fill out the entire visible area. We then align the effective game area in the middle of the screen. This makes sure there are no letterboxing black areas even without stretching out the canvas.

We need to minimize the number of texture atlases that we use, and I personally try to stick with two. In order to facilitate this, I had to make some hard decisions. I reduced the number of animation frames for all animations to three, which actually is overdoing it. I also used 1024 iPad nonretina-based textures for the menu background, the wooden base, game win, game over, and title. This does result in minor loss in quality, but it helped me fit everything into two 2048 atlases, and I specifically packed all soldier frames and game tiles into one and the rest into the other, which again helps with batching. Eventually, I ended up loading the menu background and the wood base images individually and removed them from the texture atlas.

Tip

Notice that the texture atlases are not completely filled, which is inefficient to use. But this is done to make sure the dynamic packing always gets done within a maximum-sized 2048 atlas.

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

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