1998Q2/
<!-- MHonArc v2.4.4 -->
<!--X-Subject: [MUD&#45;Dev] (fwd) Mudlib Design -->
<!--X-From-R13: X Q Znjerapr <pynjNhaqre.rate.ftv.pbz> -->
<!--X-Date: Tue, 21 Apr 1998 14:54:31 &#45;0700 -->
<!--X-Message-Id: 199804212153.OAA190627#under,engr.sgi.com -->
<!--X-Content-Type: text/plain -->
<!--X-Head-End-->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<html>
<head>
<title>MUD-Dev message, [MUD-Dev] (fwd) Mudlib Design</title>
<!-- meta name="robots" content="noindex,nofollow" -->
<link rev="made" href="mailto:claw#under,engr.sgi.com">
</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="msg00215.html">Previous</a>
&nbsp;|&nbsp;<a href="msg00412.html">Next</a>
&nbsp;]
&nbsp;&nbsp;&nbsp;&nbsp;
Thread:&nbsp;
[&nbsp;<a href="msg00412.html">Previous</a>
&nbsp;|&nbsp;<a href="msg00215.html">Next</a>
&nbsp;]
&nbsp;&nbsp;&nbsp;&nbsp;
Index:&nbsp;
[&nbsp;<A HREF="author.html#00325">Author</A>
&nbsp;|&nbsp;<A HREF="#00325">Date</A>
&nbsp;|&nbsp;<A HREF="thread.html#00325">Thread</A>
&nbsp;]

<!--X-TopPNI-End-->
<!--X-MsgBody-->
<!--X-Subject-Header-Begin-->
<H1>[MUD-Dev] (fwd) Mudlib Design</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] (fwd) Mudlib Design</LI>
<LI><em>From</em>: J C Lawrence &lt;<A HREF="mailto:claw#under,engr.sgi.com">claw#under,engr.sgi.com</A>&gt;</LI>
<LI><em>Date</em>: Tue, 21 Apr 1998 14:53:34 -0700 (PDT)</LI>
<LI><em>Cc</em>: <A HREF="mailto:claw#under,engr.sgi.com">claw#under,engr.sgi.com</A></LI>
<LI><em>Delivery-date</em>: Tue Apr 21 14:54:31 1998</LI>
<LI><em>Delivery-date</em>: Tue, 21 Apr 1998 14:54:31 -0700</LI>
<LI><em>Envelope-to</em>: claw#kanga,nu</LI>
<LI><em>Reply-To</em>: <A HREF="mailto:mud-dev#kanga,nu">mud-dev#kanga,nu</A></LI>
<LI><em>Sender</em>: "Petidomo List Agent,,,," &lt;<A HREF="mailto:petidomo#kanga,nu">petidomo#kanga,nu</A>&gt;</LI>
</UL>
<!--X-Head-of-Message-End-->
<!--X-Head-Body-Sep-Begin-->
<HR>
<!--X-Head-Body-Sep-End-->
<!--X-Body-of-Message-->
<PRE>
-- forwarded message --
Path: news.corp.sgi.com!enews.sgi.com!su-news-feed4.bbnplanet.com!su-news-hub1.bbnplanet.com!dallas-news-feed2.bbnplanet.com!news.bbnplanet.com!newsfeed.gte.net!howland.erols.net!news-peer.sprintlink.net!news-backup-west.sprintlink.net!news-in-west.sprintlink.net!news.sprintlink.net!Sprint!209.98.98.14!darla.visi.com!news-out.visi.com!ptah.visi.com!not-for-mail
From: George Reese &lt;borg#imaginary,com&gt;
Subject: Mudlib Design
Newsgroups: rec.games.mud.lp
Organization: <A  HREF="http://www.imaginary.com/~borg">http://www.imaginary.com/~borg</A>
User-Agent: tin/pre-1.4-980202 (UNIX) (SunOS/5.5.1 (sun4m))
Lines: 161
Message-ID: &lt;HyU_.248$E6.1220555#ptah,visi.com&gt;
Date: Tue, 21 Apr 1998 03:40:23 GMT
NNTP-Posting-Host: thumper.visi.com
NNTP-Posting-Date: Mon, 20 Apr 1998 22:40:23 CDT
Xref: news.corp.sgi.com rec.games.mud.lp:29894

I am getting a lot of requests for that advanced LPC book I keep
promising.  Instead of actually producing that document, I thought I
would take some time to produce a small bit of that text--some
hopefully helpful hints on mudlib design.  This is a first stab at
this document, mostly stream of consciousness.  No doubt some of it
will not come out right, so I welcome constructive comments and
questions.  

