In Hevn the player has the option to make choices that can affect the outcome of the game. One of these options takes place in the form of dialogue. "Dialogue" in this sense means communicating with other NPCs or "entities" using in-game computer terminals and tablets. This post covers some of the technical design of implementing dialogue into Hevn.
After researching various dialogue tree/graph tools and various other designs, it was determined that creating a new and basic dialogue mechanism would be best. This is mostly to ease integration into other aspects of Hevn such as the upcoming Objectives functionality or the existing Save system.
As with most dialogue trees, Hevn also borrows the concept of using questions and responses, with responses linked to further questions or more dialogue. To help ease the editing and maintenance of dialogue, we're using a plain JSON format. Here's an example of some early test dialogue data:
In the above image we can see several attributes in each dictionary (all of which are mapped to a class):
With the above structure, we're able to map out deep dialogue trees, and some of which can be reused. Also there are a couple pre-defined rules that really help make this structure work, specifically with determining where dialogue starts and ends.
Interfacing with Dialogue
With the data structure for dialogue defined, how does the player actually see this play out in the game? It's simple, in in-game computer terminals and tablets! Every computer terminal in Hevn can be interacted with and has its own set of data, objectives, and dialogue associated with it. Here's an example of a JSON configuration for a particular test computer terminal:
For this post, the only relevant piece of text is at line 14: "description":"DIALOGUE(1002)". This basically informs the in-game computer terminal that a particular dialogue option can be presented here. Here's how this configuration translates into an actual computer terminal screen:
The player essentially uses the [TAB] key to cycle through any of the above options. The [E] key selects the chosen option, which in this case is "Message Received" which happens to trigger a basic test dialogue (same one as displayed earlier in this post). After selecting this option the player is currently presented with the next screen that contains a question and actual response options:
The player has three choices at this point:
After making the selection, the player now has an objective and the NPC has replied back. How this plays out in the overall story might not be known until later. But at this point other messages can be injected into this computer terminal, either from NPCs, in-game systems, or even other "entities". Also there are still several things to work out as well, one of which is time delay - which usually happens with things such as email or texting.
Well, that's it for this week! Thanks so much for reading!
More game design details at IndieDB