In Twine-authored interactive fiction, one can find a wide range of structural approaches to storytelling through hyperlinked passages.
As explored in posts by Emily Short on small-scale structures and Twine gardening or by Sam Kabo Ashwell on standard patterns in choice-based games, as well as the work in Porpentine’s Twine Garden blog and the DotGraph project, full or partial story graphs can be useful both as a writing tool for authors, and as a way to reason about patterns of narrative structure in general.
Using twine-graph, a Python package developed to automate the creation of structured representations and visualized graphs for published Twine stories, I ran a meta-analysis of Twine stories based both on structure and on textual content.
I pulled all Twine stories published as part of the IFComp and Spring Thing competitions dating from 2012 onward (159 total stories) from the Interactive Fiction Archive, under the competitions’ terms that make all stories freely available upon entry. These were then processed into a dataset of structured representations and visualized graphs, and finally run through clustering analyses based on both structural and textual features.
Story Clustering with Structural Features
For structure, I used NetworkX to produce a number of features from each story’s graph structure: number of nodes, link degree (mean, median, and max), graph radius, and graph diameter. Given these features, the stories were passed into an algorithm for hierarchical clustering with SciPy to generate a dendrogram showing how stories group together according to similarities in their structure.

Looking at some of the stories clustered together according to structure, some interesting patterns arise. The visual representations of the stories Will Not Let Me Go (2017) [visual] and Who Among Us (2013) [visual], for instance, show clear similarities: both are fairly linear narratives with light branching and occasional denser interactive moments.
Story Clustering with Textual Features
Given that each story’s passage text was available, I also ran a clustering analysis based on textual representation, to get at content and subject matter. This involved using spaCy to preprocess each passage, removing stop words and transforming each story into a word embedding space (using GloVe vectors) to facilitate hierarchical clustering.

The clustering changes substantially when using this semantic space, leading to nice results. For instance, the three stories authored by Porpentine—howling dogs (2012), their angelic understanding (2013), and With Those We Love Alive (2014)—are clustered together, which makes sense given that the author has a uniquely poetic and enigmatic writing style with content matter focused on the surreal and monstrous. Another interesting cluster appears to cover dark fantasy, magic and the macabre, and includes, among other stories, Day of the Djinn (2017), Grimnoir (2018), and Arcane Intern Unpaid (2015).
The full dataset, including graph visuals and structured representations of each story in the corpus, is available on GitHub, for any who are interested in browsing through specific visualizations or running other types of experiments. The analysis notebook used to produce the above plots is also available, and was written using Jupyter.