[MUD-Dev] Re: AFAP: As fast as possible, non linear...

quzah quzah
Tue Dec 15 04:34:17 CET 1998


From: Jon Leonard <jleonard at divcom.slimy.com>
Date: Monday, December 14, 1998 9:47 PM
Subject: [MUD-Dev] Re: AFAP: As fast as possible, non linear...


>As has been pointed out, this is the sort of thing to check the web
>for.  There's not a lot of point writing a maze generator unless you
>want the experience of having writtten one.


Nod. That's the whole purpose. Just for something to do. I started a
small search before I made mine, but quit searching when I saw the
majority of the same links referencing the same algorithm -- one that
was supposed to take over an hour to complete the process (in pascal).

I figured I couldn't possibly do any worse than an hours time, so I
stopped looking and decided to write my own. I don't find to many
things in life "fun", however writing bits of code is one of the few
things I enjoy; which is the whole reason for making the maze.


I use an array 10x10 chars for each plane, 10 plains in all. Each
plane has one exit to the next floor, with the exit on the bottom
floor leading "out". Of each char, bits 0-5 are for direction, and
of the remaining two, I currently only use one.

I only do a plain at a time, path starting location is random. Also
stored in the maze structure is entrance[?], a definable number of
entrance points to the maze. Of which, one will be selected at rand
to place player there. I use a short int for this, and smash the
coords together. ( num/100 = z coord, num/10 = y coord, num%10 = x)

The structure also contains abc[?][10] chars for my 7th bit. :) Just
a little something to make the maze harder. (As if 1000 rooms wasn't
bad enough.)

I don't actually even use "rooms" per say. The idea is to make a
maze, store it in memory globally, then have ways for the player
to stumble into it. Doesn't move the player at all, it just fakes
it. When it's done, I'll give away the snippet under some hokey
title like "maze of the mind" or something. (The reason I call it
that, is because the character doesn't actually ever move. The
idea behind the maze is to just use the room the player is in,
more than one player will (can) "be in" the same maze, each will
still just stay in their own room.) I plan on just adding an item
type "ITEM_MAZE". Drop the sucker in a room, and whoever looks at
it is taken away into the maze. :) I have yet to finalize the
room description. I may just store it with the maze. That, or I
will just use the long description of the item that they went
through to "get in" the maze. Thus, the view of the maze will
be different (possibly) for each person entering. Furthering the
"maze of the mind" aspect. 

When the maze is solved, everyone still stays in it, except the
person that found their way out, but the maze is re-randomized.
I'm thinking of using the value[x] things for the item to hold
the possible reward for getting out. Shrug.

Anyway, when it's done, if anyone is interested, I'll post a
link. Thanks for the comments everyone.

Quzah.





More information about the mud-dev-archive mailing list