1999Q4/
<!-- MHonArc v2.4.4 -->
<!--X-Subject: Re: [MUD&#45;Dev] Embedded languages, object persistance... ack. -->
<!--X-From-R13: Yriva Zvggyrwbua <qnevhfNpbaarpg.pbz.nh> -->
<!--X-Date: Wed, 29 Dec 1999 14:20:40 &#45;0800 -->
<!--X-Message-Id: 19991229215628.80AFD41817#koro,off.connect.com.au -->
<!--X-Content-Type: text/plain -->
<!--X-Reference: 000c01bf51db$81f3f600$f6088d18#busy1,on.wave.home.com -->
<!--X-Head-End-->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<html>
<head>
<title>MUD-Dev message, Re: [MUD-Dev] Embedded languages, object persistance... ack.</title>
<!-- meta name="robots" content="noindex,nofollow" -->
<link rev="made" href="mailto:darius#connect,com.au">
</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="msg00789.html">Previous</a>
&nbsp;|&nbsp;<a href="msg00792.html">Next</a>
&nbsp;]
&nbsp;&nbsp;&nbsp;&nbsp;
Thread:&nbsp;
[&nbsp;<a href="msg00790.html">Previous</a>
&nbsp;|&nbsp;<a href="msg00792.html">Next</a>
&nbsp;]
&nbsp;&nbsp;&nbsp;&nbsp;
Index:&nbsp;
[&nbsp;<A HREF="author.html#00791">Author</A>
&nbsp;|&nbsp;<A HREF="#00791">Date</A>
&nbsp;|&nbsp;<A HREF="thread.html#00791">Thread</A>
&nbsp;]

<!--X-TopPNI-End-->
<!--X-MsgBody-->
<!--X-Subject-Header-Begin-->
<H1>Re: [MUD-Dev] Embedded languages, object persistance... ack.</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] Embedded languages, object persistance... ack. </LI>
<LI><em>From</em>: Kevin Littlejohn &lt;<A HREF="mailto:darius#connect,com.au">darius#connect,com.au</A>&gt;</LI>
<LI><em>Date</em>: Thu, 30 Dec 1999 08:56:28 +1100</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>

Hey, this stuff looks familiar ;)  Check www.bofh.net.au/mud/ for mine -
python-based, MySQL based, doing persistance and code objects and etc.