Most of you are likely using some sort of mudlib handed down to
you--either because you are on an old mud with an ancient lib, or you
have chosen to use a public mudlib, or someone else has this really
cool bastardization of a lib they want to use.  Nevertheless, you can
still take a look at your mudlib and slowly implement changes that
will give you a better more robust design.

* What is the mudlib?

Before getting deep into design issues, let's not forget the purpose
of a mudlib: it is a place to define standard behaviour for similar
mud objects.  In other words, you want all things that people carry to
fall to the ground when they drop them and you want living things to die
when their mortal bodies give out.  You don't want your creators to
have to do tedious work to accomplish simple tasks.  And finally, you
want to hide the complexities of the mud from those creators.

* Defining Your World

The key to doing all this successfully is putting together a good
model of your mud before you start coding.  Your first step should
thus be to identify the sorts of things that will appear in your mud.
You can do this by sitting down with (or sitting at the computer with)
some of the people developing your mud with you.  It does not need to
be admins.  In fact, it would help to have a few admins, a couple of
coders, and maybe even a player in the mix.  Get together and write
down every noun you can think of.  You should spend no more than 20
minutes writing down the things that come immediately to mind; nothing
anyone says at this stage is wrong.

For example, off the top of my head, I would write down the following:
sword         NPC            player          creator         room
door          armour         weapon          food            drink
container     bag            meadow          tree            fishing pole
hut           ship           body            spirit          underworld
domain        sky            entrance        exit            bank teller
Harry         connection     quest           item

Are some of these things identical objects?  Yeah, an entrance and
exit are pretty much the same thing.  A sword is a kind of weapon.
Nevertheless do not make any such judgments at this point; just write
down what anyone says.  Save the judgments until later.

* Organizing the Objects

You now have a disorganized list of "things" you want in your mud.
This list is not the definitive list of what goes in and what is left
out.  It is just a starting point.  You should, however, take a moment
to make sure nothing important has been left out.

Redundancies
The first thing to do with the list is eliminate redundancies.  What
things are identical with other things?  Be careful not to elimate
things that may seem identical yet have subtle, but important
differences.  Chances are you will not eliminate very many objects
from your list at this point.

Specialization
The next step is to identify levels of specialization.  In the list
above, a sword is a weapon.  Harry is an NPC.  A bag is a container.
On a piece of paper, draw arrows from your specific objects to their
generalizations (Harry -----&gt; NPC). 

Commonalities
Identify anything in common among your objects and create a new object
that represents that common behaviour.  From above, we see that food
and drink both have the capacity to heal a living thing.  We should
then an abstraction that captures the concept of healing.  Let's call
it a 'healer'.  Then draw an arrow from both food and drink up to
arrow.

Containment
Look at your list and see which objects contain other objects of a
specific type.  This is not containment in the same way as a bag
containing items.  It is sometimes called a "has-a" relationship.  For
example, a living thing has a body; a body has (wears) armour.

You can use containment to further identify commonalities.  If, for
example, you have forgotten "container" as an object, you should have
caught that omission by now.  Both a room and a bag have items within
them.  That is a common relationship; you can call the object that
handles that commonality a container.

Finally, there is no right answer here, but there are a lot of wrong
answers.  You need to make decisions based on the world you want to
build.  Do not be so quick though to dismiss things as "oh, we don't
need that!"  Edible armour?  It may be convenient now to say nah, no
reason to have edible armour.  Conceptually, however, writing the code
for edible armour is no more difficult than supporting food and armour
separately.  

* Putting It All Together

Look at these two object models

1. From the Nightmare Mudlib 3.x
armour -------&gt;  item
food   -------&gt;  healing
bag    -------&gt;  container  --------&gt; item

2. From unreleased versions of Nightmare
armour -----------&gt;  item
                     protection
food   -----------&gt;  healing
                     edible
edible armour ----&gt;  item
                     healing
                     protection
bag    -----------&gt;  item
                     container
                     closeable
backpack ---------&gt;  item
                     protection
                     container
                     closeable

Both models work.  The second model, however, is much more flexible.
Under MudOS or Java, it is impossible to achieve edible armour or a
backpack under the first model since MudOS has screwey virtual
inheritance and Java does not support multiple inheritance.

The second model places behaviour into smaller, better defined objects
that does not mix unrelated behaviour.  This way you can mix and match
behaviours without duplicating any code.

