Huge GC alloc in PlaySequence

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
fkkcloud
Posts: 298
Joined: Mon Oct 05, 2020 6:00 am

Huge GC alloc in PlaySequence

Post by fkkcloud »

Hello,

I am getting a huge GC Alloc in the PlaySequence function.
화면 캡처 2021-07-17 203014.jpg
화면 캡처 2021-07-17 203014.jpg (201.89 KiB) Viewed 240 times
I am calling

Code: Select all

DialogueManager.PlaySequence("SetPanel(ThoughtBubble, 2);");
and if I remove this code, it seems like it does not get GC Alloc at all.

Is there a way to force it to not look for ThoughtBubble?
ThoughtBubble does not have any Actor or GameObject correlate to it so no need to look for its Actor objects or any sort,

For instance, I'm not 100% sure if it's safe to comment on the part that I am highlighting below in HandleSetPanelInternally function.

Code: Select all

private bool HandleSetPanelInternally(string commandName, string[] args)
        {
            string actorName = SequencerTools.GetParameter(args, 0);
            var actorTransform = CharacterInfo.GetRegisteredActorTransform(actorName);// ?? SequencerTools.GetSubject(actorName, speaker, listener, speaker); <--- line commented part?
            ....
            }
            
I am only using actors that are going to be registered properly with DialogueActor component within the gameObject or none (stuff like Narrator or Thoughtbubble)

But,
If I can permanently just set the Panel ID for an actor without calling SetPanel(...) every time when the conversation starts, it'd be even better. (or putting [panel=4] in every dialogue line node)
3333.jpg
3333.jpg (181.55 KiB) Viewed 237 times

I am on 2.2.14 with Unity 2019.4.27f1 LTS.

Best,
User avatar
Tony Li
Posts: 21987
Joined: Thu Jul 18, 2013 1:27 pm

Re: Huge GC alloc in PlaySequence

Post by Tony Li »

You can set the panel number just once on the Dialogue Actor component.

Or, if you don't want to do that, you can define a custom panel number field in your actor in the dialogue database. Add an OnConversationStart method to a script on the Dialogue Manager. In that method, look up the actor's panel number field. Then call StandardDialogueUI.OverrideActorPanel().
Post Reply