(Um - This post has a lot about my own little play area, Moebius, in it.
That's because I'm still trying to find other examples of this stuff.  My
apologies in advance if it sounds like I'm pushing what I've done - I'm
not, it's not nearly ready to run an honest-to-ghod mud yet, and is
probably badly coded to boot - but it's the only thing I know atm ;)

&gt;&gt;&gt; "Joe Kingry" wrote
&gt; I've been trying to figure this out lately. At first glance I generally
&gt; thought I knew what it was about, but now I'm not so sure.
&gt; 
&gt; I mean, I know what the goals in general are. Persistance. You have a house
&gt; say in some place in the world. It get's damaged, it stays damaged until it
&gt; is repaird. So persistence is done through some kind of database, or
&gt; multiple databases broken up to distribute categories/workload.

Databasing gives you a little more than that in terms of persistance, tho.
Because there's no load/save, things are committed immediately, there's no
potential loss of information in crash etc.  Also, if you're storing time,
you can either roll the database forward on restarting a mud, or split out
things like the event engine and run that seperately from the rest of the
mud - so it's "alive", even when the mud isn't.

&gt; I want a mud server on which I can change the code online of say a skill, a
&gt; spell or something else. I understand that this is the purpose of having an
&gt; embedded language that runs "on top of" the mud's driver. i.e. MUF for MUQ,
&gt; Python for AR3 etc.  So in general I know this code is to be compiled since
&gt; you don't want to be executing "scripts", but is this code an object? and
&gt; then is the byte-code stored? ack.. I'm confused.

In mine, yeah, bytecode is stored in the database.  You _can_ treat the
code as objects (as I'm about to play with doing), or you can re-build them
as methods on objects - so a door would be an object, the open and close
methods (which exist in the database, so you can hack them up whenever) are
methods on the object, and are re-attached when they're executed.

I suspect others have different ways of dealing with it, and I suspect
it'll be affected by the ease of doing certain things in certain languages.

&gt; Here, I'll try to demonstrate what I little I think I know from MUSH type
&gt; enviroments. A MUSH allows you to create an object. Great. This object is
&gt; unique and persistent. Ie. it will be there when you get back if you so
&gt; desire. You can assign code to execute based upon certain defined actions on
&gt; the object, or you can create a new action for this object. Going by this
&gt; model then, does that mean every single object in these "new" muds is a
&gt; class and is inherited from a previous object? But then it's executed how?

That's not a problem.  (and yeah, every object can be considered a class
also).  Python at least offers you the ability to 'execute' classes - you
just give them a __call__ method, and you can call them.  Best used for:

class player:
  def attr1
  def attr1

normalPlayer = player()

normalPlayer.strength = normalPlayer.strength + 20

dwarfPlayer = normalPlayer()

If you've done good databasing in the backend, creating an instance of a
player, tweaking it, then using it as a class essentially means you created
a new 'type' of object.

Moebius starts with a bunch of pre-defined object types - player, object,
location - but they're completely arbitrary, and not at all needed.  They
make life easier for the creators - create a 'door' object, you
automatically get dest_location attributes and an open() and close()
function.

Why should you treat classes and instances seperately?

(Incidentally, there's a topic in there I'd love to pursue with other
like-minded souls - multiple inheritance vs. single inheritance, levels of
inheritance, and the possibility of a 'kit' approach on top of inheritance
- so you go "mageDwarf = mageKit(dwarfPlayer)" to extend things, then
optionally use _that_ as a prototype...)

&gt; I think I have my object/class/code/driver concepts all muddled.

It does seem to get mixed up once you start playing with this stuff.
Objects are things that exist, classes are the things you create them from
(and can optionally be objects themselves, in some cases, maybe?), code is
executable stuff that belongs to objects (or floats free), the driver is
the underlying core that should not need changing(tm)...

ColdC looked like another interesting place to look for stuff like this.

&gt; 
&gt; All I want in a mud server is this:
&gt; 
&gt; -stores things in a database file(s). No more 4000 player files.
&gt; -allows me to define objects online. Ie. I can decide I need an object that
&gt; will act like a boat, and I can code and modify this online.

Part of the trick to that is being able to add new methods.  For example, I
wanted doors to work - so I coded 'close' and 'open' functions to toggle a
attribute 'open' in the object they're attached to, added that attribute
(and those functions) to something, re-coded the 'move' function to pay
attention to whether the door was open or not - and presto, closeable doors
;)  Should be doable, but you need to have access to change even the base
functions like move and look every so often...

&gt; -doesn't have every object in memory, only when needed, otherwise on file.

Yup, although you'd be surprised what's "needed", when you've got complex
interactions happening.  Moebius handles this really badly atm  :(  Because
the top-level code pretends it's not using a database, it touches every
object when you do things like 'who' or 'list live creatures' or whatever.

&gt; -doesn't require me to learn it's "own custom embedded language", this one
&gt; really gets to me
&gt; -somehow allows for security and access levels while coding

This is really interesting.  Moebius at the moment is dog-slow, because of
'bastioning' - protecting the internal classes from external view (python
doesn't have a concept of public vs. private attributes in objects).  That
has to be done for the sake of one variable - the 'self._db' - which gives
full access to the database :(

I'd love to find a solution to this, but it's an interesting exercise
creating objects that can talk to the database, and then creating a view of
those objects that can only use the defined methods.

&gt; -somehow allows for an event type system

That's a whole 'nother kettle of fish ;)  Also another thing I've got to
read up on - what do people consider appropriate for event systems/what
needs to be supported?

&gt; -allows code to be contained in packages and has appropriate management
&gt; features. Ie. I can write the code offline in a file and then upload the
&gt; file to the server

Upload?  Hrm.  I'm going to shortly write something that drags code from
the database, presents it in a flashy tk-based window, lets you edit it,
and commit the changes.  Would that be the sort of thing you're thinking
of?

Once you throw a db into the equation, your ability to tinker with things
_should_ increase dramatically - you open up a range of ways of dealing
with the data, from web pages (see below) to python/tk/C/C++/perl/insert
favourite language here, to the "stranger" (because I don't know anything
about 'em ;) things like ODBC...

(Hrm - forte as a mud building tool...)

&gt; -will allow for http access to the database

If you've got a database, you've got that - um, again, check
www.bofh.net.au/mud/, in particular the 'live' section there.  I cheat -
Zope has beautiful database connectivity, so it's simply a case of writing
the sql to retrieve the info from the db, and wrapping that sql in basic
pages.

&gt; 
&gt; An added bonus would be, but hardly nessesary:
&gt; -driver ported to both Win32 platform and *nix platforms and database is
&gt; independent of platform.

Pick a platform-independant language, any platform-independant language ;)
python/java for your base code, pretty much any database, ODBC support and
you're there...

&gt; Muq seems to have most of these except for MUF, I got tired of programming
&gt; backwards ;).
&gt; Then there is Momoko, it uses Java which would be great, but I'm not quite
&gt; sure how to go about things and if it insists on having everything in memory
&gt; or not and file management etc and i'm unclear if every unique object is
&gt; it's own class on a persistent system.

Hrm - new things to look at ;)

