Basics of Twine 2

A summation of a workshop I put on at Play by Play, New Zealand's first international games festival. I taught teenagers and pre-teens about the basics of the tool Twine, so they could make a simple, text-based game.

Twine is an interactive fiction tool, good for making text-based, non-linear games—similar, in form, to pick-your-own adventure books. Also used for for teaching, and other art forms, Twine can also be used to great effect for storyboarding and outlines for games with branching narratives in any form.

Good for either finished games, or just figuring out the skeleton for a game, Twine can be a valuable tool for anyone, especially devs looking to get into games writing and narrative design.

Though text-based, Twine games can be given different appearances and have unique mechanics, such as in Christine Love's Even Cowgirls Bleed, in which the player hovers the cursor over the highlighted text to emulate aiming and shooting a gun.

Because it's a simple format to get a grasp of, I'll be talking about Harlowe. Each format has a different language, though they're quite similar. Once you get the hang of one, it's not so hard to see how another works. Examples: All That We Could Ever BeBloom.

On the bottom left is an example of how text looks in the editor, the bottom right is how it appears ingame.

The workspace is relatively simple, and passages can be moved about the main space to order the passages however best works for the project given, be it a horizontal branching line, a linked circle, etc.

Tags are used more with the other two formats, though they're good for organization and annotation. The first passage created in a project will automatically be set as the start passage, but this can easily be changed on the fly with the rocket symbol in Twine 2—though this differs in the original Twine.

Bug testing is the only way to start a project from a passage not selected as the start passage. This is useful for making sure what you've written works correctly, without having to play the game from the start. 

Name your passages what you like! But make sure whatever you name things makes sense, because once you have a larger project, you're going to want to be able to find the right passage with ease.

There are a variety of ways to write the passage links, as long as they're in the non-nesting double brackets. The line ( | ) and the arrows ( -> <- ) are just two ways, if you want the shown link text to differ from the actual passage name. The arrows need to point to the name of the linked passage, if arrows are used.

As with passages, variables should be given very clear and concise names, for ease of remembrance. The dollar sign ($) is what marks the text as a variable; without it, you've just written another word.

When writing macros in Harlowe, it's vital to not forget the colon ( : ), or else you won't be setting (or if-ing) anything. When a project is getting errors, a missing colon is often the issue. There are a variety of other macros in all formats (some formats, like Sugarcube, have more than others), such as setting random numbers, or picking between a bunch of set variables. 

There are plenty of resources to look out for when it comes to Twine, just be sure to check that what you're looking at matches the format you're writing in. For Harlowe, I've found this site a valuable resource, if a bit overwhelming at times for someone who hasn't touched coding in over five years. 

Finished Twine projects are saved as HTML files, which you can either host yourself, or you can share on, which is a site for free Twine hosting. Good luck, and have fun!

Latest Jobs

Xbox Game Studios

Redmond, Washington
Technical Lighting Artist


Hamburg, Germany
Game Designer - Elvenar

Six Foot

Houston, TX
Six Foot Director, Player Relations

Hometopia Inc.

Lead Engineer
More Jobs   


Explore the
Subscribe to
Follow us

Game Developer Job Board

Game Developer Newsletter


Explore the

Game Developer Job Board

Browse open positions across the game industry or recruit new talent for your studio

Subscribe to

Game Developer Newsletter

Get daily Game Developer top stories every morning straight into your inbox

Follow us


Follow us @gamedevdotcom to stay up-to-date with the latest news & insider information about events & more