[MUD-Dev] mobile movement
Matthew Mihaly
diablo at best.com
Wed Jan 6 14:06:21 CET 1999
I have a dream. I dream that someday in Achaea Sir Gawain will insult some
ogre's mother, and the next time Sir Gawain is in the land (our players do
not stay in the land when they are offline), said Ogre will set about
trying to move to where Sir Gawain is and, encountering the door that Sir
Gawain is behind, will politely knock *rap rap* and say, "Excuse me! Your
cask of Theran brandy is here, sir!" Gawain, being an infamous drunkard,
would come out and things would take a predictably violent turn.
The other coder on Achaea and I were discussing the best way to write some
code that would allow a mobile (or anything really) to intelligently move
on the shortest route from room A to room B. The two main ways we have
discussed implementing this capability are:
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).
2) When, for instance, a mobile first is assigned the task of walking to
another room, you would build a list of the necessary rooms to move
through so that the above search would only have to be done once. If the
mobile were tracking to a player, then the list would be built, and
everytime said player moved logically (as opposed to teleporting, which
would require the search to be done again), the list would be changed
accordingly. This seems much faster than method 1, but it also seems
inferior.
Have any of you implemented a system like this, and if not, why not? If
so, what method did you use? Please keep in mind that I don't know any of
the coding languages any of you know and that I lack knowledge of general
coding concepts, so I'd appreciate a minimum of jargon.
-----------
Matthew A. Mihaly
Managing Director, Achaea LLC
http://www.achaea.com
More information about the mud-dev-archive
mailing list