home *** CD-ROM | disk | FTP | other *** search
/ Source Code 1992 March / Source_Code_CD-ROM_Walnut_Creek_March_1992.iso / usenet / altsrcs / 3 / 3203 / townuser.doc < prev   
Encoding:
Text File  |  1991-04-18  |  8.2 KB  |  176 lines

  1. Welcome, as it were, to townmaze.
  2.  
  3. Just typing "townmaze" at the command line will do an example maze for
  4. you, once the program has been compiled and installed (see README).
  5.  
  6. Typing "townmaze help" at the command line will get you a "usage"
  7. display about 22 lines high, describing each of the parameters and
  8. their limits.
  9.  
  10. You might want to try both of these before reading the rest of this
  11. document.
  12.  
  13. What you see in a townmaze:
  14.  
  15. It should be obvious, but the symbols in the townmaze output are "#"
  16. for walls or solid rock, "-" or "|" for horizontal or vertical doors,
  17. and " " (blank), for streets and room interiors.
  18.  
  19. This program is not, in essence, a game, but instead a tool to use in
  20. making games.  What it does is to lay out a city after the fashion of
  21. the top level of Bard's Tale I.  You can then use this city layout in
  22. either a paper and pencil dungeon crawling game, or as part the design
  23. of a 3D computer dungeon crawling game. You can even (see
  24. townpgmr.doc) install this code into such a game to create city maze
  25. layouts on demand. 
  26.  
  27. Townmaze has a rich variety of parameters, to let you vary your city
  28. in size, shape, building density, and complexity.  The parameters are
  29. entered at the command line in standard Unix fashion, as "dash, flag
  30. letter, space, value" sets, like
  31.  
  32.     townmaze -h 23 -w 77 -g 4 -l 2 -c 0 -u 0 -s 750 -r 123456789
  33.  
  34. Except for the "r" parameter, the values shown are the defaults, and
  35. if the parameter and its value are omitted from the command line, the
  36. above defaults are used.  The exception "r", the random number seed,
  37. is read off the system clock unless it is overridden by a command line
  38. parameter. 
  39.  
  40. Here is what the parameters mean.
  41.  
  42.  
  43.  P A R A M E T E R S
  44.  
  45.  -h mazeheight         -- vertical size of the maze, in characters
  46.  
  47.  -w mazewidth          -- horizontal size of the maze, in characters
  48.  
  49.  -g mazegates          -- number of streets to start at the city wall
  50.  
  51.  -l leftgates          -- number of the gates to leave doors leading
  52.                           outside from the city (the rest are turned
  53.                           back into city wall)
  54.  
  55.  -c mazecourts         -- number of streets to start away from the city
  56.                           wall in the city interior
  57.  
  58.  -u mazeunused         -- number of cells to leave unused (solid rock)
  59.                           in the maze; these cells will be inaccessible
  60.  
  61.  -s mazestraightness   -- times per thousand to retry on average before
  62.                           accepting a random cell that makes a street
  63.                           turn rather than go straight
  64.  
  65.  -r randomseed         -- use to get the same maze again; replaces clock
  66.                           seed; seed used is reported in the header for use
  67.                           in a repeat run.
  68.  
  69. The maze is normally written to the screen (more exactly, to "standard
  70. output"), and benefits a lot from screens that can show more than 25
  71. lines and more than 80 characters; the more room townmaze has to work,
  72. the better job it can do.  The maze is sized in characters, but it
  73. really exists in cells, it takes several characters to draw a single
  74. cell.  In the Bard's Tale I game, the main level was 32 by 32 cells.
  75. In townmaze, that is a maze 65 by 65 characters, since it takes two
  76. rows of characters to make each cell, plus one extra row for the last
  77. wall, each way. 
  78.  
  79. Thus, a really effective way to use townmaze is to capture and print
  80. its output on paper, to get bigger, more interesting mazes.
  81.  
  82. Townmaze will make a maze as big as your computer will provide the
  83. memory needed for storing the maze and a corresponding list of cells,
  84. and should fail gracefully if you ask for a maze bigger than your
  85. computer can hold.
  86.  
  87. As mentioned, townmaze has a rich variety of parameters, and the best
  88. way to understand what they do is to try them; they interact with one
  89. another, so that there is no simple description of what results in the
  90. maze as you vary each one, but here's an approximation. 
  91.  
  92. The -h and -w parameters just make the maze bigger; that's easy enough.
  93.  
  94. Townmaze works by building a maze that is solid room cells with no
  95. doors, then changing a few room cells to street cells, then knocking
  96. out more room cells to make street cells until all the streets are
  97. connected and all the room cells have a door. Room cells get a door
  98. when they are adjacent to at least one street cell.
  99.  
  100. The -g parameter tells how many of the starting street cells will be
  101. on the border of the maze, next to the city wall.  To start with, each
  102. of these cells is given a door which is a gate through the city wall.
  103. Lots of these "gate" cells help break up the street that otherwise runs
  104. all around the perimeter of the city to provide doors to the border
  105. cells.
  106.  
  107. When the straightness parameter is very strict, rows of room cells
  108. often run from each side of a gate toward the middle of town, like the
  109. ones in Bard's Tale I did.  There need not be any gate cells at all,
  110. in which case your town will have a street that runs all around the
  111. outside.  Presumably then you would put the biggest treasures and
  112. nastiest monsters in the middle of town, unlike Bard's tale, which put
  113. them near the corners.
  114.  
  115. The -l parameter tells how many of the gates will survive; the rest get
  116. turned back into city wall.  This lets you enjoy the complex border of
  117. a city with lots of gate cells, without having lots of, or even any,
  118. real gates leaving town.
  119.  
  120. A town maze must start with at least one street somewhere, so the -c
  121. ("courtyard") parameter lets you start streets in the interior of the
  122. town, instead of the border.  Interesting things happen if you do 1
  123. courtyard and no gates, and also if you do maximums of courtyards and
  124. gates, and all other combinations.  In general, lots of courtyards
  125. makes for a less dense, more "gangly" city structure with lots of
  126. cul de sacs.
  127.  
  128. Townmaze with just those parameters tends to create long runs of rooms
  129. snaking about the town.  To give more elaborate structures, and still
  130. have all rooms accessible, it is necessary to leave some cells unused.
  131. The -u ("unused") parameter tells how many unused cells to allow.  The
  132. limit is low, because the rule is that a street cannot be adjacent to
  133. an unused cell, which means unused cells make it hard to connect all
  134. the streets together.  By forcing at least three cells between unused
  135. cells, this connectivity is assured, but doing this means only about
  136. 2% of the interior cells can be unused cells.  Unused cells tend to
  137. allow room structures with three or four "arms", rather than just
  138. linear snaking structures, and give the town a more interesting
  139. appearance.
  140.  
  141. The most important parameter affecting the appearance of the towns
  142. designed by townmaze is -s, the straightness parameter.  It can take
  143. values from 0 (don't worry about straightness) to 998 (try as hard
  144. as possible to make streets run straight).  Townmaze implements this
  145. straightness by repeatedly trying a random room to see if it will let
  146. a street run straight, so straightness has a profound effect on the
  147. time it takes townmaze to design a town.  A set of parameters that
  148. allows a town to be drawn in a few seconds with a straightness of 0,
  149. will take about the same number of minutes with a straightness of 996,
  150. for example.
  151.  
  152. Nonetheless, the city streets wander around a lot, and knock out lots
  153. of extra rooms, leading to sparse looking towns, until the highest
  154. levels of straightness are used.  This isn't all bad, as the empty
  155. space is like some of the big open courtyards in Bard's Tale I; you
  156. can play with this parameter until you get the appearance you like.
  157.  
  158. The -r parameter allows you to generate the same town maze repeatedly.
  159.  
  160. If the townmaze program is installed with the HEADER definition turned
  161. on, then above the maze output you will see a line showing the
  162. parameters for this run, including "seed", typically eight or nine
  163. digits.  If you feed this seed value back in as the value of the -r
  164. parameter, you will get the identical maze again.  Even without the
  165. HEADER turned on, you can enter your own choices of seed until you
  166. find the town maze that suits your needs, then run townmaze again with
  167. the same parameters to save the maze to a file, to print it, or, if
  168. you install the software in a computer game, to be able to use a level
  169. over and over without having to store its design explicitly in the
  170. game. 
  171.  
  172. I hope you have fun with my toy.
  173.  
  174. Copyright 1991, Kent Paul Dolan,
  175. PO Box 390755, Mountain View, CA, USA, 94039-0755
  176.