Header Strategies

How do you arrange your headers when writing medium-sized IF?

Do you use all the levels of the headers, or just some?
Do you separate the map from its contents, the conversations from the actors, jumble it all up? What do you do? How do you arrange it?

Hi Wayne,

I asked this same question a while back (see Code Organization). I was advised to look at others’ code and see how they’ve done it, though I never got a chance because the IF game sites were blocked at my work, where I did a bunch of my research. You might try that.

If you prefer advise from someone who has made exactly one game :laughing: , here’s how I did it.

I used major headers only but I ended up using comments as subheaders so I could have used subheaders. My first section was the Map and Initialization: the rooms and their relationship to each other, and custom messages to replace “you can’t go that way” for the boundaries (like “there’s nothing to see to the north but empty fields”). For Initialization I put various universal rules and states that could happen to any character or object in any room (i.e. "A person can be awake or asleep. People are usually awake. ")

Then I used a section for each room.

Then my last few sections were Conversations, Guidebook Entries, and Humor. In humor I put a bunch of silly stuff that didn’t further the game, but that I thought would be cute to include in response to some predicted user commands.

For each room section, I divided it into People, Items, Room Descriptions, New Actions, Rules, and Ambiance. Under ambiance I put scenery and descriptions of items that served not to further the game, but just to make it well implemented. For example, when I mentioned a bird with brightly colored feathers, I didn’t want the player to get “you see no such thing” in response to “x feathers”, even if feathers aren’t important to game play. Dividing this stuff out helped me not have to wade through it when looking for something important.

All in all, this worked well for me. I’d probably do it this way again.

Here are some relevant RAIF threads:
http://groups.google.com/group/rec.arts.int-fiction/browse_thread/thread/5ea8a3e8cf34b982?q=code#
http://groups.google.com/group/rec.arts.int-fiction/browse_thread/thread/c466473e4cf799b6?q=code