This system provides a workflow for creating branching dialogue trees using the vanilla Blueprint editor. Trees are constructed in the Blueprint event graph. DialogueTrees are meant to be instantiated within levels and can be linked to a KCameraDirector so progression through a dialogue and camera view can be synchronized with each dialogue instruction that is processed. There are 3 types of dialogue tree building blocks:
No special name - Supports manual dialogue text, dialogue audio, camera and level sequence activation.
Simple - Supports only manual dialogue text. (Coming later)
Cinematic - Supports level sequence activation and situational manual dialogue text. (Coming later)
The DialogueManagerSubsystem is the main way other game systems receive data from the dialogue system. It has several bindable events that DialogueTrees use to broadcast text: OnDialogueEnter(), OnDialogueExit(), OnDialogueNext(), and OnDialogueChoices(). Input should also be routed through the DialogueManagerSubsystem.
A DialogueTree is a Blueprintable class that provides built-in functions to construct traversable branching dialogue structures. DialogueTrees are built within the Blueprint editor using 5 functions: Root(), Step(), Path(), Branch(), and Subtree(). Each function takes a set of input parameters, the main one being DialogueInstructions. All DialogueTrees can be nested as subtrees within other trees.
DialogueTrees are actors and are meant to be placed into levels for other game systems to reference. Entering dialogue requires passing a DialogueTree to the DialogueManagerSubsystem to become the active tree. All data output from the DialogueTree is meant to be accessed through bindable events on the DialogueManagerSubsystem.
A DialogueStep executes a single DialogueInstruction. To use this class, simply call Step() within a DialogueTree.
A DialoguePath executes any number of DialogueInstructions in sequence. To use this class, simply call Path() within a DialogueTree.
A DialogueBranch executes a single DialogueInstruction and also presents an array of text options. User input is required to progress. To use this class, simply call Branch() within a DialogueTree.
The KCameraDirector is used to coordinate camera changes or level sequence triggering with the dialogue system. Cameras/level sequences are stored in key-value maps and are meant to be placed in a level alongside a DialogueTree. The DialogueTree can then reference the KCameraDirector in the level and trigger camera changes or level sequences using the map keys.
The cameras and level sequences used by the KCameraDirector are placed/authored in the level so they can utilize and reference other actors. It's suggested that everything needed for a dialogue is isolated to its own sublevel that is dynamically loaded when needed.