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. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

Question: Making App Loading Time Shorter?

Discussion in 'Scripting' started by shmulik.pangolin, Feb 4, 2015.

  1. shmulik.pangolin

    shmulik.pangolin

    Joined:
    Nov 11, 2014
    Posts:
    12
    Hey you guys!

    I'm working on a simple kids game for iOS, and somehow it takes 12 seconds for the game to load from splash screen to the actual first scene (on iPad 2/3, iPad 4 is 8 sec. - still too long)

    I guess that's because I have 27 scenes in this game and each scene weigh about 15 Mb.

    do you know of any way or a trick to make the game load faster? (even in the cost of loading scenes later)

    am I doing something wrong?
     
  2. gamer_boy_81

    gamer_boy_81

    Joined:
    Jun 13, 2014
    Posts:
    169
    Are you loading a lot of content from the beginning of the game or is it
    just splash scene to first scene ?
     
  3. shmulik.pangolin

    shmulik.pangolin

    Joined:
    Nov 11, 2014
    Posts:
    12
    I load a lobby, that only contains background and 26 UI buttons. It's pretty much like a splash scene, just a little heavier.

    one important detail: When I had only 9 scenes in the game, loading time was about 4-5 secs
     
  4. gamer_boy_81

    gamer_boy_81

    Joined:
    Jun 13, 2014
    Posts:
    169
    Can you show the scene loading code here ?
    From what I recall, ipad1 loading times were pretty high, but
    if the scenes are not that heavy, ipad2/3 should load pretty
    quick.
    You can even check it in the Unity Editor Heirarchy view if perchance
    you are loading something that is not necessary..or something that
    is loaded only at runtime and not in Editor ?
     
  5. Kiwasi

    Kiwasi

    Joined:
    Dec 5, 2013
    Posts:
    16,860
    Have you tried loading only a basic menu screen, then using LoadLevelAsync?

    The loading time will be the same, but it will be obscured by your menu screen. Only if the player does hits play before you are done loading do you need to stop and load.
     
  6. shmulik.pangolin

    shmulik.pangolin

    Joined:
    Nov 11, 2014
    Posts:
    12
    isn't there any chance that unity loads other scenes when I only load the app? it sounds unlikely but there is a fact that when I had less scenes, the first scene loaded faster.
     
  7. shmulik.pangolin

    shmulik.pangolin

    Joined:
    Nov 11, 2014
    Posts:
    12
    @BoredMormon , yeah I know LoadLevelAsync behavior, but that's not the case here:(

    let me try to simplify my explanation.
    WHEN I HAVE 27 SCENES;
    I load only the first (and light) scene. it takes 12 secs to show the first scene.
    WHEN I HAVE 9 SCENES;
    I load only the first (and light) scene. it takes 4 secs to show the first scene.

    WHY?!!?:(
     
  8. gamer_boy_81

    gamer_boy_81

    Joined:
    Jun 13, 2014
    Posts:
    169
    ha..Can you show your scene loading code ?
    Unless, we have more data, its shooting in the dark for us.
     
  9. shmulik.pangolin

    shmulik.pangolin

    Joined:
    Nov 11, 2014
    Posts:
    12
    unfortunately I can't upload the code (company's policy)

    do you know something about UI making things slower?
    My colleague says that when he added Unity UI to his project, things got slower.

    another question,
    Does total app size influence loading time?
     
  10. Sbizz

    Sbizz

    Joined:
    Oct 2, 2014
    Posts:
    250
    9 scenes x 3 = 27 scenes,
    4 seconds * 3 = 12 seconds,

    We don't ask you for your project, we ask you for your scene loading code. If your company's policies don't allow that, sad for them.
     
  11. shmulik.pangolin

    shmulik.pangolin

    Joined:
    Nov 11, 2014
    Posts:
    12
    OK, that's what made me post that question. It sounds awkward that I don't even load those scenes and yet they affect the first scene loading time. what brings me to the previous question - Does total app size influence loading time? It sounds crazy. I don't even try to load the remaining 26 scenes.
     
  12. Sbizz

    Sbizz

    Joined:
    Oct 2, 2014
    Posts:
    250
    I don't think so. Are you using LoadLevelAdditive ?
     
  13. shmulik.pangolin

    shmulik.pangolin

    Joined:
    Nov 11, 2014
    Posts:
    12
  14. Kiwasi

    Kiwasi

    Joined:
    Dec 5, 2013
    Posts:
    16,860
    Modes the profiler give you any clues? Maybe you have some weird long loops in the awake or start function of each button? That could explain why extra scenes is a problem.

    But honestly without code we are just guessing. It's probably not a unity related issue.
     
  15. gamer_boy_81

    gamer_boy_81

    Joined:
    Jun 13, 2014
    Posts:
    169
    Yeah, you can post just part of the codes. We are not here to steal :p
     
  16. shmulik.pangolin

    shmulik.pangolin

    Joined:
    Nov 11, 2014
    Posts:
    12
    OK OK!
    I've found the problem!
    it was all about the UI buttons!

    When I took them off the first scene, it loaded much faster!

    do you know something about this problem? its 6 seconds less we're talking about
     
  17. Sbizz

    Sbizz

    Joined:
    Oct 2, 2014
    Posts:
    250
    The UI has some performance issues, but 6 seconds.. You must do something wrong. I have a hundred elements in my UI and it loads really fast.