1998Q1/
<!-- MHonArc v2.4.4 -->
<!--X-Subject: Re: [MUD&#45;Dev]  Describing the environment -->
<!--X-From-R13: Dvpuneq Ibbypbpx <YnHveNqvny.cvcrk.pbz> -->
<!--X-Date: Tue, 03 Mar 1998 23:43:08 +0000 -->
<!--X-Message-Id: 34FD1532.2476#dial,pipex.com -->
<!--X-Content-Type: text/plain -->
<!--X-Reference: 34EC5ADA.845C920D#enid,com -->
<!--X-Head-End-->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<html>
<head>
<title>MUD-Dev message, Re: [MUD-Dev]  Describing the environment</title>
<!-- meta name="robots" content="noindex,nofollow" -->
<link rev="made" href="mailto:KaVir#dial,pipex.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="msg00678.html">Previous</a>
&nbsp;|&nbsp;<a href="msg00680.html">Next</a>
&nbsp;]
&nbsp;&nbsp;&nbsp;&nbsp;
Thread:&nbsp;
[&nbsp;<a href="msg00678.html">Previous</a>
&nbsp;|&nbsp;<a href="msg00672.html">Next</a>
&nbsp;]
&nbsp;&nbsp;&nbsp;&nbsp;
Index:&nbsp;
[&nbsp;<A HREF="author.html#00679">Author</A>
&nbsp;|&nbsp;<A HREF="#00679">Date</A>
&nbsp;|&nbsp;<A HREF="thread.html#00679">Thread</A>
&nbsp;]

<!--X-TopPNI-End-->
<!--X-MsgBody-->
<!--X-Subject-Header-Begin-->
<H1>Re: [MUD-Dev]  Describing the environment</H1>
<HR>
<!--X-Subject-Header-End-->
<!--X-Head-of-Message-->
<UL>
<LI><em>To</em>: <A HREF="mailto:mud-dev#null,net">mud-dev#null,net</A></LI>
<LI><em>Subject</em>: Re: [MUD-Dev]  Describing the environment</LI>
<LI><em>From</em>: Richard Woolcock &lt;<A HREF="mailto:KaVir#dial,pipex.com">KaVir#dial,pipex.com</A>&gt;</LI>
<LI><em>Date</em>: Wed, 04 Mar 1998 00:47:46 -0800</LI>
</UL>
<!--X-Head-of-Message-End-->
<!--X-Head-Body-Sep-Begin-->
<HR>
<!--X-Head-Body-Sep-End-->
<!--X-Body-of-Message-->
<PRE>
Stephen Zepp wrote:
&gt; 
&gt; This is a re-post of a previous message, do to the revival of a similar thread.
&gt; 
&gt; I've been thinking about this for a few days, after hearing about it here and
&gt; seeing it on Kavir's mud, and I'd like to hear thoughts/suggestions on a generic
&gt; module to describe objects, people, etc.For simplicity's sake, I'm gonna just

[snip]

&gt; Okay, comments?

Well I assume you are prompting me, so here is a rough description of how I do
it:

*MOBS/PLAYERS*
Description is generated according to appearance and age, ie:

