Dialogue UI hangs after reset

Announcements, support questions, and discussion for the Dialogue System.
EgilSandfeld
Posts: 11
Joined: Mon May 14, 2018 5:57 am

Dialogue UI hangs after reset

Post by EgilSandfeld »

Hi there.

Loving DS for Unity. It has saved me lots of time, and I'm still finding new areas, where it's useful :)

My issue is the following using DS and the PersistenceDataManager:
  • Play a bit, starting the first Conversation, and Save into PlayerPrefs using the PersistenceDataManager
  • Use own built menu to Reset the saved game, so player can start over
  • Play again starting that same first conversation
The menu reset contains amongst other stuff the following:

Code: Select all

DialogueManager.StopConversation();
DialogueManager.ResetDatabase(DatabaseResetOptions.RevertToDefault);
Inspecting a saved game Item called "Abs_Meet" during gameplay, shows it's correctly set. After the first conversation it is set to "active", and if I reset it it's correctly set back to "unassigned". So things are working behind the scenes it seems.

However, when playing again after the reset, the Dialogue UI sort of hangs. I have to force Continue by pressing my Cancel key, which is Escape. First time it just shows the dialogue UI NPC subtitle element without text. Pressing Escape again, shows the text.

I'm not sure why that is happening, as the first time around it works without issues. Here's a short playthrough of the issues (at the end is where I have to force Escape to bring UI and trigger NPC lines):

Image

Inspecting the Dialogue Editor UI during gameplay and watching the Conversation to be started, it shows that the first time through everything runs as intended. The second time after the reset, it hangs like this, where it doesn't move forward to the first dialogue line, unless I force it:
Image

Finally, if I stop the Unity Editor and start playing again, everything works fine as in I can play the conversation without having to force the dialogue lines forward. This would mean that something is stuck during runtime, but is loaded correctly upon start.

Any ideas why Dialogue UI hangs after resetting?
User avatar
Tony Li
Posts: 22059
Joined: Thu Jul 18, 2013 1:27 pm

Re: Dialogue UI hangs after reset

Post by Tony Li »

Hi,

Thanks for using the Dialogue System!

It's strange that it's getting stuck on the <START> node. (At runtime, the Dialogue Editor window shows the current node in green.) Could you please post a screenshot of the <START> node's Inspector view and the Dialogue Manager's Dialogue > Subtitle Settings?

It's also possible that the issue is with the Dialogue Panel's Show/Hide animations. Inspect the Unity UI Dialogue UI's Dialogue > Animation Transitions section. Make sure Show Trigger and Hide Trigger are set to "Show" and "Hide" respectively, and that Transition Mode is set to State:

Image

If you can reproduce the error state after checking this, open an Animator window and inspect the Dialogue Panel child GameObject. Make sure it's in the Show state:

Image

It's possible that something's happening where it's stuck in Hide or Start.

Please also feel free to send a reproduction project to tony (at) pixelcrushers.com. I'll be happy to take a look.
EgilSandfeld
Posts: 11
Joined: Mon May 14, 2018 5:57 am

Re: Dialogue UI hangs after reset

Post by EgilSandfeld »

Sure thing, here's the START node from the same conversation:
Image

And here is the DS Inspector for the Display -> Subtitle settings:
Image

I've checked the settings of the Dialogue UI which are exactly like you described:
Image

The pink/white checkered background is also the background of that dialogue UI, so visually and by debugging the Dialogue UI, I can confirm that the dialogue ui does appear. Plus, everything works fine the first time I come to this conversation and again after restarting the editor player. There's just some internals that seem to not be triggered.

I'll try updating DS from 1.7.7.2 now.
User avatar
Tony Li
Posts: 22059
Joined: Thu Jul 18, 2013 1:27 pm

Re: Dialogue UI hangs after reset

Post by Tony Li »

Hi,

Thanks for the screenshots. If upgrading doesn't fix it, try setting the <START> node's Sequence to Continue() instead of None(). This shouldn't make a difference, but it will be informative if it does.

