Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Voting for the Unity Awards are OPEN! We’re looking to celebrate creators across games, industry, film, and many more categories. Cast your vote now for all categories
    Dismiss Notice
  3. Dismiss Notice

Android game very fast in 2017.1.1f1 but not in 2017.4.0f1

Discussion in 'Editor & General Support' started by kiroshi, Apr 16, 2018.

  1. kiroshi

    kiroshi

    Joined:
    Jan 24, 2017
    Posts:
    5
    Hello friends,
    I have a huge problem that can not be solved somehow. I created an other 2D game, which is optimized well for Android. Building that apk in Unity3D version 2017.1.1f1 works on latest devices and it is very smooth!
    Here comes the problem: after changing to the newer Version of Unity (2017.4.0f1), my Game is not smooth anymore(on my Galaxy S7 Edge). It is verrrryy laggy. its FPS is "downgraded" somehow, after changing to a newer Version. What can i do ? Android SDK is up to date. I do not use any Lights. Only sprites and optimized Particles from the Asset Store. I dont need to talk about the other options, since My other Games works fluently after building it with the previous version. But not with the final version !

    Please help me !

    EDIT: I FIXED IT ON MY OWN AFTER 1 YEAR LOL. The solution was : setting Application.targetFrameRate = 60 at the beginning of the "FIRST" scene. I always putted in the second scene. But setting it on the first one in awake function fixed the issue. Thanks to everyone!
     
    Last edited: May 9, 2018
  2. DroidifyDevs

    DroidifyDevs

    Joined:
    Jun 24, 2015
    Posts:
    1,724
    Did you try using the Profiler as the game is running on your phone to see the differences?
     
  3. watsonsong

    watsonsong

    Joined:
    May 13, 2015
    Posts:
    555
    We met a error that scene static batch seems break when we switch the Unity 2017.1.3f1 to Unity 2017.1.3p1.
    The scene draw call is increase a lot.
    It seems like this error.
     
  4. kiroshi

    kiroshi

    Joined:
    Jan 24, 2017
    Posts:
    5
    ill reply after trying. Thank you for the answers!
     
  5. kiroshi

    kiroshi

    Joined:
    Jan 24, 2017
    Posts:
    5
    Alright, i have created 2 pictures of the Android profiler. as @watsonsong said: the draw call is increased and there are some rendering issues. should i try to make some changes on my Camera ? What can i do ? my Game is a 2D Game.
     

    Attached Files:

    • 1.png
      1.png
      File size:
      151.2 KB
      Views:
      710
    • 2.PNG
      2.PNG
      File size:
      155.5 KB
      Views:
      668
    • 3.PNG
      3.PNG
      File size:
      38.7 KB
      Views:
      699
  6. f0ff886f

    f0ff886f

    Joined:
    Nov 1, 2015
    Posts:
    201
    Are these good and bad? There are 21 drawcalls and 23 drawcalls, is that really too much for mobile?

    In the one screenshot you're spending 6ms in some CoRoutines. You should expand that: upload_2018-4-18_16-6-57.png

    20% of your frame is spent there... but its still not clear that this should lag at all?
     
  7. kiroshi

    kiroshi

    Joined:
    Jan 24, 2017
    Posts:
    5
    as i said: in the previous version everything is smooth. i replaced all necessary update functions with coroutines, since an update function doesnt made any sense to spawn enemies(for example). 21-25 draw call is not a problem for the S7 Edge. Vsync is already zero, anti aliasing is turned off, shadow + lighting as well.. i am really confused.
     

    Attached Files:

    • 4.PNG
      4.PNG
      File size:
      137.9 KB
      Views:
      689
  8. DroidifyDevs

    DroidifyDevs

    Joined:
    Jun 24, 2015
    Posts:
    1,724
    That 200ms killPlayer function is concerning... are you sure that part of your script is OK?
     
  9. arfish

    arfish

    Joined:
    Jan 28, 2017
    Posts:
    777
    Can it be some quality settings that has been changed during the update?

    I had a similar issue when upgrading a game from 2017.2 to 2017.3.
    In 2017.2 it was running smoth on both new and older devices, but after update to 2017.3 it went super sluggish on "older" Android 6.0 devices with "only" 4 cores. Went back to 2017.2 and haven't had time to investigate it further though...
     
  10. kiroshi

    kiroshi

    Joined:
    Jan 24, 2017
    Posts:
    5
    @DroidifyDevs killPlayer invokes after 2 seconds: this.gameObject.SetActive(false) and changes the enum from "Game" to "Menu". The enums changing only values and disabling scripts like "EnemySpawn".

    @arfish everything looks fine in the Quality Settings. I went back to 2017.1 too but there is no support for later android devices. Android 8.0 for example is not recognized / included when building the APK. Thats why i "must" use this version. I will profile again to find the issue. ill let you know. Thanks so far to everyone!