Since DREAD IT had an engagement curve that would start slow and end intense for every level, we recognized that we needed some long-term goals to motivate players to progress though the game. We implemented this in the form of a narrative, with text dialogue in and between levels to convey it.
The centerpiece of the dialogue system is the typewriter that powers the dialogue box, which prints out the script one character at a time. It also has parameters for typing speed, maximum line length and box height, typing sounds, page duration, and whether the dialogue is skippable by input from the player. Additionally, there are a couple effects applied dynamically, such as slowing down the typing speed while going over punctuation.
Our engine supports monospace sprite sheet font rendering, and I applied my knowledge of graphics and linear algebra to add support for text multi-lining, rotation, and center + left alignment.
In order to bring Dialogue into the gameplay, I created Dialogue Trigger objects, which send dialogue to the typewrite in the HUD when the player collides with them.
They store a script of dialogue that can be written in-editor, as well as some options for how they are handled.
Since we only support monospace fonts through sprite sheet rendering, I would be interested to look into how to implement true-type fonts if I were to do this again.
Another feature I considered was including some markup options for the typewriter, such as italicizing worlds surrounded by asterisks. It would be fun to keep expanding the dialogue system for the narrative and UI designers if I was working on a larger project, as I feel there are lots of creative possibilities.