You can also temporarily set the Dialogue Manager's Debug Level to Info. This will log a lot of info to the Console window. The first time you run the conversation, it should log this (among many other lines):

Code: Select all

Dialogue System: Player says ''
Dialogue System: Lord Mayor says 'Hi there. Good to see you...
The first line is the <START> node.

After you reset the game and run the conversation, I'm guessing that it will only show the first line. However, maybe some lines preceding or following that line will be informative.
EgilSandfeld
Posts: 11
Joined: Mon May 14, 2018 5:57 am

Re: Dialogue UI hangs after reset

Post by EgilSandfeld »

Changed to Continue() but no dice:
Image

The Dark grey circle is where the dialogue now resides in the UI. The dark grey is now the same as the old pink/white checkered background. This means the Dialogue UI comes up just as before.

The last Info debug is:
Dialogue System: Add Link (Lord Mayor): ID=3:1 'Hi there. Good to see you and thanks for coming by on such a short notice.' (True)
UnityEngine.Debug:Log(Object)
PixelCrushers.DialogueSystem.ConversationModel:EvaluateLinksAtPriority(ConditionPriority, DialogueEntry, List`1, List`1, List`1, Boolean)
PixelCrushers.DialogueSystem.ConversationModel:EvaluateLinks(DialogueEntry, List`1, List`1, List`1, Boolean)
PixelCrushers.DialogueSystem.ConversationModel:GetState(DialogueEntry, Boolean, Boolean, Boolean)
PixelCrushers.DialogueSystem.ConversationModel:.ctor(DialogueDatabase, String, Transform, Transform, Boolean, IsDialogueEntryValidDelegate, Int32, Boolean, Boolean)
PixelCrushers.DialogueSystem.DialogueSystemController:StartConversation(String, Transform, Transform, Int32)
PixelCrushers.DialogueSystem.DialogueSystemController:StartConversation(String, Transform, Transform)
PixelCrushers.DialogueSystem.DialogueManager:StartConversation(String)
PhoneController:AnswerPhone() (at Assets/_Project/Scripts/Gameplay/PhoneController.cs:40)
UnityEngine.Events.UnityEvent:Invoke()
AWE.AWE_UI_Button:OnPointerUp(PointerEventData) (at Assets/_Project/Scripts/UI/AWE UI/AWE_UI_Button.cs:105)
UnityEngine.EventSystems.EventSystem:Update()
I'm not sure if you can deduce anything from that.



Also, on a side note, I'm having issues with some Conversations swapping SpeakerInfo and ListenerInfo. Eg. if Player speaks a dialogue line, the SpeakerInfo is HC Andersen. I'm not sure this has anything to do with the issue above, but I've included it just to check:
Image
EgilSandfeld
Posts: 11
Joined: Mon May 14, 2018 5:57 am

Re: Dialogue UI hangs after reset

Post by EgilSandfeld »

I just tested that it is only the first/that "Lord Mayor/Intro Foyeren" that has the issue of the dialogue UI "hanging". When I move on and get to future conversations they run without issues like before the reset.

Also, I use ChatMapper (CM) for this project, and I use the export/import options quite a lot. I have a CM license but before updating DS, I could not get the import CMP to work. Only importing XML's from CM worked. This meant that when I exported from DS -> CM, I had to use "Import from XML" and then save that as a CMP project. I saw popups about that I need to apply a template in CM, but I used your CM template project to start from and haven't experienced other issues with this.
Now again, I add this here to this issue here in case it might be related. The CM export issue has resolved itself after updating DS from 1.7.7.2 to 1.8.1 :)
User avatar
Tony Li
Posts: 22059
Joined: Thu Jul 18, 2013 1:27 pm

Re: Dialogue UI hangs after reset

Post by Tony Li »

