1998Q3/
<!-- MHonArc v2.4.4 -->
<!--X-Subject: [MUD&#45;Dev] Objects (was Re: DBMS in MU*'s) -->
<!--X-From-R13: f001tzhNabin.jevtug.rqh -->
<!--X-Date: Wed, 22 Jul 1998 11:26:37 &#45;0700 -->
<!--X-Message-Id: Pine.PMDF.3.95.980722115521.541220184A&#45;100000#nova,wright.edu -->
<!--X-Content-Type: text/plain -->
<!--X-Reference: 01bdb41e$7deacb80$2a87ebcd@k6 -->
<!--X-Head-End-->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<html>
<head>
<title>MUD-Dev message, [MUD-Dev] Objects (was Re: DBMS in MU*'s)</title>
<!-- meta name="robots" content="noindex,nofollow" -->
<link rev="made" href="mailto:s001gmu#nova,wright.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="msg00311.html">Previous</a>
&nbsp;|&nbsp;<a href="msg00313.html">Next</a>
&nbsp;]
&nbsp;&nbsp;&nbsp;&nbsp;
Thread:&nbsp;
[&nbsp;<a href="msg00272.html">Previous</a>
&nbsp;|&nbsp;<a href="msg00274.html">Next</a>
&nbsp;]
&nbsp;&nbsp;&nbsp;&nbsp;
Index:&nbsp;
[&nbsp;<A HREF="author.html#00312">Author</A>
&nbsp;|&nbsp;<A HREF="#00312">Date</A>
&nbsp;|&nbsp;<A HREF="thread.html#00312">Thread</A>
&nbsp;]

<!--X-TopPNI-End-->
<!--X-MsgBody-->
<!--X-Subject-Header-Begin-->
<H1>[MUD-Dev] Objects (was Re: DBMS in MU*'s)</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] Objects (was Re: DBMS in MU*'s)</LI>
<LI><em>From</em>: <A HREF="mailto:s001gmu#nova,wright.edu">s001gmu#nova,wright.edu</A></LI>
<LI><em>Date</em>: Wed, 22 Jul 1998 14:24:47 -0400 (EDT)</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>


On Mon, 20 Jul 1998, quzah wrote:

&gt; 
&gt; -----Original Message-----
&gt; From: s001gmu#nova,wright.edu &lt;s001gmu#nova,wright.edu&gt;
&gt; To: mud-dev#kanga,nu &lt;mud-dev#kanga,nu&gt;
&gt; Date: Monday, July 20, 1998 12:51 PM
&gt; Subject: [MUD-Dev] Re: DBMS in MU*'s
&gt; 
&gt; [Snipped comments from quzah (me) about material types, and objects
&gt;  made up of more than one thing]
&gt; 
&gt; &gt;I like this idea better.  Instead of making the matieral the parent class,
&gt; &gt;make it a property of the class.  This way, it can be changed on the fly,
&gt; &gt;and you can get away with smaller code (think static instances).  You can
&gt; &gt;also create a linked list and have multiple material properties.  If I'd
&gt; &gt;read the Design Patterns book more thuroughly, I do believe I could name
&gt; &gt;the pattern this fits, but I have had insufficeint time to absorb it
&gt; &gt;(alas).
&gt; &gt;
&gt; &gt;I don't see how building objects out of component's answers his question..
&gt; &gt;what components would you build a crystal goblet of?  How does that
&gt; &gt;address breaking it?
&gt; 
&gt; That's one of the things I have yet to decide on. I am not sure how to
&gt; do something like:
&gt; 
&gt; Bubba has a bronze longsword. Bubba hears that werewolves can only be
&gt; wounded by silver weapons. Bubba, being the kind who does not want to
&gt; be killed by a werewolf, goes to the silversmith.
&gt; 
&gt; %hold longsword with tongs
&gt; You grasp your longsword with some iron tongs.
&gt; 
&gt; %dip longsword into vat
&gt; You dip the longsword into a vat of molten silver, thus coating it
&gt; with said material.
&gt; 
&gt; Now what? Ok, sure I could just let people not silvercoat their items,
&gt; but that'd be no fun. (Yeah, it's not something that happens every day
&gt; but my *ideal* mud is a place where you can attempt almost anything.)
&gt; 
&gt; So, so the longsword now has the characteristic of being silver coated.
&gt; Its core is bronze, however the outside (visible portions) are covered
&gt; in silver, and you would have no way of seeing the bronze.

