[MUD-Dev] Re: mobile movement
adam at angel.com
Wed Jan 6 15:12:27 New Zealand Daylight Time 1999
On Wed, 6 Jan 1999, Matthew Mihaly wrote:
> 1) Doing some sort of real-time search (BFS or DFS maybe?) everytime
> movement was to take place, to find the best room to move to from the
> current one. Advantages of this, to my mind, are that it allows for the
> most intelligent movement. The disadvantage of course is that this is darn
> slow (how slow, I don't know. I code on Achaea, but I would not really
> consider myself much of a coder. Maybe one of you could enlighten me as to
> just how slow such a routine is likely to be, given that we could limit
> how many rooms away to search, etc).
This is exactly the method that has been used in CircleMUD (and probably
others of that family) for some years now. Back when I was working with it
there were several hundred creatures on the mud who tracked players every
mobile_pulse (five seconds, I think). For example, there were nine nazgul
(ringwraiths) who tracked whichever players had any of the Rings of Power.
It caused no noticable slowdown on whatever ancient Sun machine was running
the thing at the time. If that thing was able to keep up with a few hundred
long-range BFS's like that, I imagine a nice modern processor running at 200+
mhz could manage tens of thousands without noticable difficulty.
Although I've never seen the code to it, I know that Arctic makes heavy
use of tracking mobiles; almost any mobile will track you if you attack it
and flee, but many zones have large numbers of creatures that track you
as soon as you enter, and of course the variour justice systems in each
of the eight or nine towns all rely heavily upon tracking guards.
Also, tracking is a heavily used player skill - mostly for PK, meaning
it tracks them across the whole mud, which is pretty impressive considering
that Arctic probably has upwards of 25,000 rooms. As far as I know
all of this has never caused any performance problem, although I don't
know what kind of hardware they are running. (I suspect it's not
that impressive; the admin had to do a t-shirt sale in order to fund
a modest RAM upgrade, so I don't think they have a lot spare cash
to throw around at hardware.)
The CircleMUD sources are availible from www.circlemud.org. I believe
the file you'll be interested in is called "graph.c" (don't ask me why).
More information about the MUD-Dev