-- 
George Reese (borg#imaginary,com)       <A  HREF="http://www.imaginary.com/~borg">http://www.imaginary.com/~borg</A>
     "In our fear, we make an image, and that image we call God."
	          Antonius Block in The Seventh Seal
PGP Key: <A  HREF="http://www.imaginary.com/servlet/Finger?user=borg&amp;verbose=yes">http://www.imaginary.com/servlet/Finger?user=borg&amp;verbose=yes</A>
-- end of forwarded message --


-- 
J C Lawrence                               Internet: claw#null,net
(Contractor)                               Internet: coder#ibm,net
---------(*)                     Internet: claw#under,engr.sgi.com
...Honourary Member of Clan McFud -- Teamer's Avenging Monolith...

-- 
MUD-Dev: Advancing an unrealised future.
</PRE>

<!--X-Body-of-Message-End-->
<!--X-MsgBody-End-->
<!--X-Follow-Ups-->
<HR>
<!--X-Follow-Ups-End-->
<!--X-References-->
<!--X-References-End-->
<!--X-BotPNI-->
<UL>
<LI>Prev by Date:
<STRONG><A HREF="msg00215.html">[MUD-Dev] META: We have moved.</A></STRONG>
</LI>
<LI>Next by Date:
<STRONG><A HREF="msg00412.html">[MUD-Dev] SfD: AI and muds; several approaches</A></STRONG>
</LI>
<LI>Prev by thread:
<STRONG><A HREF="msg00412.html">[MUD-Dev] SfD: AI and muds; several approaches</A></STRONG>
</LI>
<LI>Next by thread:
<STRONG><A HREF="msg00215.html">[MUD-Dev] META: We have moved.</A></STRONG>
</LI>
<LI>Index(es):
<UL>
<LI><A HREF="index.html#00325"><STRONG>Date</STRONG></A></LI>
<LI><A HREF="thread.html#00325"><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>[MUD-Dev] Re: Systems you use</STRONG>, <EM>(continued)</EM>
<ul compact>
<ul compact>
<ul compact>
<ul compact>
<LI><strong><A NAME="00468" HREF="msg00468.html">[MUD-Dev] Re: Systems you use</A></strong>, 
Katrina McClelan <a href="mailto:kitkat#the486,bradley.edu">kitkat#the486,bradley.edu</a>, Thu 23 Apr 1998, 22:31 GMT
</LI>
</ul>
</ul>
</ul>
</ul>
</LI>
<LI><strong><A NAME="00227" HREF="msg00227.html">[MUD-Dev] (fwd) SERVER: Re: New Code Base in VB Started</A></strong>, 
J C Lawrence <a href="mailto:claw#under,engr.sgi.com">claw#under,engr.sgi.com</a>, Wed 22 Apr 1998, 19:16 GMT
<UL>
<LI><strong><A NAME="00715" HREF="msg00715.html">[MUD-Dev] Re: (fwd) SERVER: Re: New Code Base in VB Started</A></strong>, 
Jon A. Lambert <a href="mailto:jlsysinc#ix,netcom.com">jlsysinc#ix,netcom.com</a>, Sat 25 Apr 1998, 13:14 GMT
</LI>
</UL>
</LI>
<LI><strong><A NAME="00412" HREF="msg00412.html">[MUD-Dev] SfD: AI and muds; several approaches</A></strong>, 
Nathan F Yospe <a href="mailto:yospe#hawaii,edu">yospe#hawaii,edu</a>, Tue 21 Apr 1998, 22:12 GMT
<LI><strong><A NAME="00325" HREF="msg00325.html">[MUD-Dev] (fwd) Mudlib Design</A></strong>, 
J C Lawrence <a href="mailto:claw#under,engr.sgi.com">claw#under,engr.sgi.com</a>, Tue 21 Apr 1998, 21:54 GMT
<LI><strong><A NAME="00215" HREF="msg00215.html">[MUD-Dev] META: We have moved.</A></strong>, 
J C Lawrence <a href="mailto:claw#under,engr.sgi.com">claw#under,engr.sgi.com</a>, Tue 21 Apr 1998, 19:19 GMT
<LI><strong><A NAME="00209" HREF="msg00209.html">[Fwd: Re: Grids and curvature of a sphere]</A></strong>, 
Richard Woolcock <a href="mailto:KaVir#dial,pipex.com">KaVir#dial,pipex.com</a>, Sun 19 Apr 1998, 05:50 GMT
<UL>
<LI><strong><A NAME="00210" HREF="msg00210.html">Re: [MUD-Dev]  [Fwd: Re: Grids and curvature of a sphere]</A></strong>, 
Caliban Tiresias Darklock <a href="mailto:caliban#darklock,com">caliban#darklock,com</a>, Sun 19 Apr 1998, 06:39 GMT
<UL>
<LI><strong><A NAME="00773" HREF="msg00773.html">[MUD-Dev] Re: [Fwd: Re: Grids and curvature of a sphere]</A></strong>, 
J C Lawrence <a href="mailto:claw#under,engr.sgi.com">claw#under,engr.sgi.com</a>, Wed 22 Apr 1998, 18:47 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>