I've spent some time thinking about this, and finnaly managed to get
something worked out.  :)  I think you can model this behavior nicely
with a few simple objects/relations.  This assumes an OO approach, and
again, if I had more time, I'd be able to tell you the OO design pattern.
:)

I propose the following class structure:

              Object
              ^    ^
              |    |
      Container    Composite 

Object is your basic object.  It is made of one material type, and has
whatever other phsyical properties you want to model.  The important thing
is that it is made of ONE material.
Composite and Container both add a list of Objects.  For Composite,
those Objects are what make up the new, composite Object, which has a new
function beyond that of its components, but dependant on their existance
(and placement if you wanna model that too). Container's list is a list of
the objects contained.  The Container has its own function, which should
have nothing to do with the objects within.  Depending on the nature of
the Container, you may or may not be able to easily modify the contents.
Compiste does not set a matieral type.. or maybe it jsut sets it to
'composite', whereas conatiner DOES set a material type.

For example, I would model the 'silver coated sword' by making a 
'&lt;material&gt; coating' container, with no entrance/egress.  The space w/i
the container is set to exactly the space occupied by the contents being
coated.  When the werewolf's damage is calcualted, the 'weapon' is asked
"what is your material?"  The container intercepts this message and
returns 'silver', and the damage calculation continues.

This should sound a lot like JC's spoofs, just an implementation limited
to the physical aspects being modeled.

This still doesn't address the larger problem of not modeling emergant
function.  I think it adds a lot to the basic object model, but it does it
by 'faking it', to borrow a phrase form Chris Gray.  :)

&gt; As for the goblet. It would just be a "goblet-item", made up of one 
&gt; piece, which is composed solely of crystal. Crystal would have a tensil
&gt; strength of X, and each action would need to do something like:

&lt;...sample code...&gt; 

&gt; Something like that. You'd need to find some way to determine your noise
&gt; factor, ie: if it is made of glas primarily, then you would hear more of
&gt; a shattering sound than you would a splintering sound from the wooden part
&gt; of whatever.

&lt;OO high horse&gt;
    Model the 'composed of' property with an object.  You ask that object
    its tensile strength, and when it breaks, you ask it for the noise
    description.
&lt;/OO high horse&gt;
 
&gt; One piece items would be by far the easiest to deal with, as you wouldn't
&gt; have to thread through the linked list of item pieces (or however you had
&gt; it set up) to determine the resulting sound/effect of the object breaking.

Nod... the base case is always the easiest... and by far the least
rewarding.  :)
 
&gt; My idea is to give every action effects, picking up something would have a
&gt; a very tiny effect on its tensil strength applied to a do_break type of
&gt; thing, it would also have some effect on its contents, [shaken not stirred]
&gt; and so on, depending on each action. -- For every action, there is an...
&gt; 
&gt; [snip]
&gt; &gt;composite objects would simply implement a 'dissasemble' verb, which
&gt; &gt;allows you to (with sufficeint means) break a composite into its
&gt; &gt;components.  'Normal' verbs would simply be passed onto each component:
&gt; 
&gt; [snip]
&gt; 
&gt; Yes, and above, the silver coating on the bronze longsword would not
&gt; be able to be disasembled -- So I guess you would need to decide at
&gt; what point in creating/modifying an object, the object no longer is
&gt; able to be disassembled. Also, some commands such as:

