top expert

i am my own ghost

Let’s Make IF #11: new nouns, new text.

last time, on Let’s Make IF…

My update was short yesterday. I successfully converged several different rules into a single rule. Is the new code more complex? It might be, line for line, but considering the upshot (fewer individual rules, more consistency) is a net decrease in complexity. I already had a method: using a table to link something to a table of descriptive text. In this updated, I used the noun (or nothing) for this purpose. So far, it’s working well, but I’ll have to keep an eye on it.

The second tactic was to intercept commands consisting of just “d,” which Inform really ought to interpret as shorthand for “GO DOWN.” Since Marbles’s old friend, D, is a character in my game, the “d” command was usurped. I used an “after reading a command” rule to intercept such commands and convert them to the “going down” action.

what now.

Believe it or not, my next goal is to get Marbles and D back to the stage! It may sound repetitive or tedious, but remember that most of my effort so far has been dedicated to framework/architecture stuff: managing complex variations of text, having a reasonable way to track all of it, and so forth. The player, whom I should always keep in mind, has played ten turns at the most–if not, I have failed to show the player the way–is just getting started. Unless my opening crawl tired them out, they should be on board, especially if I don’t show them the same descriptions.

Have you ever played Shade by Andrew Plotkin? While Marbles, D, and the Sinister Spotlight is radically different in terms of tone, I’ve become interested in the possibility of a space or spaces that can change around the player, of going to new places without literally going somewhere. My goal, then, is to make familiar places feel new as the story progresses.

It’s time to shift emphasis away from technical development and toward the narrative.

old geography, new places.

Thanks to my work so far, updating my description of the Main Entrance is straightforward. I just need to update a table entry.

act i	"[if the main entrance is the location]Now that the area near the exit doors were well-lit, D must have been able to see finer details. The doors were painted a rich, deep shade of green, for instance, and the ladder leading up to the platform overhead was made of Miznian hardwood[otherwise]The exit doors were the most attention-getting feature of the main entrance area, but the unknown purpose the the booth above it was enough to make any cat curious[end if]."

I like to get some basic text written, then refine it the project progresses. That’s because it’s easier for me to revise something that’s playable. Whether than agonize too much over the prose, I’ll focus on building things out. Once Act One is complete, I’ll have a better sense of what should be said and how things fit together.

Note: because I use the word “color,” some tester will likely try to examine it. I’ll quickly whip something up:

the color is part of the exit doors.
understand "some/kind of/-- color/colour/paint" as the color.

instead of doing anything to the green paint:
say "As you probably know, cats, humans, and lemurs all see color differently, so I'm trying to use terms that we can all understand."

I haven’t implemented the ladder yet, have I? The ladder isn’t for Marbles; it’s for D. I’ll create it, make some varied descriptions of it, then prevent Marbles from climbing up it.

the wooden ladder is scenery in the main entrance.
the description of the wooden ladder is "[a variable description]".

Next, I just drop descriptive text into a new table.

table of wooden ladder descriptions
present action description
prologue "[if the wooden ladder is in the location]The ladder was pretty fancy[em]so far as ladders go[em]because it was made of something called 'Miznian hardwood.' That meant is cost a lot of what human adults 'money.' D's parents were always talking about money and the things they couldn't have because of it.[otherwise]I could make out what appeared to be a ladder leading up to a darkened platform of some kind."
[space added for clarity]
act i "[if the wooden ladder is in the location]The ladder was made from what D's parents called 'Miznian hardwood,' which is the kind of silly thing that impresses human adults. It led up to a platform or booth above the exit doors. Because the broad slats of the ladder were directly above and below one another, it would have been awkward for me to climb on my own.[first time] I could have done it, mind you, but it didn't seem worth the trouble, especially since getting down would be even worse.[only][otherwise]Looking at it from a distance, the most interesting thing about the ladder was that it led to a small, open booth. I could tell there was a strange contraption of some kind, but I had no idea what it could have been for.[end if]"

(note that “end if” isn’t necessary at the end of these texts. It’s something I’m habituated to)

Next, a simple rule about climbing the ladder:

instead of climbing the ladder in main entrance:
if the prologue is happening:
say "There was no point in wandering off unless I could help D do something about the light in there.";
otherwise:
say "Climbing it would have been awkward[em]not impossible![em]for a cat. I decided to wait until I had a reason to go up there.".

instead of going up in exit doors:
try climbing the ladder.

