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. Dismiss Notice

Question Android performance issue, fps jumping up and down

Discussion in 'Android' started by Sandwich_2, Jun 7, 2023.

  1. Sandwich_2

    Sandwich_2

    Joined:
    Sep 8, 2022
    Posts:
    10
    Hi, I am kinda new to the mobile part of game development and I have some issues around the performance. In the editor the game runs just fine, but as I build it to my phone it gets some serious fps issues. I tried displaying the fps and it seems like it is hoping between 60 and 4 fps at a very fast rate.
    I took a look at the profiler and saw "spikes" in the "others" category. It went from 10ms to about 30-40ms and then back down. But I saw nothing else.
    Has anybody experienced the same issue or have a possible solution? Thankful for answers.
     
  2. DevDunk

    DevDunk

    Joined:
    Feb 13, 2020
    Posts:
    4,362
    Send a screenshot of the profiler and check in the hierarchy what is causing this issue.
    Make sure to do this with the android build and not just in editor.
    It can be many things
     
  3. Sandwich_2

    Sandwich_2

    Joined:
    Sep 8, 2022
    Posts:
    10
    This is a screenshot of the profiler when I ran the game on my phone:

    I have no idea what and why the scripts are doing this. I guess it could have something with that I use URP but I don't know. What do you think? (Btw, now the fps doesn't hop up and down. It's just in a constant 9-10 fps)
     
  4. DevDunk

    DevDunk

    Joined:
    Feb 13, 2020
    Posts:
    4,362
    Looks like you got a lot of stuff rendering or using different render features etc. In the hierarchy you can click down to see what it might be.
    Otherwise you can try renderdoc to see where the GPU performance goes.
     
  5. Sandwich_2

    Sandwich_2

    Joined:
    Sep 8, 2022
    Posts:
    10
    One that caught my eye was "PostLateUpdate.FinishFrameRendering".
     
  6. DevDunk

    DevDunk

    Joined:
    Feb 13, 2020
    Posts:
    4,362
    That's the GPU working probably
     
  7. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    10,977
    I guess it's probably very project dependant, but try disabling Vulkan and turning off Optimised Frame Pacing.
     
    DevDunk likes this.
  8. Sandwich_2

    Sandwich_2

    Joined:
    Sep 8, 2022
    Posts:
    10
    I recently tried making another mobile game and had the same problem. I think it has something to do with the unity version I'm using (2021.3.18f) as I have made mobile games before that haven't had this issue (this was before changing to my current version).
     
    Last edited: Jun 15, 2023
  9. Sandwich_2

    Sandwich_2

    Joined:
    Sep 8, 2022
    Posts:
    10
    Both of those options were turned off by default. Any other ideas?
     
  10. Sandwich_2

    Sandwich_2

    Joined:
    Sep 8, 2022
    Posts:
    10
    I just now tried remaking the game without URP and the builds run just fine. I will continue developing the game like this, but since URP gives much advantages it's a shame and I really would like to be able to work with it. I tried switching the quality settings to performant which took away all my additional lights which are important in my game, so that's not the way to go (The game ran good though).
     
  11. DevDunk

    DevDunk

    Joined:
    Feb 13, 2020
    Posts:
    4,362
    You just gotta set it up properly. Maybe look up a demo project on GitHub or unity learn?
     
  12. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    10,977
    Eh, I still think if you really play to built-ins strengths, it's much easier to get good performance on mobile than with URP (and playing to built-ins strengths is easier).

    I do think that for somewhat higher end features you can set up URP to be much faster that built-in.
     
    Unifikation likes this.
  13. DevDunk

    DevDunk

    Joined:
    Feb 13, 2020
    Posts:
    4,362
    For me with the same project when testing performance (and similar feature sets being enabled), performance is within 5% (can go to either URP/built in dependant on the scene and device)
     
  14. Sandwich_2

    Sandwich_2

    Joined:
    Sep 8, 2022
    Posts:
    10
    Sorry for the late response. I managed to install URP to my project and it works fine now. I believe there were some options enabled/disabled when creating the project directly in URP. It was actually great restarting cuz I figured I'd make new models and the game looks much better. Thank you for your help.
     
    DevDunk likes this.