Re: Finding the Nearest Person

From: Chris Jacobson (fear@ATHENET.NET)
Date: 03/05/98


On 3/6/98 3:00 AM, Wesley Fonvergne (tadrith@GATEKEEP.NET) stated:

>        I was looking through the find_first_step function, which track is
>based
>off of, which determines the direction a player must next go to find
>someone. Thinking this over, would it be possible to determine the entire
>set of steps needed to a player, and then find that for every person in a
>zone, and then compare how many there were to find which player is closest?
>Is this possible to do, in C code, or would it cause too much processing to
>have every MOB doing this at one time? Thanks for any help! :)

Its possible in C, yes... almost anything program-wise is possible in C
:-)
However, thats kind of drastic, and allows for too strict hunting, IMHO.

I would recommend a simple function that aggy mobs would do: scan each
direction, as far as line of sight permits (up to a maximum distance),
and find a character it would attack, then start hunting that character.
If none, just wander until someone enters line of sight.  Realistic and
far less processing power needed.

But as far as "power required", its not that much... MUDs run normally at
> 1% CPU power on a P2/233 Linux system... our development port, (at time of
check: 7.5k rooms, 1.5k mobs loaded, 5.8k objs loaded, 26 hours uptime.
This has scripts and mobprogs, and is in C++, so there is more overhead
than a C-based mud) uses less than .5% of CPU time (7:02 time usage).  Of
course, with players on, this would maybe double or triple, but the other
port is 4 month old code and crashes every so often... like rightbefore I
started writing this letter, so I can't check it :-)  But you get the
idea.

- Chris Jacobson


     +------------------------------------------------------------+
     | Ensure that you have read the CircleMUD Mailing List FAQ:  |
     | http://democracy.queensu.ca/~fletcher/Circle/list-faq.html |
     +------------------------------------------------------------+



This archive was generated by hypermail 2b30 : 12/15/00 PST