Twine, Part 2: Hello, Chapbook

Written in

by

If you read the previous post in this series, you might remember that I had some issues warming up to Harlowe, the default Twine story format. Really, I like the visual design of Harlowe just fine, I just can’t stand the macro language. For a Choose Your Own Adventure type story, it would be perfectly fine. Of course, that’s also true for every other story format, since they all have in common the Markup and Wiki syntax that powers basic formatting and linking. So, I’m trying some of the other included formats for a few other projects, to get an idea of what their strengths and weaknesses are.

Chapbook is the newest of the included Twine formats, and it’s also supposed to be “beginner friendly”, like Harlowe, but it largely accomplishes that by virtue of being fairly minimal. There just isn’t much to it, at least as currently documented. It does, interestingly, include some basic stuff that Harlowe doesn’t, notably including sound effects and background audio. There are some basic formatting controls, a few user-input widgets, and a very basic header and footer. And that’s basically it.

For scripting, Chapbook can use plain JavaScript (hallelujah!). There are a few “global” objects that contain the current story state, and a few functions you can call on them to do things like modify the global appearance of the story, inspect or change the history, and the like. There is also a built-in, limited macro language of sorts.

Things That I Like about Chapbook

The default presentation of the story

I wouldn’t necessarily have chosen that color scheme (see “Don’t Like”, below), but the overall presentation of the story is quite nice. It’s formatted very much like a physical book page, with decent margins on desktop and mobile, a header and footer line on each page, and a subtle drop-shadow box around it. It’s quite pleasant to read, whereas some of the other Twine formats are a bit more in your face.

The testing tools

Chapbook’s testing tools are first-rate. There’s a sidebar that you can expand and collapse to show just about the entire state of the story, and you can edit anything, from the state of your variables, to the formatting of an individual page, or the story defaults, and see the changes immediately. And you can copy & paste those changes right into the code of your story, and they’ll be the new defaults. Nice!

There’s a snapshot functionality, so you can start testing from somewhere other than the beginning, and have all of the state up to that point.

Sensible defaults

If you don’t change anything, you get a perfectly reasonable, book-like presentation, with a “restart” link and your story title at the bottom of the page, and Chapbook automatically remembers the state of the story for your reader and starts them back in the same place if they don’t explicitly choose to restart. There are no additional “sidebar” items you might need to remove, like in Harlowe.

Minimalism

I’m not in love with the built-in macros, but it’s easy to work with them, and there isn’t much there, so it’s very little to learn, and there’s little confusion about how the various parts interact. It is, for lack of a specific term, much less nerdy in terms of the macro language design.

Things That I Don’t Like

The default text and link formatting

The text formatting that you get out of the box is a little stark. Very dark grey text on a white background, with a red color for links. But, it’s really easy to change that in a simple way (see the likes, above).

The macro language

There is a language of sorts you can use for scripting without dropping into JavaScript. It’s a bit idiosyncratic, though. Variable assignments are done with colons, so instead of a=10, you have a:10. It’s a bit like HTML/CSS styles, that way. All of your calculations need to be done at the top of the passage, in a special “variables” section, which is set apart from the text of the passage with a line with just — on it.

This is…nice, because it means that you don’t have to have complex rules for escaping text and program code from each other, which is an issue in other formats. It’s annoying, in that a bunch of the places where you’d expect to be able to use an expression like “x+10” in a macro, you end up having to create a separate variable to hold the value. Similarly, you can’t nest if-then structures, which sounds insane coming from a coder’s perspective, but makes sense in that you need to just have a variable that holds the value you’re branching based on.

The default text and link formatting

The text formatting that you get out of the box is a little stark. Very dark grey text on a white background, with a red color for links. But, it’s really easy to change that in a simple way (see the likes, above).

The documentation is a bit sparse

As the newest built-in story format, there isn’t as much information about how to do things in Chapbook readily available on the internet. Unfortunately, the Chapbook documentation doesn’t really cover advanced topics like “how to use Javascript to manipulate the story” very much, at all.

Conclusions

I think I like it. If I choose to do more projects in Chapbook, I very well might expand its capabilities with my own macros, and some custom JavaScript. But for certain projects, especially anything more story-like and less RPG-like, I think it’s a great choice.

Leave a comment