RPG Dialog is a dialog system written for Unity 3D v5.x and patterned off of what I could remember from working on the KOTOR dialog system. The initial version was written for the CMPT-330 Game Design class where we designed and implemented the Starhaven game. The original version that was done for the class project relied on
a web based editor for editing dialog. This allowed a collaboration between team members to write the dialog. The version released on the unity store has the ability to have a web editor built for it, but features a built in dialog editor within the Unity IDE.
A dialog is implemented as sparse matrix of dialog nodes with backward linking within a sqlIte3 database. Dialog nodes alternate between NPC lines and PC responses. A given node is only displayed when the check script fragment returns true. When a PC response is selected then a script fragment is executed to handle the game interaction.
Each node links to a set of text lines identified by language. For each language the text, and audio files are referenced. With the text a macro substitution system allows for macros to break the text into multiple pages of display, and to replace names with dynamic text. For example a macro can replace itself with the players name. A nother example of a common macro provided as a demo is to trigger an emotive animation on the player at a specific time during the play back. This allows for NPC pawns to play animations reflecting the mood of the dialog line.
RPG Dialog is implemented on a Model-View-Controller model. The database operates as the model with a controller layer mediating the interaction between the model and the view. The view is implemented using Unity's UI system, allowing a licenser to replace the UI with one that matches there game play. The Ui can be customized for coloration of nodes, number of responses to diplay at one time, and controls used for selecting a response.
Utility classes are provided to allow for the suspension of movement controls, and playback of animation within a dialog.
Depending on demand and viability of this Unity package future work includes.