iOS5 and Unity Performance?

I have a couple of games on the app store called Pocket Passer QB and Pocket Passer QB Free.

I am starting to get reports from users that when they upgrade their iPhones and iPod Touches the gameplay becomes laggy and unresponsive. It’s a flick game, and it is taking them many times to get the ball to flick. It does still seems to be OK on the iPad.

These games were built with Unity 3D 3.4.0f5 and updated on the app store a few weeks ago. They also include EZGUI/SM2 from Above and Beyond Software and iAD/AdMob/GameCenter plug-ins from Prime 31.

So my question is has anyone seen a degradation in performance for their Unity3D with iOS5? If so, can you point me any known places where it would be good to start optimizing.

Thanks

Sounds like you are using unity pro?
Use the profiler to watch whats cost intensive inside editor.
The second thing is that you can use the xcode profiler for more testing .

I am used to using profiler in Xcode, but haven’t tested with new OS yet. Just trying to see if there were any “known” issues out there with Unity and iOS5 so I didn’t waste too much time.

One thing I was thinking is that I am still building for iOS 3.1.3 with Universal armv6+armv7. I am wondering if that can be causing some issued between armv6 and iOS5? Not really my area of expertise.

Should I just be building for armv7 at this point?

I haven’t heard any grumblings from my users since iOS5 launched, and my games are built to support armv6 and pretty old iOS versions as well, so that may not be a factor.

OK. Looks like I’ll just have to dive in tonight and figure it out. Its just unfortunate timing.

Thanks

I experienced lag on iPod Touch 3rd gen devices that I updated to iOS5. The same game with the same device before the update runned just fine. No lag on iPad 1 with iOS 5.

I don’t know what is the problem, hope this can/will be fix with a Unity update !

Is the lag you are experiencing dealing with input/touches or overall graphics performance?

It seems to be overall graphics performance: it occurs when there are more enemies on the screen (3D and animated); indirectly, there are also more FXs and sounds.

OK. Does someone know what is the best way to reach the folks at Unity to raise this issue?

This sounds upsetting. I hope if its a unity issue it can be fixed with a update too.

Have you tried changing
#define USE_OPENGLES20_IF_AVAILABLE 1
to
#define USE_OPENGLES20_IF_AVAILABLE 0

This isnt a soltuion ios5 related but i’ve found unity runs lots faster with ogles 20 disabled. but if your using glsl/cg shaders its not really a ideal solution

Submit a bug report via

Help->Report a Bug

inside unity.

I don’t know if its pro related but i’ve got quick responses before.

Thanks!

I have submitted a bug report with my XCode project. I will let you all know if I hear anything back.

Thanks

i am glad someone else has noticed this. i recently upgraded to iOS 5 and have been having a hell of a time trying to figure out why my game was all of a sudden too slow to run at a decent framerate.

at first, i thought it had to do with a high amount of draw calls, so i spent 2 days straight reworking and optimizing. it was really frustrating to get no noticeable results. next i tried to reduce transparency, and went to great lengths reworking that… it helped a little, but no serious solutions.

finally, i disabled what i thought was a pretty innocuous “clean up” function that was disabling scripts en mass – huge speed boost. i had thought that enabling/disabling custom scripts had no performance cost, so i never even bothered to check. it seems like there is a lot of memory use involved with it, as if iOS 5 is more strict with allocating memory. perhaps im crazy, but it seems like the lag has to do with the garbage collection being invoked constantly.

please let me know how the devs respond to you, because it has been a serious blow to my enthusiasm. the lag that was newly introduced really frustrated me, especially because no one seemed to be having the issue.

just an added note:

my game is still experiencing tons of lag, compared to how it was previously. i would definitely like to hear an update from the devs.

THANK YOU!!! This is what I needed for the time being. I made this change and everything is running as its supposed to be. I have submitted my updates to the app store.

What caught me off guard was that my main dev phone is a 3Gs. The performance was fine on this. It was crappy on the 4G with iOS 5. As it turns out, it wasn’t even that great with iOS 4 on the 4G, but it was passable enough not to get complaints.

Here’s some interesting stats from the profiler:

BEFORE REMOVING OPENGLE 2.0 - #define USE_OPENGLES20_IF_AVAILABLE 1
iOS 4.3 - iPhone 3Gs
iPhone Unity internal profiler stats:
cpu-player> min: 11.5 max: 16.5 avg: 14.3
cpu-ogles-drv> min: 2.3 max: 6.2 avg: 3.2
frametime> min: 30.2 max: 37.5 avg: 33.4
draw-call #> min: 33 max: 37 avg: 35 | batched: 9
tris #> min: 5296 max: 5652 avg: 5482 | batched: 122
verts #> min: 7072 max: 7501 avg: 7302 | batched: 98
player-detail> physx: 2.0 animation: 0.0 culling 0.0 skinning: 0.0 batching: 0.1 render: 5.5 fixed-update-count: 0 … 2
mono-scripts> update: 1.6 fixedUpdate: 0.1 coroutines: 2.8
mono-memory> used heap: 2707456 allocated heap: 2740224 max number of collections: 0 collection total duration: 0.0

