To increase participant engagement while participating in ExNovo UI research experiments, I created a system to house a lighthearted, spacefaring story. Written as a standalone module, the narrative system allows for on the fly audio and art control, player input, and between session saves.
* The narrative gameplay system is complete, but as it was written for the ongoing ExNovo project, incremental updates and tweaks may occur.
As the Cognitive Science Lab moved to the second round of testing the ExNovo interface, we saw the need for a longer testing session. In order to keep players actively engaged, we opted to provide context for their actions by framing it around a fun story about invading aliens, friendly robots, and becoming the very best (like no one ever was). To accomplish this, we needed a framework that could house our story and that would be robust to any future directions we took the project, or new ones the lab came up with.
The framework allows for three independent layers to create the backing environment. A background layer provides the base, foreground mainly for transitions, and midground layer for effects. Each layer is independent of the others and can use any visual asset such as photos, animated gifs, and videos.
Backgrounds do us very little good without characters to live in them. A theoretically unlimited number of actors can be spawned into the scene. Each character inherits from a master character class (in Character.cs) with the unique attributes being housed in its prefab. Characters can talk via the dialogue system, move and animate on screen, and house relevant story elements within their instantiation. Any Unity model can be slotted in, though the current state is set up for sprite-based characters.
As unique a challenge as a dialogue free story may be, the time for that is in a different project. Character dialogue and actions are read off text files with custom markup embedded in them. Dialogue is rendered with TextMesh Pro meaning the system has access to crisp vector fonts and effects (colour, bolding, differing fonts, etc.), as well as inline sprite rendering.
Text can be displayed on a per character basis, all at once, or anywhere in between. The dialogue scripts also hold the story choice options, and have the ability to call functions in the narrative engine, load scenes, effect components outside the framework and more.
A brief overview of the key scripts
The core scripts of the narrative engine can be found on my personal github. Check it out here. Please note that this is only a copy of the main project on a private development repo and as such does not house any art, story, or gameplay assets, and may not reflect the current project.