Datalexic

Data × Puzzles & Games

Page 5 of 5

Twine Story Clustering

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.

Introducing TwineGraph

Twine Graph is a Python package and command line tool for parsing passage and link structure from published .html Twine stories and outputting the resulting graphs in visual (.pdf) or structured (.json) formats. The goal of Twine Graph is to allow for research and analysis of story structure in freely-available Twine games.

The initial release is now available through PyPI under the name twine-graph, and the source code is available on GitHub.

Story Visualization

To demo Twine Graph’s capabilities, let’s look at two recent, highly rated Twine stories from the annual Interactive Fiction Competition (IFComp). Cactus Blue Motel (2016) is a game that involves a large amount of movement between the rooms of the titular motel, while Will Not Let Me Go (2017) is a more linear story that moves from scene to scene with only a few clusters of densely interlinked passages.

The twine-graph command line utility takes a published .html Twine file as input and programmatically derives a directed graph structure of passages and links. It outputs a structured .json file and corresponding graph image file, with the nodes laid out according to heuristics encoded in the graphviz library. The automatic layout appears to work well for many Twine stories, creating a top-to-bottom flow with nodes clustered into visually coherent sections.

In Cactus Blue Motel, the start and end sections are apparent, along with an interesting mid-game containing large clusters of highly-connected nodes indicating distinct explorable areas. [Visualization]

In the case of Will Not Let Me Go, the flow of the story is more linear, with only a few occasional clusters of nodes for scenes that focus on interlinked passages and choices. [Visualization]

Corpus of Twine Stories

In order to unveil insights into Twine story structure on a larger scale, I’m working on putting together a corpus of story files in .json and .pdf formats for all of the freely available Twine games that have been submitted to both IFComp and the Spring Thing festival since the inception of Twine games in those competitions, which goes as far back as 2012. I’m excited about the possibilities that this data will open up for the IF community to research and analyze choice-based game structure.

IFComp 2018 Reviews

The 2018 interactive fiction competition has brought together a range of games covering different formats, themes, and play times. After playing about a dozen that intrigued me, focusing primarily on choice-based games, I’ve compiled reviews for my top 5.

*Warning: The below reviews may contain spoilers!

1. Bogeyman

Rating: 9/10

Bogeyman is a deeply disturbing and successful piece that takes a malleable entity from folklore and embodies it in a specific setting, casting the creature as a sadistic paterfamilias who employs psychological and physical abuse to ensure the children he abducts remain “good”.

The design choices for the game are bold and effective, without overshadowing the story. These include a white-on-black palette, text fade-ins, spooky images during chapter breaks, and a haunting, thrumming soundtrack. If they were removed, the story would remain strong on its own, but they provide a great added touch.

The choice-based flow of the game is relatively linear, with short passages that move the reader through the story quickly and smoothly. Every passage adds to the dramatic tension, slowly piling on indignities small and large, flowing through days of quotidian chores and tasks that range from the banal to the grotesque, all in the service of building a complex portrait of life under a tyrant whose moods and reactions are often unpredictable. An undercurrent of tension about what fates await the children, as well as an occasional glimmer of hope for escape, ratchets up from chapter to chapter, ensuring that the reader remains hooked to the very end.

The game is able to deftly tackle a number of themes ranging from abuse to the nature of punishment and whether complicity is ever morally acceptable, all while delivering a gripping story with moments where it’s often as difficult to look as it is to look away.

2. + = x

Rating: 7/10

+ = x is a story about hurtling through the galaxy at some point in our planet’s future, where a sinister sorting device decides the destinies of people unlucky enough to encounter it, assigning them different mathematical symbols that can either add, multiply, or equal, but, in line with the forward motion of the planet, can neither divide nor subtract.

The story’s momentum is carried along by short, yet dense, dark-humored sci-fi passages that call to mind a tradition ranging from Kafka to David Mitchell, wherein characters helplessly navigate a dystopian future full of institutions that are as arbitrary and laughable as they are ominous.

The UI is split into two types of interaction: in some passages a forward button propels the reader further into the story, while in others a drag and drop, slot-based UI simulates the mechanical quality of the sorting device as paper gets fed in and fates get spit out, indelibly, in ink. The UI allows for a modicum of choice, albeit hidden—in many passages, three unnamed bars are available as options to slide into the machine, with no indication of what the outcome will be.

The story is able to leverage its unique take on interactivity to enrich its dystopian satire, allowing the reader to share first hand in the helplessness of its unlucky characters. It succeeds because its interactive elements remain invisible and fluid as they integrate seamlessly with the themes of the underlying piece of short fiction.

3. Ürs

Rating: 7/10

Ürs is a gorgeously illustrated game about a rabbit who lives in a warren that appears idyllic on the surface, but which opens up into a larger extraterrestrial world with signs of an older civilization whose technology may be able to help prevent a looming disaster.

The gameplay of the story is focused on navigating through the world of the rabbits, including the warren, the tunnel system leading to the surface, and finally a set of ancient ruins. The detailed illustrations help visually orient the reader as to the current physical location in the story, and there is an interesting input mechanism at one point in the story that highlights links within a text-based map, allowing easy hops to adjacent rooms within a multi-room building.

While navigating through the space is delightful, the story struggles a bit to keep up. The focus from passage to passage rests strongly on exploration, but progress is ultimately very linear. A compelling narrative could pick up the slack, but the story doesn’t deliver on initial promises of tension, character development, or momentum. There are some welcome opportunities to engage in dialogue with key characters, but these dialogues don’t lead to impactful choices, and much of this dialogue ends up functioning as exposition or instruction for how to complete the main puzzle. And while the world building is generally intriguing, it remains more of a sketch than a realization.

The overarching puzzle in the game is executed very cleanly and beautifully, but is also fairly straightforward. And because of the lack of dramatic tension throughout, the feeling of success at the end is somewhat tempered by the sense that there’s not quite enough meat on this beautifully carved set of bones.

4. They Will Not Return

Rating:  6.5/10

They Will Not Return is a game about a helper robot navigating a future in which disaster has arrived in a previously tranquil setting, with choice-based interaction and some surprising shifts in its narrative flow.

The first half of the story offers a piercing look into how the peace and routine of serving others morphs into a sense of desolation as time passes, entropy sets in, and it becomes increasingly clear that things will never return to how they were before.

The decision to have the reader revisit and explore the same location repeatedly, across a consequential period of of time, creates a beautiful tension in the first half of the story. There’s a sense of discovery, as in a video game like Chrono Trigger, where one can visit the same world in different eras and observe the staggering effects of time. Here, this choice is also a powerful way of exploring themes of human-induced natural disasters and disease, especially through the perspective of a helper robot who isn’t equipped to deal with these eventualities. The use of reduced choice dialogue options when a second robot enters the story is likewise powerful. As a reader, one may want the main character to come to terms with its situation more quickly, but the limited range of options reflect what the robot is capable of feeling and its slowness in adapting to the situation, given its programming.

The second half of the game shifts to a more standard adventure quest that navigates through a few different settings: on the street, in a police station, and finally in a robotics facility. These scenes offer some light puzzles and additional tidbits of information about the fate that befell the world. On balance, though, they’re at odds with and dampen the effect of the first half of the story, due to the sudden shift in tone. The finale offers a set of choices that hint at interesting ideas around self determination and free will, but the different endings are somewhat abrupt and lean toward the formulaic.

The game is thus a beautifully effective story about the passage of time, with interactivity that brings depth to the experience of a house robot in a hypothetical future, but is also ultimately led somewhat astray by an unnecessary coda.

5. smooch.click

Rating: 6/10

A cafe serves a bagel-centric spin on avocado toast, a party has an analog radio playing in background, and a cousin’s loft is decorated with a shiny new vitamix. After this, a moment of hesitation, of anticipation, or of self-doubt. A bit of pretentious banter about jazz from him, a flirty line about ears from her, or a smile from them. And finally, after a moment of consideration, there’s a kiss, clean and smooth, or close-lipped and awkward.

smooch.click is a procedurally generated game in 5 extremely short acts covering various settings, moments, and feelings leading up to a fateful kiss. The progression from one act to the next appears to be fairly random, with each act containing three or so possible links that are drawn from a larger pool and are cycled through in real time. These UI choices support and enhance the themes of anticipation and possibility in the game.

While simple, the game is effective at creating a sense of place, time, and feeling in a very small package, with the short length encouraging replayability. After several playthroughs, additional themes emerge: the commonality of human experience and desire across infinite possible permutations, the serendipity of chance encounters, and the delight in making the most of the cards you happen to be dealt in one potentially special moment.

Newer posts »

© 2026 Datalexic

Theme by Anders NorenUp ↑