Unity3D Project Retrospect

Posted on January 17, 2011

Table of Contents

1 Version control

The Unity scene file is binary. Artists, designers and programmers all need to modify the scene. And there was no way to merge our local modifications. This leads to a large amount of time waste that one needs to redo all the modifications after updating the working copy and everyone has to do this every time there is a change in the scene.

Asset server may help, but we don’t have it.

There is also an open source project that converts Unity scene file to plaintext. But cautions are there to inform that it is not approved by Unity and may fail to work.

2 Script performance tweak

Though scripts are not the performance bottle neck, there are something we can do to make it even faster.

3 Graphics performance tweak

Graphics is the bottleneck of our project. We have spent much time on it and finally have a game running smoothly both on a PC and on an iPad.

3.1 Shader

3.2 Draw call

3.3 3D models

3.4 Textures/Materials

3.5 Particle systems

3.6 OpenGL ES 1.1/2.0

There is an option to turn OpenGL ES 2.0 on and off after exporting the Unity project to an Xcode project.

Our game runs at 23~35 frames per second with OpenGL ES 1.1. With OpenGL ES 2.0, the frame rate drops to 5~9 frames per second.

3.7 Shadows

4 Memory consumption tweak

Our final project which runs smoothly on a PC, without specific optimizations, crashes almost every time it is run on an iPad. GDB shows that the application has received low memory warning.

The following changes are made to save memory:

These settings save as much as about 10MB memory space.

Further profiling shows that if the game asked for more than 35MB memory, it would possibly crash on an iPad. After the tweaks, our game needs 7MB in the main menu and 29MB in the game.

5 Cross-platform issues

5.1 Textures

5.2 Models

5.3 Videos

Videos should be places in “Assets/Streaming Assets” folder to be accessible on an iOS device.

6 Remaining issues

6.1 iOS4 multi-tasking support

Unity 3 does not fully support the multi-tasking function of iOS4. There are problems suspending/resuming the game.

6.2 Movie playback on iOS devices

To play a movie, iOS devices pause the game, call the system media player to open and play the movie file, return to the game and resume it. As we do not have control over the execution order, the last frame rendered before movie playback would appear again after playback for a short while until the game is resumed and the next frame is rendered and shown on the display.

Author: qingpei

Date: 2011-01-07 15:30:00

HTML generated by org-mode 6.33x in emacs 23