Forum rules - please read before posting.

Loading time troubles and differing loading time between the same scenes

UNITY 2018.1.8F1
AC V1.64.2

My game is almost ready, the only worrying thing that is causing me a headache is the loading scene times. Not all scenes take ages, just some in particular and I cannot work out why this is. 

The first scene of two scenes (A to B) for example is instant in loading, but when I move to the second scene ( A to B (fine) then back to A (ages)), it takes forever to load. Also, if I start in scene B, and move to scene A, it is seamless, but when going back to scene B it takes ages, so again, it is not the size of the scene A or B. 

See video here:

https://www.dropbox.com/s/11xbsta2j0z8c5f/Loadingtimes.mp4?dl=0

And image of Profiler when:Loadingtimespng


I am using preload and have asynchronous set to on.

Please look at my overall build size:

Screen Shot 2018-08-13 at 112007png

Are my textures overly large?

I have gone through my long audio files and chosen Compressed In Memory and unticked Preload Audio.

But this doesn't seem to have changed the loading time.

Big backgrounds are 4096 pixels.

See import settings:

texture editorpng
«1

Comments

  • Update, I did a test and removed every piece of audio and background images and it still had the delay...
  • attachFull291724 
    Could it be the number of animation clips? and if so, is there a way to sort this without reducing the number?
  • Removed all animation too, didn't make much of a change. 
  • Do you have any Substances rather than "traditional" materials? They can take longer to load (depending on their Load Behaviour).
  • Hi Deckard, I don't think so, I have a few assets - water, smoke from asset store, I tried removing them and there was no difference
  • As I recall you have a huge number of animation clips placed in the base layer of your Player's Animator - and this can have a big impact on performance.

    To test, duplicate your Player's Animator Controller, remove all custom animations from the copy, and temporarily assign it as your Player's new Animator Controller.  Provided that any scenes you test don't involve another player, does it speed things up?
  • Made no difference. as i pointed out earlier, the first time you swap scenes it is instant, but when you go back it takes forever...
  • The same trick can be used to find the source of any bottleneck.  Duplicate your project, remove all e.g. background textures from the project, and test for speed.  Once you get a significant increase, whatever you last deleted is the cause.

    Your backgrounds are big, however - and you're only using "Normal" compression.  The typical recommendations of using square textures, sprite packing etc should all be applied, regardless of this being an AC project or not.
  • This is something I will definitely do. However, it seems that there is something  that causes the massive pause/lag on re-entry to the scene. The first scene load is instant, but the second very long.

    It is not the same pause as 'loading' like in other scenes, but also as if AC and Unity just stops, I cannot even move the cursor. I have tried copying the scenes properties into a new scene but thee same thing happens....
  • Your profiler spikes are all green - meaning it's the Rendering (i.e. graphics) that's contributing the most.

    Does this occur if you switch between the two scenes by loading save games placed in them both?  Or is it only when re-entering the scene through natural gameplay?
  • So, after a process of elimination, I have worked out the issue, it is my Resources folder with my Speech inside. Is there any way to speed this up? I removed the whole folder and scenes load instantly now. But I do not want to get rid of the speech! What to do?

    The hierarchy sits as Resources, with Speech folder inside, with sub folders of characters names.
  • I have 6096 lines of recorded dialogue
  • Might this loading time be reduced if the folder hierarchy is Resources/Speech/Scene/Player or NPC folder? rather than Resources/Speech/Player or NPC folder?
  • Nice spot @jamesfootlight! I have noticed the same thing but never been able to pin point the reason.

    I also have some dummy speech files in my project (in Resources/Characters/[CharacterName]/Speech).
  • Resources audio files are pulled in directly via their expected filepath/filename - as opposed to being searched for - so their folder placement is for management convenience only.  Further subfolders won't affect performance times.

    Backing up first, try this wiki script.  It auto-assigns your audio files when they're to be manually assigned (which is better for performance).
  • Thanks, I will implement, I have two questions however, is this script set for file hierarchy as follows -  Resources (folder)/Speech (folder)/Character Name (folder)/ CharacterNameNumber (FrithelMEC2890) or do I need to pull all audio into the Speech folder loose?

    Also, do I need a game object with the script attached in every scene?

    Sorry if these seem like dumb questions but just want to clarify

    Cheers

    James
  • You can run it once in an empty scene - it just needs the scene starting itself to run.

    It should work for whatever your hierarchy is - it'll look for what the "automatic" file should be, then assign it manually.  Afterwards, check that they're all appearing in the Speech Manager entries and you can then move them out of the Resources folder.
  • So it would just need an empty game object in the Title Opening Scene for example, with the script attached, and that is all? It would run itself just by being attached in the scene?
  • Not quite sure what you mean - 'Afterwards, check that they're all appearing in the Speech Manager entries and you can then move them out of the Resources folder.'
  • It doesn't matter which scene its run from - it can be an entirely fresh one just for this purpose.  It's only to be run once from the Editor - not when your game is actually running.

    See the "Manual association" part of the Manual's "Speech audio" chapter - that's what I'm referring to.
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.