1999Q1/
<!-- MHonArc v2.4.4 -->
<!--X-Subject: Re: [MUD&#45;Dev] Naming and Directories? -->
<!--X-From-R13: [vx Qynexr <zvxpyexNvoz.arg> -->
<!--X-Date: Tue, 16 Mar 1999 04:40:21 &#45;0800 -->
<!--X-Message-Id: 36EECFD9.110DC67E#ibm,net -->
<!--X-Content-Type: text/plain -->
<!--X-Reference: 199903140640.XAA01563@ami&#45;cg.GraySage.Edmonton.AB.CA -->
<!--X-Head-End-->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<html>
<head>
<title>MUD-Dev message, Re: [MUD-Dev] Naming and Directories?</title>
<!-- meta name="robots" content="noindex,nofollow" -->
<link rev="made" href="mailto:mikclrk#ibm,net">
</head>
<body background="/backgrounds/paperback.gif" bgcolor="#ffffff"
      text="#000000" link="#0000FF" alink="#FF0000" vlink="#006000">

  <font size="+4" color="#804040">
    <strong><em>MUD-Dev<br>mailing list archive</em></strong>
  </font>
      
<br>
[&nbsp;<a href="../">Other Periods</a>
&nbsp;|&nbsp;<a href="../../">Other mailing lists</a>
&nbsp;|&nbsp;<a href="/search.php3">Search</a>
&nbsp;]
<br clear=all><hr>
<!--X-Body-Begin-->
<!--X-User-Header-->
<!--X-User-Header-End-->
<!--X-TopPNI-->

Date:&nbsp;
[&nbsp;<a href="msg00607.html">Previous</a>
&nbsp;|&nbsp;<a href="msg00609.html">Next</a>
&nbsp;]
&nbsp;&nbsp;&nbsp;&nbsp;
Thread:&nbsp;
[&nbsp;<a href="msg00577.html">Previous</a>
&nbsp;|&nbsp;<a href="msg00581.html">Next</a>
&nbsp;]
&nbsp;&nbsp;&nbsp;&nbsp;
Index:&nbsp;
[&nbsp;<A HREF="author.html#00608">Author</A>
&nbsp;|&nbsp;<A HREF="#00608">Date</A>
&nbsp;|&nbsp;<A HREF="thread.html#00608">Thread</A>
&nbsp;]

<!--X-TopPNI-End-->
<!--X-MsgBody-->
<!--X-Subject-Header-Begin-->
<H1>Re: [MUD-Dev] Naming and Directories?</H1>
<HR>
<!--X-Subject-Header-End-->
<!--X-Head-of-Message-->
<UL>
<LI><em>To</em>: <A HREF="mailto:mud-dev#kanga,nu">mud-dev#kanga,nu</A></LI>
<LI><em>Subject</em>: Re: [MUD-Dev] Naming and Directories?</LI>
<LI><em>From</em>: Mik Clarke &lt;<A HREF="mailto:mikclrk#ibm,net">mikclrk#ibm,net</A>&gt;</LI>
<LI><em>Date</em>: Tue, 16 Mar 1999 21:40:42 +0000</LI>
<LI><em>Reply-To</em>: <A HREF="mailto:mud-dev#kanga,nu">mud-dev#kanga,nu</A></LI>
<LI><em>Sender</em>: <A HREF="mailto:mud-dev-admin#kanga,nu">mud-dev-admin#kanga,nu</A></LI>
</UL>
<!--X-Head-of-Message-End-->
<!--X-Head-Body-Sep-Begin-->
<HR>
<!--X-Head-Body-Sep-End-->
<!--X-Body-of-Message-->
<PRE>
Chris Gray wrote:

&gt; [Mik Clarke:]
&gt;
&gt;  &gt;Given a task of sending a message to a specific player, when that player could be
&gt;  &gt;located anywhere within the mud, how do you propose to do it faster than by running
&gt;  &gt;the list of all connected players?  Sure, a binary index by name might help, but I
&gt;  &gt;suspect you'd have trouble seeing the saving...
&gt;
&gt; Depends on how often you do it. After removing some idiocy in my database
&gt; code, and skipping the MUD language interpreter, the biggest hits on
&gt; my profiling of a test with 600 "machines" was the code that sees who
&gt; should get a message whenever a machine does something. E.g., a machine
&gt; goes from one room to another. All characters and machines in both
&gt; rooms may need to know about that. So, with 600 machines moving around
&gt; every couple of seconds, thats an order 600 * 600 = 360,000 cost. It
&gt; starts to be noticeable. So, the bit of work I've done recently has
&gt; been to start adding more pointers to the agent structures, so that
&gt; I can link them together based on location, and also via a table
&gt; hashed by locations. The first ring gets me those in the old location.
&gt; The hashing gets me to any ring for the new location. I expect a
&gt; noticeable speedup once I get all the pointer fiddling right.

Ever heard of event driven interaction?

In a Diku each room has a list of all of the objects and all of the players that are in
the room.  The thing to do, as you are finding, is to utilize this 'locality' to reduce
the amount of work you have to so.

The way CthulhuMud handles this is as follows:

1. A context is created.  This describes the participants and their roles (actor, victim,
observer (yes, it changes for each observer), primary object, secondary object, number,
text and room).
2. An event is created this references the context and has a description of both the type
of action and a more specific subtype.  Examples might be GET and GET_ITEM or DEPART and
DEPART_WALK.  Further details of the action are stored in the context.  The context also
contains pointers to the templates for the messages that the actor, the victim and any
observes get to see.
3. The event is issued to the room (as this is C it just a function call with the room
and the wev as its arguments).
4. The room then passes to event to each mob in the room (who might be interested in it).

5. Code for the mob then decides what to do with it.  For player Mobs, the message is
sent to the player.  For NPC mobs it can trigger mobprogs.

There are a couple of refinements:

Challange events.
The event is issued as a challange before the event occurs. Mobs may veto the action by
triggering a mob prog.  This prevents the action from happening, but it is up to the mob
to explain why.  (The best traditional mobprogs can do is to say 'Naughty player, put
that down right now!' and maybe force them to drop it.)

Scrying and Monitoring
If everything that happens in the room is described by an event (and CthulhuMud is about
75% of the way there), then its possible to extend the room_issue_wev function to send
the event to mobs which are elsewhere but which want to monitor the room (for cool
animation effects) and to feed them to objects that are 'remotely observing' the room.
(Scrying isn't yet implemented, but I've got all the bits.)

Echos
If you define exits to be 'transparent' 9to light, sound or both) you can punt the event
into neighbouring rooms, allowing people to see further in open spaces.

Mik



_______________________________________________
MUD-Dev maillist  -  MUD-Dev#kanga,nu
<A  HREF="http://www.kanga.nu/lists/listinfo/mud-dev">http://www.kanga.nu/lists/listinfo/mud-dev</A>


</PRE>

<!--X-Body-of-Message-End-->
<!--X-MsgBody-End-->
<!--X-Follow-Ups-->
<HR>
<!--X-Follow-Ups-End-->
<!--X-References-->
<UL><LI><STRONG>References</STRONG>:
<UL>
<LI><STRONG><A NAME="00577" HREF="msg00577.html">Re: [MUD-Dev] Naming and Directories?</A></STRONG>
<UL><LI><EM>From:</EM> Chris Gray &lt;cg#ami-cg,GraySage.Edmonton.AB.CA&gt;</LI></UL></LI>
</UL></LI></UL>
<!--X-References-End-->
<!--X-BotPNI-->
<UL>
<LI>Prev by Date:
<STRONG><A HREF="msg00607.html">Re: [MUD-Dev] Naming and Directories?</A></STRONG>
</LI>
<LI>Next by Date:
<STRONG><A HREF="msg00609.html">Re: [MUD-Dev] Re: pet peeves</A></STRONG>
</LI>
<LI>Prev by thread:
<STRONG><A HREF="msg00577.html">Re: [MUD-Dev] Naming and Directories?</A></STRONG>
</LI>
<LI>Next by thread:
<STRONG><A HREF="msg00581.html">Re: [MUD-Dev] Naming and Directories?</A></STRONG>
</LI>
<LI>Index(es):
<UL>
<LI><A HREF="index.html#00608"><STRONG>Date</STRONG></A></LI>
<LI><A HREF="thread.html#00608"><STRONG>Thread</STRONG></A></LI>
</UL>
</LI>
</UL>

<!--X-BotPNI-End-->
<!--X-User-Footer-->
<!--X-User-Footer-End-->
<ul><li>Thread context:
<BLOCKQUOTE><UL>
<LI><STRONG>Re: [MUD-Dev] Naming and Directories?</STRONG>, <EM>(continued)</EM>
<ul compact>
<ul compact>
<ul compact>
<LI><strong><A NAME="00571" HREF="msg00571.html">Re: [MUD-Dev] Naming and Directories?</A></strong>, 
Caliban Tiresias Darklock <a href="mailto:caliban#darklock,com">caliban#darklock,com</a>, Sat 13 Mar 1999, 23:07 GMT
<UL>
<LI><strong><A NAME="00572" HREF="msg00572.html">Re: [MUD-Dev] Naming and Directories?</A></strong>, 
Ben Greear <a href="mailto:greear#cyberhighway,net">greear#cyberhighway,net</a>, Sat 13 Mar 1999, 23:20 GMT
</LI>
</UL>
</LI>
</ul>
<LI><strong><A NAME="00579" HREF="msg00579.html">Re: [MUD-Dev] Naming and Directories?</A></strong>, 
Mark Gritter <a href="mailto:mark#erdos,Stanford.EDU">mark#erdos,Stanford.EDU</a>, Sat 13 Mar 1999, 23:26 GMT
</LI>
</ul>
<LI><strong><A NAME="00577" HREF="msg00577.html">Re: [MUD-Dev] Naming and Directories?</A></strong>, 
Chris Gray <a href="mailto:cg#ami-cg,GraySage.Edmonton.AB.CA">cg#ami-cg,GraySage.Edmonton.AB.CA</a>, Sat 13 Mar 1999, 22:50 GMT
<UL>
<LI><strong><A NAME="00608" HREF="msg00608.html">Re: [MUD-Dev] Naming and Directories?</A></strong>, 
Mik Clarke <a href="mailto:mikclrk#ibm,net">mikclrk#ibm,net</a>, Tue 16 Mar 1999, 12:40 GMT
</LI>
</UL>
</LI>
<LI><strong><A NAME="00581" HREF="msg00581.html">Re: [MUD-Dev] Naming and Directories?</A></strong>, 
Chris Gray <a href="mailto:cg#ami-cg,GraySage.Edmonton.AB.CA">cg#ami-cg,GraySage.Edmonton.AB.CA</a>, Sun 14 Mar 1999, 09:31 GMT
</LI>
<LI><strong><A NAME="00622" HREF="msg00622.html">Re: [MUD-Dev] Naming and Directories?</A></strong>, 
Chris Gray <a href="mailto:cg#ami-cg,GraySage.Edmonton.AB.CA">cg#ami-cg,GraySage.Edmonton.AB.CA</a>, Tue 16 Mar 1999, 22:15 GMT
</LI>
<LI><strong><A NAME="00623" HREF="msg00623.html">Re: [MUD-Dev] Naming and Directories?</A></strong>, 
Chris Gray <a href="mailto:cg#ami-cg,GraySage.Edmonton.AB.CA">cg#ami-cg,GraySage.Edmonton.AB.CA</a>, Tue 16 Mar 1999, 22:21 GMT
<UL>
<LI><strong><A NAME="00631" HREF="msg00631.html">Re: [MUD-Dev] Naming and Directories?</A></strong>, 
Jo Dillon <a href="mailto:emily#thelonious,new.ox.ac.uk">emily#thelonious,new.ox.ac.uk</a>, Wed 17 Mar 1999, 09:51 GMT
</LI>
</UL>
</LI>
</ul>
</LI>
</UL></BLOCKQUOTE>

</ul>
<hr>
<center>
[&nbsp;<a href="../">Other Periods</a>
&nbsp;|&nbsp;<a href="../../">Other mailing lists</a>
&nbsp;|&nbsp;<a href="/search.php3">Search</a>
&nbsp;]
</center>
<hr>
</body>
</html>