Projecting MUD maps

Hakusa at Hakusa at
Mon Nov 6 01:25:50 CET 2006

BJörn Lindqvist wrote:
> Hello, I'm looking for an algorithm to project "MUD maps" such as the
> following map:
> MUD:s consists of rooms, each rooms has up to four orthogonal edges
> (north, east, west and south) that connects it to another room. So it
> is very easy to model a MUD as a directed graph. But projecting the
> graph on a surface is very complicated. For example, Room A:s North
> edge may connect it to Room B. But Room B:s South edge may connect it
> to Room C. Or another tricky example: Room A:s East edge connects it
> to Room B, whose East edge connect it to Room C, whose North edge
> connects it to Room D, whose West edge connects it to Room E, whose
> South edge connects it to Room A. In that example, there would be a
> "hole" between Room D and E.
> --
> mvh Björn

I'm working on a text adventure where if the player types in n, w, e or
s he/she gets something back like "You go north, then turn around, then
look left, right . . . finally you realize that you have no idea in
which direction North is." It makes mapping more tedious, but also
simplifies it and gives you more freedom.

Or you could do something like this.

>>> rooms = [class instance, class instance, 0 (because there's no room here),
. . . . . . . . . . .0,                  , class instance]

But that would still only get you the mapping and not the
implimentation, and it's untested by me because I chose not to do it.

And for my closing remark:
You know the game Zork? The people who made that game never made a grid
or anything. I'd bet that in the class, they had a variable for NW, N,
NE, E, SE, S, SW and W, and they probably even had a U and D for
defining what rooms would be in those directions..

More information about the Python-list mailing list