articy instructions not converted into groups?

Announcements, support questions, and discussion for the Dialogue System.
User avatar
Tony Li
Posts: 21032
Joined: Thu Jul 18, 2013 1:27 pm

Re: articy instructions not converted into groups?

Post by Tony Li »

This patch adds an "Instructions As" dropdown that you can change from Regular Entry to Group Entry. Note that if you have Instruction nodes that link directly to input pins that check values changed by the Instruction node, you'll need to keep this dropdown set to Regular Entry. By default, conversations will assign the conversant (the second actor entity assigned to the Dialogue) to Instruction nodes and the intermediate nodes between Instructions and input pins, which should prevent the issue you described above. If the conversation's conversant isn't an NPC, it will try to set them to a non-player actor, first checking the conversation's actor, then going through the whole actor list.

DS_ArticyPatch_2024-06-03.unitypackage
_marc
Posts: 69
Joined: Mon Nov 05, 2018 5:44 am

Re: articy instructions not converted into groups?

Post by _marc »

Thank you for the quick fix, there is no more warning message!
Unfortunately I'm experiencing some strange behaviours :( Maybe I'm doing something wrong. My game is mainly based on randomness and replayability, that's why at certain moments I have to run conversations to handle huge pieces of logic. Here is an exemple of the kind of thing I have in articy :
articy_large_01.jpg
articy_large_01.jpg (317.95 KiB) Viewed 160 times
For now, the instructions are imported with the regular option (non-groups).
The important part is after the condition node, when it evaluates to true.
articy_zoom_01.jpg
articy_zoom_01.jpg (141.63 KiB) Viewed 160 times
-> An instruction node generates a random int (with a lua function registered in c#) from 0 to 7 included.
-> We check the result in the 3 next nodes (0, 1 or 2). If the number is not 0, 1 or 2, a lower priority link goes back to the function call to get a new random int, until we get 0, 1 or 2.
-> Finally, a jump node goes back to the entry of the conversation.

When I run the conversation, it seems that only the first node condition is checked (quite often it's false, and the dialogue stops here).
I can see it in the dialogue system debug messages, just after the links to delay evaluation nodes 223, 226 and 228 are added:
debug_01.jpg
debug_01.jpg (216.69 KiB) Viewed 160 times
Here is the problematic area in the database:
database_01.jpg
database_01.jpg (81.08 KiB) Viewed 160 times
I hope it's just me doing a stupid error about logic, really :| Am I missing something?
User avatar
Tony Li
Posts: 21032
Joined: Thu Jul 18, 2013 1:27 pm

Re: articy instructions not converted into groups?

Post by Tony Li »

Hi,

This is a case where articy and the Dialogue System diverge. What's happening is that the first <Delay Evaluation> node is being selected, and so it's following down that path. I'll provide an update today that uses a single <Delay Evaluation>, which will address the issue:

singleDelayEvaluation.png
singleDelayEvaluation.png (235.01 KiB) Viewed 157 times

In a pinch, you can use a Hub node until then:

hub.png
hub.png (311.85 KiB) Viewed 157 times

I'm also looking into providing a checkbox to disable the extra level look-ahead on Conditions. The catch is that it won't work with some continue button modes that need to know what's ahead two levels. But if that's not an issue, then it makes for a clean solution since evaluation will happen exactly like it's written in articy.
_marc
Posts: 69
Joined: Mon Nov 05, 2018 5:44 am

Re: articy instructions not converted into groups?

Post by _marc »

Tony Li wrote: Tue Jun 04, 2024 7:37 am I'm also looking into providing a checkbox to disable the extra level look-ahead on Conditions.
That would be great! I don't think I have something using the continue sequence, but even if it means rewriting some parts of my dialogues logic, I'm ready for it! I mean, the priority is to have this "clean" solution, as you say.
User avatar
Tony Li
Posts: 21032
Joined: Thu Jul 18, 2013 1:27 pm

Re: articy instructions not converted into groups?

Post by Tony Li »

Hi,

I was waiting to roll out this feature in 2.2.47, but it's all tested and it makes articy imports simpler:

DS_ArticyPatch_2024-06-04.unitypackage

Steps:

1. Inspect your Dialogue Manager GameObject/prefab, and tick Other Settings > Reevaluate Links After Subtitle. This may already be ticked when you import the package.

2. In the Articy Import window, make sure the Reevaluate Links checkbox is ticked.

This removes the necessity for intermediate <Delay Evaluation> nodes. However, with the Dialogue Manager's Reevaluate Links After Subtitle checkbox ticked, nodes will evaluate their links twice: once before showing the node as a subtitle, then a second time after showing the subtitle. It needs to do this in case a node's Sequence or OnExecute() event, or a OnConversationLine method, changes the values that the input pins' Conditions check. If you know that nodes won't have any Sequences or OnConversationLine methods that will change Conditions values, you can untick the Dialogue Manager's Reevaluate Links After Subtitle checkbox to avoid having to do that second evaluation. Instruction nodes and output pins put their code in dialogue entry Script fields, which run before the first evaluation, so it's okay to have those and still untick the checkbox.

If you don't want to tick Reevaluate Links After Subtitle for some reason, the articy importer will now properly use a single <Delay Evaluation> node that links to all input pins rather than separate <Delay Evaluation> nodes for each input pin.
_marc
Posts: 69
Joined: Mon Nov 05, 2018 5:44 am

Re: articy instructions not converted into groups?

Post by _marc »

Thank you! I've tested the patch with this configuration:
- all links reevaluation options checked
- instructions conversion in regular mode (with the "group" mode, my conversation creates a stack overflow, but we'll discuss that point later...)

It seems that the problem has moved on. Here is my full setup.
After loading each level, a conversation "LoadLevel" is started. It starts with an empty dialogue fragment node to be sure that Dialogue system messages (OnConversationEnd, especially) are fired, even if no valid condition is met.
Then, I have flow fragments for each level with a simple level check in the input pin.
LoadLevel_01.jpg
LoadLevel_01.jpg (223.09 KiB) Viewed 131 times
In the flow fragment...
Checkpoint0_Neverlogged.jpg
Checkpoint0_Neverlogged.jpg (73.54 KiB) Viewed 131 times
This is the part just before what I've already posted yesterday. It's a good case study. Nothing complicated here. Just after the SimStatus check, an instruction node is supposed to log a message to the Unity console. But it's never logged!
Looking at the debug messages:
- SimStatus check is evaluated to true
- SimStatus is set to WasDisplayed
- problem starts here: I guess that the instruction node (added by the ArticyConverter) plays its sequence Continue()
Checkpoint0_Neverlogged_databaes_01.jpg
Checkpoint0_Neverlogged_databaes_01.jpg (143.65 KiB) Viewed 131 times
- then, the empty dialogue text of the entry point of my LoadLevel conversation (on the first image of this post) is spoken
- then, the level is checked again...
- the SimStatus is also checked again, but this time it's evaluated to false.
Problem: the instruction to debug the line and the rest of the conversation after that was never played.
Checkpoint0_Neverlogged_Debug.jpg
Checkpoint0_Neverlogged_Debug.jpg (298.11 KiB) Viewed 131 times
You said in the previous post that conditions of links will be evaluated twice, maybe is it what's happening here? But in this case, instructions in output pins should not be executed in the first pass, right? I'm talking about the Simstatus of the group node...

It's not the first time I have this problem. In fact, this was the original reason for me to ask you about why instruction nodes are not converted ito groups, at the beginning at this thread :?
User avatar
Tony Li
Posts: 21032
Joined: Thu Jul 18, 2013 1:27 pm

Re: articy instructions not converted into groups?

Post by Tony Li »

Hi,

Have you set the articy importer window's Instructions As dropdown to Group Entry?

I'll think about a way to account for SimStatus separately. It may be that Reevaluate Links just won't be practical with SimStatus -- in which case the other fix in the importer should do the trick. It adds that intermediate <Delay Evaluation> nodes to be shared by all links from the instruction to the various input pins. However, please use this version:

DS_ArticyPatch_2024-06-05.unitypackage

It renames the articy importer's "Reevaluate Links" checkbox to "Delay Evaluation" to make its purpose clearer. (It adds "Delay Evaluation" nodes.) Given how you're using SimStatus, it may not be necessary to tick Delay Evaluation. Instead, you may just be able to set "Instructions As" to Group Entry. Also, you may need to UNtick the Dialogue Manager's Other Settings > Reevaluate Links After Subtitle checkbox since this would cause it to re-check SimStatus after the parent node changes SimStatus.
_marc
Posts: 69
Joined: Mon Nov 05, 2018 5:44 am

Re: articy instructions not converted into groups?

Post by _marc »

Tony Li wrote: Wed Jun 05, 2024 8:17 am Have you set the articy importer window's Instructions As dropdown to Group Entry?
I tried and got a nice stack overflow, that's why I sticked to the regular mode. I guess that it's because of the jump, at the end of the conversation. It goes back just before the sim status check, which is probably never set to "WasDisplayed" by the instruction, so it makes a loop...

I'm going to try with today's patch, with different converter settings, and I get back to you!
_marc
Posts: 69
Joined: Mon Nov 05, 2018 5:44 am

Re: articy instructions not converted into groups?

Post by _marc »

So, here are my results with the 2024/06/05 patch:

Instructions as regular nodes, Reevaluate links to true, Delay evaluation to true
Same result as before (the Debug log line method is never called).

Instructions as regular nodes, Reevaluate links to true, Delay evaluation to false
Same result as before (the Debug log line method is never called).

Instructions as regular nodes, Reevaluate links to false, Delay evaluation to false
Same result as before (the Debug log line method is never called).

Instructions as groups, Reevaluate links to false, Delay evaluation to false
Good, the DebugLogLine method is called just after the simstatus check! But then I have the stack overflow exception. It's happening here (same pic as yesterday):
articy_zoom_01.jpg
articy_zoom_01.jpg (141.63 KiB) Viewed 111 times
StackOverflow_Debug.png
StackOverflow_Debug.png (80.7 KiB) Viewed 111 times
In this example the random int is 1. So the next nodes following the "Checkpoint B" node are evaluated: we jump to the start of the flow fragment, we block on the simstatus check (this is what is expected). But...then it starts to evaluates the other nodes "Checkpoint A" & "Checkpoint C" :shock: Their conditions are not met (the random int is still 1), so we pick another random number, and here we go again...
User avatar
Tony Li
Posts: 21032
Joined: Thu Jul 18, 2013 1:27 pm

Re: articy instructions not converted into groups?

Post by Tony Li »

Hi,

Please try this:
  • Import: DS_ArticyPatch_2024-06-05-A.unitypackage
  • On the Dialogue Manager GameObject/prefab, tick Other Settings > Stop Evaluation At First Valid and UNtick Reevaluate Links After Subtitle
  • In the articy importer window, UNtick Delay Evaluation
I tested this articy dialogue:

articyRepro.png
articyRepro.png (99.05 KiB) Viewed 99 times

which imported as this:

articyReproImported.png
articyReproImported.png (67.92 KiB) Viewed 99 times

Prior to the patch and settings above, it would generate the same stack overflow since it would evaluate all links, including the "...try again!" link. Now it stops at the first node if its Conditions are true. Otherwise it stops at the second node if its Conditions are true. Failing both of those, it goes to "...try again!" and tries again.
Post Reply