Also, Portrait With Wolf ^_^ delayed but OMG coming to Let’s Make IF!
it seems like only last week…
In my recent interview in issue #18 of the What’s New in IF zine, I talked about my weird game inspired by the Single Choice Jam, Portrait With Wolf ^_^. Unfortunately, I don’t think there’s time (or people) to test it thoroughly. In the first place, it’s late: I only started this project a few weeks ago. On top of that, there’s a lot happening right now, with some current activities and the upcoming IF Comp.
Why is it so hard to test? The text printed is highly variable. Every turn, the output is the product of three factors. A given playthrough will only see a small portion of what is written. Under the hood, players will only see outcomes from different, specific mechanisms. Getting people to look at everything seems like a big ask under the best of circumstances.
Saturday night, I think I found and fixed the last bug, but textual problems remained. Specifically, there are three different endgame paths, but those paths can be broken at any time. I did not yet have a way to acknowledge the breaks and point players in a new direction. That required more tech changes.
There simply isn’t a way to get those changes tested in time. It’s too late for major logic modifications! Verifying them would be near impossible in a slow period, but now? Forget it. Since I only release work that I consider finished, the project is delayed.
but you know what? that’s great news for us.
We’ve been talking about generating text, and approaching things as a writer might. Let me show you something:

This is a compilation results report generated by Inform 7. Even if you’re not used to seeing such things, 19,823 words sounds like a lot for just one room and 11 things, doesn’t it? Portrait With Wolf ^_^ is almost entirely made up of printable text. This project is a perfect way for us to talk about formatting, varying, and choosing output in our Inform 7 works.
Let’s talk about varying text for a few episodes, and see if that discussion leads us to PWW.
before beginning.
Let’s start simply. We’ve recently discussed the phases of action processing, and the ways in which we can use actions to create output and change the state of the game world. Refreshers:
Inform 7 has other entrances and exits where we can do a bit of code to make things happen, even though they aren’t part of the turn-to-turn machinery of a project. We can have our games do specific things when they end, for instance. We can create scenes, a powerful way for us to handle events in the game world. By design, these aren’t triggered during action processing rules. The Marbles and D series discusses scenes in detail, though at an advanced level.
Authors usually want to print text and/or perform special operations at the very beginning of their games. Such rules begin, rather fittingly, with the phrase “when play begins:”. If we wanted to print some scary text at the beginning of our horror-themed game, it is as simple as this:
the story title is "A Chilling Tale for Beginners".
the story headline is "A 'Let's Make IF' project".
the story author is "Drew Cook".
lab is a room.
the description of lab is "Yikes, it's so scary here in the lab."
when play begins:
say "Oooh what a spooky situation! This must be a very spooky game!".
the generated output will look like this:
Oooh what a spooky situation! This must be a very spooky game!
A Chilling Tale for Beginners
A "Let's Make IF" project by Drew Cook
Release 1 / Serial number 240820 / Inform 7 v10.1.2 / D
lab
Yikes, it's so scary here in the lab.
Let’s think about what’s happening here. The WHEN PLAY BEGINS rule prints first. Next comes the “printing the banner text” activity (we won’t be talking about ‘activities’ for a long time), which displays the title, author, and version information. Authors often ask about changing when the banner text displays. We won’t be covering that here, but you can find this relevant code example in the Inform 7 documentation.
Finally, our room name and description prints. This output seems exactly the same as output from typing a *LOOK* command, doesn’t it? That’s because it is. An Inform 7 game begins with the looking action. What if we wanted to print something after the banner text but before the room description? We have a couple of options. In the first, we can use action processing to handle this one-off situation. In the second, we can use Inform 7’s built-in capabilities for varying text.
We’ve talked about this in our action processing discussions. If we want something to happen before something else, we can just say so.
before looking:
say "Before we proceed, I think you should know that I'm afraid of bugs."
Don’t worry, I’m not going to write some scary text about bugs. This is just a placeholder.
Our starting output would look like this:
Oooh what a spooky situation! This must be a very spooky game!
A Chilling Tale for Beginners
A "Let's Make IF" project by Drew Cook
Release 1 / Serial number 240820 / Inform 7 v10.1.2 / D
Before we proceed, I think you should know that I'm afraid of bugs.
lab
Yikes, it's so scary here in the lab.
The problem is that this output will print every time we look. To make this a one-time event, we’ll have to be more specific. Since we want to avoid mishaps, it pays to be as specific as possible. As-is, the message would print anywhere, not just the opening room. That’s probably not what we want. Here’s what we could do to have a one-time Before rule that only works in the lab:
before looking in the lab for the first time:
say "Before we proceed, I think you should know that I'm afraid of bugs."
There! Specific is better. Note how readable that code is!
We have other options. Long-term, this second method is probably the smartest one. I like to have unique, one-time texts print when a player enters a room for the first time. Inform 7 is built for that kind of thing. Here’s a modified room description.
the description of lab is "[first time]Before we proceed, I think you should know that I'm afraid of bugs.[paragraph break][only]Yikes, it's so scary here in the lab."
As we’ve discussed before, using brackets in quoted text means that we are doing something mechanical with our code. Perhaps we are substituting what’s there for some other code someplace. Perhaps we are formatting the text. In cases like this one, we are using Inform 7’s built-in features for varying text output. If we want something to print just one time, we preface that passage with [FIRST TIME] and end it with [ONLY]. It’s as simple as that. Note that we also have a bit of formatting included, which inserts a paragraph break. The before and after outputs look like this:
lab
Before we proceed, I think you should know that I'm afraid of bugs.
Yikes, it's so scary here in the lab.
>l
lab
Yikes, it's so scary here in the lab.
advice for writers.
Why would this be important? Printing first time text can give authors a chance to creative a bit of narrative “connective tissue,” making exploration and discovery feel significant in a way that repeated room descriptions do not. Entering a new space can feel like an event. Here’s a short passage from my other, longer WIP, “I, Thief” printed a first and second time:
Dungeon Entrance
This is a long, north-south corridor constructed from rectangular stones cut with mathematical precision. The doorway to the north is mere framing around a rockfall.
Off to the south, two massive, crumbling statues with the broad backs and limbs of ogres stand guard at the hall's midway point. The entire area is strewn with rubble. How can a corner of the Great Underground Empire be unknown to you? The treasury behind you and the fallen sculptures before you merit some measure of fame, but this rapidly collapsing nowhere has escaped all Imperial notice.
second time:
Dungeon Entrance
This is a long, north-south corridor constructed from rectangular stones cut with mathematical precision. The doorway to the north is mere framing around a rockfall.
Off to the south, two massive, crumbling statues with the broad backs and limbs of ogres stand guard at the hall's midway point. The entire area is strewn with rubble.
These print from a single description using the [FIRST TIME]… [ONLY] feature of Inform 7. As you can see, we can place FIRST TIME output anywhere in a text and not just at the beginning.
If you’ve been following along, you know that an ongoing concern of mine is this: how can parser games achieve a sense of movement and urgency? Many choice-based IF games are very good at this, so what can we learn from them? Varying output based on any number of situations (this is only a first step) is key to creating a dynamic experience for players.
As we discussed last time, authors have to consider what the player needs to make progress. We don’t want to hide useful information, like exits, in long passages. It’s important to consider what players will look at the first time versus the tenth time. By the tenth time, they are probably only looking for exits and usable objects. What is the sweet spot between descriptive, dramatic prose and prose with utility? We need to offer both in hopes of engaging players while avoiding the experience of reading comprehension exams. This is hard to do well, but the tools are there for us. Let’s keep at it.
next.
more on varying text.

Leave a comment