Forum rules - please read before posting.

Second time load a scene taking too long

I found in this forum 3 post with the exactly same problem, but none of the solutions worked for me.
When I enter a scene for the first time is instant, if I go back and enter again it take 3 or 4 seconds, in my game you change rooms frequently and those 4 seconds start to bother you.
The strange thing is that the first time you enter in any room, the load is instant.

My Resource folder is empty, my game has no speech sounds, only sound effects, I play the sound effects via default sound using the Sound: Play and changing the default clip.

Every scene has the same music that keep playing through the scenes.

Any idea?

Comments

  • Saved data related to the scene is loaded upon re-entering it, but how long this takes is made up of a number of factors - not just the state of the Resources folder.

    What is your AC version, and what exactly does your scene and Player comprise of? If you use the Profiler window at this time, it should be able to give you an idea of the process that's causing it.

    The Manual's "Performance and optimisation" chapter gives a rundown of a few things to be aware of so far as improving load times go - have you attempted any of the steps listed there?

  • I am reading it right now, I'll try every step.

    This is what happen when switching scene

    I am using 1.69.5 with Unity 2019.3.7f1


  • Switching to a empty AC scene.

  • edited May 2020

    OK, I did every step nothing seems to work.

    It seems that the long time is editing the scene I am unloading.

  • Ok, now I know what is causing it, I start deleting all assets from the game to see. When I deleted one of the npcs is just works. Now I need to understand why is causing it.

  • Well in the end was a unused folder with some 3d models and textures.

    Adventure Creator must search for every single folder in the project.

    So, I think I didn't do the right way with the Resources folder like in Manual, because it keep searching the assets on the entire project.

    It's really hard to know what exactly I am using on the project and what AC is requiring since it became a big project after a year developing without thinking about optimization.

    I worked in several games but as an artist, this is the first time that I have made a game entirely on my own.
    So during development I learned a little about programming.
    AC helps me a lot to understand how game logic works.


    Anyway I'll try to put everthing in the Resource folder and keep it organized, but I need to understand how Resource folder really works.

    The path must be Resources/SaveableData/Animations/Idle.anim ?

    Or can I create subfolder inside the Animations folder?

    Like Resources/SaveableData/Animations/Girl/Idle.anim

    Or can I use any folder name after Resources/SaveableData/Characters/Girl/Idle.anim


    In the manual it says to put at least one placeholder in each folder, but should I import a video just for the sake of it?
    SaveableData/VideoClips


    I use Unity UI, in the manual says that I can Disable OnGUI, but I didn't know what exactly I should do with this "entering ACIgnoreOnGUI as a Scripting Define Symbol".


    Sorry about so much questions.

  • Your project as a whole shouldn't be searched - only Resources folders. Even if you haven't created them yourself, they are used by the two demo games - but the aren't necessary for AC to run. Backing up first, you should be fine to delete both the Demo and Demo2D folders.

    The Profiler suggests that this is related to a "Remember Transform" component - do you have any such components on the NPC? If so, for what purpose are you using it - perhaps we can find an alternative.

    "SaveableData" paths must be of the form "Resources/SaveableData/(Type)", where (Type) is Animations, Audio, etc. You can place such assets in subdirectories within this, i.e.:

    /Resources/SaveableData/Animations/Characters/Girl/Idle.anim
    

    But the "type" must be set first. The following will not work, because it has no "Animations" folder:

    /Resources/SaveableData/Characters/Girl/Idle.anim
    

    In the manual it says to put at least one placeholder in each folder, but should I import a video just for the sake of it?

    Ideally, yes.

    I didn't know what exactly I should do with this "entering ACIgnoreOnGUI as a Scripting Define Symbol".

    Scripting Define Symbols are entered into Unity's Player Settings.

  • In one of the Npcs has a "moveable" object, all they have are Remember NPC. I don't use in any object Remember Transform.
    I usually use Remember Visibility and Animator for some characters and other interactive objects.

  • Well I made a complete clean up of the entire game assets folder and updated the AC.

    I must say really good work on the ActionList Editor, the version I was using was terrible, laggy and when you zoom out the scroll it became so small that you couldn't click.

    One thing that could make the AC incredible, would be to use the node editor from Unity Shader Graph API.

    Anyway, let me ask you, the only way to create dialogue is via nodes? Because my game has really long dialogue and become pretty tedious to copy and paste nodes with different characters.

  • Because my game has really long dialogue and become pretty tedious to copy and paste nodes with different characters.

    In what context? Does each character say the same thing?

    If you don't rely on speech audio, you can parameterise the Action's Speaker field so that you can set the speaker at runtime. See this tutorial for more on parameters.

    Other ways to generate speech lines include:

    • Generating speech Actions through script. See the Manual's "Generating ActionList through script" chapter.
    • Scripting a cutscene without Actions - see this tutorial.
    • Using the speech track in Timeline - see this tutorial.
    • Using Dialogue System from Pixel Crushers, which supports AC as well as importing speech from third-party applications
  • When I said "Copy and Paste Nodes" I didn't mean that the characters says the same thing, but I found faster copy and paste a node and edit the line, than find my character prefab and drag into the speaker field.

    What exactly should I parameterise to make it faster? I probably should make a popup variable and edit the node so I can use a enumpop and find my characters names.

  • If they're intended to be separate speech lines - i.e. not repeated lines shared by different characters, then best not to rely on parameters, as the Speech Manager will need to have those fields directly assigned.

    If you rely on player-switching, then you can assign all your characters in the Speech Manager so that they can be assigned from drop-down boxes in Actions. You'd have to first convert your NPCs to Players and rely on the player-switching workflow (even if those characters themselves aren't made playable), though. A tutorial on this can be found here.

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.