Clustering

Complex branching dialogue in roleplaying games often contain groupings of character dialogue that only differ slightly in wording. These slight variations are written to account for the player’s actions in the game world. Take for example this sample dialogue from a conversation in Disco Elysium: The Final Cut.

1dialogueOptions = {}
2...
3if Variable["seafort.deserter_i_am_also_communist"] then
4  table.insert(dialogueOptions, "You can tell a comrade. It won’t be *that* usable.")
5elseif Variable["seafort.deserter_sugg_you_are_buddies"] then
6  table.insert(dialogueOptions, "You can tell me, here. It won't be *that* usable.")
7end
8...
9return dialogueOptions

In this example, whether the player frequently identifies as a communist determines whether or not they refer to themselves as a comrade.