It looks like the answers to your questions might be codebase specific, in
honesty.  I can say what' I've done in Moebius, others will be able to
explain the object/class model and inheritance system for their own
codebases - but those are not likely to be the same thing across muds.  In
fact, I suspect with the newer muds, they're being built specifically to
try out new and interesting ways of modelling objects, at least in part ;)

KevinL



_______________________________________________
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="00790" HREF="msg00790.html">[MUD-Dev] Embedded languages, object persistance... ack.</A></STRONG>
<UL><LI><EM>From:</EM> "Joe Kingry" &lt;jkingry#uwaterloo,ca&gt;</LI></UL></LI>
</UL></LI></UL>
<!--X-References-End-->
<!--X-BotPNI-->
<UL>
<LI>Prev by Date:
<STRONG><A HREF="msg00789.html">Re: [MUD-Dev] Two threads forced to one CPU? (was: Collecting ideas for a MUD server...)</A></STRONG>
</LI>
<LI>Next by Date:
<STRONG><A HREF="msg00792.html">Re: [MUD-Dev] Embedded languages, object persistance... ack.</A></STRONG>
</LI>
<LI>Prev by thread:
<STRONG><A HREF="msg00790.html">[MUD-Dev] Embedded languages, object persistance... ack.</A></STRONG>
</LI>
<LI>Next by thread:
<STRONG><A HREF="msg00792.html">Re: [MUD-Dev] Embedded languages, object persistance... ack.</A></STRONG>
</LI>
<LI>Index(es):
<UL>
<LI><A HREF="index.html#00791"><STRONG>Date</STRONG></A></LI>
<LI><A HREF="thread.html#00791"><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="00790" HREF="msg00790.html">[MUD-Dev] Embedded languages, object persistance... ack.</A></strong>, 
Joe Kingry <a href="mailto:jkingry#uwaterloo,ca">jkingry#uwaterloo,ca</a>, Wed 29 Dec 1999, 17:00 GMT
<UL>
<LI><strong><A NAME="00791" HREF="msg00791.html">Re: [MUD-Dev] Embedded languages, object persistance... ack.</A></strong>, 
Kevin Littlejohn <a href="mailto:darius#connect,com.au">darius#connect,com.au</a>, Wed 29 Dec 1999, 22:20 GMT
</LI>
<LI><strong><A NAME="00792" HREF="msg00792.html">Re: [MUD-Dev] Embedded languages, object persistance... ack.</A></strong>, 
Laurent Bossavit <a href="mailto:bossavit#cybercable,fr">bossavit#cybercable,fr</a>, Wed 29 Dec 1999, 22:40 GMT
</LI>
</UL>
<UL>
<li>&lt;Possible follow-up(s)&gt;<br>
<LI><strong><A NAME="00793" HREF="msg00793.html">Re: [MUD-Dev] Embedded languages, object persistance... ack.</A></strong>, 
cg <a href="mailto:cg#ami-cg,GraySage.Edmonton.AB.CA">cg#ami-cg,GraySage.Edmonton.AB.CA</a>, Thu 30 Dec 1999, 05:09 GMT
</LI>
</UL>
</LI>
<LI><strong><A NAME="00782" HREF="msg00782.html">Re: [MUD-Dev] Two threads forced to one CPU? (was: Collecting ideas for a MUD server...)</A></strong>, 
cg <a href="mailto:cg#ami-cg,GraySage.Edmonton.AB.CA">cg#ami-cg,GraySage.Edmonton.AB.CA</a>, Fri 24 Dec 1999, 19:03 GMT
<UL>
<LI><strong><A NAME="00787" HREF="msg00787.html">Re: [MUD-Dev] Two threads forced to one CPU? (was: Collecting ideas for a MUD server...)</A></strong>, 
Hans-Henrik Staerfeldt <a href="mailto:hhs#cbs,dtu.dk">hhs#cbs,dtu.dk</a>, Tue 28 Dec 1999, 16:05 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>