Hi Everybody,
i am pretty new to programming, Unity and all this iphone-stuff…
So… i have tried to created a 2D-game, with a character who has to jump from one moving platform to another. Because i have only one character that could collide with 10 platforms, i have solved the collisions via simple “if-then-scripts that are looking for overlapping positions” in update and late update.
My game has no physics, no skinned geometry, just plane polys for the background, platforms and the player, some of the textures are animated with a max of 8fps, ( i have altered the Animating Tiled texture - Extended-script) so that i can call 6 different UV-Animations via InvokeRepeat…
FixedTimeStep = 1
Iphone Script Call Optimization= Fast but no Exceptions
I have only 1 scene
The Game runs on my Ipod Touch 2G with about 55 to 59 fps
Unfortunatly every 15 seconds the fps drops for half a second to about 35 fps!
Because i am totally new to programming i have 18 scripts for my GameObjects and each uses its own function Update(), could this cause the slowdowns?
It would be very kind if someone would have a look at the stats of my profiler… is there something unusual?
(In the last part the max framtime is 106.1 … this should be the moment when the slowdown appears…)
iPhone Unity internal profiler stats:
cpu-player> min: 8.8 max: 15.0 avg: 11.6
cpu-ogles-drv> min: 0.9 max: 3.6 avg: 1.6
cpu-present> min: 0.8 max: 1.0 avg: 0.9
frametime> min: 16.0 max: 28.5 avg: 17.5
draw-call #> min: 13 max: 15 avg: 14 | batched: 0
tris #> min: 156 max: 190 avg: 165 | batched: 0
verts #> min: 152 max: 180 avg: 161 | batched: 0
player-detail> physx: 0.0 animation: 0.0 culling 0.4 skinning: 0.0 batching: 0.0 render: 7.9 fixed-update-count: 0 .. 0
mono-scripts> update: 2.9 fixedUpdate: 0.0 coroutines: 0.0
mono-memory> used heap: 356352 allocated heap: 356352 max number of collections: 0 collection total duration: 0.0
iPhone Unity internal profiler stats:
cpu-player> min: 8.7 max: 18.0 avg: 11.7
cpu-ogles-drv> min: 1.1 max: 3.7 avg: 1.6
cpu-present> min: 0.8 max: 2.1 avg: 0.9
frametime> min: 16.0 max: 37.1 avg: 17.6
draw-call #> min: 13 max: 15 avg: 14 | batched: 0
tris #> min: 156 max: 190 avg: 164 | batched: 0
verts #> min: 152 max: 180 avg: 160 | batched: 0
player-detail> physx: 0.0 animation: 0.0 culling 0.5 skinning: 0.0 batching: 0.0 render: 8.1 fixed-update-count: 0 .. 1
mono-scripts> update: 2.5 fixedUpdate: 0.0 coroutines: 0.1
mono-memory> used heap: 286720 allocated heap: 356352 max number of collections: 1 collection total duration: 5.0
iPhone Unity internal profiler stats:
cpu-player> min: -2.1 max: 48.4 avg: 15.6
cpu-ogles-drv> min: 1.0 max: 14.5 avg: 2.1
cpu-present> min: 0.8 max: 2.7 avg: 1.0
frametime> min: 13.4 max: 56.5 avg: 22.3
draw-call #> min: 14 max: 16 avg: 14 | batched: 0
tris #> min: 158 max: 192 avg: 167 | batched: 0
verts #> min: 156 max: 184 avg: 164 | batched: 0
player-detail> physx: 0.0 animation: 0.0 culling 0.5 skinning: 0.0 batching: 0.0 render: 11.9 fixed-update-count: 0 .. 0
mono-scripts> update: 2.5 fixedUpdate: 0.0 coroutines: 0.0
mono-memory> used heap: 335872 allocated heap: 356352 max number of collections: 0 collection total duration: 0.0
iPhone Unity internal profiler stats:
cpu-player> min: 8.5 max: 58.4 avg: 16.3
cpu-ogles-drv> min: 1.1 max: 4.4 avg: 1.7
cpu-present> min: 0.8 max: 1.9 avg: 0.9
frametime> min: 14.9 max: 69.0 avg: 25.1
draw-call #> min: 13 max: 15 avg: 14 | batched: 0
tris #> min: 156 max: 190 avg: 166 | batched: 0
verts #> min: 152 max: 180 avg: 162 | batched: 0
player-detail> physx: 0.0 animation: 0.0 culling 0.6 skinning: 0.0 batching: 0.0 render: 12.8 fixed-update-count: 0 .. 1
mono-scripts> update: 2.4 fixedUpdate: 0.0 coroutines: 0.0
mono-memory> used heap: 270336 allocated heap: 356352 max number of collections: 1 collection total duration: 4.8
iPhone Unity internal profiler stats:
cpu-player> min: 8.9 max: 18.3 avg: 11.3
cpu-ogles-drv> min: 1.1 max: 2.5 avg: 1.5
cpu-present> min: 0.6 max: 2.1 avg: 1.1
frametime> min: 15.8 max: 106.1 avg: 20.9
draw-call #> min: 14 max: 15 avg: 14 | batched: 0
tris #> min: 158 max: 190 avg: 165 | batched: 0
verts #> min: 156 max: 180 avg: 162 | batched: 0
player-detail> physx: 0.0 animation: 0.0 culling 0.5 skinning: 0.0 batching: 0.0 render: 7.9 fixed-update-count: 0 .. 1
mono-scripts> update: 2.1 fixedUpdate: 0.0 coroutines: 0.0
mono-memory> used heap: 311296 allocated heap: 356352 max number of collections: 0 collection total duration:
0.0
Thank You
Torsten