Simple Debugger

version 1/080105 by Michael Hilborn

  • Home page
  • Beginning
  • Previous
  • Next



  • Chapter: Debugger modes - General and object mode

    What has just been described is one of three modes available in Simple Debugger. This particular mode is labeled "General Mode" because it's most useful for displaying general information. Unfortunately, this mode can get quite messy during play-testing should you liberally decorate your source code with debugging information. Usually, it's better to concentrate on one aspect--or more to the point, on one *object*--of the game. Fortunately, Inform 7 is a language about objects, and Simple Debugger permits you to debug individual objects. This is referred to as "Object Mode".

    Suppose you want to track the movements of a thief as he flits from room to room, waiting to ambush the player. Normally, the game wouldn't display any information regarding the thief until the designated ambush, but while debugging your game, it's helpful to know where the thief is at all times... especially when he doesn't ambush the player when he's supposed to.

    Here's how you might go about tracking the thief after he has successfully moved:

        Report the thief trying going a direction:
            if the thief is being debugged, say "// The thief is now in [the location of the thief]."

    Note the description, "is being debugged". When Simple Debugger is included in your source, this description applies to *any* Inform object:

        if the fiery geyser is being debugged, ...
        if the rodent of unusual size is being debugged, ...

    A player can toggle an object's debug mode by typing "debug [thing]". To debug the elusive thief, the player would type "debug thief". To turn off the thief's debugging mode, you would type "debug thief" again.

    A player can activate the debugging mode of *all* objects in your game by typing "debug things" or "debug things on". Again, this activates the debug mode of every, single object within your game, so players should use this command with caution. Players can always turn object-debugging off with "debug things off".

    One additional command, "debug everything" or "debug everything on", does exactly what its name implies: It turns on "General Mode", as well as the "Object Mode" of every object in game. This functionality is known as "Ultra Mode", for lack of a better term. To turn Ultra Mode off, type "debug everything off".

    Again, these commands are only available within debug builds. Full releases of your game will deactivate these commands.