[MUD-Dev] Virtual Chemistry

Jon A. Lambert jlsysinc at ix.netcom.com
Mon Jul 14 00:14:21 CEST 1997


> From: Matt Chatterley <root at mpc.dyn.ml.org>
> Subject: [MUD-Dev]  Virtual Chemistry
> On Sat, 12 Jul 1997, Jon A. Lambert wrote:
> 
> [Snip my original post]
> 
> > An excellent idea.  I think we may have peripherally touched on this
> > concept in a thread on "assemblies" of objects.  It was my thought that
> > these assemblies would have there own predefined attributes and methods
> > that hide unassembled objects attributes and methods.  The assembly class
> > might have an assemble method and a disassemble method.  The assemble
> > method checking that all components are present and the disassemble 
> > creates the aggregated objects upon disassembly.
> > I think some rudimentary chemistry/alchemy could be implemented using 
> > this technique.  
> 
> I think so. Perhaps basic checking on assemble, ie 'are they mixable?'
> (ie, you can't really mix a liquid and a gas), and then a causitive result
> (just what *will* happen if you mix ground up dragons tooth and wolves
> blood?). A central information storage could record that 'elements' X Y
> and Z have certain reactions with each other, and mixtures could report
> the quantities of each the contain to get the appropriate return, even.
>
My assumptions were that the results of the combination/assembly were 
known in advance (created by builders).  I see from some of the other
posts and yours here that you could in fact create new assemblys on the fly 
given enough rudimentary (al)chemistry.  Perhaps this is a more interesting 
way to proceed?  
  
> > Perhaps some attributes of an assembly class could be:
> > 
> > components list
> > spells list
> > energy/mana consumer
> > energy/mana producer
> > components list destroyed upon assembly
> > components list released upon disassembly
> 

Another mundane example of alchemy using some odd mud language:

class bread implements assembly {
 list components = ((wheat , 2 cups),(salt, 1 tsp),(yeast,1 tsp));
 list skills = ("bake");
 list spells = ();
 int energy = 5000; // Cal
 int time = 40; // min
 list released = (crumbs);
 list destroyed = (wheat ,salt, yeast);

 class method assemble() {
   if (components.present() and skills.check() and energy > 5000) {
     components.destroy();	
     consume(energy);
     return create(time); // instance bread in time
   }
 }

 class method disassemble() {
   released.create();
   destroyed.delete();
   return energy;
 }

 instance method eat() { 
   return disassemble();
 }

 class method bake() { 
   return assemble();
 }

}

Just a start, full of holes. :)


JL

-
I am the Dragon of Grindly Grund, but my lunches aren't very much fun,
For I like my damsels medium rare, And they always come out well done.

----------

 



More information about the mud-dev-archive mailing list