Jump to content

Spell Analysis


Niemand

Recommended Posts

Inspired by Nioca's recent research, I decided to revisit a problem that I first started working on some time ago, namely spell formulas. So far I have derived what I believe to be a complete formula for the damage inflicted by Bolt of Fire.

 

Method:

All spells were cast on a completely unarmored, level 1 goblin, defined thusly:

Click to reveal..
Code:
begindefinecreature 255;	import = 21;begindefinecreature 21;	clear;	cr_name = "Goblin";	cr_level = 1;	cr_default_attitude = 4;	cr_species = 1;	cr_which_sheet = 1521;	cr_summon_class = 1;

 

The caster was my usual guinea pig, Ampersand, a level 1 character with utterly minimal skills. Certain skills were boosted in small increments to determine their impact.

 

In order to determine a damage formula, I made certain assumptions about its general form. These were:

-Only positive integers are used in calculations

-A non zero number m of dice with side values [1,n] with n another positive number

-A non negative constant may be added to the sum of the dice rolls

I did not allow for dice to have side values beginning at a value larger than 1. While I don't have a proof of this, my scribblings indicate that doing so leads to no increase in generality.

 

With these constraints it is possible to enumerate all of the possible dice combinations which could produce an observed distribution. Denoting such a combination as [m]d[n]+[r] where m is the number of dice, n is the number of sides, and r is the added constant, the mean of the resulting distribution is in the range [m+r,mn+r] with mean µ=(m+r+mn+r)/2=(m(n+1))/2+r. This last expression can be solved for n to give n=(2/m)(µ-r)-1=(2µ-2r)/m-1. We can place conditions on the set of dice based on the range of the observed distribution; these would be exact except in real sampling the tails of the distribution are difficult to resolve, so the best we can do is to require that the range of the theoretical distribution be greater than or equal to that of the observed distribution. Letting the observed minimum and maximum be a and b, respectively: m+r≤a, mn+r≥b. These conditions will be redundant, either being of equal strength or with one being stronger than the other, so we can just choose to always use the stronger one. Assuming that this is the minimum condition (if the maximum condition is stronger we can rewrite it as though it had been the minimum condition) and using the assumptions that r≥0 and m>0 the possible solutions are confined to a right triangular area on the mr-plane. For each of the m,r pairs in this area we can compute the required value of n from the mean formula (n=(2µ-2r)/m-1), noting that we can additionally reject all pairs for which 2µ-2r is not evenly divisible by m. (This form in which the 2 has been distributed over the difference is useful because µ may be half-odd-integer and this form allows us to work exclusively with 2µ so that only integer math is required.)

 

Having listed all (m,n,r) combinations which could produce the observed results it's fairly straightforward to evaluate which is the closest fit to the data. At the moment I simply evaluate the theoretical distribution of results from each set of dice by brute force, tallying up every possible combination. These distributions are then compared to the data using a chi squared test. I'm not implementing this test quite correctly at present, as apparently it's supposed to be done only on counts not of proportions, but i don't think this makes a material difference since I ignore the magnitudes of the resulting values, as I only need to compare them relative to each other.

 

Results (So far):

At this point I have only had time to collect data on the Bolt of Fire spell's dependence on the caster's Intelligence, Mage Spells skill, Magery, and spell level. The raw data, along with the code of the analysis program can be downloaded here(8 KB). Many goblins died to bring us this information. (Over 3000 of them.) Since a character cannot have less than 2 INT and 1 MAG and 1 level of the spell are required to cast it at all, this was my starting point. I tested 10 settings listed here as INT, MAG, Magery, Spell Level:

Code:
Setting 	Formula-----------------------2,1,0,1		2d4+32,1,0,2		4d4+32,1,0,3		4d5+6 (6d4+3 is a close second fit)2,1,0,4		8d4+33,1,0,1		2d4+44,1,0,1		2d4+52,2,0,1		2d4+42,3,0,1		2d4+52,1,1,1		2d4+42,1,2,1		2d4+5

This implies that the general formula is:

Code:
Bolt of Fire damage = (2*Spell Level)d4+(INT+MAG+Magery)
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...