Glimmr Automap

version 2/101030 by Erik Temple

  • Home page
  • Beginning
  • Previous
  • Next



  • Chapter - Post-processing of map data

    [The automap post-processing rules are provided as a hook to any post-processing we may want to do of the map data. By default, we repair corner tiles here by filling in the gaps of diagonals with small tiles. If post-processing is not desired, we can compile using the no post-processing option to avoid checking the rulebook at all.]

    The automap post-processing rules are a rulebook.

    An automap post-processing rule (this is the fill diagonal corners rule):
        let scan be 0;
        repeat with N running from 1 to (map height * map width):
            increase scan by 1;
            if scan > map width:
                let scan be 1;
            if the map glyph of N is 53 or the map glyph of N is 70:
                if (scan + 1) < map width, place glyph 73 at (N + 1);
            if the map glyph of N is 36:
                if (scan - 1) > 0, place glyph 71 at (N - 1);
                if (scan + 1) < map width, place glyph 73 at (N + 1);
            if the map glyph of N is 51 or the map glyph of N is 68:
                if (scan - 1) > 0, place glyph 71 at (N - 1);
            if the map glyph of N is 52 or the map glyph of N is 69:
                if (scan + 1) < map width, place glyph 74 at (N + 1);
            if the map glyph of N is 35:
                if (scan + 1) < map width, place glyph 74 at (N + 1);
                if (scan - 1) > 0, place glyph 72 at (N - 1);
            if the map glyph of N is 50 or the map glyph of N is 67:
                if (scan - 1) > 0, place glyph 72 at (N - 1);
            if the map glyph of N is 90:
                if (N - map width) > 0, place glyph 11 at (N - map width) imperiously;
                if (scan + 1) < map width, place glyph 12 at (N + 1) imperiously;
                if (N + map width) < (map height * map width), place glyph 13 at (N + map width) imperiously;
                if (scan - 1) > 0, place glyph 14 at (N - 1) imperiously;
        #if utilizing Glimmr debugging;
        say "[>console][GLAM]Automap data post-processed to correctly render corner tiles.[<]";
        #end if.