1998Q3/
<!-- MHonArc v2.4.4 -->
<!--X-Subject: [MUD&#45;Dev] Re: Socket&#45;Script: Socket&#45;capabable script language and matching library -->
<!--X-From-R13: "Oqnz X. Fubeagba" <nqnzNcubravk.Bevaprgba.SRG> -->
<!--X-Date: Wed, 5 Aug 1998 08:05:06 &#45;0700 -->
<!--X-Message-Id: 19980805110035.A20957#flagstaff,Princeton.EDU -->
<!--X-Content-Type: text/plain -->
<!--X-Reference: 199808051331.HAA07657@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, [MUD-Dev] Re: Socket-Script: Socket-capabable script language </title>
<!-- meta name="robots" content="noindex,nofollow" -->
<link rev="made" href="mailto:adam#phoenix,Princeton.EDU">
</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="msg00490.html">Previous</a>
&nbsp;|&nbsp;<a href="msg00492.html">Next</a>
&nbsp;]
&nbsp;&nbsp;&nbsp;&nbsp;
Thread:&nbsp;
[&nbsp;<a href="msg00490.html">Previous</a>
&nbsp;|&nbsp;<a href="msg00496.html">Next</a>
&nbsp;]
&nbsp;&nbsp;&nbsp;&nbsp;
Index:&nbsp;
[&nbsp;<A HREF="author.html#00491">Author</A>
&nbsp;|&nbsp;<A HREF="#00491">Date</A>
&nbsp;|&nbsp;<A HREF="thread.html#00491">Thread</A>
&nbsp;]

<!--X-TopPNI-End-->
<!--X-MsgBody-->
<!--X-Subject-Header-Begin-->
<H1>[MUD-Dev] Re: Socket-Script: Socket-capabable script language and matching library</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>: [MUD-Dev] Re: Socket-Script: Socket-capabable script language and matching library</LI>
<LI><em>From</em>: "Adam J. Thornton" &lt;<A HREF="mailto:adam#phoenix,Princeton.EDU">adam#phoenix,Princeton.EDU</A>&gt;</LI>
<LI><em>Date</em>: Wed, 5 Aug 1998 11:00:35 -0400</LI>
<LI><em>Reply-To</em>: <A HREF="mailto:mud-dev#kanga,nu">mud-dev#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>
Thanks much, folks.  I'm going to implement both J.C.'s and Chris's
suggestions: that is, I'm going to sit down with the design and a cup of
coffee and see if I can easily abstract it into a cleaner parent-child
process model so that the handoffs aren't quite as ugly, but I'm also going
to count on using sendmsg, since it seems to be relatively portable; my
child processes can create AF_UNIX sockets and use those to pass around
connection data as needed.

I'm doing this right now on a Linux box; I doubt that that will change in
the near future, and if it does, I suspect I'd be going to either Solaris
or HP-UX.  I have no plans, thankfully, to write any of the back end code
under Win32.  I'm doing it in C right now, but mostly because I don't know
enough Java and there isn't a Java-&gt;native compiler for Linux yet.  (I
don't want the portability, I want the good thread and network support);
does Java provide something equivalent to sendmsg/recvmsg?

