[MUD-Dev] Room Searching

Jared jared81 at jps.net
Sun Apr 1 09:25:15 CEST 2001


Hello everyone.

I'm new to the list as of about nine minutes ago, and I joined because
I have a question to which I have only one answer but would like to
have as many answers as is conveniently possible.

I'm the head coder on a mud called Cursed Lands (mudbox.net 6969)
which is a heavily modified GodWars codebase (originally based upon
Merc, for those unfamiliar with GW) and I've recently run into a small
dilemma. Before the dilemma, we have some background information. The
world of CL is in a state of incredible disrepair right now, and I
have no real way of knowing what is and isn't a work in progress,
etc. The immortal communication scheme before my arrival was
nonexistant, but as of the past few months, they've gone through some
changes and I want to push those changes further.

The dilemma is that I don't know how to find if "room B" can be walked
to from "room A". That is to say, if a room cannot be walked to in the
game, and it isn't a clan or guild headquarters, then it's illegal to
be in. I need some function like:

  bool can_walk (ROOM *origin, ROOM *destination);

Which would return true if 'destination' can be walked to from
'origin'. The rooms all have the four cardinal directions in addition
to up and down as their exits, and the only solution I've found thus
far is to treat the situation like searching a tree with at most six
branches, over the course of 8000 rooms.

However, this solution of mine seems computationally expensive and if
I'm running through this traversal for each room, that's an 8000 node
tree traversed 8000 times- which makes me think I'm going to bring the
server to its' knees. I don't have any real idea of how hardcore this
is gonna be, but I'd like some input on it before I try using the
tree-approach.

Thanks.
-Jared



_______________________________________________
MUD-Dev mailing list
MUD-Dev at kanga.nu
https://www.kanga.nu/lists/listinfo/mud-dev



More information about the mud-dev-archive mailing list