iOS 4.3 iPhone 4G
iPhone Unity internal profiler stats:
cpu-player> min: 11.5 max: 54.7 avg: 44.5
cpu-ogles-drv> min: 2.0 max: 4.1 avg: 2.6
frametime> min: 19.9 max: 61.6 avg: 51.0
draw-call #> min: 40 max: 46 avg: 43 | batched: 11
tris #> min: 6150 max: 6632 avg: 6519 | batched: 301
verts #> min: 8188 max: 8684 avg: 8568 | batched: 210
player-detail> physx: 2.9 animation: 0.0 culling 0.0 skinning: 0.0 batching: 0.1 render: 33.9 fixed-update-count: 0 … 3
mono-scripts> update: 2.0 fixedUpdate: 0.0 coroutines: 3.7
mono-memory> used heap: 3153920 allocated heap: 3657728 max number of collections: 0 collection total duration: 0.0

AFTER REMOVING OPENGL 2.0 - #define USE_OPENGLES20_IF_AVAILABLE 0
iOS 4.3 iPhone 4G
iPhone Unity internal profiler stats:
cpu-player> min: 5.4 max: 33.2 avg: 8.0
cpu-ogles-drv> min: 2.0 max: 3.6 avg: 2.3
frametime> min: 27.1 max: 39.3 avg: 33.5
draw-call #> min: 30 max: 37 avg: 33 | batched: 13
tris #> min: 4936 max: 5656 avg: 5239 | batched: 421
verts #> min: 6785 max: 7668 avg: 7121 | batched: 288
player-detail> physx: 0.6 animation: 0.0 culling 0.0 skinning: 0.0 batching: 0.1 render: 1.8 fixed-update-count: 1 … 1
mono-scripts> update: 1.7 fixedUpdate: 0.0 coroutines: 2.1
mono-memory> used heap: 2813952 allocated heap: 3657728 max number of collections: 0 collection total duration: 0.0

iOS 5 iPhone 4G
iPhone Unity internal profiler stats:
cpu-player> min: 7.1 max: 29.6 avg: 9.8
cpu-ogles-drv> min: 1.8 max: 3.6 avg: 2.4
frametime> min: 26.2 max: 35.6 avg: 33.3
draw-call #> min: 29 max: 39 avg: 34 | batched: 11
tris #> min: 4824 max: 5656 avg: 5250 | batched: 206
verts #> min: 6527 max: 7668 avg: 7085 | batched: 156
player-detail> physx: 0.7 animation: 0.0 culling 0.0 skinning: 0.0 batching: 0.1 render: 2.6 fixed-update-count: 1 … 1
mono-scripts> update: 2.6 fixedUpdate: 0.0 coroutines: 2.1
mono-memory> used heap: 3457024 allocated heap: 3657728 max number of collections: 0 collection total duration: 0.0

I am assuming I was using some bad shaders for OpenGL 2.0 and I need to do some research to get up to speed. (Although I have heard it can be slow.) At least I have a short term fix which I am happy with.

oh er wow. Unity say something? you guys on top of this ? :S

fi you are using already mobile shader provided in unity and get those result , well yeah it sound kind of weird, specially considering that openGL 2.0 will become the standard to go for now XD…

I already saw in my own app that flag it to 0 lower stuff , and sometimes give you a boost or at last more stable fps, but that really depends on the game, on a 2d game I am doing now , with some overdraw going on, it doesn’t matter if i set openGL flag 0 or 1 , that do not change any about perf , in both case it kept 60 fps.

so well , I guess as hippo said , UT staff could share some light in this considering you are using recommended shader for iOS…

@bigtoeproductions what you are actually comparing?

I see GLES 2.0 data for iPhone 3GS vs iPhone4 (the same OS, different devices) and GLES 1.1 comparison is for the same device (iPhone 4), but for differen OS’es. It looks a bit like comparing apples to oranges :slight_smile:

P.S. what’s your case number?

using old opengl did not solve my lag issue.

can anyone tell me if there seems to be any glaring issue in these stats? i am receiving lag about every second


