OPTIMIZING iOS GAMES IN UNITY FOR UNIVERSAL BUILDS PART 1: Environments

Our initial roll out plan for our current game Nitropia was to distribute in HD and SD SKUs. This would allow us to maximize our potential install base and tune each SKU for performance. After signing with a publisher we were informed that the game would be easier to market (code for ‘Apple likes it so do it…’) and distribute as a universal SKU. So we began the process of researching how we could optimize our game to play on multiple hardware platforms without sacrificing the quality we worked so hard to achieve. Fortunately, after a little research and testing we found that Unity PRO had some nifty in built solutions for compression, profiling and loading. Our goal was to make a universal build without compromising the number of concurrent characters, environment effects and resolution of the characters with iPad 2 and iPad mini as our lowest common denominators. We will deal with the Android SKU in a separate post.

 

ENVIRONMENTS

map 15 copy

We are using Unity 2D to build a dimetric game world. First we tried using a single 2K image atlas for our background but realized very quickly that it limited depth and interaction with the environment. This led to a little experimenting with a few creation methods. Eventually, we found that using tiles gave us the most flexibility and interaction.

 

Creating layered tiles in Photoshop and adding them to Unity as 2D sprites is a tedious and time consuming task. To speed this up we first wrote an editor script to classify objects as foreground and background. Then with a few shortcut buttons we were able to add and layer tiles as you would normally do in Photoshop. The tiles are then distributed into the foreground [1024 x 512] and background [1024 x 512] layers which allowed us to show some depth and interaction despite using 2D. Run time depth sorting occurs based on the relative Y position of two objects. So if a unit had a higher Y value than a foreground object, it would be in front of it.

 

Below is a quick visual look at how we build an environment:

 

1. Setup grid to iPad display dimensions.

1

2. Mark out the pathways in grey. Everything in brown is terrain.

2

3. Lay down tiles to create background and pathways.

3

4. Populate with foreground objects

FG

5. The finished environment.

5

 

Look out for Part 2 of our technical article where we discuss the optimization we did on our characters.

admin…

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

%d bloggers like this: