Want your story to drive your game rather than vice-versa? Inkle and Failbetter discuss the storytelling potential of the open source Ink

“Writing in games is often very bad, very clunky and clumsy. And that’s not the fault of the writers. That’s the fault of the tools,” says Jon Ingold, co-founder of indie studio Inkle. And so the studio, step-by-step, came up with a better way of writing stories for games: Ink.

“One of the things I was really keen on was finding a way to write that was fluent, because almost all interactive text writing tools are very far removed from being fluent.” He then explains: “So you set something up, you make a little box, you drag it in, you give it a title, you wire some connections together, you type in a variable condition, then finally you get to write something,” he sounds exasperated just explaining it.

“There’s just an enormous amount of resistance to writing anything. The only way to get any good at writing is to write a lot, and to throw a lot away. And in general, tools for writing are so busy, obsessing over the structure of the writing, for the computer’s benefit, that the human never gets to really think about it.”

So Ink is an attempt to put the human back on top.

“The one thing that I feel passionate about is the core of all of the design for Ink is the idea that it should be a tool for humans to write things for other humans, and the computer should get out of the way and stay out of the way as much as possible.”

And that’s increasingly been the case. The open source tool is now well known and widely used by writers and narrative designers across the industry.

So with Ink hitting its 1.0 release – just as Failbetter Games’ Ink-powered title, Mask of the Rose, is successfully kickstarted – we thought it a good time to take stock of its success and to consider how that outlook could be applied to other areas.

Jon Ingold, Inkle
Jon Ingold, Inkle

CONDITIONAL TENSE

The tool started out simply as a markup language, that was then read by what Ingold describes as a “terrible script in a programming language I didn’t really understand.” Although that was still sufficient to get the studio through the Sorcery series (based on the Fighting Fantasy books of the same name) and its multiple award-winning 80 Days.

Those both take inspiration from the ‘choose your own adventure’ format. But even in its early form, Ink allowed Inkle to do far more than could ever have been achieved using pen-and-paper.

“I wanted it to be incredibly fast to define a choice. And to branch back in, I didn’t want to have to think about that. I wanted it to remember everything that you’d ever seen, by default, so it remembered every single choice in every single paragraph you’d been to.

That then allowed the writer to easily add conditional markup, to let previous choices affect the story and future options. “You didn’t have to define variables to track things, because if you do it means that when you want to track something, you can’t really be bothered because you’ve got to set this thing up. Well, let’s turn that the other way around.”

So instead of having to track choices, Ink simply tracks every choice by default and let’s the writer pivot based on those choices effortlessly. The onus is then on the system, not the writer. “Computers are coping fine, it’s the humans who are struggling,“ notes Ingold.

Emily Short Failbetter
Emily Short, Failbetter Games

INK SPILL

After Sorcery and 80 Days, that initial markup and script had to evolve, at the urging of co-founder Joe Humphrey. “He was saying, ‘look, this is our livelihood, it’s the core pipeline and it’s built on this terrible piece of code’.” And so Ink as it largely is today was born.

Ink today is a middleware markup language, a narrative engine with Unity integration. It has its own editor, Inky, which you can get started with in seconds. And then there’s spin offs such as Inklewriter, an even more accessible interactive storytelling tool, which is popular in education.

LIke any good tool, Ink can be useful at several levels, Ingold tells us: ”You can just use Inky as a scratch pad for knocking out a conversation quickly to see what it’s like or how it feels. And I’m sure a lot of people would use that, because it’s the easiest way to do it. But that doesn’t necessarily mean you go all the way to actually implementing your game in Ink.

So how many games are made using Ink at some level?

“The short answer is we really don’t know, people who ship games with it tend to tell us and there’s been a few, maybe seven or eight in the last year, reasonably high profile titles. But I’m pretty sure that everyone within the narrative design community is aware of it. And a lot of them have tried it.”

