Text Adventures Part 4: The Document

A text adventure would not be useful to me if it was not written down. Particularly when the goal is to have an unfeeling, strict parser doling out commands only when successfully prompted, it’s important to have a reference that is clear, contains maps and explanatory information, space for notes, and everything the “computer” needs to say throughout the game.

With the exception of Recurring Nightmare, I write every text adventure using LaTeX. Over time I’ve built up commands and formatting to make this process simpler. For Recurring Nightmare, I tried my hand at InDesign since I had received a license from work. That license no longer exists, and it’s easier for me to edit a .tex document than an InDesign document, so LaTeX continues to be the way forward.

In this post I’ll talk about some of the decisions I made for formatting my document, how I make maps, and other bits of trivia that come to mind.

When I began writing Sail Away, I had no clue how to set up my document in a logical way. I had the general idea of likely needing multiple columns, but that was where the thoughts ended. So, I purchased a Parsely adventure PDF to have some point of comparison.

Some key design elements were minimizing how many pages the adventure spanned, differentiating between spoken words and notes, and trying to establish a visual consistency with the topic of the adventure. Those first two are pretty easy; the last one I only attempted when using InDesign and don’t have clear plans to continue with.

What’s great about a digital medium is that you can make the size of the paper larger without compromising on anything, as you can always zoom in later when using it. I found that my sweet spot was A3 paper (about 11.7″ by 16.5″) in landscape, then I use 3 or 4 columns of text. Most of my adventures fit on one of these papers using 10pt font.

To denote speaking, I use a “command prompt” style beginning with a greater-than sign, and all text in italics. Both the room descriptions and results of commands are written in this way. Exits are listed in red, while possible commands are listed in blue.

Eventually I built up custom LaTeX commands to do all of these. Here’s the preamble I’ve put together for my adventures.

\documentclass[10pt]{extreport}


\usepackage{multicol}
\setlength{\columnsep}{0.3cm}
\usepackage[landscape,margin=0.2in]{geometry}
\geometry{a3paper}
\usepackage[T1]{fontenc}
\renewcommand*\familydefault{\sfdefault}
\usepackage[document]{ragged2e}
\usepackage[usenames, dvipsnames]{color}
\usepackage{graphicx}
\usepackage{asymptote}
\linespread{1}
\usepackage{hyperref}
\usepackage{enumitem}
\usepackage{adjustbox}
\usepackage{amsmath}
\usepackage{amssymb}
\setlist{itemsep=0mm}

\newcommand{\room}[1]{
    \noindent\textit{> #1}\\
}

\newcommand{\move}[3]{
	\textcolor{blue}{\textbf{#1} #2}: \textit{> #3}\\
}

\newcommand{\exits}[1]{
	\textcolor{red}{EXITS ARE: #1}\\
}

\setlist[itemize]{leftmargin=*}

The various packages are just meant to allow me to do smaller bits of formatting, add links between sections, include images, and provide support for the Asymptote vector language that I use for maps. The main commands can be seen in each line that starts \newcommand.

We have \room, which is just shorthand for providing the description of a room; this comes immediately after the section header for a room.

After that I use \exits, which again only takes one argument that is a list of exits. This is so I don’t have to make the color red and prepend “EXITS ARE:” before each list of exits.

Finally, I’ll use \move several times, one for each move that is allowed in a room. This one takes three commands, which are typically an action, an object that is acted upon, and the description of what happens as a result. The reason the verb is a separate part of the command is that I chose to make that bold blue, whereas the object is not bold. For example, I could do the following.

\move{Inspect}{table}{The table has two small drawers, both locked. You also see a watch and a pen on top of the table.}

With LaTeX, it’s harder to get into really custom fonts (or at least harder for me to find them and figure out how to make them work.) To that end, the visual design of all my adventures is the same, with basic headers and very polygonal maps with little flair. They are quite usable, but not publishable, particularly compared to the Parsely adventures that have a lot of visual elements that add to the experience for the person playing the parser.

The benefit of using LaTeX is that it’s everywhere. I can easily make edits to an adventure from any of my devices, and the early decision to not worry about design keeps me free to focus on writing a good adventure. Perhaps in the future I’ll play around with building out more exciting versions of the documents, like I did for Recurring Nightmare, but considering I don’t have the background to do anything spectacular it’s unlikely.

Leave a Reply