iPhone Unity internal profiler stats:
cpu-player> min: 12.6 max: 72.8 avg: 29.6
cpu-ogles-drv> min: 0.8 max: 14.2 avg: 2.1
frametime> min: 20.4 max: 79.1 avg: 39.2
draw-call #> min: 14 max: 14 avg: 14 | batched: 56
tris #> min: 296 max: 314 avg: 305 | batched: 408
verts #> min: 412 max: 448 avg: 431 | batched: 283
player-detail> physx: 4.6 animation: 0.0 culling 0.0 skinning: 0.0 batching: 0.7 render: 12.2 fixed-update-count: 0 … 1
mono-scripts> update: 8.3 fixedUpdate: 0.1 coroutines: 0.0
mono-memory> used heap: 675840 allocated heap: 864256 max number of collections: 1 collection total duration: 4.7

iPhone Unity internal profiler stats:
cpu-player> min: 11.6 max: 46.7 avg: 28.5
cpu-ogles-drv> min: 0.8 max: 9.0 avg: 1.9
frametime> min: 29.1 max: 64.5 avg: 39.7
draw-call #> min: 14 max: 14 avg: 14 | batched: 58
tris #> min: 280 max: 310 avg: 297 | batched: 385
verts #> min: 380 max: 440 avg: 415 | batched: 267
player-detail> physx: 5.6 animation: 0.0 culling 0.0 skinning: 0.0 batching: 0.9 render: 11.7 fixed-update-count: 0 … 1
mono-scripts> update: 6.2 fixedUpdate: 0.1 coroutines: 0.0
mono-memory> used heap: 753664 allocated heap: 864256 max number of collections: 0 collection total duration: 0.0

iPhone Unity internal profiler stats:
cpu-player> min: 11.5 max: 51.6 avg: 26.4
cpu-ogles-drv> min: 0.8 max: 13.9 avg: 1.7
frametime> min: 29.1 max: 62.7 avg: 36.1
draw-call #> min: 14 max: 14 avg: 14 | batched: 59
tris #> min: 278 max: 300 avg: 288 | batched: 357
verts #> min: 376 max: 420 avg: 396 | batched: 248
player-detail> physx: 4.6 animation: 0.0 culling 0.0 skinning: 0.0 batching: 0.2 render: 11.4 fixed-update-count: 0 … 1
mono-scripts> update: 6.8 fixedUpdate: 0.1 coroutines: 0.0
mono-memory> used heap: 704512 allocated heap: 864256 max number of collections: 1 collection total duration: 6.2

iPhone Unity internal profiler stats:
cpu-player> min: 12.9 max: 50.9 avg: 25.9
cpu-ogles-drv> min: 0.8 max: 18.9 avg: 2.4
frametime> min: 29.1 max: 61.9 avg: 36.8
draw-call #> min: 14 max: 14 avg: 14 | batched: 59
tris #> min: 272 max: 296 avg: 283 | batched: 341
verts #> min: 364 max: 412 avg: 386 | batched: 238
player-detail> physx: 4.6 animation: 0.0 culling 0.0 skinning: 0.0 batching: 0.2 render: 11.2 fixed-update-count: 0 … 1
mono-scripts> update: 6.7 fixedUpdate: 0.1 coroutines: 0.0
mono-memory> used heap: 688128 allocated heap: 864256 max number of collections: 1 collection total duration: 4.3

iPhone Unity internal profiler stats:
cpu-player> min: 11.6 max: 47.8 avg: 25.5
cpu-ogles-drv> min: 0.8 max: 14.3 avg: 1.6
frametime> min: 21.5 max: 69.9 avg: 35.9
draw-call #> min: 14 max: 14 avg: 14 | batched: 60
tris #> min: 278 max: 290 avg: 285 | batched: 349
verts #> min: 376 max: 400 avg: 391 | batched: 243
player-detail> physx: 5.1 animation: 0.0 culling 0.0 skinning: 0.0 batching: 1.0 render: 8.7 fixed-update-count: 0 … 1
mono-scripts> update: 6.5 fixedUpdate: 0.1 coroutines: 0.0
mono-memory> used heap: 684032 allocated heap: 864256 max number of collections: 1 collection total duration: 5.3

iPhone Unity internal profiler stats:
cpu-player> min: 10.6 max: 40.6 avg: 17.1
cpu-ogles-drv> min: 0.8 max: 13.5 avg: 1.8
frametime> min: 17.9 max: 55.1 avg: 34.5
draw-call #> min: 14 max: 14 avg: 14 | batched: 62
tris #> min: 288 max: 290 avg: 288 | batched: 358
verts #> min: 396 max: 400 avg: 397 | batched: 249
player-detail> physx: 2.9 animation: 0.0 culling 0.0 skinning: 0.0 batching: 0.2 render: 4.7 fixed-update-count: 0 … 1
mono-scripts> update: 5.8 fixedUpdate: 0.1 coroutines: 0.0
mono-memory> used heap: 761856 allocated heap: 864256 max number of collections: 0 collection total duration: 0.0