[MUD-Dev] Room Searching

David Bennett ddt at discworld.imaginary.com
Tue Apr 3 16:46:31 New Zealand Standard Time 2001

On Sun, 1 Apr 2001, Jared wrote:

> 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);

If you want a general route finding solution for all npcs there are
other ways to generate this relatively efficently.  You can divide up
your graph of rooms into clusters and then store cluster connectivity.
So you generate a path of from the start cluster to the end cluster
then generate smaller intercluster paths (caching all the intercluster
paths of course).  This allows you to quite easily do a relatively
quick breadth first search through all the rooms in the mud and find a
connected route.

I am sure this is talked about in graph theory too :)

Good luck!

MUD-Dev mailing list
MUD-Dev at kanga.nu

More information about the MUD-Dev mailing list