Hi,
I am in the process of optimizing iPhone game, we currently develop and have just ran out of ideas.
The game is 3d shooter, with isometric camera. Test scene consists of level geometry (ground + walls), player character, player weapon and four GuiTexture objects.
Avarage frametime at level of 33-35 ms is way too high, if I want to add more elements to the game.
Device: iPhone 3G
SDK: 3.1.3
Profiler outputs:
----------------------------------------
iPhone Unity internal profiler stats:
cpu-player> min: 9.0 max: 13.6 avg: 11.3
cpu-ogles-drv> min: 1.8 max: 3.9 avg: 2.4
cpu-present> min: 1.2 max: 2.2 avg: 1.4
frametime> min: 33.2 max: 33.6 avg: 33.5
draw-call #> min: 9 max: 9 avg: 9 | batched: 0
tris #> min: 1929 max: 1929 avg: 1929 | batched: 0
verts #> min: 822 max: 822 avg: 822 | batched: 0
player-detail> physx: 0.5 animation: 0.5 culling 0.8 skinning: 0.6 batching: 0.0 render: 7.3 fixed-update-count: 1 .. 2
mono-scripts> update: 0.9 fixedUpdate: 0.0 coroutines: 0.0
mono-memory> used heap: 278528 allocated heap: 368640 max number of collections: 0 collection total duration: 0.0
----------------------------------------
----------------------------------------
iPhone Unity internal profiler stats:
cpu-player> min: 11.4 max: 13.4 avg: 12.5
cpu-ogles-drv> min: 1.7 max: 2.1 avg: 1.9
cpu-present> min: 1.2 max: 2.4 avg: 1.3
frametime> min: 33.4 max: 34.6 avg: 33.5
draw-call #> min: 9 max: 9 avg: 9 | batched: 0
tris #> min: 1929 max: 1929 avg: 1929 | batched: 0
verts #> min: 822 max: 822 avg: 822 | batched: 0
player-detail> physx: 0.6 animation: 1.4 culling 0.4 skinning: 1.0 batching: 0.0 render: 5.7 fixed-update-count: 1 .. 1
mono-scripts> update: 1.9 fixedUpdate: 0.0 coroutines: 0.0
mono-memory> used heap: 278528 allocated heap: 368640 max number of collections: 0 collection total duration: 0.0
----------------------------------------
----------------------------------------
iPhone Unity internal profiler stats:
cpu-player> min: 9.5 max: 22.9 avg: 13.0
cpu-ogles-drv> min: 1.7 max: 3.4 avg: 2.1
cpu-present> min: 1.2 max: 1.6 avg: 1.3
frametime> min: 27.8 max: 56.8 avg: 35.6
draw-call #> min: 9 max: 9 avg: 9 | batched: 0
tris #> min: 1929 max: 1929 avg: 1929 | batched: 0
verts #> min: 822 max: 822 avg: 822 | batched: 0
player-detail> physx: 0.7 animation: 1.0 culling 0.6 skinning: 0.8 batching: 0.0 render: 7.2 fixed-update-count: 1 .. 2
mono-scripts> update: 1.5 fixedUpdate: 0.0 coroutines: 0.1
mono-memory> used heap: 278528 allocated heap: 368640 max number of collections: 0 collection total duration: 0.0
----------------------------------------
Four draw calls come from GuiTextures.
one is from player character (single mesh),
one from player shadow mesh (plane),
one from level ground mesh,
one from level walls mesh,
one from player weapon.
I have no idea where such high frametime comes from.
I don’t use OnGUI and pre-allocate everything (“used heap” statistic doesn’t grow with time).
If you guys have suggestions, what else I could do to increase performanceor what I could have done wrong, please let me know.
Thanks!