Best practice for making larger dialogue trees and avoiding looping errors

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
dantuom
Posts: 18
Joined: Fri May 06, 2022 10:06 am

Best practice for making larger dialogue trees and avoiding looping errors

Post by dantuom »

Hi

First post as I'm very new to the dialogue system, really enjoying using it so far but have run into one problem with dialogues that become larger and more sprawling.

In this example I've made a dialogue tree that essentially has three branches for the player to explore. Once they have fully exhausted one I would like to present them with the option to go back to the start and explore one or both of the other two.
Screenshot 2022-05-06 at 16.10.38.png
Screenshot 2022-05-06 at 16.10.38.png (586.52 KiB) Viewed 1094 times
However after completing one branch and going back round to the top to begin another one, I get a console error like this
Screenshot 2022-05-06 at 15.58.30.png
Screenshot 2022-05-06 at 15.58.30.png (206.58 KiB) Viewed 1094 times
...and the text stops appearing in the subtitle text, although the response buttons still display and (oddly) the space the text would have taken up still advances. I can continue to click response options but the empty space just grows.
Empty subtitle text 1.png
Empty subtitle text 1.png (376.46 KiB) Viewed 1094 times
Empty subtitle text 2.png
Empty subtitle text 2.png (448.65 KiB) Viewed 1094 times
Empty subtitle text 3.png
Empty subtitle text 3.png (554.61 KiB) Viewed 1094 times
I understand from this post https://www.pixelcrushers.com/phpbb/vie ... php?t=3246 and from slowly chewing my way through the manual that

1. this is probably happening because the text is forming a never ending loop and
2. my fairly disorganised and haphazard way of putting a dialogue tree together is not best practice

But I'm struggling to understand why, and how to do it better. Am I missing a guide somewhere on the basic principles of assembling a workable conversation tree? The dialogue editor section of the manual introduces some concepts like gather nodes but then doesn't really expand on how or where or why to use them.

Based on a kind of a hunch I've inserted an empty node in the links between each "branch", and strangely this does seem to allow me to go back to the top once, but when I try to explore the third branch I once again get the error and the "empty"/invisible subtitle text.

One possible solution I've thought of is to make each branch of the tree into separate sub-conversations that link to each other, but I don't know if this will solve my looping problem either.

I do apologise if this question is very broad or demanding, as I say I'm new to the dialogue editor (and to making games in general) and am really trying to keep things as simple as possible for myself while still being able to make large conversations.

Thanks in advance for any help.
User avatar
Tony Li
Posts: 22149
Joined: Thu Jul 18, 2013 1:27 pm

Re: Best practice for making larger dialogue trees and avoiding looping errors

Post by Tony Li »

Hi,

Yes, go with your instinct to break up your large conversation into several smaller sub-conversations and use cross-conversation links. You can also use Group nodes (tick the node's Group checkbox) to define commonly used hub/return points in your conversations.

To help with purely visual organization, you can also group your nodes.

Finally, to help identify the looping issue, you can do two things:

1. Keep the Dialogue Editor open on the conversation while playing in the editor. The current node will be highlighted in green. However, if you get to a loop that keeps adding the same text to the UI without returning control back to the editor, the Dialogue Editor window may not update which node is green in realtime.

2. More helpfully, temporarily set the Dialogue Manager's Other Settings > Debug Level to Info. This will log a lot of information to the Console window, including which dialogue entry nodes the conversation is using. You should be able to trace through the logs to identify the loop.
dantuom
Posts: 18
Joined: Fri May 06, 2022 10:06 am

Re: Best practice for making larger dialogue trees and avoiding looping errors

Post by dantuom »

Thanks Tony, I followed your advice and broke it into smaller inter-linked conversations, which definitely helps to keep things organised.

As for the loop though, I'm still no closer to a solution having followed your advice on setting the Debug Level to Info. Following along in the Dialogue Editor window and the Console everything seems to behave normally. The Dialogue Editor even continues to behave normally after the error has occurred.

The error can occur at different points in the conversation depending on which order I navigate it in. It seems more a question of time than of a faulty point in the tree.

Perhaps the problem is that I don't fully understand what you mean by this:
You should be able to trace through the logs to identify the loop.
When I scroll back through the log it appears to be behaving normally until the error occurs.
Screenshot 2022-05-06 at 18.33.10.png
Screenshot 2022-05-06 at 18.33.10.png (160.3 KiB) Viewed 1082 times
Screenshot 2022-05-06 at 19.32.44.png
Screenshot 2022-05-06 at 19.32.44.png (300 KiB) Viewed 1082 times
(instances of it occurring at two different points without any apparent warning)
But to be honest I probably don't entirely know what I'm looking out for.

My initial understanding of the loop issue was that a great big circle of nodes in one dialogue would overload the UI. But since it happens at different points each time I suspect I must have this wrong. If explaining this is beyond the scope of this forum maybe you could direct me to somewhere in the documentation that would help? Thanks.

Final thoughts:
When I click the error in the console it directs me to the Subtitle Text game object. It seems almost like Subtitle Text has an arbitrary(?) point at which it refuses to render any more text. The dialogue continues to appear as expected if I watch the Text component in the Inspector window, but in the game screen UI it remains invisible. Is there such thing as a conversation that simply has too much text for the UI to render?

Also, if i leave the conversation and come back into it again without leaving runtime, it will begin to render text as normal again in the UI until a certain (again, seemingly arbitrary) point where it once more goes invisible.
User avatar
Tony Li
Posts: 22149
Joined: Thu Jul 18, 2013 1:27 pm

Re: Best practice for making larger dialogue trees and avoiding looping errors

Post by Tony Li »

Hi,
dantuom wrote: Fri May 06, 2022 1:37 pmWhen I click the error in the console it directs me to the Subtitle Text game object. It seems almost like Subtitle Text has an arbitrary(?) point at which it refuses to render any more text.
It does. Please see How To: Limit Text Length With Accumulate Text Option for an explanation and solution.
dantuom
Posts: 18
Joined: Fri May 06, 2022 10:06 am

Re: Best practice for making larger dialogue trees and avoiding looping errors

Post by dantuom »

Tony Li wrote: Fri May 06, 2022 2:11 pm Hi,
dantuom wrote: Fri May 06, 2022 1:37 pmWhen I click the error in the console it directs me to the Subtitle Text game object. It seems almost like Subtitle Text has an arbitrary(?) point at which it refuses to render any more text.
It does. Please see How To: Limit Text Length With Accumulate Text Option for an explanation and solution.
Brilliant! There's my answer. Thanks so much Tony.
User avatar
Tony Li
Posts: 22149
Joined: Thu Jul 18, 2013 1:27 pm

Re: Best practice for making larger dialogue trees and avoiding looping errors

Post by Tony Li »

Glad to help!
Post Reply