modding:guide:intro_dice_stats
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revision | |||
| modding:guide:intro_dice_stats [2012/04/08 19:24] – rpc | modding:guide:intro_dice_stats [2014/12/27 04:40] (current) – external edit 127.0.0.1 | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| + | ===== Introduction to Dice Stats ===== | ||
| + | considering a **aDb+c** dice throw | ||
| + | |||
| + | * min damage: **a+c** | ||
| + | * max damage: **ab+c** | ||
| + | * average between max damage and min damage: **(ab+a+2c)/ | ||
| + | |||
| + | now, we want to calculate 2 arrays, the first is the array with the list of all possible throw in order: lets call this a1 | ||
| + | it start at **a+c** and finishes at **ab+c** | ||
| + | so | ||
| + | < | ||
| + | a+c, a+c+1, ..., ab+c-1, ab+c | ||
| + | </ | ||
| + | how long is this array ? **ab-a+1** | ||
| + | |||
| + | now let's consider a second array (a2), as long as the first, and fill it with the corresponding values of the probability of the throw. | ||
| + | We discovered that we can calculate the values of the probability from the diagonals of the Pascal' | ||
| + | the values are exactly the values of the diagonal number a, up to the value b | ||
| + | The additional values, up to the half of the array lenght or half of the array leght +1 (if the array is odd) are calculated as : number of the pascal' | ||
| + | |||
| + | moreover the sum of all the numbers of **a2 = b^a** | ||
| + | |||
| + | |||
| + | |||
| + | |||
| + | Example, step by step: | ||
| + | lets take 3d5 (aDb) | ||
| + | lenght of the array is: ab-a+1=13 | ||
| + | a1=3, | ||
| + | |||
| + | the a (so the third) pascal' | ||
| + | so let's put the numbers of the diagonal up to b in the a2 | ||
| + | a2=1, | ||
| + | x will be 21-(a*1)=18 | ||
| + | where 1 is the first number of the same diagonal | ||
| + | y will be 28-(a*3)=19 | ||
| + | where 3 is the second number of the same diagonal | ||
| + | as a check of our calculations: | ||
| + | and 125 = 5^3 (b^a) | ||
| + | |||
| + | |||
| + | |||
| + | |||
| + | Resolved dices thows, as full examples: | ||
| + | < | ||
| + | 2d6+1 | ||
| + | 3, | ||
| + | 1, | ||
| + | |||
| + | |||
| + | 3d6+1 | ||
| + | 4, | ||
| + | 1, | ||
| + | |||
| + | 4d3 | ||
| + | 4, | ||
| + | 1, | ||
| + | |||
| + | 3d3 | ||
| + | 3, | ||
| + | 1, | ||
| + | |||
| + | 3d4 | ||
| + | 3, | ||
| + | 1, | ||
| + | |||
| + | 5d4 | ||
| + | 5, | ||
| + | 1, | ||
| + | </ | ||
| + | |||
| + | Resources: | ||
| + | an interactive pascal' | ||
| + | http:// | ||
| + | |||
| + | to get the diagonal | ||
| + | |||
| + | all negative terms are 0 | ||
| + | |||
| + | the 0 term is always 1 | ||
| + | |||
| + | the nth term is the ∏ from i=1 to n of (a + i - 1)/i | ||
| + | |||
| + | < | ||
| + | number of the pascal' | ||
| + | number of the pascal' | ||
| + | </ | ||
| + | Just to clarify this you can have more than two extra numbers they just follow the same pattern. | ||
| + | |||
| + | lets do some pseudo code to fill out a2 Very Happy | ||
| + | |||
| + | lets define N(x,y) as the y term on the x diagonal | ||
| + | lets define the current terms index as t | ||
| + | lets define the array length as l | ||
| + | < | ||
| + | for every t up to and including l/2 - 1 + l%2 | ||
| + | { | ||
| + | the t term is N(a, | ||
| + | the l - t - 1 term is the same as the t term | ||
| + | } | ||
| + | </ | ||
| + | how does that look (might be an off by one error but that is the basic look) | ||
| + | |||
| + | There' | ||
| + | It has tons of features and will graph the results for you. | ||
| + | |||
| + | ===== Round off error ===== | ||
| + | |||
| + | Simple statistics unfortunately don't tell the whole story. Because Transcendence uses integer math lower damage weapons can lose a great deal to roundoff error while higher damage weapons lose proportionally less. | ||
| + | |||
| + | Take for example the basic 1d4 laser cannon and 3d4 turbolaser cannon. | ||
| + | |||
| + | Let's assume basic armor. Armor that has no defined resistances still has resistances and vulnerabilities derived from its level. (see [[modding/ | ||
| + | |||
| + | The laser resistance by level is in the hpBonus terminology used in most places in the game data | ||
| + | ^ Level | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | | ||
| + | ^ Armor Laser Resistance | +0 | +25 | +67 | +150 | +300 | +614 | +1150 | +2400 | +4900 | *** | | ||
| + | |||
| + | The formula in question is 100 / (100 + hpBonus) = percentile_resistance = 1 - damage_adjustment. | ||
| + | |||
| + | First let's look at the laser colimnator. | ||
| + | |||
| + | The laser is easy. Just 1d4. | ||
| + | ^ possible rolls | 1 | 2 | 3 | 4 | average | | ||
| + | ^ laser | 1 | 2 | 3 | 4 | 2.5 | | ||
| + | ^ colimnated laser | 1 | 3 | 5 | 7 | 4 | | ||
| + | |||
| + | As you can see it only actually gains +60%. | ||
| + | |||
| + | The turbolaser is more troublesome with multiple dice. | ||
| + | |||
| + | ^ possible rolls | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | average | | ||
| + | ^ probability | 1/64 | 3/64 | 3/32 | 5/32 | 3/16 | 3/16 | 5/32 | 3/32 | 3/64 | 1/64 | - | | ||
| + | ^ turbolaser | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 7.5 | | ||
| + | ^ colimnated turbolaser | 5 | 7 | 8 | 10 | 12 | 14 | 15 | 17 | 19 | 21 | 12.75 | | ||
| + | |||
| + | Now we're getting +70%. | ||
| + | |||
| + | Of course doing that in a table is cumbersome. | ||
| + | |||
| + | Because I don't have anything like that set up right now I'm only going to do one example. | ||
| + | |||
| + | ^ possible rolls | 1 | 2 | 3 | 4 | average | | ||
| + | ^ laser raw damage | 1 | 2 | 3 | 4 | 2.5 | | ||
| + | ^ against light titanium | 1 | 2 | 3 | 4 | 2.5 | | ||
| + | ^ against light plasteel | 0 | 1 | 1 | 2 | 1 | | ||
| + | |||
| + | Rather than doing 60% as much damage against level 3 armor as against level 1 the laser is doing 40%, a 50% drop in effectiveness due to roundoff. | ||
| + | |||
| + | ^ possible rolls | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | average | | ||
| + | ^ probability | 1/64 | 3/64 | 3/32 | 5/32 | 3/16 | 3/16 | 5/32 | 3/32 | 3/64 | 1/64 | - | | ||
| + | ^ turbolaser raw damage | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 7.5 | | ||
| + | ^ against light titanium | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 7.5 | | ||
| + | ^ against light plasteel | 1 | 2 | 3 | 3 | 4 | 4 | 5 | 6 | 6 | 7 | 4.09375 | | ||
| + | |||
| + | Roundoff still hurts dropping the damage from 60% to just under 55%, but that's about a 9% reduction in effectiveness, | ||
| + | |||
| + | Further examples will wait until I've made a script to do the math. | ||
