Here's a not so brief explanation on how to use cartograph.
First:
Draw your map. How do you do this? Well, really it's simple.
Go into your favorite text editor and start placing rooms by
typing an asterisk ("*") for each one. To connect rooms, draw
dashes ("-", "|") between the rooms you want to connect. A
sample map might look like:
*---*---------------------------*-----*
| | |
* | |
| *----------* *-----*
| |
*--------------*
Second:
Compile cartograph for your system. On most Unix systems you
accomplish this by typing:
make
Third:
Run the program. You will be prompted for the name of the
map file you hav created (we'll call ours "sample"), the
virtual number of the first room, and a value for roomflags
that you want set on every room on the map. After answering
these questions, you will see a bunch of lines that look like:
#: 0 X: 11 Y: 3 N: -1 E: 1 S: 3 W: -1 U: -1 D: -1
The first number (0) is the virtual number of the room. The X and Y
values are the coordinates of that room in your map file. Then for
each direction (N,E,S,W,U,D) the virtual number of the room in that
direction is printed. -1 means there is no exit in that direction.
The ".wld" extension is added to your input file name and all the
Diku world data is put into a file with this name (for our example
the name of the file would be "sample.wld"). All room names are set
to "Room #<Room Number>" and all descriptions are set to "This
description is yet unfinished..." No door names or directional
descriptions are added.
(Details on creating up/down passages, "curved" passages,
customized rooms, and inserting doors can be found further down
in this file)
Fourth:
Edit the new .wld file putting in room descriptions, extra
descriptions, and direction descriptions. You will also need
to change the room flags if there are any rooms that need more
or less than you specified, and the sector types.
More complicated Stuff:
*** Cartograph is case sensitive! v does not equal V ***
The following sector types have been defined:
I = Inside H = Hills
C = City M = Mountains
F = Field U = Underwater (Swimable)
T = Trees (Forest) B = Water (Not Swimable)
By using one of the above letters rather than an asterisk,
cartograph will determine which sector type to put onto the room.
Rooms of terrain Inside, are also automatically give the INDOORS
room flag.
One way passages can be defined using the following arrows:
^ = One-way north v = One-way south
> = One-way east < = One-way west
The arrow can appear at any point in a string of dashes.
(i.e. "*---->---*" works, as does "*-->*", or even "*>*")
In a similar fashion, up/down passages can be created by using
the two slashes ("/", "\") in the middle of the path. Using a
Here are some examples:
Up -> Down ->
*----/----* *----\----*
<- Down <- Up
* *
| |
| D | ^
^ | o U | |
| | w p |
/ n \ D
U | | | o
p | | v | w
| v | n
| |
* *
"Curved" passages can be defined using the following numbers:
1 = North/East 3 = North/West
3 = South/East 5 = South/West
This means that you can make maps that look like:
3-----*-----5
| | |
*-----*-----*
| | |
1-----*-----3
If you find that you have passages that "cross" but do not
intersect, you can use a "+" to represent this. For example:
*----*
| |
*----+----*
| |
*----*
Defining new rooms, doors, or paths:
Cartograph v3.0+ allows you to define letters to represent rooms,
doors, or paths. The default rooms and passages are all defined
in cartograph.arc.
To add a new room type, you need to add a line to the top of
your map file. The format for a new room is:
#ROOM Z 127 1 Room name; Comment
This line defines a new room represented by "Z" on the map.
The 127 is the roomflag value for "Z" rooms, and the 1
is the sector type. The words "Room name" will be used as
the name of each "Z" room. You may choose not to include
a room name, in which case, the default name of "Room #"
followed by the room number will be used. The semicolor (";")
designates that the rest of the line is a comment and shoul
be ignored.
To add a new door, you also need to add a line to your map
file. This line should look like:
#DOOR Z 1 3000 name1 name2 name3 ... ; Comment
This line defines a door represented by "Z" with door flags
set to 1 and a key type of 3000. The rest of the line (from
after the 3000 to before the semi-colon comment) is assigned
to the name of the door. To place a door on the map, just
place it on the path between two rooms, i.e.:
*------Z-------*
To add a new path, you need to add a line that looks like:
#PATH Z A-@ R-# B-$ L-% ; Comment
This defines a path represented by "Z". The four pairs of
characters after the Z represent from-to definitions for
the path. A,R,B, and L are abbreviations for Above, Right,
Below, and Left (respectively) and designate the direction
on the map that the person is coming from. The characters
after the dash ("-") represent what happens when a person
leaves this part of the path. For example, the following
declaration (taken from cartograph.arc) shows how to
create and North/South path)
#PATH | A-B B-A
This statement defines a path represented by "|". When a person
gets to this space from the square above, they go to the square
below. When a person gets to this space from the square below,
they go to the square above. Notice that the L and R pairs
were omitted. Whenever a pair is left out, it defaults to a
dead-end path (meaning that if you came from the left or right,
the path would lead nowhere, and would not be considered an exit)
Since this is really confusing, here's another example from
cartograph.arc:
#PATH @ A-A R-R B-B L-L
Notice that no matter where the person comes from, they are
being sent back in the direction in which they came. This is an
example of a circular path, one which leads to the room that
you start in. If your map had the following:
*---@
you would have a room, whose east exit would lead back to itself.
You can also define paths that change the direction to up or
down by including a U or D in the destination string. Here's
a standard token from cartograph.arc:
#PATH / A-DB R-DL B-UA L-UR
This path makes the direction up when entered from below or the
left, and down when entered from above or the right.
To make it easier to define strange and unusual paths, there
is a "skip" field that can be added to the destination string.
In cartograph.arc, the following definition exists:
#PATH = R-SL L-SR
This path is a regular east-west passage, but it skips the next
character. Here's a way this could be useful:
*--------/=---------*
In the picture above, the path from left to right becomes an
up exit because of the slash ("/"). But when going from right
to left, the slash gets skipped, so it remains a west passage.
You could even do some other strange things like:
*-------=*----------*
For more examples of doors, paths, and room types, check out
the examples in cartograph.arc and the ones used in the
"sample" file included in this distribution.
Cartograph v3.10 was written by Jeff Fink.
Comments? Questions? Complaints?
Mail them to jfink@acm.vt.edu and I'll try to answer them...