Lines of Communication

version 1 by Aaron Reed

  • Home page
  • Beginning
  • Previous
  • Next

  • Example: * Background Hint Processing - Hint processing in the background while the player continues.

    Here, we use a background file channel to work on recommending a course of action while the player keeps playing. We send information to the hint system about important game state changes-- new locations discovered and acquired objects. Then, when the player requests a hint, we turn on the hint system and let it chug until it comes up with a recommendation.

    To simulate this, try moving around a little and observing how "hintOutput.glkdata" updates. Then type BACKUP to request a hint, make a few more moves, and put something like "recommend get the knife" in "hintInput.glkdata". Make another move in the story and observe the result.

        "Background Hint Processing"

        Include Lines of Communication by Aaron Reed.

        The File of hint-input is called "hintInput". The File of hint-output is called "hintOutput".

        The hint system is a background file channel. The input file is File of hint-input. The output file is File of hint-output.

        After taking something:
            inform hint system that "take [noun]";
            continue the action.
        Before going to an unvisited room (called the new place):
            inform hint system that "go [new place]";
            continue the action.
        Understand "backup" as requesting a hint. Requesting a hint is an action applying to nothing.

        Carry out requesting a hint:
            say "You pull out your walkie-talkie and radio base. 'Captain, I could really use some advice here,' you say.[paragraph break]'Roger that,' the Captain says, 'I'll analyze your situation and get back to you.'";
            inform hint system that "hintrequest";
            now hint system is switched on.

        Understand "recommend [text]" as recommending. Recommending is an action applying to one topic. Recommending is restricted to file channels.

        Carry out recommending:
            say "Your radio crackles. 'Echo niner, captain here,' it says. 'Recommend you [the topic understood]. Repeat, [the topic understood].'[paragraph break]'Roger wilco,' you say.";
            now hint system is switched off.

        Intersection is a room. It is south of Bedroom, east of Dining Room, west of Foyer, and north of Kitchen. An apple and a knife are in Kitchen. A bed is fixed in place in Bedroom. A coat and a hat are in Foyer.