home *** CD-ROM | disk | FTP | other *** search
- Townmaze v1.1 -- A Program to Design "Bard's Tale I"-Style City Mazes
-
- Copyright 1991 by Kent Paul Dolan, Mountain View, CA, USA 94039-0755
-
- This program was written in response to a request in USENet newsgroup
- rec.games.programmer for "code that designs a town-shaped maze like the
- town Bard's Tale I uses"; you be the judge how well it does; I'm quite
- proud of the result. The goal is not a great "pencil and paper" maze,
- but instead a fun town for a 3D dungeon crawl game to incorporate.
- Here's a tiny (7/64 the size of the BT-I town) example output, big ones
- look better:
-
- ht 15 wd 33 gates 8 left 1 courts 4 unused 2 straight 950 seed 113181
- #################################
- ### | | # | | # | | # | # # # ###
- ##### ##### ##### ##### #-#-#-###
- # | | # | | # | # # # #
- ###-# ##### ### #####-# ### #-#
- # # # | # | | # | | # #
- #-### ####### #-####### ###-###-#
- | | ### | # ### # | # # # # #
- #-### ####### #####-### #-###-###
- # # # # # # | | #
- ###-# #-# ### ### ###
- # | | # | #
- ###-### #-#-#-#-#-#-#-#-# ###-###
- ### # | # # # # # # # # # | # ###
- #################################
-
- There are now _lots_ of command line parameters; you can choose the maze
- height in characters, the maze width in characters, number of edge
- "gate" street starting positions in the start of the maze design, the
- number of these gates that survive in the finished maze, the number of
- inner "courtyard" street starting positions in the start of the maze
- design, the number of unused cells in the interior to provide more
- complex branching in the building nets, how hard the program tries to
- make the streets run straight, and you may override the clock seed of
- the random number generator with a forced seed, to get a repeat of an
- especially nice maze that flashed by while you weren't saving the
- output.
-
- Things to try: no gates, no courtyards, lots of gates, lots of
- courtyards, straightnesses of 0, 250, 500, 750, 950, 980, 996, a few
- unused cells to make four way branch points.
-
- You can make as big a maze as your machine has memory to hold; the maze
- elements are dynamically allocated from free memory, and freed before
- the program exits. The mazes get pretty spectacular several pages long,
- and need to be at least a full screen to see much of the "town" effect
- at all.
-
- That much stuff made the command line pretty busy, so things like
- debugging are still controlled by #defines in the townmaze.h file.
-
- For reasons having to do with Lattice C use, one of the two places I
- wrote this, the makefile is that thing called "townmaze.lmk"; at least
- on my BSD 4.3 Unix system, "make -f townmaze.lmk" works. You may need
- to edit the makefile a little to work on your system.
-
- For compiling on the Amiga, make the indicated edits. Due to the short
- command line allowed by AmigaOS, the blink command must run using the
- auxiliary command input file townmaze.with.
-
- One big gotcha for porting to various systems is the name of the good
- random number generator; if you work on a system that uses the drand48
- family instead of random() and srandom(), you'll want your compiles to
- have RAND48 defined; see the townmaze.lmk file for an example of how
- that works under Lattice C.
-
- When you have the program built, "townmaze help" will get you a usage
- display. You may also want to read the townuser.doc and townpgmr.doc
- files for more information about the program for users and programmers
- respectively.
-
- File CHANGES documents the running changes from release to release, and
- file townmaze.test will do a complete test of the user interface code;
- when you see how big script townmaze.test is, you'll know why providing
- a script was a friendly gesture.
-
- Any non-commercial use of this code is permitted, in whole or in part;
- credit to the author is requested but not demanded. Commercial use may
- be arranged with the author for little or no fee. The primary reason for
- the copyright is to keep some yokel from patenting the algorithms
- contained herein and spoiling programming for the rest of us.
-
- This program is for fun; you use it at your own risk, of course.
-
- Kent, the man from xanth.
- <xanthian@Zorch.SF-Bay.ORG> <xanthian@well.sf.ca.us>
-