Showing posts with label melee. Show all posts
Showing posts with label melee. Show all posts

Saturday, July 24, 2010

The "new" melee pDIF

This post is definitely not for those who neither understand nor care about what melee "pDIF" is all about and why it can be of interest, so I find no point in making some sort of "for dummies" kind of introduction and will just jump into the results.

First, a reference to the "new" melee pDIF should be seen as a sarcastic gesture, as there likely have no been wholesale changes to pDIF after the August 2007 version update that brought the gameplay-altering "two-handed weapon adjustment." Therefore, the following results are assumed to reflect the actual changes to pDIF made in August 2007.

Data and results

The guy who plays Masamunai (currently of Cerberus) provided this spreadsheet of data, having tabulated the observed damage values for various ratios of attack to defense (without level correction), using both one-handed and two-handed weapons, on level 63-65 Lesser Colibri and then "standardizing" them to approximate observed pDIF values (acknowledging estimation error associated with in-game truncation of values). There are more details concerning the raw data and he provided his own analysis, but I prefer to do my own analysis so you don't necessarily have to review the spreadsheet yourself.

The following is an image attempting to plot 67,123 of the observed pDIF data values (almost of all the data) to show primarily how the minimum, maximum, and (most important to me) mean pDIF for both critical and non-critical ("normal") hits varies with the ratio of attack to defense:



It is somewhat difficult to plot 67,123 data values cleanly and elegantly with limited resolution, so I exploited transparency of data points, resulting in narrow "bands" that vary in opacity from top to bottom, an attempt to illustrate roughly the relative "density" of observed values. Each band represents the entirety of the data collected for a given attack/defense ratio. Another interpretation is that each band represents the observed conditional distribution of pDIF for a given attack/defense ratio.

The bands for critical pDIF are generally less "dense" or less opaque than those for normal pDIF, reflecting that fact that there are many more data points for normal pDIF (55,956 versus 11,127). Also, the bands are generally most translucent at the endpoints, reflecting the fact that the observed data at the extremes of each conditional pDIF distribution (for a given attack/defense ratio) occur relatively less frequently, which is consistent with the idea that pDIF is now a function of two uniform random variables (either the sum or the product), which follows a trapezoidal(-like) distribution. (But I will not be discussing probability distributions today.)

Aside from the plotting of the data values, regression lines for the mean pDIF (controlling for attack/defense ratio) were also plotted (lines based on ordinary least squares, which is justifiable as there are a lot of data points involved for each level of attack/defense considered). Regression was done in an informal piecewise fashion, as there are specific ranges of attack/defense ratio where the variance of pDIF is obviously not constant, specifically for three cases:
  • where there is a critical pDIF upper limit imposed (3.15 when attack/defense is approximately greater than 1.65)
  • where there is a normal pDIF lower limit imposed (1.00 when attack/defense is between 1.25 and 1.5), and
  • where the mode of normal pDIF is 1.00 and the mode does not occur at the left endpoint of the pDIF distribution (when attack/defense is less than 1.25). It should be noticed that it is impossible to discern the mode of pDIF (conditional on a given attack/defense ratio) based on the above graph. One would have to consult the original source as cited above.
I hope that will suffice as an explanation for the elements of the graph.

Interpretations and conclusions

These are a few of the things one could take away from the graph above.

Aside from the maximum attack/defense ratio attainable, there appear to be no differences in pDIF between one-handed weapons and two-handed weapons. I have incorrectly thought otherwise in the past, but I assumed people who cared about this knew what they were talking about. Obviously not.

While there is no data for two-handed weapons below 1.398 attack/defense ratio, I would invoke model parsimony and assert there is no good reason to expect differences at lower values of attack/defense. Although it is not shown above (and cannot be shown above cleanly), 2.00 is the maximum attack/defense ratio for one-handed weapons, and 2.25 is the maximum attack/defense ratio for two-handed weapons. Support for the these maxima can be found in the spreadsheet.

The ceiling on critical hit pDIF first occurs near 1.65 attack/defense. Moreover, the value of the ceiling, 3.15, is the modal (most frequently occurring) pDIF for attack/defense ratios above 1.65.

