top expert

a biting cat website

Let’s Make IF #7: ambiguous scenery.

Last time, on let’s make IF…

Friday’s update was exclusively concerned with moving D, an NPC, from area to area.

  • How to move him, turn to turn?
  • How to update the player on his progress?

These goals were accomplished for the immediate situation, but there will be more work to do. The current solution assumes only one scenario: D begins in the player’s location and walks to a remote location. What about D passing the player, or walking to the player? I decided to move on for now, and I’ll expand the solution as future needs become apparent.

clutter.

I need to wrap up description of the stage. Well, the “description” in Inform 7 terms is written already, but it includes some ambiguous “stuff” that I need to account for. In the game’s beginning, there’s this line:

The stage was cluttered with strange shapes, and they all seemed to glob together in the dim, gloomy light.

In subsequent descriptions of the room (during the prologue), the reader sees this:

This dark, gloomy space was filled with human junk. Even though I could see pretty well in this kind of light, the stage was so cluttered that it would take quite a bit of exploration to know what I was looking at.

Once this area is illuminated, it will be very busy! One of the big challenges of this game will be managing the fact that there are lots of interesting items on stage that don’t do anything interesting until Act III (a scene). Here in the prologue, though, that won’t be too hard. We’ll just make a scenery object with a bunch of synonyms.

the clutter is scenery in at center stage.

Right now, I’m thinking that we’ll have the stage manager remove this from play when the prologue ends, so it can serve as a catch-all that we will later replace with individual objects.

the description of the clutter is "This stage was full of human weirdness. Who knows why they make what they make? Or why they like to make piles out of those things? The low light wasn't a problem for me, but I had no way to make sense of what I was seeing. A large, long box, which somehow seemed darker than its surroundings, stood out as having a bit of a dangerous smell."

There. A description. Our work isn’t done, though. We’ll need some synonyms, for one thing.

understand "weirdness / piles " as the clutter.

The description makes a couple of commitments. It’s important to keep an eye commitments! In this case, we have a new object (the box) that can be described. Smelling, an action, will be necessary as well.

the box is scenery in center stage.

understand "long / large / dark / box" as the box.

the description of the box is "It was large, at least the size of a human car. It also seemed darker than the area around it. I know that doesn't really make any sense, but that's how it was."

The slashes in the “understand” statement will make it possible for the player to mix and match the terms, typing “dark long box” or “large box” as examples.

What about smelling? Smelling is built into the standard rules. By default, typing *SMELL* at the command prompt results in smelling the current location. Even though it may not appear this way, smelling in Inform 7 always applys to *something*. The other thing to know about Inform is that the Standard Rules has a baked-in report response:

Report an actor smelling (this is the report smelling rule):

if the actor is the player:
if the action is not silent:
say "[We] [smell] nothing unexpected." (A);
otherwise:
say "[The actor] [sniff]." (B).

This is a report rule. What do we know about report rules? They’re at the very end of action processing, so we can halt processing at any prior point to avoid the message. Alternately, we could disable the rule under specific conditions:

the report smelling rule does nothing when the prologue is happening and the noun is the box.

Now, that will work, and going about things that way is perfectly fine. However, let’s talk about action processing and understanding how it works. We could use any of these constructions, since they all precede the “report” phase of action processing:

before... instead
instead...
check... instead
carry out... instead
after... instead

The documentation uses an “instead” rule as an example. I personally like to “carry out” actions that succeed. In other words, I would only use “instead” rules if the protagonist could not or would not smell. Does it really matter here? No, I don’t think it does, but if I have a consistent approach, I know where to look when problems arise.

Just speaking in general, I’ve become more and more committed to using the entire action sequence, leaving room for rules like “after doing something” and the like.

I’ll commit here and now to writing a “smell” response for each room, and redirecting actions as needed. That being so, I’ll disable the report smelling rule altogether:

the report smelling rule is not listed in any rulebook.

Now, the implementation:

carry out smelling at center stage when prologue is happening:
say "There was a hard-to-place mustiness in the air that reminded me of deep places in the earth, places where D and I have gone, where we have felt afraid.".

carry out smelling the box when prologue is happening:
say "I was hesitant to get close to the box, but from where I stood it smelled like still air and darkness.".

instead of smelling something in at center stage when the noun is not at center stage and the noun is not the box:
try smelling at center stage.

Note the last rule, which is a sort of “everything but” approach.

Later in the game–smell is important to cats, after all–we might need an adjective to manage an increasingly large number of smellable things. This isn’t hard to do!

a thing can be fragrant or odorless.
a thing is usually odorless.
instead of smelling something odorless:...

And so on. I’ve added a very short description of the seating area. It was easy to copy/paste my table and phrasing for describing center stage, and I was updating text after maybe a minute. I think we have a good, extensible approach for managing room descriptions!

next.

Just a short update today, since I had to wrap up a post about Infocom’s Trinity over at my other blog, Gold Machine. Still, I’ve got everything moving in the right direction. If I keep writing reusable code, the project should get easier as we press forward.

Next time, I’ll write a room description for the exit, implement something for preventing Marbles from going there on her own (it’s a vertical ladder, perfectly perpendicular to the floor), and have D flip that doggone switch. I’ll also need to make the remote descriptions for the doors and some sort of description of the stage when viewed from the audience.

There’s always so much to do!

Here is the folder where daily source code updates are stored.

This is today’s updated code. For the best reading experience, paste into an IDE.