[DGD] First of many methodology questions

Noah Gibbs noah_gibbs at yahoo.com
Thu Oct 16 18:40:36 CEST 2003


--- nihilxaos at nihilxaos.com wrote:
> On some muds that I've seen the base user object
> handles absolutely
> everything about the user.

  Yup.  This method is probably actually faster than
breaking it up into smaller objects -- you'll find
that the objects wind up having to send a lot of
information back and forth to the main object since
there's a lot of shared state that everybody cares
about.  That means that the modular method uses more
function calls, so the extra overhead in calling a
top-level function once is less than the extra
overhead of extra between-object function calls.

  So the one-object approach is actually faster if you
do it right.  However, it's also far less modular and
convenient.  More to the point, the total speed hit is
really, really small.  If your MUD is maxing out the
processor (and it shouldn't be for any normal kind of
MUD), this isn't going to be real problem.  Instead
you'll have something else that is either really,
really inefficient or just really, really hard to
calculate in realtime.  Modern processors are scarily
fast, even on cheapo desktop boxes.

> The other option is creating sub-objects (kind of
> like the wiztool) that
> handle specific commands and operations dependent on
> what kind of
> character we're dealing with.

  Yup.  Phantasmal does some of this, but not as much
as Melville.  I separate out big areas of
functionality (like say/emote/tell/gossip/etc) that
are related to each other into wiztool-like objects,
but I don't separate out each individual command.  I
find that this is the best compromise, for me
personally, when it comes to maintenance.  I like all
the related commands to be near each other in case I
have to fix a bug in all the communications commands,
but I don't want to have to sift through all the
non-communications commands.

  Melville's method is pretty damn cool for command
modularity, though.  Eventually I plan to do something
similar, but not as fine-grained.  The Phantasmal
social/soul commands do something like that, in fact.

> The later should ultimately take up more space in
> memory on the whole, but
> each segment would be smaller.

  Yup.  Because of the way DGD does swapping and
memory management, this means they'll be significantly
larger.  On the other hand, say you take an extra 8kb
penalty for every player...  Dude, it's 8kb.  Suck it
up and deal.  If you have 200 simultaneous players,
that's 1.6MB.  And if you have 200 players, the extra
buck and a half spent on memory shouldn't be a big
deal :-)

  I'll respond to Steve Schmidt in a minute -- he made
some good points.


=====
------
noah_gibbs at yahoo.com

__________________________________
Do you Yahoo!?
The New Yahoo! Shopping - with improved product search
http://shopping.yahoo.com
_________________________________________________________________
List config page:  http://list.imaginary.com/mailman/listinfo/dgd



More information about the DGD mailing list