Forum rules - please read before posting.

Scene switching takes very long time.

Hi,
I don't understand what is happening here. Scene switching is time consuming.. It happens almost everywhere, and it seems is an audio related issue.. any suggestion?

I searched here for similar question but nothing found.

See the video attached.

https://youtu.be/ec9LtAcbUwQ

Comments

  • What's your AC version?

    "SoundManager.LoadFMODSound" isn't related to AC. Your project makes use of FMOD, I take it?

    Long load times when switching scenes is typically related to assets in Resources folders. See the Manual's "Performance and optimisation" chapter - in particular, the section named "Use Resources subfolders".

  • Hi @ChrisIceBox
    I'm using v1.71.5 and no.. I don't use FMOD, I don't understand why is happening.
    I've already read that chapter, and it's not clear if assets can be organized with subfolders. I have lot of sprites so it's not possible to move inside that folder without a sub structure.

    Thx

  • edited August 2020

    I have lot of sprites so it's not possible to move inside that folder without a sub structure.

    Can you elaborate on this? What assets specifically do you have in Resources folders, and what are they used for? It may not be necessary for all your sprites to be in Resources folders if that's where they are now.

    Except for speech audio, you're typically free to move such assets around, so long as they're in a Resources folder - links to them will still be retained.

  • edited August 2020

    https://ibb.co/GMPsqD4

    This is my Resource folder I use: Animation Sprites, Scene static sprites, Prefabs, Fonts, Audio.

    Sprites/Rooms, Sprites/Animations and Sprites/GUI are structured in subfolders (every animation/scene has it's own one)

    Animations and Animation Controllers are not under Resources.

    I don't yet use speech audio, but I will.

    The Saveable Data structure are empty it was a test, I just moved audio files trying to resolve this issue.

  • edited August 2020

    You should only place files into Resource folders if they need to be there - i.e. for speech audio playback, or for saving/loading. Don't place them in there otherwise - having this many files in there will be the cause of your long load times. This is true of all Unity projects - it's not a behaviour specific to AC.

    The SaveableData workaround can alleviate much of this, but you'll also need to have dummy assets inside them - it'll have no effect if they're empty. Having this many files inside Resources will still affect performance, however.

  • Ok, so I will check my Resource folder. Thx for replying to a non-AC related issue.

  • Hi @ChrisIceBox , I found what cause the super lag. It was the Audio folder under Resources. Well, moving outside the Resources folder done the job.
    But I don't understand why the function "MultisceneChecker.Start()" needs to reload every files under resources folder.. even if not used by the current scene. Now scene switching takes ~270ms.

    I hope that this time is faster in the release build.
    If not I think that I had to change scene switching with the async version.

    Is it right?

    Thx.

  • edited August 2020

    You should move as much as you can out of Resources - the more you have in it, the longer your load times will be.

    MultiSceneChecker.Start initiates AC's scene loading process, which updates scenes with data and asset files that may need to be loaded in. If you keep unnecessary files out of Resources and rely on SaveableData folders though, this should not have a significant impact.

  • Hi @ChrisIceBox, another problem actually causing this issue is when you have large and complex navmesh collider and small player/npc. This takes very long time at the beginning to calculate path finding datas. A better approach could be to make possible the baking of those datas. I've already tried to "bake", using the function present in the latest version, but same results. I think that baking function is only for pre-calculating holes collider.

  • Try using the A* pathfinding algorithm a try - the movement's a little different, but the calculation is a lot faster than the default 2D pathfinding. It can be found on the Downloads page.

  • I found that most scene switching lags are created by Animators. Seting them to "Cull completely" fixes this. It seems to be a Unity related issue.

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.