Is it possible to create a branching Dialogue System?

Is it possible to create a branching Dialogue System using Blueprints? This is the main feature of a game (adventure game) and was just wondering if it was possible. We are still very new blueprints and the whole Unreal Engine itself (coming from Unity). Any help or any advice on where to start would be great. :slight_smile:

yes, it is possible with just blueprints. menu systems don’t require tons of math or physics every frame, so blueprint can easily handle that kind of logic.

you can use canvas functions to render images and text to the screen, use custom events to have the blueprints communicate with each other, and use a database of quest flags to handle the games state/save file. each menu has a menuAddress and a list of menuOptions, and each menuOption can have a display name, a list of questFlags it will set when the option is clicked, and a MenuAddress that it links to, kinda like an HTML hyperlink. using onclick events or key press events you can have a function that uses the address data of the menuOption you clicked on to change the CurrentMenuAddress, which you can use to decide which menu should be displayed. the QuestFlags are part of the players save data, and can be used in branch nodes to adjust the logic flow of your games events.

for example, the first time you talk to a bar tender, they welcome you to the bar, then it flips a QuestFlag called “bBeenToBar” which is checked with a branch node in the bartenders blueprint every time you talk to the bartender, so the next time you talk to him, he no longer gives you the introduction and skips right to the “name your poison, stranger” menu. later in the game you could save his daughter or something and it would trip another QuestFlag that tells the bartender to give you a different menu where he calls you friend and offers a discount on drinks.

this can easily become a very complicated system that is integrated tightly into your quest and inventory systems, and if you design it well, it could reuse alot of the same code. quests, mcguffins, weapons, and achievements, are all just types of inventories, so you could make a generic inventory code that they all use to add/remove/use/equip/view menu items.

this is a system that would be useful for alot of games, so once you get started on it, sharing your progress with the community will probably give you alot of feedback for making the system better.

if you want to see the logic behind a dialogue system from a shipped game, check out the Skyrim Creation Kit Wiki:

http://www.creationkit.com/Category:Dialogue

http://www.creationkit.com/Bethesda_Tutorial_Dialogue

these links don’t explain any code or fine details of their systems, but just looking at the interfaces for their design tools should give you all the information you need to build similar dialogue/quest systems.

This is a great comment - could you go into the database part of it a bit? I wasn’t aware we could use databases in blueprints?

by database i meant a subclass of saveGame.

first i created a subclass blueprint of “saveGame” that i called “Omni_SaveGame” and added a few variables to it. this is where you would add questflag booleans, player stats, inventory items, etc…

then i made a variable in my player controller of type “omni_saveGame” called “Omni_SaveData”. this object keeps all of the important variables during gameplay. so loading a game is just copying a file from disk to set this object, and saving is setting the file on disk from this object.

to load a game, i use a “load game from slot” node, then cast it to my custom saveGame type, then use that to set “OmniSaveData” (the member variable in my player controller that holds the data i use during the game)

this all sounds confusing, but the image should explain it better.

I took the approach of using UMG, Blueprints, and Data tables for my system.
The basics are simple enough to implement using these systems, though there are some limitations if you don’t dive into C++ in (at least 4.7), for example: changing the font at runtime.

Edit: Shoot me a message if need more specific help with this (if you go this route)

(I’ve recently submitted my system to the marketplace - shameless plug: Blueprint Dialogue System - Marketplace - Unreal Engine Forums)