“I know Sea of Thieves used Inky to draft up a lot of their narrative stuff. I think they ultimately either built their own runtime or kind of hacked the two together or something. But it was definitely part of the pipeline at one point. I know that at Valve they use Inky or some people at Valve use Inky for drafting, but they don’t like to talk about it, because they’re Valve.”

People who do like to talk about it include Haven, NeoCab and Over the Alps. And a current example is Failbetter’s latest project, as it’s creative director, Emily Short, tells us:

“Mask of the Rose is Failbetter’s first project using Ink, though several of us at the studio have used it before in other contexts. Ink felt like an ideal fit for Mask of the Rose. Mask is a romantic visual novel with a mystery at the centre of its plot. There’s lots of lore and evidence to discover, and many possible relationship states between the player and other characters,” perfect fodder then for Ink’s capabilities.

“Our previous games in the Fallen London universe all use StoryNexus to manage their content. For Mask, though, we knew StoryNexus had the wrong granularity. It’s a system that’s designed for showing paragraphs of text at a time, which makes it great for showing what happens when your ship docks at port in Sunless Sea, but not so great for delivering one nuanced dialogue line at a time.

“Instead, we knew we needed an engine that could handle a significant amount of branching conversation, that could easily substitute variable text, and that would automatically track state like “has the player ever asked this question before? Have they been to this story node before?” Ink does all of that, and with less friction many of the other systems in this space.

Mask of the Rose
Failbetter’s Mask of the Rose is the studio’s first Ink-powered title

“Mask also has more of a system underlying its dialogue than some visual novels. The player character’s personal background, choice of outfits, and other choices change their dialogue options and also how other characters will respond to them. So we needed to build a dialogue system that would handle that complexity without a massive stack of if-statements.

“Ink offers enough coding affordances that we could build that behaviour within our scripts, rather than needing to call out to external code to determine whether a social move has just succeeded or failed.”

That built in logic, is something that Ingold knew he wanted to include from the start.

“I knew I wanted to have the ability to do full logic. Again, a lot of writing tools have a kind of block-based system for doing logic. So you know, here’s an option and you drag on a variable, and that’s a conditional that has to meet this variable, and you drag and drop it. That’s kind of the standard sort of interface.

“But that means you can only do logic up to a certain complexity. I have a maths degree, I’m gonna get annoyed by this at some point,” So Ink is designed to handle all the logic you can throw at it. “This, or this, plus this, or that, then call out a function, which does some things with some numbers and returns that – like full actual programming.”

Although it’s still designed to be words first: “The programming sits within the text, not the text sitting within the programming. So if you write in JavaScript or something, every time you do text, you have to put it in quote marks and put a semicolon on the end to tell the computer ‘this is text’, don’t worry about it. So again, it’s turning that model upside down, human first and computer second.”

MORE FLOW, LESS FLOW CHART

Ink does away with the flowchart model for creating branching narratives. In part because it’s inefficient to write into, but also because a flowchart simply can’t cope with the complex narratives that humans are capable of creating, such as the conversation system in Inkle’s own Heaven’s Vault.

“A flowchart says this blob exists within a structure, where this comes before and this comes after,” says Ingold. “In Heaven’s Vault, when [main characters] Six and Aliya walk around, there’s a bucket of about 3,000 to 4,000 things they can say.”

“And Ink just runs through all of them and says, ‘give me all the conversations that would make sense at this moment’. And then it says, ‘which one is the most relevant to what you were talking about last’, and it puts that in front of the player. And that’s all it does, there is no structure, no flowchart.

The conversations end up like a deck of cards, but all indexed for different possible uses. “What’s great about it, is that once you throw the flowchart away, if I want to add 20 more lines of dialogue, I just write them and stick them in the deck. And it doesn’t matter how many other cards there are, my deck of cards can be this big, or it can be that big. And it makes no difference. Because I don’t have to fit into a superstructure, which I don’t care about anyway.”

Heaven’s Vault by Inkle