[snip]
    if ( years &lt; 13 ) switch ( char_app( ch ) )
    {
        default: looks = "a"; break;
        case 0:  case 1: looks = "an ugly"; break;
        case 3:  case 4: looks = "a cute"; break;
        case 5:  case 6: case 7: case 8: case 9: case 10:
                 looks = "a beautiful"; break;
    }
    else if ( years &gt;= 40 ) switch ( char_app( ch ) )
    {

[snip to later part of code]

    if ( ch-&gt;sex == SEX_FEMALE )
    {
        switch ( years )
        {
            case 0:
                sprintf(buf,"%s newborn baby", looks); break;
            case 1:
                sprintf(buf,"%s tiny little baby", looks); break;
            case 2:
                sprintf(buf,"%s little baby", looks); break;
            case 3:
                sprintf(buf,"%s baby", looks); break;
            case 4:
                sprintf(buf,"%s toddler", looks); break;
            case 5: case 6: case 7: case 8:
                sprintf(buf,"%s little girl", looks); break;
            case 9: case 10: case 11: case 12:
                sprintf(buf,"%s young girl", looks); break;
            case 13: case 14: case 15:
                sprintf(buf,"%s young teenage girl", looks); break;
            case 16: case 17: case 18: case 19:
                sprintf(buf,"%s teenage girl", looks); break;
            case 20: case 21: case 22: case 23: case 24: case 25:
                sprintf(buf,"%s young woman", looks); break;
            case 26: case 27: case 28: case 29: case 30:
            case 31: case 32: case 33: case 34: case 35:
            case 36: case 37: case 38: case 39:
                sprintf(buf,"%s woman", looks); break;
            case 40: case 41: case 42: case 43: case 44:
            case 45: case 46: case 47: case 48: case 49:
                sprintf(buf,"%s middle-aged lady", looks); break;
            default:
                sprintf(buf,"%s elderly lady", looks); break;
        }
[snip]

This description is currently generated every time the player connects,
or when a dynamic mob is created.  If I code anything to let people
change their appearance stat then I'll probably call the function again
from that.  People age at approximately 1 mud year per 6 days real time.

*OBJECTS*
Object descriptions are currently generated according to a number of
values (each character of an alphabetical string), as well as the
condition of the object, ie:

[snip]
    switch ( values[0] )
    {
        default: send_to_char("BUG.\n\r",ch); return;
        case 'a':
            obj-&gt;wear_flags = ITEM_TAKE + ITEM_WEAR_LEGS;
            pair_of = TRUE;
            switch ( values[1] )
            {
                default: send_to_char("BUG.\n\r",ch); return;
                case 'a': strcpy( buf1, "jeans" ); break;
                case 'b': strcpy( buf1, "trousers" ); break;
                case 'c': strcpy( buf1, "skirt" ); break;
                case 'd': strcpy( buf1, "kilt" ); break;
                case 'e': strcpy( buf1, "miniskirt" ); break;
                case 'f': strcpy( buf1, "leather trousers" ); break;
	    }
	    break;
        case 'b':

[snip to later part of code]

    switch ( values[8] )
    {
        default : send_to_char("BUG.\n\r",ch); return;
        case 'a': case 'b': case 'c': case 'd': case 'e':
        case 'f': case 'g': case 'h': case 'i': case 'j':
        case 'k':
            if ( ch-&gt;size &lt; values[8] )
                size_fit = -1;
            else if ( ch-&gt;size &gt; values[8] )
                size_fit = 1;
            break;
    }

[snip to later part of code]

    if ( obj-&gt;condition &gt;= 100 )
        strcpy( dam_mes, "" );
    else if ( obj-&gt;condition &gt;= 75 )
    {
        switch ( obj_dam )
        {
            default:
                strcpy( dam_mes, "torn " ); break;
            case DAMAGE_HARD:
                strcpy( dam_mes, "slightly dented " ); break;
            case DAMAGE_WEAPONS:
                strcpy( dam_mes, "slightly notched " ); break;
        }
    }
    else if ( obj-&gt;condition &gt;= 25 )

[snip to later part of code]

    if ( is_weapon )
    {
        if ( obj-&gt;condition &gt;= 100 )
            sprintf( buf, "%s %s %s", an_not_a ? "an" : "a", buf3, buf1 );
        else
            sprintf( buf, "a %s%s %s", dam_mes, buf3, buf1 );
    }
    else switch ( obj-&gt;wear_loc )
    {
            sprintf( buf, "a %s%s%s%s %s", dam_mes,
                pair_of ? "pair of " : "",
                size_fit &gt; 0 ? "tight-fitting " :
                    size_fit &lt; 0 ? "loose-fitting " : "", buf2, buf1 );
            break;
        case WEAR_FACE:
            sprintf( buf, "a %s%s%s %s", dam_mes,
                pair_of ? "pair of " : "", buf2, buf1 );
[snip]

Sorry to quote so much code, but its easier than trying to describe without
examples ;)

Objects are renamed every time they are worn, removed, damaged or repaired.
At the moment the descriptions only vary in terms of size (tight, loose)
and damage, but as soon as I get some free time I'll update it to also 
include blood stains (wet and dry), wetness, rust (for metal - I already
have material types so it shouldn't be too hard), dirt and various other 
things.  The result is that fighting can seriously mess up you clothing -
but then I am trying to get away from pure hack-and-slash anyway, so it
shouldn't be a problem.

As a quick example of what the equipment looks like:

&lt;[Healthy] [Exp:538]&gt; eq
You are using:
[On Body       ] a tight-fitting black t-shirt
[On Legs       ] a ripped pair of black leather trousers
[On Feet       ] a pair of black boots
[On Hands      ] a shredded pair of black leather gloves
[Around Body   ] a tight-fitting black jacket
[Around Waist  ] a torn black leather belt
[Around Wrist  ] a silver watch
[Right Hand    ] a slightly notched iron shortsword
[Left Hand     ] a notched iron knife
[On Face       ] a slightly dented pair of black shades

Now I admit the code is not written as well as it could be, but I hope
this will give some insight into a possible solution to Stephen's 
suggestion.

KaVir.

</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="00678" HREF="msg00678.html">Describing the environment</A></STRONG>
<UL><LI><EM>From:</EM> Stephen Zepp &lt;zoran#enid,com&gt;</LI></UL></LI>
</UL></LI></UL>
<!--X-References-End-->
<!--X-BotPNI-->
<UL>
<LI>Prev by Date:
<STRONG><A HREF="msg00678.html">Describing the environment</A></STRONG>
</LI>
<LI>Next by Date:
<STRONG><A HREF="msg00680.html">Re: [MUD-Dev] Unique items (was: Graphic MUDS/Ultima Online)</A></STRONG>
</LI>
<LI>Prev by thread:
<STRONG><A HREF="msg00678.html">Describing the environment</A></STRONG>
</LI>
<LI>Next by thread:
<STRONG><A HREF="msg00672.html">Tutorial: Let's build a Compiler! - Part XIII: Procedures</A></STRONG>
</LI>
<LI>Index(es):
<UL>
<LI><A HREF="index.html#00679"><STRONG>Date</STRONG></A></LI>
<LI><A HREF="thread.html#00679"><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="00683" HREF="msg00683.html">VEIL Network Protocol</A></strong>, 
Brandon Gillespie <a href="mailto:brandon#roguetrader,com">brandon#roguetrader,com</a>, Wed 04 Mar 1998, 15:32 GMT
<LI><strong><A NAME="00682" HREF="msg00682.html">Monthly FAQ Posting</A></strong>, 
Ling <a href="mailto:K.L.Lo-94#student,lboro.ac.uk">K.L.Lo-94#student,lboro.ac.uk</a>, Wed 04 Mar 1998, 13:28 GMT
<LI><strong><A NAME="00681" HREF="msg00681.html">Re: [MUD-Dev]	Tutorial: Let's build a Compiler!</A></strong>, 
Chris Gray <a href="mailto:cg#ami-cg,GraySage.Edmonton.AB.CA">cg#ami-cg,GraySage.Edmonton.AB.CA</a>, Wed 04 Mar 1998, 01:39 GMT
<LI><strong><A NAME="00678" HREF="msg00678.html">Describing the environment</A></strong>, 
Stephen Zepp <a href="mailto:zoran#enid,com">zoran#enid,com</a>, Tue 03 Mar 1998, 22:36 GMT
<UL>
<LI><strong><A NAME="00679" HREF="msg00679.html">Re: [MUD-Dev]  Describing the environment</A></strong>, 
Richard Woolcock <a href="mailto:KaVir#dial,pipex.com">KaVir#dial,pipex.com</a>, Tue 03 Mar 1998, 23:43 GMT
</LI>
</UL>
</LI>
<LI><strong><A NAME="00672" HREF="msg00672.html">Tutorial: Let's build a Compiler! - Part XIII: Procedures</A></strong>, 
Jon A. Lambert <a href="mailto:jlsysinc#ix,netcom.com">jlsysinc#ix,netcom.com</a>, Mon 02 Mar 1998, 21:39 GMT
<LI><strong><A NAME="00671" HREF="msg00671.html">Tutorial: Let's build a Compiler! - Part XII: Miscellany</A></strong>, 
Jon A. Lambert <a href="mailto:jlsysinc#ix,netcom.com">jlsysinc#ix,netcom.com</a>, Mon 02 Mar 1998, 21:38 GMT
<LI><strong><A NAME="00670" HREF="msg00670.html">Tutorial: Let's build a Compiler! - Part XI: Lexical Scan Revisited</A></strong>, 
Jon A. Lambert <a href="mailto:jlsysinc#ix,netcom.com">jlsysinc#ix,netcom.com</a>, Mon 02 Mar 1998, 21:38 GMT
<LI><strong><A NAME="00667" HREF="msg00667.html">Re: [MUD-Dev] Net protocols for MUDing</A></strong>, 
Chris Gray <a href="mailto:cg#ami-cg,GraySage.Edmonton.AB.CA">cg#ami-cg,GraySage.Edmonton.AB.CA</a>, Mon 02 Mar 1998, 09:35 GMT
</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>