Jump to content

Is too many states with state triggers likely to make dialog malfunction?


Recommended Posts

This is my third topic in the sub-forum in a short space of time, so I will call it quits after this topic. Anyway.

Is there any realistic amount of states and state triggers (or response triggers, if that matters) that is likely to make a dialog malfunction?

I'm asking for two reasons: (a) testing dialog is far more hassle than testing changes to BCS scripts; and (b) I've written a dialog with a lot of top-level states with multiple state triggers.

As a related question (related in the sense that the answers could reduce the number of top-level states I'm using):

Can a dialog state with non-empty state triggers, which can therefore potentially be chosen as the intial state during a conversation, also be accessed mid-conversation via a transition? If this is possible, do the state triggers for that state still need to be met, or is it enough to aim at the state with a transition? Finally, if the answers to the questions in the previous two questions are "yes", is it enough to set the necessary variables for the state in question in the stateActionString during the transition to that state, or do the necessary variables need to be set before the dialog has begun? If anybody would like to answer, but is slightly unclear about the question asked, then I will be happy to provide an example. Otherwise, it just makes the post longer for no reason.

Thanks in advance for any answers.

Link to comment

Well, for what it's worth, I found the answer to my "related question": a dialog state with state triggers can be accessed mid-dialog via a transition, and there is no need to meet the conditions one would have to meet to access that state as the first state in a dialog. Marvellous.

I'll quantify the other part of the question:

I have a dialog with 16 top-level states, which between them have 42 lines-worth of state triggers.

Should I worry that lines may skip, ruining the structure of the conversation, or this not really a concern on the EEs and with more modern hardware?

Link to comment
13 hours ago, The_Baffled_King said:

I have a dialog with 16 top-level states, which between them have 42 lines-worth of state triggers.

This doesn't matter at all, does it?

I've mostly been looking at unmodded BG1 dialogs, most of which are far less complicated than the above.

But then I figured I should check BG2 and BG1 mod-added dialogs for what I expected would be complicated dialog.

149 state triggers in BG1 NPC AJANTJ - including many single triggers with over 10 lines. Puts things in perspective a bit.

Link to comment
28 minutes ago, The_Baffled_King said:

149 state triggers in BG1 NPC AJANTJ - including many single triggers with over 10 lines. Puts things in perspective a bit.

Are you concerned with dialogue states per dlg or with reply options in one state? For the former I don't see a problem (I don't think any dlg hit a wall and some mod NPCs have a lot to say). For the latter - I did recode Ajantis' PID because before hand it was one state and then all reply options with different conditions lead to the dialogue hang for a second or two before it opened - that was the old engine (Tutu), though. Split it up in several dialogue states sorted by conditions still having a lot of triggered reply options made it work fine.

Link to comment
33 minutes ago, jastey said:

Are you concerned with dialogue states per dlg or with reply options in one state?

All of the above! Just a case of wanting to get it right the first time. I feel like it would be hideous to have to rewrite dialogs for Scar or Vai that are linked to progressing the game.

33 minutes ago, jastey said:

For the former I don't see a problem (I don't think any dlg hit a wall and some mod NPCs have a lot to say).

Thanks, that's good to know.

I had thought the problem would be where the game decides between a lot of different choices for the first state to load when dialog begins (top-level states).

33 minutes ago, jastey said:

For the latter - I did recode Ajantis' PID because before hand it was one state and then all reply options with different conditions lead to the dialogue hang for a second or two before it opened - that was the old engine (Tutu), though. Split it up in several dialogue states sorted by conditions still having a lot of triggered reply options made it work fine.

Oh, that's interesting. I just want to check that I understand you right. I think you're saying that:

(1) The number of top-level states is not really a problem.

(2) The problem didn't come from the number of states at all (ie. going from Top-level state > state > state > state > etc down through a large number of states.

(3) The problem came from having a lot of reply options attached to a single state.

(4) The problem in particular came from having a lot of reply options with different response triggers attached to one state.

Is that accurate?

Edited by The_Baffled_King
Link to comment
39 minutes ago, The_Baffled_King said:

(1) The number of top-level states is not really a problem.

At least i didn't run into one so far, and never heard of any. As I said, If you look at some talkative NPC mods I would assume that's more dialogue states (also with triggers) than you'd need for your BG1 - flexible - story mod idea. One thing I don't know is if you'd make the order inside the dlg arbitrary and WEIGHT all dialogue states, whether that would have any influence. What I mean is that most NPC mods just give the dialogue states unique triggers so the engine searches from top to bottom until it finds the true one. Maybe it takes longer if the whole file needs to be checked because there are WEIGHTed states. But then, I guess the engine would have to check the whole dlg always to find WEIGHted states, so it probably looks through the whole file anyway. - I'm not a good source for these kind of questions, though. I'm rather ignorant with regard to which actions get processed first or instantly or whatever, as long as it works in the game.

44 minutes ago, The_Baffled_King said:

(2) The problem didn't come from the number of states at all (ie. going from Top-level state > state > state > state > etc down through a large number of states.

(3) The problem came from having a lot of reply options attached to a single state.

(4) The problem in particular came from having a lot of reply options with different response triggers attached to one state.

Is that accurate?

Exactly. If you have a look at Ajantis' PID in BG1NPC (bg1npc/pid/x#ajpcfl.d) and imagine all those different states combined to (almost) one (I think I separated between flirt and engaged), you get an idea about the scope of what made the classic engine hickup.

Link to comment
10 minutes ago, jastey said:

As I said, If you look at some talkative NPC mods I would assume that's more dialogue states (also with triggers) than you'd need for your BG1 - flexible - story mod idea.

Yeah, that's exactly it. I realised that I was looking at the wrong kind of DLG files.

And yeah, the flexible story doesn't need that kind of dialog. Not close! Most dialog changes are REPLACE_SAY for very minor edits. However, Officer Vai's dialog has grown a fair bit in relative terms - from 9 states (5 top-level), she has now 32 (16 top-level). Scar's dialog will inevitably grow as well.

Some additions are because she can be met at various different stages (3 NumTimesTalkedTo(0) dialogs). Some add a third or fourth reply option, with a corresponding state afterwards, because I detest dialog that offers nothing to someone who is neither a paladin/obseqious suck-up or an aggressive sociopath. Some are because she now offers 3 quests. One is due to adding an option for her to open Wyrm's Crossing. And some add 1-off states with reminders governed by 0/1 local variables.

10 minutes ago, jastey said:

 One thing I don't know is if you'd make the order inside the dlg arbitrary and WEIGHT all dialogue states, whether that would have any influence.

I'm not worrying about declaring weight - I'm just relying using the implicit ordering of the state declarations, plus the state triggers. So in the case of Officer Vai:

State 0: IF: Chapter 7; DukeThanks 0; THEN: Enemy()

It's not likely to come up but, if it does, it should override anything else!

10 minutes ago, jastey said:

Exactly. If you have a look at Ajantis' PID in BG1NPC (bg1npc/pid/x#ajpcfl.d) and imagine all those different states combined to (almost) one (I think I separated between flirt and engaged), you get an idea about the scope of what made the classic engine hickup.

Oh, wow, like LITERALLY just a handful of states! That is reassuring then : )

10 minutes ago, jastey said:

as long as it works in the game.

This is what matters! Thank you again for the help. Onto Scar's dialog now!

Link to comment

Join the conversation

You are posting as a guest. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...