[Home] [Groups] - Message: [Prev in Group] [Next in Group]

nu.kanga.list.mud-dev

18015: Re: [MUD-Dev] Room Searching - how about doors?

[Full Header] [Plain Text]
From: Gavin Doughtie <gavin@idealab.com>
Newsgroups: nu.kanga.list.mud-dev
Date: Thu, 05 Apr 2001 09:28:33 -0700
References: [1] [2] <-newest
Organization: Kanga.Nu
> MANY FINE COMMENTS ABOUT GRAPH TRAVERSALS OMITTED

Just a quick diversion -- consider the concept of a "door". This may
not fit with your codebase, but I would consider an intermediate door
object that functions much like a many-many join record in a
relational database.  Each door would hold references to two rooms,
and metadata about the relationship between them (i.e., it's locked on
the room A side, but the key is in the lock on the room B side). Each
room object holds a collection of doors.

Re-reading the original post it appears that this approach would
require a one-time traversal of the world graph to update the rooms
database to contain the doors. Your movement functions would then need
to contain logic that says "if there is a door I can go through in the
direction I want to go in, then set my new room to the object
referenced by the door"

You get some interesting extensibility via subclassing the door object
-- you can make them invisible, transparent to sounds from the
adjacent room, permeable only to members of certain classes, etc.

Gavin

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