[MUD-Dev] Virtual Chemistry

Nathan Yospe yospe at hawaii.edu
Fri Aug 1 12:42:23 CEST 1997


On Fri, 1 Aug 1997, Matt Chatterley wrote:

:On Wed, 30 Jul 1997 clawrenc at cup.hp.com wrote:

:[Snip my original post]

:> First thoughts on a representational model:

:>   Create a coordinate system.  
:>   The axis of the coordinate system are the principles of your
:>     alchemy system (yes, lotsa dimensions).
:>   The purpose of the coordinate system is to define the 
:>     behaviour of a substance.
:>   Given a substance, a coordinate location can be computed from 
:>     its components.
:>   Given a coordinate location, the effect of the substabce can 
:>     be derived.

Ghah, gets messy. I have a series of "universal" chemical attributes, and
one of "specialized" attributes, that can be inherited by any substance.
There are few specialized attributes... none so far. But I have individual
compounds seperately defined. No way am I going to try to _predict_ the
results of a reaction. Undefined reactions just fizzle.

:I was initially unsure about this, but the more I thought - the more I
:liked it, and, for what I want to create, it makes perfect sense, and
:seems to work nicely (at least theoretically).

Luck to you.

:> Thus the leaves of the herb WaggaWagga might have a coodinate weight
:> of (-5, 8, 3) presuming the simplistic case of only 3 principles.  The
:> root of the UmbaUmba plant might have a value of (2, 9, -10).  Mix
:> then together with GooGoo mud (0, 0, 2), and you get a substance (-3,
:> 17, -5).  That location can be plotted in the coordinate system and a
:> result computed:

:>   A minor weakening agent (-3) that also a *really* effective sleeping
:> draught (17), and reduces physical dexterity (-5).

With these kinds of properties, do have any idea how _huge_ the list would
get? (Um. All of the above qualify as "specialized" attributes, now that I
think of it.)

:Yup. Of course, you'd need many more properties tracked.. but still, we
:have the basic spirit captured here. First things which came to mind were
:properties to track reactivity of substances, acidity, and magical
:capacitance. More general things with relevant to the mixing of
:chemicals. A question rose subsequently here - what about by products? How
:do we tell if a by product should be produced? I have yet to answer that
:one.

I _do_ have ph, solubility in polar and nonpolar, state (crystal, liquid,
gas, glass, and plasma), density, reactions (actually externally
tracked... there is a pointer to every derivative, and the derivative
backpoints to its components... most reactions require some trigger that
looks to generate reactions, IE heat.), color, maleability, rebound, etc.
Some of these only apply to solid states, of course.

:> Or some such similar whatever.  You can then add other weightings,
:> such taht the WaggaWagga(-5, 8, 3) gets an added (-2, 1, -8) value
:> added if it is prepared by grinding in a special stone bowl while
:> chanting the desiderata backwards.  

:It's easy to add in special cases once you have an established system,
:almost trivial (some sort of basic db format seems in order, loaded at
:runtime). Also, consider the states of compouds - mixing two solids
:(powders) is hard. Or rather, you can mix them easily, but not chemically
:combine them (unless they *really*really* react!). Of course, its not the
:same with two liquids, and/or a liquid and a powder. Gases are pretty
:tricky to react, too (without appropriate equipment).

Of course, there is the example of charcoal, saltpeter, and sulphur.

:Incidentally, bringing in the concept of tracking state produces a flaw in
:the design of many stock (LP) bases - you have a drink inheritable, which
:all drinkable substances must include, defining alchoholic properties etc
:(this is pretty standard accross LP, excepting very different games). Of
:course, this is not going to really work with liquids - in theory you can
:drink any liquid, but you don't want to inherit drink into all of them!

So isn't a drink a solution of ethanol and something else? And therefore
liquid state?

:Simple solution: Ditch the lame idea of a drink inheritable, and simply
:make drinks chemicals with appropriate properties. This also allows the
:use of common drinks (eg: water) in such reactions as formation of
:solutions from powders, and dilution of solutions (and also brings in the
:notion of concentration of solution). Excellent.

Quite. Well done.

:> The reason for doing a coordinate system rather than a flat expression
:> for each axis is tht it allows you to put in break values.  Simple
:> things like values on this axis smaller than X have this effect, and
:> larger than Y have this totally other effect.  Compound that across
:> multiple axis, and you can get a result which is far removed from the
:> intial components.

What of features like shear? There is no antishear...

:Definitely. You can literally simulate the change in properties of
:alchohols as you increase the length of the carbon chain (aka, add CH2 to
:go up from Methanol to Ethanol, to Propanol and then Butanol, etc). The
:effects are fairly subtle(ish), but mappable in this way. Woo.

Of course, this means ignoring the reality, or actually specifying the
reaction.

:> Next up would be to then special case certain combinations (reflective
:> alchemy), such that components A (which normally has a very simple
:> effect), and B (similarly simple), in combination do something else
:> entirely (ie mutate into a totally different coordinate.

:You could do special cases both by mutation of one or more properties, or
:just by taking an effect 'out of the hat' and assigning it, so to speak
:(for instance, a binary liquid, which is harmless on its own, but explodes
:without explanation on contact with another similar liquid).

The reason I make these things _always_ specified is that I have almost
never seen anything that wasn't an exception to logical rules in this
arena.

:> This special casing can be handled without undue difficulty by
:> building it into the base system.  Again, going back to the simplistic
:> 3 principles above, just add various other "fake" principles after
:> that.  Thus WuggaWugga could be (-5, 8, 3, 0, 12, 2) and UmbaUmba (2,
:> 9, -10, -5, 9, -10).  Then when they're mixed the result is (-3, 17,
:> -2, -5, 21, -8).  Now you can do your special casing on the fake
:> values (-5, 21, -8).  Say things like if the first fake value is less
:> than -5 it was apply (X,Y,Z) to the base matrix, it its over +5 apply
:> (Q,R,S) etc.  This results in a really simple way to codify the
:> exceptions and and special cases while allowing new compnents to be
:> added which have their own unique behaviours.

:Yup.
:
:> >Has anyone actually attempted anything of this nature, or
:> >contemplated it?

Something in the same continent, at least.

:> Nope.

:Well - that answer is changing now. The above reflect a few of my
:considerations as I put pen to paper to map this out properly.

*nod*

:Another random one that just flew past:

:We can represent loose solids in a room easily. Liquids fairly easily
:(pools that can be manipulated with some difficulty, and that evaporate
:over time based on their volitality), but what about gases? Should we
:begin measuring the atmospheric compositions of a room/area/whatever, and
:allowing for temporary changes?

Well, it should be taken for granted that I model as much of this as is
interesting at any point in time. Meaning I don't actually do a barometer,
unless a room has suffered a sudden serious pressure change (airlock), in
which case it is fully evaluated. Poison gasses and gas grenades are an
important factor in my game, as are mists. Evaporation of a fluid happens
only if it has checked _interesting effect_ and
_non-infinite-evaporation_. An object (a fluid) is only checked once.

"You? We can't take you," said the Dean, glaring at the Librarian.
"You don't know a thing about guerilla warfare." - Reaper Man,
Nathan F. Yospe  Registered Looney                   by Terry Pratchett
yospe at hawaii.edu   http://www2.hawaii.edu/~yospe           Meow




More information about the mud-dev-archive mailing list