Using Ink with Unity

Alright, I’m finally building something along the lines of the basic RPG / lightweight management sim I’ve mentioned before! I partnered up with indie author Michael Coorlim for this project. We actually started discussing a partnership back in February, but stuff happened. And by “stuff” I of course mean a global pandemic.

I’m pretty good at building mechanics and systems, if I do say-so myself, but I’m definitely out of my depth when staring down the barrel of all the design work and narrative content for an RPG. Well, on a game developer forum I saw Michael asking if anyone wants to work with him on a game, and after looking a bit into his background it seemed like a great fit. Although he has little experience with computer game development, he has a lot of experience with both tabletop RPGs and fiction writing. I mean, he’s even self-published a bunch of well-received steampunk novels!

At his suggestion, we’re gonna use Ink, a narrative scripting framework. I’ve never worked with it before, but it has a Unity integration plugin and works very well for game storytelling.

Ink is a fairly easy system to work out. I’ve already figured out how to load .ink files directly, even though their documentation only goes over loading JSON file generated in a precompilation step. The code for loading .ink directly is very simple:

// inkFileContents: linked TextAsset, or Resources.Load, or even StreamingAssets
var compiler = new Ink.Compiler(inkFileContents);
Ink.Runtime.Story story = compiler.Compile();

That’s so simple it made me a little suspicious, so I asked about it on their GitHub. Sounds like this approach is fine though.

One thought on “Using Ink with Unity

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s