Mean pDIF, as a function of attack/defense, does NOT increase at the same rate for critical hits as for normal hits for a given value of attack/defense. A consequence of this is there is no pat way to relate normal pDIF to critical pDIF, like critical pDIF = normal pDIF + 1. To see what I mean, refer to this blog entry (JP), particularly the first image, to get a sense of how pDIF was incorrectly perceived more than a year after the August 2007 version update (a mish-mash of the critical hit pDIF ceiling of 3.15, increased attack/defense ratio maximum, and the old pDIF model).

Irrelevant considerations

This is a matter of personal preference, but I consider the so-called "secondary randomizer" an irrelevant red herring. pDIF as a product of two uniform random variables or sum of two uniform random variables, so what? (But I will note that the slope of mean pDIF without the second random factor does not change if the factor is added and does change if the factor is multiplied.) I just know it's there and I can explain what can cause it, but it is not very important for estimating mean pDIF, which is why I even made this post in the first place.

I also do not care about exactness of any pDIF model. Approximately true is fine with me as far as modeling rates of damage is concerned. (There are other factors when completely ignored or incorrectly computed that cause much more error than mere sampling error based on 60,000+ samples).

Formulas for mean pDIF as a function of attack/defense ratio and whether the weapon is one-handed or two-handed

These formulas are based on the regression estimates. (You may have noticed discontinuities in the piecewise mean pDIF functions suggested in the graph, but I do not care that much about fudging the estimates to eliminate that.) For normal-hit pDIF, which I have denoted as MNormal, the estimated mean of MNormal, as a function of H, the number of hands required to wield a weapon (H = 1, 2), and R, the attack/defense ratio (level-corrected or otherwise), is



For critical-hit pDIF, the functional relationship between that and H and R is



The following is the output of the regression procedure. I only include this to show that there is no reason to expect that the coefficient of determination be high, mainly because there is inherent variability of pDIF.

***Regression for normal pDIF, ATK/DEF < 1.25****

Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 0.225403 0.010107 22.3 <2e-16 ***
ratio 0.782699 0.009748 80.3 <2e-16 ***
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

Residual standard error: 0.1621 on 12257 degrees of freedom
Multiple R-squared: 0.3447, Adjusted R-squared: 0.3446
F-statistic: 6447 on 1 and 12257 DF, p-value: < 2.2e-16



***Regression for normal pDIF, 1.25 < ATK/DEF < 1.5****

Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 0.07274 0.04129 1.762 0.0781 .
ratio 0.90232 0.02969 30.390 <2e-16 ***
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

Residual standard error: 0.2369 on 14254 degrees of freedom
Multiple R-squared: 0.06085, Adjusted R-squared: 0.06078
F-statistic: 923.6 on 1 and 14254 DF, p-value: < 2.2e-16



***Regression for normal pDIF, ATK/DEF > 1.5****

Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) -0.294339 0.016866 -17.45 <2e-16 ***
ratio 1.162306 0.009566 121.50 <2e-16 ***
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

Residual standard error: 0.2518 on 29479 degrees of freedom
Multiple R-squared: 0.3337, Adjusted R-squared: 0.3336
F-statistic: 1.476e+04 on 1 and 29479 DF, p-value: < 2.2e-16



***Regression for critical pDIF, ATK/DEF < 1.65****

Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 0.94139 0.01739 54.14 <2e-16 ***
ratio2 1.07335 0.01273 84.29 <2e-16 ***
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

Residual standard error: 0.232 on 6745 degrees of freedom
Multiple R-squared: 0.513, Adjusted R-squared: 0.5129
F-statistic: 7106 on 1 and 6745 DF, p-value: < 2.2e-16



***Regression for critical pDIF, ATK/DEF > 1.65****

Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 1.59673 0.04287 37.25 <2e-16 ***
highratio 0.68607 0.02344 29.27 <2e-16 ***
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

Residual standard error: 0.1905 on 4377 degrees of freedom
Multiple R-squared: 0.1637, Adjusted R-squared: 0.1635
F-statistic: 856.8 on 1 and 4377 DF, p-value: < 2.2e-16