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

Alex Oren alexo at bigfoot.com
Mon Jun 9 14:36:43 CEST 1997


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]


Have fun,
Alex.




More information about the mud-dev-archive mailing list