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

Speeding up game for Mobile

Discussion in 'Scripting' started by epochplus5, Feb 20, 2021.

  1. epochplus5

    epochplus5

    Joined:
    Apr 19, 2020
    Posts:
    677
    Is there a way to speed the whole game up?

    it runs faster in my editor than on my mobile, would be nice to speed the whole game up without having to go through every game object and speed things up. is there a global setting.
     
  2. SparrowGS

    SparrowGS

    Joined:
    Apr 6, 2017
    Posts:
    2,536
    What do you mean? are you talking about fast/slow motion or the frame rate?

    if you're talking about the frame rate there's no secret setting, you just gotta optimize for mobile.
     
  3. epochplus5

    epochplus5

    Joined:
    Apr 19, 2020
    Posts:
    677
    The whole game is just running slower, so there is no way around this, just got to speed up every element?
     
  4. SparrowGS

    SparrowGS

    Joined:
    Apr 6, 2017
    Posts:
    2,536
    What do you mean speed up every element?

    You need to see what's running slow (in the profiler) and make it faster, IE: optimize
     
  5. Havyx

    Havyx

    Joined:
    Oct 20, 2020
    Posts:
    140
    Yes. Enable the "Warp Speed" option in the player settings. This should make the game run at least 15 times faster.

    In all seriousness though...

    There are two basic concepts. "CPU Locked" and "GPU Locked". Performance is either degraded due to:

    - The CPU is at maximum load
    - the GPU is at maximum load

    This is where you first determination should be as it will allow you to figure out if you need to focus on graphics or code optimisation.

    From there you will need to use the profiler to figure out exactly what is causing issues.

    https://docs.unity3d.com/Manual/Profiler.html

    Also bear in mind with mobile you have to watch out for thermal throttling where the OS will actually limit CPU/GPU usage to reduce temperature.
     
  6. epochplus5

    epochplus5

    Joined:
    Apr 19, 2020
    Posts:
    677
    Its not that the game is running terribly, everything works, just being on mobile i think its running slower than it does on a powerful laptop. would be nice to increase the speed by 2
    its only a simple 2D game, so i dont think there is any serious graphics issues.
     
  7. SparrowGS

    SparrowGS

    Joined:
    Apr 6, 2017
    Posts:
    2,536
    Don't think, check.
    The profiler will tell you all you need to know.

    A mobile device has less processing power, what do you expect the engine to do exactly? it's gonna run faster on better hardware (IE a development computer)
     
  8. epochplus5

    epochplus5

    Joined:
    Apr 19, 2020
    Posts:
    677
    " what do you expect the engine to do exactly? it's gonna run faster on better hardware (IE a development computer)" which was my point exactly, which is why i posted this question.

    but yes i have heard about profiler before and how useful it is, will def check it out, thanks guys.
     
    Last edited: Feb 20, 2021
  9. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    11,002
    If I understand what you mean, look into making your code frame rate independent.
     
  10. Havyx

    Havyx

    Joined:
    Oct 20, 2020
    Posts:
    140

    also... burst compiler.

    https://docs.unity3d.com/Packages/com.unity.burst@0.2/manual/index.html

     
  11. MartinTilo

    MartinTilo

    Unity Technologies

    Joined:
    Aug 16, 2017
    Posts:
    2,160
    That does indeed sound like what they mean. To clarify this: make sure that your speed calculations are using Time.deltaTime (usually needs to be multiplied with your speed variable) to make the movements independent of the amount of frames the device can fit into a second.
     
    AcidArrow likes this.