[MUD-Dev] Room-based vs. coordinate-based

Shawn Halpenny malachai at iname.com
Mon Jun 9 12:36:28 CEST 1997


Alex Oren wrote:
> 
> Shawn wrote:
> 
> } > How will I handle "Boffo arrives from the north" type of messages?
> } >
> } > Room-based (or, rather, "container-based") has an advantage here.  A
> } > container may send messages to the objects it contains.  In a
> } > coordinate-based system I will need to consult a "map" of object
> } > locations to determine message recipients.  Or am I wrong?
> }
> } Well, I have a mapping of locations to objects as well as each objects
> } existing in a container (i.e.  the room it's in).  To make Boffo
> } arrive from the north, I (roughly):
> }     - set Boffo's coordinates to the new location
> }     - check the location->object mapping to see if there is a real room at
> }       that location
> }         - if so, add Boffo to that container and generate a message for its
> }           contents
> }         - if not (the room is deterministically generated, so there is no
> }           room container), from the mapping grab all objects at Boffo's
> }           new location and tell them of Boffo's arrival.
> 
> The desert of desolation stretches from (500,200) to (900,500).
> Bubba is in the desert (620,342).
> Boffo is in the desert (621,343).
> Wesley is in the desert (888,472).
> Humperdink arrives (from the north, obviously), his position is now
>   (621,342).
> 
> If the (huge) desert is defined as one room, who gets the message? Why?
> If there was no explicitly defined room, who gets the message? Why?
> 
> [The expected answer is: Bubba and Boffo]

If object A is in the same room as object B, they occupy the same
location in 3-space (my room granularity is purposefully low), so the
huge desert as one room is impossible with the requirements you
stated.  Given that, I should have elaborated that when grabbing all
objects at Boffo's new location, objects in the surrounding vicinity
are grabbed as well.  The surrounding vicinity is defined to some
arbitrarily small number of units.  Any observers within the square
bounding the vicinity (only Bubba--see below) will see something
indicating Humperdink's arrival in the appropriate direction (they
may or may not be able to determine whether it is "Humperdink" or
"Someone" who has arrived, depending on their respective vision or
being indoors).  The only time one sees the "X has arrived" message
is if X now occupies the same space as the observer (because of the
low granularity).

So, Boffo will see the "Humperdink leaves south" message.  If Boffo
looks around again, he will see something like "You see Humperdink to
the south".  Boffo will not automatically receive a message
indicating that Humperdink is now to the south since Humperdink was
leaving Boffo's location and the repetition would seem ridiculous. 
Bubba (since he was not at the location Humperdink had left) will get
an automatic message saying that Humperdink has moved to his east
(though probably not a message with "arrive" in it, since that seems
to imply that the objects are in the same room).

--
Shawn Halpenny

"You only need two things in life:
    WD-40 to make things go and duct tape to make them stop."
                                                - Unknown



More information about the mud-dev-archive mailing list