Note that I’m specifying a location. That’s not because the player will be climbing the ladder from anywhere. It’s that way because a player might try to climb down from the spotlight booth, a room we haven’t described yet. I also divided output into prologue and otherwise. I don’t know what I’ll eventually need for this setup, so I’m coding just enough to keep going.

It does look like I’ll need a custom response for trying to do things to objects in remote rooms when the actions require a “touchable” thing. For instance, how should trying to climb the ladder from center stage be handled? Inform 7 already has a built-in response for this, actually, so there’s no need to come up with a whiz-bang solution. However, the message isn’t suitable for my narrative voice:

>get apple
You can't reach into the closet.

Most of Inform 7’s default resonses are broadly applicable, but they probably won’t have much to do with your game. If you want to make the narrative voice of your game entirely your own, you will likely want to replace most–nearly all in some cases–of these built-in responses. I’ll write many of these to sound like things Marbles would say. and it’s time to do my first one. It isn’t hard.

The can't reach inside rooms rule response (A) is "From where I stood, I could not reach the contents of [noun] with my little paws, nose, ears, or fangs.".

Note that the [noun], via some sorcerous process that is not described in the Standard Rules, has been changed from the noun in the player’s command to the printed name of the room. The output from my new response looks like this:

>get ladder
From where I stood, I could not reach the the main entrance with my little paws, nose, ears, or fangs.

See? Instead of “ladder,” Inform prints “the main entrance.” That isn’t a problem that needs fixing, as it works fine for my narrative voice. It’s just a thing to notice. The (A) in my code above indicates that this is a message for the player. If I had a game where simulating NPC behavior was important, I might want to write a (B) response, since those apply to them. But really, I’m not interested in simulating D. He is an actor in my play, not an automoton.

I’ll need a rule to cover everything else involving the ladder.

instead of doing anything other than cat behavior or climbing or examining to the wooden ladder:
say "The ladder was obviously good for something, but that something was not [it]that[rt]."

You might wonder: what is “cat behavior?” Cat behavior is a kind of action that will encompass things cats do: rubbling/marking, smelling, listening, pawing, and meowing. Maybe kneading and purring, too. It’s a good thing that there will be so few nouns in the game, because my goal is to let Marbles get unique responses for cat behavior as applicable every single thing in the game. That’ll be a big job! A lot of it won’t change from scene to scene, though, so this shouldn’t really ever get out of hand.

People playing as a cat will want to do cat things, right? Our audience is made up of people who like Zork, parser games, children’s stories, and cats. It’s good to give them what they want. We won’t be doing that today, though. With the exception of meowing, they won’t really have anything to do with the main throughline of the game.

As a last detail, I mentioned the hardwood, so it needs to be implemented. It’s not a lot of trouble to do, though it’s important to remember that the game let’s players try to examine things from afar. Still, there’s no need to vary text by scene, so this work is accomplished quickly.

the miznian hardwood is part of the wooden ladder.
understand "miznian/-- wood/hardwood" as the miznian hardwood.

instead of doing anything to the miznian hardwood:
say "[if the miznian hardwood is in the location]The expensive wood, had been coated to look shiny. It almost looked slippery, in fact. A slippery climbing surfance is something only human adults could come up with.[otherwise]I didn't care about 'Miznian' this or that when it was right in front of me, let alone way off near the main entrance.".

Note that, because the ladder is scenery, the hardwood is, too. It won’t be printed in locale paragraphs. The other thing worth mentioning is that my “instead” rule shuts down every action, even examining. So I haven’t actually written a description for it. Rather, I’ve written text that prints instead of a description.

In my experience, uninteresting nouns like this can be used to develop the character or do worldbuilding. If the description isn’t important, use the occasion to say something else.

What else? We’ve got to send D back the stage, for one thing, though we don’t have to be in a rush. I’ve tweaked the “when act i begins” rule accordingly:

when act i begins:
say "[bt]ACT ONE[rt][pb]";
try looking;
now the box interests D;
now the destination of D is center stage;

D has a new interest now; I’ll use that to show him investigating the box both before and after Marbles gets back to the stage. I’ve already set up a mechanism to describe his travels, so giving him a new destination is all that we need to do logistically.

I think that’s good enough for one day. Monday–I’m taking the weekend off, thank you very much–I’ll get a version of the auditorium described and give Marbles something to do there. I’ll also write a good deal about the box. It will be visible from both auditorium and main entrance, and I’d like to build interest/suspense regarding it. D’s commentary will help with this as well.

Here is a link to a folder where regular source code revisions are maintained.

This is today’s updated code. For best results, view in an Inform 7 IDE.

next.

Act One begins with new text and a deepening mystery. See you next week!