Each release of HyperBowl for the iPhone is a bit of an ordeal, since main development takes place on the web player version with Unity Pro, and I have to copy that latest snapshot to Unity iPhone and then hack away at it until it runs at an acceptable frame rate. Sometimes I forget an optimization or two that I’d made in a previous release, so this seems as good a time as any to jot down the steps. These are what I remember now – if I missed any, I hope they’ll come back to me as soon as I start.
- Duplicate the Unity Pro project, open up the new project in Unity iPhone, watch it convert.
- In the Player Settings, set the game name
- In the Player Settings, set the most aggressive speed and code stripping settings
- Copy the splash screen and icon files into the project, assign them in the Player Settings
- Replace control and option scripts with iPhone counterparts
- Set Static on all static game objects
- Assign batching script to object groups that move together
- Replace certain materials (like bump maps) with simpler ones
- Change diffuse materials to vertex lit
- Remove transparent objects as necessary
- Remove lights as necessary
- Remove particle effects as necessary
- Remove blob shadows as necessary
- Replace Unity water with simple water
- Use the iPhone background shader for the background
- Replace Ogg Vorbis sound with uncompressed or m4a sounds
- Replace any DXT compressed textures with PVRTC compressed textures
- Set accelerometer frequency to zero
And of course, profile, profile, profile…