Don’t Fear the Macros (and Other Lessons I Learned Using Twine 2)

insights

I have a confession to make. Until recently, I never built an electronic game by myself. Every day at Schell Games, I work in Unity3D, writing, placing and manipulating objects in the world, and managing certain features; I decided it was time to prove to myself that I can build games, as Captain Jack would say, “All by me onesie, savvy?”

Captain jack sparrow

I have a project I’m trying to prepare myself for, which I plan make during Jam Week, but it requires learning new tools. (Jam Week, by the way, is the one week per year when Jesse lets everyone in the studio pursue whatever passion project we want, in the name of discovering new projects and learning new things; it’s the highlight of the year around here!) I came to this industry as a writer with absolutely no technical experience. I’ve improved this over the last four years, but I want to become even better. I found the idea of digging in and building something exciting, but also…intimidating.

Home Alone

I decided to learn Twine, a well-known freeware tool for interactive adventures. The online documentation is precise, but not always well organized; thank goodness for Anna Anthropy’s tutorial! My non-programmer mind understands a well-explained step-by-step guide better than a table of expressions. Most of the online Twine examples I saw involved “Click to continue” rather than meaningful decisions. Because I wanted to offer a deeper experience, I needed to use the advanced functions in Anna’s tutorial: macros. (Ominous “dun dun DUNNNNNNN.”)

Twine Logo

My 11yo son loves Minecraft, and Telltale Games just announced a new story mode for Minecraft which has him excited, and he is ravenously awaiting the first episode. I decided to build a Telltale-style Minecraft adventure for him to enjoy while he waits. The first thing I did was write down the story basics. I named the planet where my adventure takes place “Eupraxia,” after the greek goddess associated with a sense of wholeness and well-being.

Using Google Drawings, I flowcharted the story. (That thing you see below is less than one half of the flow chart, which took a weekend.) I can’t imagine having even opened Twine without having this document already finished.

Flowchart

Many have advised me that the best way to learn a tool is to just dive right in, and learn through failure, so that’s exactly what I did. Here are some things I learned:

  • Draw a visual map of the area(s) your story takes place in. This helps a lot in knowing which directional options to offer players. Note: when you’re approaching the same destination from the opposite direction, you can’t say “it’s on the left” anymore.
Whichway
  • Twine documentation favors 2.0. I followed the syntax exactly, but was experiencing errors, and couldn’t find an explanation. I was using version 1.3. I upgraded to 2.7, but then couldn’t open older file and had to painstakingly copy-paste about half the game into a newer file. The syntax then worked perfectly. Note: Twine 2 makes testing and de-bugging a lot easier than Twine 1, but you have to validate nodes individually or else painstakingly play the game over and over to find all the bugs in all the story strings. Twine would benefit from one-button validation, to find all errors in the file at once.
  • You can’t set variables in the Start node. At the beginning of the game, I had 20 or so variables I needed to set, but found that you can’t do this in a Start node. This is one of the reasons my game has a “Dedication” at the front – I needed an extra node to set variables in.
  • Don’t fear the macros. Macros, once you stop being intimidated by them, are incredibly helpful and save a lot of work. For instance, with <<print $npcName>>, I was able to replace a long “if” statement or save myself from making separate nodes for separate NPCs. As I build more things, I’ll find more ways to be efficient; but macros are important. Note: Punctuation counts!
Code

Macros I used in Eupraxia:

  • Setting and changing variables
  • Conditional statements (sometimes using three variables at a time)
  • Selecting a random line of text from a list
  • Integer tracking
  • Selecting a number randomly from a range
  • Naming shortcuts

Eupraxia, my first Twine (which took about 12 hours to flowchart, 36 hours to build, plus a week of my friends playtesting and me de-bugging), is available on my personal website. It has five zones, an animal companion system with five animals you can find and tame (each with their own abilities), a specialization system, an inventory system with 29 unlockable backpack items, and the ability to play as a female or a male adventurer. I wanted it to be fun, action-packed, and replayable. For this game, I was mainly concerned with getting choices and systems right, so players could feel like they were actually traveling, not clicking, through an adventure. My next goal with Twine will be to tweak the visual formatting, and to add images and audio to make an even more compelling experience. From there it will be building visual novels…which I’ll need for my Jam Week project!

What about you, readers? Do you Twine? What awesome Twines have you played? If you played Eupraxia, what do you think?