Search Unity

Game stops responding on startup

Discussion in 'Scripting' started by Dotanukii, May 23, 2015.

  1. Dotanukii

    Dotanukii

    Joined:
    Aug 15, 2013
    Posts:
    16
    I'm working on a game right now with a lot of large audio files. When i export the game to windows standalone and try to launch it the unity 5 splash animation plays and then a blue screen will display for around 10 seconds. If i click around or press buttons during this time a windows popup will come up saying the game has stopped responding and asks to close the program or wait. Could this be due to the large number of assets the game is trying to load or something else? I've tried it on two different machines and had the same issue.
     
  2. krougeau

    krougeau

    Joined:
    Jul 1, 2012
    Posts:
    456
    Does the game work fine if you don't click around and instead just allow it to take it's time and load? If not, then the culprit may be in one of your starting scene scripts. Infinite loops and the like will also cause this behavior. I'd assume that, if large files were the problem, you'd have crashes in the Unity editor as well. Granted, this is all guesswork based on the limited amount of data you've provided. Hope it helps though :)
     
  3. Dotanukii

    Dotanukii

    Joined:
    Aug 15, 2013
    Posts:
    16
    It works fine if I don't click around, but it still takes a while to load. Is there some way I could possibly load a loading screen image, and disable clicking?
     
  4. krougeau

    krougeau

    Joined:
    Jul 1, 2012
    Posts:
    456
    While you could certainly setup a loading screen, it sounds like the main issue is that the game is slow to start up while loading all of these large assets, correct? That being the case, the end user could still crash the game or just get impatient and give up on it before everything loads. I'm not terribly familiar with their use, but I'd recommend looking into Resources and perhaps AssetBundles as alternatives to simply letting Unity load them all up at once.

    Here's a Live Training on Asset Bundles I've been meaning to look over myself:
    http://unity3d.com/learn/tutorials/modules/intermediate/live-training-archive/unity5-asset-bundles
     
  5. Dotanukii

    Dotanukii

    Joined:
    Aug 15, 2013
    Posts:
    16
    Thanks, Ill look into that. One thing i've noticed is that If i load up the game once and it takes a long time to load at startup then quit it and load it again, the game will load almost instantly. Any idea why this might be?