Forum rules - please read before posting.

Long loading times for scene changes on Android

I am currently porting my game to Android and am experiencing issues that I'm not sure are related to AC or Unity settings in general.

On desktop, there is no issue and scenes change/load within 1-2 seconds but on Android they take around 2 minutes each, every single scene.

I've done some research and found out that apparently Unity loads up the contents of the Resources folder every time it loads a new scene. If this is true then I'm presuming that's the problem as I have literally hundreds of voice clips in their own folders within the Resources folder along with a couple of movie clips for cutscenes, etc.

I've noticed that the profiler shows 'Loading.UpdatePreloading' at around 98% when it changes scenes.

I'm not sure of what screenshots might be needed here but if any help then I'll gladly upload them.


Comments

  • This is a Unity issue, but AC has some ways of combating it.

    See Section 13.6 of the Manual, point 2.  You can limit that number of Resources files Unity searches by placing assets in subfolders.

    Another option would be to rely on manually-assigned links between speech lines and their audio files, which would mean they no longer need to be in Resources folders.  If you uncheck Auto-name speech audio files? in the Speech Manager, an audio clip field gets exposed in each line's entry.

    Given that you've got hundreds of lines though, you'll want to write a custom script that goes through each line for you and manually assigns the audio file.  You can access all speech lines with:

    AC.KickStarter.speechManager.lines

    Which is a List of SpeechLine classes.  A manually-assigned audio file is stored in its customAudioClip field.
  • Thanks Chris

    Unfortunately I have no idea how to create custom scripts so I'll either leave the android release or have a version without voices :(

    I'll try placing the speech files in the folders you specify in the manual to see if it makes a difference.
  • See if it helps and if not, I'll see if I can help.
  • It still doesn't seem to work. I've still got 1-2 minute scene loading time :/
  • Thanks, Chris...But that script is for if the audio files are in the Resources folder, right? I'm not sure how that would speed things up as the scene would still reload the contents of the Resources folder anyhow, surely? 
  • edited June 2017
    Once they're assigned in the Speech Manager fields, you can move them out of the Resources folder.
  • edited June 2017
    Will I have to manually go through each and every audio clip? And I just leave the script as it is? Do I have to call this script in every scene? I'm sorry, I'm not up on actual scripting etc.
  • No, this will add the audio clips automatically.  Back it first, though.  Just run it once, and yes you can leave it as it is.
  • Thanks, Chris. Unfortunately it seems to not be working. I even deleted the speech files altogether and still had the same problem so it must be something else. I'm going to have to take some lessons in mobile optimisation and see where it leads me.

    Again, thanks for the help anyhow :)
  • @voops: It's not tied to Unity, so you'd first have to get it running within Unity.  I can't comment on its performance impact or viability, as it's not AC-related.
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.