See my above comments on the 'silver coated sword' object.
The Container would have to have the get, put, look in, etc, overriden,
but that shouldn't be a problem.  If it was coated with something less
resiliant than silver, say gum, you'll want to have access to the contents
(it shouldn't be all that hard to remove the sword from the gum), but it
won't be as easy as pulling the sword from it's sheath.  Obviously, some
thought needs to go into how you override the verbs, but it shouldn't be
too difficult.
 
&gt; %pry gem from goblet
&gt; You pry a small gem from the silver gem encrusted goblet.
&gt; 
&gt; %look goblet
&gt; The silver goblet is ..blah blah.. however, it seems to be missing one
&gt; of its gems.

Composite objects know what should be in them, and if one item is missing
it should be pretty simple to generate a message like the above.  Think of
a composite as a template, if you will.
 
&gt; I haven't quite decided on how to work with broken objects either.
&gt; Perhaps I'd just create X number of "pieces" from the object. So, an
&gt; axe handle broken in two pieces would produce two small pieces. shrug.

*nod*  That's where my thoughts are leaning, but does it add anything to
the game play?

-Greg



</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="00272" HREF="msg00272.html">[MUD-Dev] Re: DBMS in MU*'s</A></STRONG>
<UL><LI><EM>From:</EM> "quzah" &lt;quzah#geocities,com&gt;</LI></UL></LI>
</UL></LI></UL>
<!--X-References-End-->
<!--X-BotPNI-->
<UL>
<LI>Prev by Date:
<STRONG><A HREF="msg00311.html">[MUD-Dev] Re: [CODE] [LANGUAGE/PLATFORM SPECIFIC] My Event Engine</A></STRONG>
</LI>
<LI>Next by Date:
<STRONG><A HREF="msg00313.html">[MUD-Dev] OT: Sid Meier</A></STRONG>
</LI>
<LI>Prev by thread:
<STRONG><A HREF="msg00272.html">[MUD-Dev] Re: DBMS in MU*'s</A></STRONG>
</LI>
<LI>Next by thread:
<STRONG><A HREF="msg00274.html">[MUD-Dev] Re: DBMS in MU*'s</A></STRONG>
</LI>
<LI>Index(es):
<UL>
<LI><A HREF="index.html#00312"><STRONG>Date</STRONG></A></LI>
<LI><A HREF="thread.html#00312"><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: DBMS in MU*'s</STRONG>, <EM>(continued)</EM>
<ul compact>
<ul compact>
<ul compact>
<LI><strong><A NAME="00670" HREF="msg00670.html">[MUD-Dev] Re: DBMS in MU*'s</A></strong>, 
J C Lawrence <a href="mailto:claw#under,engr.sgi.com">claw#under,engr.sgi.com</a>, Tue 11 Aug 1998, 23:33 GMT
<UL>
<LI><strong><A NAME="00679" HREF="msg00679.html">[MUD-Dev] Re: DBMS in MU*'s</A></strong>, 
s001gmu <a href="mailto:s001gmu#nova,wright.edu">s001gmu#nova,wright.edu</a>, Wed 12 Aug 1998, 12:52 GMT
</LI>
</UL>
</LI>
</ul>
<LI><strong><A NAME="00319" HREF="msg00319.html">[MUD-Dev] Re: DBMS in MU*'s</A></strong>, 
Adam J. Thornton <a href="mailto:adam#phoenix,Princeton.EDU">adam#phoenix,Princeton.EDU</a>, Thu 23 Jul 1998, 20:21 GMT
</LI>
</ul>
<LI><strong><A NAME="00272" HREF="msg00272.html">[MUD-Dev] Re: DBMS in MU*'s</A></strong>, 
quzah <a href="mailto:quzah#geocities,com">quzah#geocities,com</a>, Mon 20 Jul 1998, 20:37 GMT
<UL>
<LI><strong><A NAME="00312" HREF="msg00312.html">[MUD-Dev] Objects (was Re: DBMS in MU*'s)</A></strong>, 
s001gmu <a href="mailto:s001gmu#nova,wright.edu">s001gmu#nova,wright.edu</a>, Wed 22 Jul 1998, 18:26 GMT
</LI>
</UL>
</LI>
<LI><strong><A NAME="00274" HREF="msg00274.html">[MUD-Dev] Re: DBMS in MU*'s</A></strong>, 
Chris Gray <a href="mailto:cg#ami-cg,GraySage.Edmonton.AB.CA">cg#ami-cg,GraySage.Edmonton.AB.CA</a>, Tue 21 Jul 1998, 01:36 GMT
<UL>
<LI><strong><A NAME="00282" HREF="msg00282.html">[MUD-Dev] Re: DBMS in MU*'s</A></strong>, 
s001gmu <a href="mailto:s001gmu#nova,wright.edu">s001gmu#nova,wright.edu</a>, Tue 21 Jul 1998, 20:26 GMT
<UL>
<LI><strong><A NAME="00289" HREF="msg00289.html">[MUD-Dev] Re: DBMS in MU*'s</A></strong>, 
Adam Wiggins <a href="mailto:adam#angel,com">adam#angel,com</a>, Tue 21 Jul 1998, 22:27 GMT
</LI>
</UL>
</LI>
</UL>
</LI>
<LI><strong><A NAME="00672" HREF="msg00672.html">[MUD-Dev] Re: DBMS in MU*'s</A></strong>, 
Chris Gray <a href="mailto:cg#ami-cg,GraySage.Edmonton.AB.CA">cg#ami-cg,GraySage.Edmonton.AB.CA</a>, Wed 12 Aug 1998, 03:48 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>