Such structures are too often foisted about writers, which is understandable in an industry where the story all too often is a secondary consideration to the gameplay. We suggest that the flow charts harness the writing and make it clear to producers that everything is present and correct.

“That’s absolutely true and in my AAA days,” recalls Ingold, who spent three years at SCEE Cambridge. “I’ve definitely done that for producers – produce flowcharts, to show to someone who just wanted to be reassured. They don’t really read it.

“One of the things about founding Inkle is that it liberated us to not have to satisfy anyone apart from yourself. I don’t have to prove it to an investor, I don’t have to prove anything we make to a producer, as long as I know that it works, then it works. It’s an order of magnitude change in terms of what your ambition can be.

And that kind of faith is required when you really push things with Ink’s conditional storytelling. “These things shouldn’t work, because no one human has a picture of how the internals of the story work, because you actually don’t need to.”

INK-TEGRATION

OK, so most people aren’t going to go that far, but still integrating Ink into your workflow might be just the thing you’re next narrative-driven title needs. So how does that work in practice. Let’s go back to Failbetter’s Short for that:

“Ink became part of the Mask of the Rose project very early in development, and was our go-to option when we started prototyping. We’re using it alongside Naninovel, which manages backgrounds and character art – so, for instance, when a new scene begins, we might have an Ink function generate some Naninovel markup to specify which characters should come on-screen, with what emotions.

“When drafting new content, we start with some outlining and spreadsheet work – determining what the major beats of the story are, where they’re taking place, which characters are involved, and what assets are needed. But as soon as we’re at the point to write actual dialogue that the player might encounter, we draft that directly in Ink.

“The Inky tool lets us verify the flow of that dialogue really quickly: one of its strongest points is that it will let you make a change to the script and instantly see how that changes the text of a given playthrough – or back up a few turns and try alternate paths. So we do a bunch of iteration that way, verifying the fundamental behaviour of the new dialogue.

“Much as we value the ease of testing in Inky, that tool has occasionally been a bit flakey, so we do most of our actual editing in Visual Studio Code. That’s an extra layer to deal with, but it makes the editing process more robust.

“Before checking anything in, though, we also look at the new dialogue in Unity. That’s the point where we can see how the lines play in context with the art and UI. That’s the moment to make pacing changes or revise how we’re triggering NPC emotional reactions.”

“One of its strongest points is that it will let you make a change to the script and instantly see how that changes the text of a given playthrough”

For those making more traditional games, maybe ones that aren’t led by narrative or dialogue, there are still options for using Ink, where you’re not putting it at the heart of your game, Ingold explains.

“You can also just use it as a very intelligent database. So it’s not a single story, it’s a collection of little nodes of content. One of them might be ‘my conversation with Seth’, and then I walk around the game as I would normally and when I talk to Seth, it finds that conversation, we do it using the script, it renders that script and when it’s finished, it stops and goes back to the game again.” Which all sounds delightfully meta.

And there are key advantages to doing it that way. “You still get all the benefit of the actual conversations themselves are extraordinarily fast to author because you’ve got this nice format, you can still do a conditional, everything the player has seen,” even in other modules, “is a conditional which you can test for very rapidly.”

“So your conversations can be very dynamic within themselves, but they can also be dynamic with a conversation over there. It’s exactly no effort to say: ‘I asked Chris about this thing, what do you think Seth?’

“Whereas normally in a game, you’ve got to make a variable, you’ve got to make sure it’s accessible to this person over here, you’ve got to communicate that to the designer of the level, that this is a thing that they can do. And you have to do all this interconnection, whereas with Ink everything is global all the time.” And those conditionals aren’t limited to conversations.

“So if we have a health stat we’ll store it in Ink, because we’ve got to store it somewhere. So we might as well store it somewhere where the Ink can say, ‘Wow, you’re looking peaky today’. And that approach is just really fun, because as soon as you have all of this stuff in data, I just tweak that line based on this number over here. And you don’t have to talk to someone about it. And you don’t have to ask permission. And you don’t have to do any programming. It’s just there.”

