MOO-cows Mailing List Archive

[Prev][Next][Index][Thread]

Re: really stupid newbie question



Bolie Williams, IV wrote to me on March 1:
> >A more general system of handling @go would be to use a room database.
[snip]
> The big problem with this, which I noticed on BayMOO, is that you have
> to have a unique name for your room.  This is great for players, but
> it can be a pain if you want to make a beach and every variation on
> beach has already been taken.  So for a while, I lived in 'not a beach.'
> You could also run into problems if you want to have hallways and the
> like...

The solution I use on my MOO is to search every time you want to go
somewhere.  I use walking on my MOO instead of teleportation, so I
need to search to find a path anyway, even if I used a room database.

I perform a breadth-first search starting from the player's room, and
I stop whenever I find a room that has an alias matches the room name
desired.  This way, if there are several beaches, you walk to the
_closest_ beach.

I think this makes a lot of sense to the player.  If you're in
Houston, you probably want to walk (!) to the Galveston beach, not to
the Santa Cruz beach.  If there are several Galveston 'beach' rooms,
you just walk the closest one instead of getting an "Ambiguous Room
Name" error.

The main problem with searching, of course, is that it doesn't work
well on a large MOO.  One solution could be to use 'regions' of rooms;
you could make a region object keep track of all aliases of all rooms
within the region.  You only have to search regions to find out which
one has a beach.  Then you look through only those regions (instead of
through ALL rooms) to find the closest beach.  You could also cache
paths between common rooms, so that you search only for less-used rooms.



	- Amit


-- 
Amit J Patel, Computer Science Department, Stanford University
ex-Rice-University student



References:

Home | Subject Index | Thread Index