Forum rules - please read before posting.

Long pause before Actionlist triggered from Unity UI in Scene Menu activates

On our character select screen we have a toggle to switch between the male and female voice actors for our main character. When the player hits the M or F buttons, the character switches and the new character plays a line of dialogue so the user can hear what they're getting themselves in for. If the player player clicks the already selected button, it runs through a sequence of sample dialogue lines.

The problem we're encountering is that the first time this button is clicked there's a long (almost 3 second?) pause before the voice line plays. This happens on F, which is the default, or M. Any subsequent clicks on either button play the Actionlist almost instantaneously. It's also not effected by how long the scene has been running, you get the same 3 second-ish pause if you let the scene idle for 5+ minutes, so it doesn't seem like it's to do with the UI not having initialised yet on scene start.

None of the other toggles on this screen (and there are quite a few) have this behaviour either, so it's perhaps dialogue? Dialogue is played via addressables, they're set to Streaming and Optimize sample rate.

Any idea what might be causing this, or suggestions for a work-around?

Greatly appreciate everyone's help, as always!

-M-

Comments

  • What are your AC/Unity and Addressable package versions, and is this in the Editor only, or builds as well?

    Does this occur if the ActionList only runs a speech line, and doesn't do anything visual?

  • Unity 2021.1.0f1
    Addressables 1.16.16 (happy to update this if it'll help)
    AC 1.73.6

    This happens only in builds, and doesn't happen in the editor at all.

    Reducing the actionlist to one single line of dialogue reduces the pause massively, to well within acceptable levels (if I'm being picky, it's still a fraction slower than the subsequent clicks with the normal list, but I'd be overjoyed if it ran this fast on the first click!).

    Under normal circumstances, the only visual thing it does is display a subtitle for the line and change the toggle graphic, with no transition or animation; if you're selecting M then the character prefab would be changed, but selecting F doesn't do anything other than play the line (as part of the sequence admittedly).

    Cheers!

    -M-

  • I'll need to see specifics. Let's see some comparisons of the ActionList when you're using all the Actions vs just the single line of dialogue.

    Also:

    • Are any Unity UI menus showing for the first time as a result of this ActionList? You should see them appear in the Hierarchy window if so.
    • Run a Deep Profile scan using the Profiler window - do any spikes show at the time of the pause?
  • By specifics, do you mean screens of the actionlists themselves? If not, what do you need?

    I'll get on the profiler this afternoon, and check the menus - follow up soon!

  • Yes - the logic that has a delay, vs the logic that doesn't.

    If in doubt, share everything.

  • Had a number of fires to extinguish this w/e, so I've not made it to the profiler as of yet - however, I have one major finding to report:

    This bug isn't exclusive to the character setup screen/scene and the associated actionlists; the big pause happens on the first subtitle menu displayed, regardless of source: For example, if I load a save game from the title screen, whatever character I speak to first in this play session there will be a big pause before the speech menu is displayed.

  • Is the Subtitle menu rendered using Unity UI? Please see my question above about any UI menus appearing in the Hierarchy at the time of the pause.

    If so, it may be to do with the spawning of the menu. How complex is it in terms of resources (graphics, animation etc) compared with the default SubtitlesUI?

    Temporarily switch the Subtitles menu's Source to Adventure Creator - does that remove the pause?

  • Yes, the subtitle menu is unity UI - it's a panel, two attached images for the speech bubble tail, two text boxes (one for dummy text to expand it to i's full size, one that actually displays the text) and two scripts, one which does the dummy text, and the other that turns off the unwanted tail image based on the characters facing. No animations. So, it's more complex than the default subtitle, but not by much in the grand scheme of things (AFAICT).

    Regarding the menu appearing in the hierarchy - it only happens in builds, so I'm not able to see it in the hierarchy, but it does happen 100% reliably whenever the first subtitles menu (all the NPCS have their own subtitles menu, exactly the same but with different coloured bubbles and sometimes a different font) is spawned.

    Switching the subtitles menu to Adventure Creator UI halves the pause, but it's still there: With Unity UI I reckon it as nearly 4 seconds, with AC UI it becomes about 2 seconds.

  • Copy your Subtitles menu into the Demo_MenuManager asset file and lock/delete the demo's original Subtitles menu. Then run the Demo game's Managers + Scene - does the issue still occur then?

    If so, PM me a .unitypackage of the modified Demo_MenuManager, your UI prefab and associated assets (scripts / fonts / etc) and I'll try to recreate it myself.

  • I've tried the suggestion above, and the issue doesn't occur either in the editor (where with my usual managers and scenes it doesn't occur anyway) or in a build. It occurs to me that this may be due to the park scene speech lines not having associated addressable lines of dialogue. What do you suggest as the next step?

  • Can confirm that if the first subtitles menu spawned has no addressable voice sample it displays immediately - the first subtitles menu that does have one still triggers the pause afterwards too.

  • edited August 2021

    I've replied to your PM on the same issue - please stick to just one means of discussing this topic, as it'll help me to keep all the necessary information together.

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.