Coding collections in Unity
In the previous topic, we examined ways to have ink create and plan content for a player. In this section, we move back into Unity. Often, in large projects, story and otherwise, narrative content will be one of several complex interlocking mechanics in a game. In these cases, procedural storytelling will be one of multiple systems, and Unity, as the game engine driving the project, will be programmed to use one story over another as part of more complex operations and planning. In these cases, the narrative content is stored in what C# names collections. These can be something as simple as an array or a much more complex data structure capable of sorting its internal elements based on patterns or the values of their internal elements.
In the first section, Using multiple stories, we will look at an example of moving the procedural storytelling aspect of a project from ink into Unity. Instead of working with shuffles in ink, we will use randomness in...