Automap

version 4 by Mark Tilford

  • Home page
  • Beginning
  • Next



  • Documentation


    Automap will watch what rooms the player has visited and create a Beyond Zork style automap.

    Kinds: Mappable Room. All rooms which are to show on the map must be of this kind.

    By default, rooms will be placed one unit away in the appropriate direction. If the path should be longer, you can manually set the distance.

    It is the responsibility of the author to make the map has a consistent geography and that no two rooms overlap.

    Activities:

    - The "Automap work" is activity is being handled while the program is attempting to explore a room or draw the map (that is, the times when it might perform the "which room is (direction) from (room)" decision). It is provided if you need to have anything work differently during such a test.

    Use options:

    - Use automap manual display: The program will not display the map to the status line on its own.

    - Use automap manual exploration: The program will not add rooms to the map unless you explicitly run the "(room) is explored" decision.

    - Use automap hide paths through closed doors: The program will not add paths that go through closed doors.

    - Use automap static allocation: Causes a glulx game to allocate memory for the automap at compile time. Reduces flexibility, but allows the game to run on more interpreters. (Automatically set when compiling to zcode.)

    - Use automap reserved area of at least N: Sets the amount of memory the game will use for drawing the map. Must be at least (map rows)*(map columns). This option is ignored when compiling to glulx, unless the "use automap static allocation" option is set.

    - Use automap visible background: Spaces that would ordinarily be blank will be shown as periods. Meant for experimenting with the size of the map while testing and is not meant for release.


    New source code syntax:

        decision: "(mappable room) is placed (number) and (number) from (mappable room)":
    If the player has visited both rooms, it will attempt to arrange the map so that they will appear in the given relative positions.
    Returns yes unless doing so creates an inconsistency.
    It will not be necessary to use this decision in your own code unless you want to have rooms that would not ordinarily be on the same map region together. (For example, if a closet is connected to the main room by in / out, this would put it on the map with the rest of the rooms.)

        decision: "(room) is explored":
    Attempts to connect (room) with any adjacent rooms. It probably will not be necessary to use this unless you want to add rooms the player hasn't visited, or you are using the manual exploration option.
    Returns no if doing so creates any inconsistencies, and yes otherwise.

        phrase: "explore (room)" / "remap (room)":
    Attempt to add the room to the automap. Prints an error if there are any problems. Again, it probably will not be necessary to use this unless you want to add rooms the player hasn't visited, or you are using the manual exploration option.

        phrase: "unmap (mappable room)":
    Removes the room from the automap. Will be needed if you want to change its position relative to other rooms.

        phrase: "fill status bar with (selected table - a table-name) and map":
    Will print the calculated automap. Should only be necessary if you are using the manual display option.

        phrase: "reserve automap memory of (number) rows by (number) cols":
    Sets the size of the displayed map. Must be called for any map to display. May be changed at any time. (Maps will center better if the height and width are 1 more than a multiple of 4: 1, 5, 9, 13, 17, ...)

        phrase: "reserve automap memory of (number) rows":
    Sets the size of displayed map. Width is the current width of the status line. If using static allocation, and this would require more memory than is allocated, width is trimmed to what will fit. (Maps will center better if the height and width are 1 more than a multiple of 4: 1, 5, 9, 13, 17, ...)


    New in-game commands:

    - "zoom in": Shows the map so that rooms have 3x3 grids.

    - "zoom out": Shows the map so that rooms have 1x1 grids. (the default)

    - "zoom away": Removes the map entirely.

    - "zoom": Rotates through the various zoom modes.

    To set the zoom manually, change the current zoom variable to map zoomed in, map zoomed out, or map absent.


    - "map automatic": Try to use the font 3 characters. If the interpreter does not support them, convert down to ASCII characters.

    - "map fancy": Force using the font 3 characters, whether the interpreter supports them or not.

    - "map plain": Convert down to ASCII characters. Don't even try to use font 3. (the default)

    If the game is run on a buggy interpreter, using the command "gargoyle bug workaround" should prevent problems.

    - "map view" (not for release): shows information


    Thanks to Jesse McGrew and Mike Talbert for help with overriding decisions.
    Thanks to Cristoph Ender and Andrew Plotkin for help with Unicode.
    Thanks to Andrew Plotkin and Jesse McGrew for help with joining I6 and I7.
    Thanks to S. John Ross for testing and feedback.
    Thanks to Aaron Reed for feedback and a minimal example.
    Lots and lots of thanks to Peter Pears for heavy testing and feedback.
    Erik Temple prepared version 4 for submission to the extensions library.