#Need help making a dialogue choice system that scales

2 messages · Page 1 of 1 (latest)

nova shard
#

For the past few days I have been trying to create a quest dialogue system that scales and I keep running into hurtles. So far my system works like this:
I have created a custom Resource with the class_name QuestNode. A QuestNode has these parameters

@export var qn_number:int = 0
@export var content_file_name:String = ""
@export var linked_qn_1:QuestNode
@export_multiline var choice_qn_1:String
@export var linked_qn_2:QuestNode
@export_multiline var choice_qn_2:String
@export var linked_qn_3:QuestNode
@export_multiline var choice_qn_3:String
@export var linked_qn_4:QuestNode
@export_multiline var choice_qn_4:String

In gameplay, when the player reaches dialogue that is a QuestNode, the dialogue is loaded from a file path which uses the content_file_name variable. Once that text is finished being displayed to the player, they are given some dialogue choices. That text for that choice is stored in the choice_qn_ variables. Depending on what choice the player chooses, the respective QuestNode specified by the linked_qn_ variable will be loaded up next.

That solution I hacked together is clunky. It requires the developer to memorize the specifics of every dialogue option so that the branching paths make sense. It is also limited to 3 choices without including conditional choices. There has to be a better way to do this.

dire ruin
#

do you always have the same amount of linked_qn and choice_qn?