Intelligent Hinting

version 5 by Aaron Reed

  • Home page
  • Beginning
  • Previous
  • Next

  • Example: * Cloak Of Darkness - The standard IF example game, with Intelligent Hinting support added.

    Cloak Of Darkness is a very simple game that has long been used to demonstrate functionality in various IF languages. This is a somewhat streamlined version with comments and extraneous features removed; it is otherwise the same as the standard Inform 7 version, except for the final section.

        "Cloak Of Darkness"

        Foyer of the Opera House is a room. "You are standing in a spacious hall, splendidly decorated in red and gold, with glittering chandeliers overhead. The entrance from the street is to the north, and there are doorways south and west." Instead of going north in the Foyer, say "You've only just arrived, and besides, the weather outside seems to be getting worse."

        The Cloakroom is west of the Foyer. "The walls of this small room were clearly once lined with hooks, though now only one remains. The exit is a door to the east." In the Cloakroom is a supporter called the small brass hook. The hook is scenery. Understand "peg" as the hook. The description of the hook is "It's just a small brass hook, [if something is on the hook]with [a list of things on the hook]hanging on it[otherwise]screwed to the wall[end if]." Understand "hang [something preferably held] on [something]" as putting it on.

        The Bar is south of the Foyer. The printed name of the bar is "Foyer Bar". The Bar is dark. "The bar, much rougher than you'd have guessed after the opulence of the foyer to the north, is completely empty. There seems to be some sort of message scrawled in the sawdust on the floor."

        The scrawled message is scenery in the Bar. Understand "floor" or "sawdust" as the message. Neatness is a kind of value. The neatnesses are neat, scuffed, and trampled. The message has a neatness. The message is neat.

        Instead of examining the message: say "The message, neatly marked in the sawdust, reads..."; end the game in victory. Instead of examining the trampled message: say "The message has been carelessly trampled, making it difficult to read. You can just distinguish the words..."; end the game saying "You have lost".

        Instead of doing something other than going or solving in the bar when in darkness: if the message is not trampled, change the neatness of the message to the neatness after the neatness of the message; say "In the dark? You could easily disturb something." Instead of going nowhere from the bar when in darkness: now the message is trampled; say "Blundering around in the dark isn't a good idea!"

        The player wears a velvet cloak. The cloak can be hung or unhung. Understand "dark" or "black" or "satin" as the cloak. The description of the cloak is "A handsome cloak, of velvet trimmed with satin, and slightly splattered with raindrops. Its blackness is so deep that it almost seems to suck light from the room." Instead of dropping or putting the cloak on when the player is not in the cloakroom: say "This isn't the best place to leave a smart cloak lying around."

        Carry out taking the cloak: now the bar is dark. Carry out putting the unhung cloak on something in the cloakroom: now the cloak is hung. Carry out putting the cloak on something in the cloakroom: now the bar is lit. Carry out dropping the cloak in the cloakroom: now the bar is lit.

        When play begins: say "[paragraph break]Hurrying through the rainswept November night, you're glad to see the bright lights of the Opera House. It's surprising that there aren't more people about but, hey, what do you expect in a cheap demo game...?"

        [Now for the puzzle definitions.]

         Section - Hints

        Include Intelligent Hinting by Aaron Reed.

        Winning-The-Game requires Noticing-The-Dark-Room, Hanging-The-Cloak, and Reading-The-Message.

        Noticing-The-Dark-Room is a task with venue The Bar. Definition: Noticing-The-Dark-Room is complete if the player has been in the bar.

        [Strictly speaking, Noticing-The-Dark-Room is not necessary to winning; it's more of a clue. It takes a bit more work, but it's a good idea to incorporate the discovery of clues into your puzzle structure, both to more thoroughly test your game and to help players using "suggest" to see the logic of the puzzles.]

        Hanging-The-Cloak is a reversible task. The venue is Cloakroom. Requirements for Hanging-The-Cloak: do the action of putting the cloak on the hook. Definition: Hanging-The-Cloak is complete if cloak is hung.

        Reading-The-Message is a task. The venue is The Bar. Requirements for Reading-The-Message: do the action of examining the scrawled message.

        Test me with "solve / solve / solve / solve / solve / solve / solve".

    Seven moves and Cloak of Darkness neatly solves itself. Not much of a feat, but hey, what do you expect from a cheap extension example?