Descant logo

Descant

Enhanced Unity Dialogue System

by Owen Hellum

Please view the README for information regarding installation and usage!

Unity Asset Store

GitHub

Descant is a Unity dialogue system plugin. The Unity Asset Store is chock full of many such types of plugins, ranging from feature-rich, to ultra-minimalist, to downright bad. Descant aims to hit the sweet spot between quality UI, powerful features, and easy-to-lean functionality, while also addressing many of the game-specific consequences of the standard dialogue manager setup. Besides acting as a standard tool for creating, saving, and actualizing non-linear game dialogue, it also pushes the envelope by adding optional dialogue-enhancing node components that introduce features to break away from the overused and underwhelming trends seen in many interactive fiction games. These enhancements act similar to Unity's standard GameObject Component system, and can be applied at-will to nodes. This modular approach is so-far not explored in the world of Unity dialogue systems. The project will be free (and collaborative open-source) forever. Feel free to send me a message or submit a pull request if you want to make any changes.

Component documentation

A number of Descant Components come bundled with the system by default. They cover a wide range of applications, and can be edited at-will. Please see the next section, Component creation, for a guide on how to write your own Components in C#.

Component creation

  1. Create a new C# class in Descant/Components/Custom.
  2. Make sure that the Component is in the Descant.Components namespace.
  3. Make sure that the Component inherits from the DescantComponent abstract class.
  4. Add a [Serializable] attribute to the Component.
  5. Add a [MaxQuantity(...)] attribute to the Component (replace the '...' with the maximum number of Components of this type that can be added to a single node) ('...' can be float.PositiveInfinity).
  6. Add a [NodeType(...)] attribute to the Component (replace the '...' with the DescantNodeType indicating which types of nodes it can be added to).
  7. Add any number of public variables/properties to the Component (these properties will show up in the Descant Graph Editor when you add the Component to a node) (you may also create private/protected properties, but they won't appear in the editor). Properties may only be of type string, float, int, bool, Vector2, Vector3, Color, UnityEngine.Object (including but not limited to DescantActor), or Enum.
  8. For each public variable, add either an [Inline] attribute (indicating that it will be visually nestled beside the Component name in the editor) or a [ParameterGroup(...)] attribute (indicating that it will be visually arranged in a new group beneath the Component name in the editor) (replace the '...' with the string name of the group to order it into).
  9. Optional: By default, all Component fields filter any out most special characters on input. You can override this by giving any public variable a [NoFiltering] attribute, disabling filtering for that variable's corresponding field in the Descant Graph Editor. This is useful for long-form fields that may have sentence grammar and punctuation.
  10. If this Component performs some action when it is reached during dialogue, give it the following method: public override DescantNodeInvokeResult Invoke(DescantNodeInvokeResult result). The DescantNodeInvokeResult object being passed contains all the choice/response text for the current node, the current actors, and info regarding the actor portraits) (see the DescantNodeInvokeResult class for more info). The Invoke method must return a DescantNodeInvokeResult object (almost always just result itself, with its properties modified).
  11. Optional: Many default Descant Components only do their effect if some comparison is made. Should your Component also wish to do so, the CompareVariable method in DescantComponentUtilities may be of use.
  12. Optional: If you need the Component to do something continuously while it is active during dialogue, give it one of the following methods: public override bool FixedUpdate() or public override bool Update(). They function in exactly the same manner as the classic MonoBehaviour methods of the same names, save for the fact that if they ever return false, the dialogue ends immediately (should the Component want to end the dialogue for some reason).
  13. That's it! Your new Component will now show up as an option to add to a node in the Descant Graph Editor.