FREE INK

And thanks to its open source nature, Ink is just there for the taking. Something that Ingold attributes to his co-founder Humphrey’s foresight.

“Joe was mostly the one advocating for this. And he was absolutely right, that as soon as we did open source it, what we got is a community of people contributing back to us. So within the first sort of six months, somebody did the JavaScript port of the engine, a fairly large amount of work, actually, I don’t think we would ever have done it.

“I use that for building prototypes. And for building auto testers, because I’m not very good at C#, but I can do JavaScript. So I built kind of auto players that test for dead ends in the story. And we got that for free. Essentially, it just appeared in our inboxes overnight. That’s kind of amazing.”

Ingold tells us that to commercialise Ink would have taken a lot more time and energy than they were willing to commit to something that wasn’t making games. “It might have been a profitable business after five years of hard work. But then again, it might have been just another startup that fails. And none of that is interesting.”

And as an open source tool, developers can be confident that as long as it’s useful to them, then it’s there to be used. “People are really suspicious of new tools, because then they often just disappear after six months, and then you’re stuck with this broken thing, which is understandable,” says Ingold.

Failbetter’s Short focuses on the community when asked.

“So the most common reasons I hear for studios to pick an open source tool – the desire to fully control their codebase, or the desire to avoid spending any money – aren’t the chief concerns for us. And we’re not making a lot of direct modifications to its workings ourselves.

“There are other benefits to its open source status, however. For one thing, there’s a substantial community of users working with Ink and discussing it, which has helped it mature. For another, tools like this democratise narrative game creation and open a lot of possibilities for hobbyist interactive fiction authors and indie narrative game designers – and that’s good for the whole ecosystem.”

“We support Inkle via Patreon,” Short adds, “using their guidelines about how for-profit studios should support the tool.” Something that anyone using Ink should consider, as Inkle continues to expand its capabilities.

THE GOOD STUFF

Ink isn’t the only narrative tool, there’s Yarn Spinner for instance, or the web-focused Twine. However, it’s Ink’s name that comes up most often when we speak to people in the space. And the appreciation of a responsive, conditional narrative is growing.

“We were quite startled by the reaction to Hades last year with everybody saying, ‘Wow, it’s so incredibly responsive’,” admits Ingold. “We were sort of saying, well, you know, there are people who have been doing this level of responsive narrative for ten years now.

“That somehow presents itself as a mainstream game. And the idea of responsive text within a mainstream game is still considered kind of quirky and kooky and a bit strange. So I think we’re still a long way off the Assassin’s Creed people using Ink or seeing any benefit to pivoting to Ink… although I bet you they draft stuff in Inky.

“And I think if Ink has succeeded, or connected with writers at all, It’s because it looks so incredibly lightweight. And it’s so quick to type into that you can forget that you’re typing, and just get on with actually making stuff because I find that a lot of the games industry is focused on technology, on tools and on systems, naturally enough.

But all of the good stuff comes when you get those [tools] to serve a person who’s actually creative and interesting and has something to contribute. So when writers enjoy using Ink, that makes me much happier than when programmers enjoy using Ink, because programmers will ultimately be fine. But writers are generally struggling in a computer environment. Because it’s complicated and confusing. It’s new, and it’s different. And anything which can make that easier, just leads to astronomical leaps in the quality of the written content that you get.”

About Seth Barton

Seth Barton is the editor of MCV – which covers every aspect of the industry: development, publishing, marketing and much more. Before that Seth toiled in games retail at Electronics Boutique, studied film at university, published console and PC games for the BBC, and spent many years working in tech journalism. Living in South East London, he divides his little free time between board games, video games, beer and family. You can find him tweeting @sethbarton1.

Check Also

IRL – tickets now on sale, nominations open – join us at the comeback industry event on September 16th

IRL will be a casual, inclusive event, designed so that anyone and everyone in the industry can attend, meet colleagues, network, and applaud our collective efforts