I'm not actually too worried about the N-processes-for-N-players problem,
mainly because empty rooms are kind of boring, and I suspect that players
will quickly congregate in rooms with other players.  If I have per-room
scoping then I have a reasonably natural solution to the data
representation problem by making each room a process and making its object
data available to all threads (player objects) running in it.  Object data
is ultimately represented in the database backend, but for each process it
is locally represented in in-memory data structures, which, as they change,
get written to a low-priority database queue thread, which runs when the
cycles are free or gets flushed on some schedule (e.g. every thirty seconds
if it hasn't had a chance to run yet).

One thing I haven't worked out yet in my model is just what to lock when
players move globally visible objects.  I could lock everything in the
room--that is, put a mutex around the room data for as long as it took to
copy the transaction to the DB queue thread--but that locks a lot of stuff
that doesn't need to be locked.  If I'm willing to do the computation, I
can lock the object tree with the manipulated object's parent at its head
(that is, if an orange is in the cupboard, lock the cupboard and everything
in it...but if an orange is in a shoebox in a cupboard, do I lock the
cupboard or the shoebox?), or I can cheat a little and lock the region of
space that contains the object in question (each room has a Cartesian grid
underlying it--if the orange in the shoebox in the cupboard is at (5,5),
lock all objects which are at (5,5)).  This works up until I want objects
that occupy multiple spaces; for instance, ropes.  However, ropes are such
hideously intractable objects (rec.arts.int-fiction yells about this at
least once a month) that I'm tempted to go with a purely localized object
model and do spatial locking, at least for now.

Adam
-- 
adam#princeton,edu 
"There's a border to somewhere waiting, and a tank full of time." - J. Steinman


</PRE>

<!--X-Body-of-Message-End-->
<!--X-MsgBody-End-->
<!--X-Follow-Ups-->
<HR>
<ul compact><li><strong>Follow-Ups</strong>:
<ul>
<li><strong><A NAME="00496" HREF="msg00496.html">[MUD-Dev] Re: Socket-Script: Socket-capabable script language and matching library</A></strong>
<ul compact><li><em>From:</em> Nathan F Yospe &lt;yospe#hawaii,edu&gt;</li></ul>
</UL></LI></UL>
<!--X-Follow-Ups-End-->
<!--X-References-->
<UL><LI><STRONG>References</STRONG>:
<UL>
<LI><STRONG><A NAME="00490" HREF="msg00490.html">[MUD-Dev] Re: Socket-Script: Socket-capabable script language and matching library</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="msg00490.html">[MUD-Dev] Re: Socket-Script: Socket-capabable script language and matching library</A></STRONG>
</LI>
<LI>Next by Date:
<STRONG><A HREF="msg00492.html">[MUD-Dev] Re: Socket-Script: Socket-capabable script language and matching library</A></STRONG>
</LI>
<LI>Prev by thread:
<STRONG><A HREF="msg00490.html">[MUD-Dev] Re: Socket-Script: Socket-capabable script language and matching library</A></STRONG>
</LI>
<LI>Next by thread:
<STRONG><A HREF="msg00496.html">[MUD-Dev] Re: Socket-Script: Socket-capabable script language and matching library</A></STRONG>
</LI>
<LI>Index(es):
<UL>
<LI><A HREF="index.html#00491"><STRONG>Date</STRONG></A></LI>
<LI><A HREF="thread.html#00491"><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><A NAME="00494" HREF="msg00494.html">[MUD-Dev] Secrets of the Game Designers</A></strong>, 
s001gmu <a href="mailto:s001gmu#nova,wright.edu">s001gmu#nova,wright.edu</a>, Wed 05 Aug 1998, 16:51 GMT
<LI><strong><A NAME="00493" HREF="msg00493.html">[MUD-Dev] Re: 3D World Models</A></strong>, 
S. Patrick Gallaty <a href="mailto:choke#sirius,com">choke#sirius,com</a>, Wed 05 Aug 1998, 16:12 GMT
<LI><strong><A NAME="00489" HREF="msg00489.html">[MUD-Dev] Re: Socket-Script: Socket-capabable script language and matching library</A></strong>, 
Chris Gray <a href="mailto:cg#ami-cg,GraySage.Edmonton.AB.CA">cg#ami-cg,GraySage.Edmonton.AB.CA</a>, Wed 05 Aug 1998, 13:29 GMT
<UL>
<li>&lt;Possible follow-up(s)&gt;<br>
<LI><strong><A NAME="00490" HREF="msg00490.html">[MUD-Dev] Re: Socket-Script: Socket-capabable script language and matching library</A></strong>, 
Chris Gray <a href="mailto:cg#ami-cg,GraySage.Edmonton.AB.CA">cg#ami-cg,GraySage.Edmonton.AB.CA</a>, Wed 05 Aug 1998, 13:33 GMT
<UL>
<LI><strong><A NAME="00491" HREF="msg00491.html">[MUD-Dev] Re: Socket-Script: Socket-capabable script language and matching library</A></strong>, 
Adam J. Thornton <a href="mailto:adam#phoenix,Princeton.EDU">adam#phoenix,Princeton.EDU</a>, Wed 05 Aug 1998, 15:05 GMT
<UL>
<LI><strong><A NAME="00496" HREF="msg00496.html">[MUD-Dev] Re: Socket-Script: Socket-capabable script language and matching library</A></strong>, 
Nathan F Yospe <a href="mailto:yospe#hawaii,edu">yospe#hawaii,edu</a>, Wed 05 Aug 1998, 19:47 GMT
<UL>
<LI><strong><A NAME="00498" HREF="msg00498.html">[MUD-Dev] Re: Socket-Script: Socket-capabable script language and matching library</A></strong>, 
Adam J. Thornton <a href="mailto:adam#phoenix,Princeton.EDU">adam#phoenix,Princeton.EDU</a>, Wed 05 Aug 1998, 21:05 GMT
</LI>
<LI><strong><A NAME="00499" HREF="msg00499.html">[MUD-Dev] Toba Java-&gt;C</A></strong>, 
Adam J. Thornton <a href="mailto:adam#phoenix,Princeton.EDU">adam#phoenix,Princeton.EDU</a>, Wed 05 Aug 1998, 21:11 GMT
</LI>
</UL>
</LI>
</UL>
</LI>
</UL>
</LI>
<LI><strong><A NAME="00492" HREF="msg00492.html">[MUD-Dev] Re: Socket-Script: Socket-capabable script language and matching library</A></strong>, 
##Make Nylander <a href="mailto:thenewt#use,usit.net">thenewt#use,usit.net</a>, Wed 05 Aug 1998, 16:00 GMT
</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>