Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork28
Open-source node-based tool for developing branching conversation trees
License
TeodorVecerdi/DialogueGraph
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
Dialogue Graph is an open-source editor tool for theUnity game engine used to create branching conversation trees in an easy and straightforward way by connecting nodes, and setting up conditions and triggers for the different conversation branches. An obvious use case for this tool is to create conversations with NPCs, although the versatility of this tool allows for any kind of project that requires branching behaviour based on checks and triggers.
Dialogue Graph is compatible with the following Unity versions:
- 2020.3 LTS
- 2021.2
Other versions of Unity may work as well, but are not tested.
Requires OpenUPM-CLI
Run the following on the command line in your unity project's folder:
openupm add com.github.teodorvecerdi.dialoguegraph
To install Dialogue Graph in your project use the Unity Package Manager.
To open the Unity Package Manager, inside unity, go toWindow > Package Manager
and to install Dialogue Graph click the+
icon in the upper left corner of the window, then click onAdd package from git URL...
and paste inhttps://github.com/TeodorVecerdi/DialogueGraph.git
To start using Dialogue Graph, create a Dialogue Graph in your assets folder by going toAssets > Create > Dialogue Graph > Empty Dialogue Graph
.
Dialogue Graph currently contains four different types of nodes:NPC,Self,Property, andBoolean.
TODO
The NPC and Self nodes represent the dialogue lines said by either an NPC or the player. After creating one of these two nodes you can add dialogue lines by clicking theCreate Dialogue Line
button on each respective node.
Each dialogue line entry comes with additional ports.Branch andTrigger ports are available to both node types and theCheck port is available only to NPC nodes.
TheBranch port connects to the next node in the conversation tree. This connection is used by the runtime engine to progress the conversation once an option (dialogue line) was chosen. Unless you want the conversation to end with that line you should connect the Branch port to another node.
TheTrigger port connects to one or more Trigger property nodes and is optional (more on that in theProperty Nodes section).
TheCheck port connects to one or more Check property or Boolean nodes and is optional (more on that in theProperty Nodes section).
NPC nodes also contain anActor port to which you should connect your Actor Property node (more on that in theProperty Nodes section). Actor property nodes not only let you differentiate between which character performs the dialogue lines but also allows you to attach any custom data to the actor through scriptable objects.
TODO
DialogueGraph contains several nodes that can be used to combine multipleCheck nodes into one:
- NOT Node: Negates the result of theCheck port.
- AND Node: Returns true if bothCheck ports are true.
- OR Node: Returns true if eitherCheck port is true.
- XOR Node: Returns true if exactly oneCheck port is true.
- NAND Node: Returns true if bothCheck ports are false.
- NOR Node: Returns true if eitherCheck port is false.
- XNOR Node: Returns true if exactly oneCheck port is false.
You can combine multiple boolean nodes together to create more complex conditions.
If a boolean node has a missing connection, then that connection is assumed to be false.
The following images use the Sample Project included with the package. You can install the Sample Project by going to the package manager, selecting Dialogue Graph, and clicking theImport
button under Samples.
Nodes:
Properties: (you can open the properties window by clicking the "Blackboard" button in the toolbar at the top of the Dialogue Graph window)
Note: The following images use the Sample Project included with the package. You can install the Sample Project by going to the package manager, selecting Dialogue Graph, and clicking theImport
button under Samples.
Attaching functions to properties is almost identical to the way you would do it with the Unity UI system (Buttons, TextFields, etc). Attach a script to the object field and then choose the method you want to use.
Check the included samples for the API usage.
If you would like to contribute to this project feel free to submit apull request, and take a look at theContributing document provided to get a better insight into whatcontributing means, and theCode of Conduct.
We useSemVer for versioning. For the versions available check thetags on this repository.
This project is licensed under the MIT License. SeeLICENSE for more details.
About
Open-source node-based tool for developing branching conversation trees
Topics
Resources
License
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Sponsor this project
Uh oh!
There was an error while loading.Please reload this page.
Packages0
Contributors4
Uh oh!
There was an error while loading.Please reload this page.