Hi,
EgilSandfeld wrote: Tue May 15, 2018 7:58 amI just tested that it is only the first/that "Lord Mayor/Intro Foyeren" that has the issue of the dialogue UI "hanging". When I move on and get to future conversations they run without issues like before the reset.
Would it be possible for you to send a copy of your dialogue database to tony (at) pixelcrushers.com? From all indications in the Console window, the line "Sequencer.Play( Continue()@0 )" should move the conversation forward to the link that was added: "Hi there. Good to see you...".

The Console window has a line: "ConversationController: Starting conversation with Lord Mayor". Is this a script of yours? Could it be related to the issue?
EgilSandfeld wrote: Tue May 15, 2018 7:52 amAlso, on a side note, I'm having issues with some Conversations swapping SpeakerInfo and ListenerInfo. Eg. if Player speaks a dialogue line, the SpeakerInfo is HC Andersen. I'm not sure this has anything to do with the issue above, but I've included it just to check: (image)
It's probably unrelated. You may need to swap the assignment of Actor and Conversant in your Conversation Trigger, or however you're starting the conversation. In Dialogue System 1.x, you can assign different GameObjects than the ones intended for each actor in the conversation. The explanation and rationale are here: How GameObjects Are Associated With Conversations.
EgilSandfeld wrote: Tue May 15, 2018 7:58 amAlso, I use ChatMapper (CM) for this project, and I use the export/import options quite a lot. I have a CM license but before updating DS, I could not get the import CMP to work.
I'm glad it's working for you now. I'm not sure what the issue was. The Dialogue System had full Chat Mapper support before it had an in-Unity editor. It originally started as a front-end for Chat Mapper, in fact. Importing directly from CMP file into Unity does require the Commercial or Team license, though, since those are the only ones that support the Chat Mapper command line tools that CMP import uses.
EgilSandfeld wrote: Tue May 15, 2018 7:58 am...when I exported from DS -> CM, I had to use "Import from XML" and then save that as a CMP project. I saw popups about that I need to apply a template in CM, but I used your CM template project to start from and haven't experienced other issues with this.
You only need to worry about applying a different template if you've added or deleted fields. If you're using the default fields that came with the CM template project, then you're all good.
EgilSandfeld
Posts: 11
Joined: Mon May 14, 2018 5:57 am

Re: Dialogue UI hangs after reset

Post by EgilSandfeld »

I've sent you the dialogue database.

The ConversationController is just a listener on conversations from various triggers. The code looks like this and shouldn't do anything to DS as it reads only:

Code: Select all

public void OnConversationStart(Transform actor)
    {
        Transform character = actor;
        if (character.name == "You")
        {
            //We need the NPC of this conversation
            if (DialogueManager.ConversationController.ActorInfo.Name != "You")
            {
                character = DialogueManager.ConversationController.ActorInfo.transform;
            }
            else
            {
                character = DialogueManager.ConversationController.ConversantInfo.transform;
            }
        }

        CharacterLogic npc = character.GetComponent<CharacterLogic>();
        if (npc != null)
        {
            GameController.Instance.lastNPC = npc.transform;
        }
        else if (currentUsable != null)
        {
            npc = currentUsable.GetComponent<CharacterLogic>();
            if (npc != null)
            {
                GameController.Instance.lastNPC = npc.transform;
            }
        }
    }
Thank you on clearing up what is required for ChatMapper to work. Turns out that area should work fine then :)
User avatar
Tony Li
Posts: 22059
Joined: Thu Jul 18, 2013 1:27 pm

Re: Dialogue UI hangs after reset

Post by Tony Li »

Thanks for sending the dialogue database. I haven't been able to reproduce the problem. I sent you the test scene that I used.

What else is in your menu reset code? Is it possible that some other code is causing the issue?
EgilSandfeld
Posts: 11
Joined: Mon May 14, 2018 5:57 am

Re: Dialogue UI hangs after reset

Post by EgilSandfeld »

I guess so. I will have a deeper look into that.

I get to the same result with your test scene as well. I'll try to figure it out.

Thank you so much for the help so far!
Post Reply