Check, Carry out and Report...

I believe that the intent, broadly speaking, is that check, carry out, and report are meant to house the “default” behavior of an action, while before, instead, and after handle specific situations.

Check contains the fundamental, sanity-check rules of when an action is or isn’t allowed to proceed (e.g., you can’t take something if you already have it; you can’t take something that is fixed in place; etc.). Carry out houses any rules that change the game state when the action occurs under normal circumstances (e.g., now the noun is carried by the player). Report provides the default game response (“Taken.”).

The conceptual difference between before and instead can be a bit fuzzy, but I find it helps to bear in mind that before rules do not halt the action by default, while instead rules do. Thus, before is suited for rules that cause things to happen, but then allow the action to proceed as normal (e.g., “You do a few stretches and make sure to bend at the knees,” before attempting to take something heavy), while instead handles situations that should prevent the action from occurring (e.g., instead of taking something hot, say “Yow! That’s hot!”). Finally, after is meant to provide non-default game responses (“The grapefruit squishes slightly when you pick it up”). That’s why it comes before the report rules and normally supersedes them.

To sum up:

  • Before - situational rules that should happen before the action begins but then allow the action to continue
  • Instead - situational rules that should block an action from happening before it begins
  • Check - default rules that decide when an action is or is not possible under normal circumstances
  • Carry out - default rules that change the game state (e.g., moving things around, setting properties, etc.)
  • After - situational rules for customized game responses
  • Report - default rules for default game response

That being said, it is also definitely true that “best practice” is whatever works best for your game. Some authors like to load all of their action-blocking rules, situational or otherwise, into check, or load all of their game responses into report. Sometimes it works better for a before rule to stop the action, or for an instead rule to let the action proceed. And so forth. There is a neat sort of logic to the way the rulebooks are arranged, but that logic won’t always hold for every situation or make perfect sense to every author.

As others have mentioned, there are a couple of niche situations in which you’d want to pay closer attention to where you’re putting your rules. One is when writing extensions. The other is when you need to keep track of whether an action “succeeded” or not. Inform decides this based on (I think) whether the action got all the way through the carry out stage without being blocked. So, for example, consider these two rules:

[code]Instead of smelling the barbecue: say “Smells delicious!”

After smelling the barbecue: say “Smells delicious!”
[/code]
From the player’s perspective they do exactly the same thing. However, from Inform’s perspective, the first rule prevents the smelling action from happening, while the second rule does not. This is often a trivial distinction, but sometimes it can be significant, such as when writing conditions about the past tense (e.g., “if the player has smelled the barbecue” will return false if the instead rule is used, but true if the after rule is used.

6 Likes