[MUD-Dev] absolute vs. relative coords

Inq Admin inqcode at excalibur.inetsolve.com
Sat Oct 14 02:22:19 New Zealand Daylight Time 2000


KevenL wrote:

> Question for anyone doing coordinate-based stuff:  If you're keeping the 
> co-ordinates that an object exists at, are you keeping them as absolute 
> coordinates across the whole mud, or as relative coordinates within the 
> particular room/container/whatever they're in?
> 

We use a relative system on our MUD - relative to the room only, there's
no need to consider coordinates when an object is within a container or on
a person; the pointer to those objects refers to the ultimate parent
object's location - and, therefore, its coordinates.

> If absolute, how do you deal with moving - where every object inside/being 
> carried by a moving object also needs it's coord updated?
> 
As said, ours is relative but, so long as you allow the subordinate
objects (ie, keys within a pouch) to inherit the data of the parent
object, this shouldn't become a problem.

> If relative, how do you figure out what objects are within a certain area/at a 
> certain point, given some objects may be inside others and thus not be using 
> the same coord numbers?

Example of keys in a pouch:  The keys, if something needed their
coordinate information, poll the pouch for it, because the list knows that
they are within that item.  If the pouch is itself within another item,
that one is in turn polled, until such time as we have one with a real
coordinate value.

An object is never queried for its coordinate location unless it is lying
freely within a room.  If a character drops something, the object inherits
the characters x/y data.  If they pick something up, their locations must
be within a certain radius of one another, otherwise they're told they are
too far to do so.  The only time we actually use any of the data related
to coordinates is when performing object manipulations iwthin a room.  My
point being, there's no real difficulty in tracking the relative
coordinates.

Robbert					-Duty is the most sublime word in the
Programmer, The Inquisition MUD		-English language.  One can never do
www.theinquisition.net			-more than their duty, and one should
telnet://theinquisition.net 5000	-never wish to do less.



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



More information about the MUD-Dev mailing list