Search Unity

Very poor performance on Android after upgrading to Unity 5

Discussion in 'Android' started by digitalMUTANT, Mar 3, 2015.

  1. UnityLighting

    UnityLighting

    Joined:
    Mar 31, 2015
    Posts:
    3,874


    Is solved in 5.4.1 64 bit test
     
  2. Azmar

    Azmar

    Joined:
    Feb 23, 2015
    Posts:
    246
    Oddly enough, when I first started learning Unity the guides I followed and Unity answers lead me down the road of doing a canvas for each UI element like one for Menu, one for Settings, etc. Heck it felt natural as it feels more component based design with this approach, and was easy to activate / deactivate different UI this way. Obviously this is wrong, and if I remember correctly a few people did this too at the beginning of the thread.
     
  3. UnityLighting

    UnityLighting

    Joined:
    Mar 31, 2015
    Posts:
    3,874
    I think canvas is only for draw UI elements. therefore for each scene you need only one canvas. It's clear.
    Therefore, with one canvas, you have no fps loss problem. Is it true?
     
    Last edited: Oct 25, 2016
  4. JamesArndt

    JamesArndt

    Joined:
    Dec 1, 2009
    Posts:
    2,932
    Yep. Performance should normally dramatically improve when baking lighting vs. using real time lighting on everything with real time shadows. You can do a lot of cool tricks to fake shadows with simple decals, blob shadow projectors, etc. You can even write up a simple script that will skew and rotate a blob shadow based on the sun's location (really just a transform).
     
    UnityLighting likes this.
  5. obses

    obses

    Joined:
    Jan 23, 2016
    Posts:
    7
    UnityLighting likes this.
  6. studentvz

    studentvz

    Joined:
    Dec 14, 2014
    Posts:
    149
    Don't use Unity 5.4.3f1 because of poor performance.

    I work in Unity 5.3.4f1, having almost stable 60fps, in Unity 5.4.3f1 I have 40-55fps. Just when I hoped things got better, they are actually worse...

    Which Unity version do you use?
     
  7. MrEsquire

    MrEsquire

    Joined:
    Nov 5, 2013
    Posts:
    2,712
    Yes but if you use old version then you miss out all the Android bug fixes in the newer.
    So you got think about it, it be better if you try and figure out the cause of the performance drop
    and then send report Unity as I dont think they do much performance testing on real life projects..
     
  8. studentvz

    studentvz

    Joined:
    Dec 14, 2014
    Posts:
    149
    I'm aware of that, bug fixes are main reason why I wanted to move to new Unity version.
    You know what is annoying? I've already lost to much time on performance optimizations just to get close to Unity 4 performance, and now again I should go a step back and identify what is broken.
    All this versions should have Beta in their names...

    I will stick to old version, if I get to many bug reports maybe then I will dig into it.
     
  9. Vagabond_

    Vagabond_

    Joined:
    Aug 26, 2014
    Posts:
    1,148
    Well v5.5f1 is out and i thought i will give it a try hoping the things changed since 5.4... but the things are like getting worse... Build/Deploy times for a very simple scene to the device i am using is about 30-40 minutes when make some change to the level and about 5-10 minutes if just rebuild it without any changes... It's like developing for android is a pain... Not sure if building for android is worth... "trying to "optimize all the time" something that suppose to run at 50-60fps but runs at 20 fps is not acceptable...

    Holding development again!
     
  10. UnityLighting

    UnityLighting

    Joined:
    Mar 31, 2015
    Posts:
    3,874
    I already opened my unity 4 project into unity 5( Direct open u4 project in 5.4.1) for test his performance after baking light map again in unity 5.4.1.
    And I concluded that performance is same. I don't know what is happened but my game is run smooth as unity 4 version on Lenovo A3500(mali 400 mp2). My game is not a simple scene, It has a lots of explosions,enemy's and advance weapon system like UFPS (+Canvas and Control Freak 1 (GUI))
    www.GIFCreator.me_1JmMnj.gif
    Unity_4_5_2.jpg
    Unity_4_5_1.jpg
     
  11. Vagabond_

    Vagabond_

    Joined:
    Aug 26, 2014
    Posts:
    1,148
    Well the point as we know is that performance issue affects like half of existing devices... If you have device with Adreno GPU try build on that... as i am pretty sure you won't get that good performance. I am having access to a device with Mali-2 GPU and there is no performance regression... only on that with Adreno GPU
     
  12. UnityLighting

    UnityLighting

    Joined:
    Mar 31, 2015
    Posts:
    3,874
    In Adreno 330 (Xperia Z1),i can play game in 720p resolution with Amplify Color and Sun Shaft images effects in solid 60 fps.
     
  13. studentvz

    studentvz

    Joined:
    Dec 14, 2014
    Posts:
    149
    You constantly have 60fps for like 10-15min of playing?

    Z1 is good device (GPU and native resolution are balanced). Downgrading resolution is good trick to get more fps and if device is not overheating thats great. For example, my main test device LG G3 has same GPU as Z1 but native resolution is way bigger and GPU can't handle it for long time. Device overheats quickly and fps starts to drop. I like to use this device to see how bad can my game perform.

    Do you use Unity Terrain?
     
  14. UnityLighting

    UnityLighting

    Joined:
    Mar 31, 2015
    Posts:
    3,874
    I didn't test in a long time.
    Yes i used terrain (In some cases unity terrain is work better than converted terrain to mesh).
    And i think overheating is not unity 5 problem, It's for phone design and GPU company.
     
  15. UnityLighting

    UnityLighting

    Joined:
    Mar 31, 2015
    Posts:
    3,874
  16. studentvz

    studentvz

    Joined:
    Dec 14, 2014
    Posts:
    149
    Maybe you are CPU bound.
     
  17. UnityLighting

    UnityLighting

    Joined:
    Mar 31, 2015
    Posts:
    3,874
    My performance is good. I am wonder about fog performance ,that is not same in my new test compare to my old test:
     
  18. FuzzyQuills

    FuzzyQuills

    Joined:
    Jun 8, 2013
    Posts:
    2,871
    That's odd actually, the performance is cut in half just rendering fog... :/
     
  19. CesarNascimento

    CesarNascimento

    Joined:
    Mar 26, 2013
    Posts:
    15
    Did anyone ever had a problem like your game running WAY slower if on an "older" Android version?
    For example, I have 2 identical phone, but one is running Android 4.4 and the other is at 5.0.
    The 4.4 runs the same .apk WAY slower than the 5.0. Unbearably so. The profiler isn't helping much, but I can see that apparently some scripts take way longer to execute. But I still can't pinpoint the problem, I don't know if it's something with the code, with some shaders/meshes, or if 4.4 simply won't work well. Any kind of help would be appreciated.



    Update: Never mind, found the problem. Using a Zenfone 5 with Android 4.4, if I installed a FAT .apk for some reason the game would be running the ARM part, not the x86. I solved it by generating a x86 apk.
     
    Last edited: Dec 1, 2016
  20. UnityLighting

    UnityLighting

    Joined:
    Mar 31, 2015
    Posts:
    3,874
  21. studentvz

    studentvz

    Joined:
    Dec 14, 2014
    Posts:
    149
    Did anyone experience performance drop after Android OS update to 7.0?

    I have Samsung S7 Edge, my game was running at stable 60 fps, now after update to Android 7.0 my game runs on unstable 45-60fps.
     
    Vagabond_ and MrEsquire like this.
  22. sledgeman

    sledgeman

    Joined:
    Jun 23, 2014
    Posts:
    389
    Hey all.

    I compared U4.72 and U5.34, U5.38 & U5.62. My performance results are interesting, because the difference between U4.7 and U5.6 is really big ! U5.6 doesn´t seems to have a chance against U4.7. I turned everything off inside U5.6. Like environment, Gi, etc. I even don´t have Physics3D / 2D inside my project. So you can exclude this. What i´ve noticed is, that simple movements inside U5 are slaggish and stuttering. U4.7 does not has any stutters at all, and the movements are really good & smooth. My Project is about simple sidescroller prototype with use of the sprite system. So no big meshes here. The build size out of U5.6 is plus 5mb in comparison to U4.7, so it gets bigger file size :-(

    You can only test this, notice it, on some older Android devices. That have a max. of 2 cores and KitKat OS. If i test it on my newer device with 8x cores and Android 5.1 you can´t notice this difference between U5.6 & U4.7, so good. This is why i went to a lower specs device.

    Has someone go through same expiriences here, with simple movements, simple sidescroller mechanics and only the use of the sprite system ?
     
  23. sledgeman

    sledgeman

    Joined:
    Jun 23, 2014
    Posts:
    389
    After a while i got very interesting news for everybody who suffered with bad performance by using unity 5.6 to publish to android. There is a hidden checkbox that should be activated: Disable Depth and Stencil ! Now if you publish your APK it runs smooth on your old Android Device as with Unity 4.7. Glad i figured it out. I hope it can help someone with same issues.
     
  24. JamesArndt

    JamesArndt

    Joined:
    Dec 1, 2009
    Posts:
    2,932
    Ah ha! Can anyone else confirm this? I haven't made an Android build with 5.6 yet, so I haven't seen the performance issues.
     
  25. sledgeman

    sledgeman

    Joined:
    Jun 23, 2014
    Posts:
    389
    If anyone want to confirm this, i would suggest to use a old device with max. 2x cores and 1gb RAM. Otherwise it will be difficult to recognize the "stuttering" of simple sprite animation (as described, without any physics attached on it)
     
    JamesArndt likes this.
  26. xxhaissamxx

    xxhaissamxx

    Joined:
    Jan 12, 2015
    Posts:
    134
    what it do coz when i enabled it i couldn't see my terrain
     
  27. larku

    larku

    Joined:
    Mar 14, 2013
    Posts:
    1,422
    This explains a little: http://answers.unity3d.com/questions/1282005/why-would-i-want-to-disable-the-stencil-and-depth.html

    Z-buffering is a way of keeping track of the depth of every pixel on the screen. https://open.gl/depthstencils

    If your game does not use shaders which utilize the depth or stencil buffers, disabling them could (should) reduce the amount of workthe GPU/CPU must do and also free up a bit of memory.

    There's more nitty-gritty here: https://open.gl/depthstencils

     
    AlMartson, JamesArndt and xxhaissamxx like this.
  28. xxhaissamxx

    xxhaissamxx

    Joined:
    Jan 12, 2015
    Posts:
    134
    i thought it's for 2D only o_O so why my terrain disappeared i tested with 2 terrains one with custom shader and with default terrain both same
     
  29. sledgeman

    sledgeman

    Joined:
    Jun 23, 2014
    Posts:
    389
    @ larku ... Thx for the explaination and the links !
     
    larku likes this.
  30. xxhaissamxx

    xxhaissamxx

    Joined:
    Jan 12, 2015
    Posts:
    134
    any new tips ? :D
     
  31. Netuddmeg

    Netuddmeg

    Joined:
    Mar 2, 2018
    Posts:
    14
    Same problems in 2017.3 ?
     
  32. ZubakIVAN

    ZubakIVAN

    Joined:
    Sep 21, 2015
    Posts:
    2
    Thanks bro, this fixed my game on UNITY 2017.2.2F1 i had 30fps, now i have 60fps+
     
  33. user099

    user099

    Joined:
    May 29, 2015
    Posts:
    25
    the release notes of unity 2017.2 shows:

    Android: Changed default frame rate (Application.targetFrameRate = -1) to 30 when v-sync is off, similar to iOS.
     
    AlMartson and JamesArndt like this.