[Top][All Lists]

 From: Kai Sterker Subject: [Adonthell-devel] On combinations Date: Fri, 1 Feb 2002 00:50:33 +0100

```If we want to use reagents to create spells, there are basically two
possibilities. Either you define all posssible mixtures, which means that
there wouldn't be too many of them. And defining them would mean plenty of
work.

The other possibility would be to calculate the result. In that case you had
virtually zillions of possible combinations.

I spent a couple of hours and came up with something that might be
interesting, so here it is.

In general, if you want to calculate the result of a combination, the items
you combine need properties that you can do some maths with.

For lack of better ideas I came up with the following five:

* Quality
* Water
* Fire
* Air
* Earth

Quality defines how much power the ingredient has.
The other 4 define how the item is made up, with the following additions:

* The sum of the 4 equals 100.
* For valid items, none of the values may be less than 0.
* Air and Water are going well together as do Fire and Earth
* Fire and Water oppose each other, as do Air and Earth

With those basics in mind, when combining items the following will happen.
Each item will be desintegrated, and in the process, the stronger element of
(Air/Water) and (Fire/Earth) will get a boost from the weaker one. At the
same time, the weaker one will be further suppressed by the stronger
opposing element.

Heh. I'll better give an example

Item 1: (Quality 20)

Fire (F)  = 15            E_new = E + F/2       = 42,5
Air (A)   = 20    --->    W_new = W + A/2       = 40
Water (W) = 30            A_new = A + W - E_new = 7,5
Earth (E) = 35            F_new = F + E - W_new = 10
------                                ------
100                                   100

Each item used in the combination will undergo a similar transformation.
The new item is created by simply adding the individual elements weighted by
that item's quality.

Lets do the numbers for another item to see what will happen:

Item 2: (Quality 10)

Fire (F)  = 10            A_new = A + W/2       =  70
Air (A)   = 60    --->    F_new = F + E/2       =  15
Water (W) = 20            W_new = W + A - F_new =  65
Earth (E) = 10            E_new = E + F - A_new = -50
------                                 ------
100                                    100

Result of Item_1 + Item_2:

F_res = 11.67 (= 20 * F_1 + 10 * F_2 / 30)
A_res = 28.33
W_res = 48.33
E_res = 11.67
------
100

In that fashion you could combine any number of items. With the resulting
ratios of elements, you could look up the spell that fits to those values in
a previously defined table.

However, if one (or more) of the resulting elements are less than 0, the
combination will fail and the reagents and ring/amulet/staff to be enchanted
will be destroyed.

What about the quality of the enchantment? Simply adding the qualities of the
reagents would be quite lame, so how about distributing it equally over the
elements of each reagent and then weighting it with the resulting element
values?

Q_res = (11,67 * (0.3 + 0.1) + 28.33 * (0.4 + 0.6) + 48.33 * (0.6 + 0.2) +
11.67 * (0.7 + 0.1)) / 3
= 27

That way, the quality of the enchantment is pretty hard to guess, although it
*should* usually be greater than the quality of the reagents involved.

The way I imagine it, the quality of the enchantment would represent how much
you can charge the spell.

In combat you should be able to define how much of the charge you want to put
into an individual spell casting. So you could either cast a fairly big
number of weak spells, or a few strong ones before you need to recharge.

Guess I'll have to code that up and do some testing to see what comes out,
but I guess the more ordinary spells would be composed of all elements in the
range between 10 and 50. (I might be wrong, as I'Ve just done that single
example.) Less common spells would require more extreme combinations.
All in all, with combinations of 4 different values, we should be able to
have a fair number of spells. :)

Kai

```