More useful damage statistics
Moderator: Forum Moderators
Forum rules
Before posting a new idea, you must read the following:
Before posting a new idea, you must read the following:
-
- Posts: 873
- Joined: July 4th, 2004, 9:14 pm
- Location: My imagination
- Contact:
More useful damage statistics
Currently we have Total damage done and Expected damage done (by you and to you). These numbers can be used to calculate how good our luck was. Trouble is, that isn't exactly a trivial calculation for us poor unmathematical humans. I suggest:
Percentage deviation from expected value:
_| expected - actual |_
.......expected
(or: abs(expected - actual) / expected)
EDIT: silly me, the displayed value shouldn't use absolute value; it should be (actual - expected) / expected.
And percentage chance that, given an arbitrary random sequence, its deviation from expected would be less than the actual deviation. That is to say, how likely it is that the actual damage is this far off the expected (actually, how likely to be that-much-or-farther off than expected, to give useful results). Note that higher % deviations are more likely when there has been less fighting.
I have no idea how to calculate this one, though. Any ideas? Does Wesnoth keep enough statistical information to calculate it?
How useful do people think these would be? Do people even use the existing statistics much? If not, is it because they don't know about them, they're not interested in them, or they're too obtuse to get anything useful from?
Percentage deviation from expected value:
_| expected - actual |_
.......expected
(or: abs(expected - actual) / expected)
EDIT: silly me, the displayed value shouldn't use absolute value; it should be (actual - expected) / expected.
And percentage chance that, given an arbitrary random sequence, its deviation from expected would be less than the actual deviation. That is to say, how likely it is that the actual damage is this far off the expected (actually, how likely to be that-much-or-farther off than expected, to give useful results). Note that higher % deviations are more likely when there has been less fighting.
I have no idea how to calculate this one, though. Any ideas? Does Wesnoth keep enough statistical information to calculate it?
How useful do people think these would be? Do people even use the existing statistics much? If not, is it because they don't know about them, they're not interested in them, or they're too obtuse to get anything useful from?
Last edited by Invisible Philosopher on December 15th, 2004, 10:20 am, edited 1 time in total.
Play a Silver Mage in the Wesvoid campaign.
Agreed: I also would prefer a more useful summary than expected value. After all EV is not much use without knowing the standard deviation.
Assuming that individual attacks are independent and identically distributed, the number of successful hits in a series of consecutive attacks forming one single skirmish then has a binomial distribution, with expected value n*p, where n is the number of attacks and p is the probability of hitting, and variance n*p*(1-p).
The damage X for a single skirmish then obeyswhere d is the damage for a single successful hit, so damage in a single skirmish then has expected value n*p*d, and variance d*d*n*p*(1-p).
Now we need somehow to add together the damage across skirmishes. The expected value D of the total damage is just the total of expected values of each skirmish (and I assume this is just what is currently done in the code). If we assume independence of damage across skirmishes, we can then add variances also to get an overall variance of V.
It would now be nice to apply something like the central limit theorem. However, the numbers of hits in each skirmish do not constitute identically distributed variables, and I don't know how to aggregate them in a sensible way, since the n and p values vary from skirmish to skirmish. Normalising the values into percentages doesn't work, since then they are definitely not identically distributed. It may be possible to assume that the percentages approximate normally distributed variables with mean 0.5, though I'm not sure this is reasonable. At least the binomial distribution is symmetric so we wouldn't have to worry about skewness.
If we could apply the CLT then the approximation to the normal distribution could be used to say things like the probability of observing actual damage greater than 1 standard deviation above the expected value is 16%, or 32% for damage 1 standard deviation away from expected damage, or this could be inverted to say things like the probability of seeing a damage value this far away from the mean is X %.
Can anyone take this further?
Assuming that individual attacks are independent and identically distributed, the number of successful hits in a series of consecutive attacks forming one single skirmish then has a binomial distribution, with expected value n*p, where n is the number of attacks and p is the probability of hitting, and variance n*p*(1-p).
The damage X for a single skirmish then obeys
Code: Select all
Pr[X=x*d] = (n!/(x!*(n-x)!))*(p^x)*((1-p)^(n-x))
Now we need somehow to add together the damage across skirmishes. The expected value D of the total damage is just the total of expected values of each skirmish (and I assume this is just what is currently done in the code). If we assume independence of damage across skirmishes, we can then add variances also to get an overall variance of V.
It would now be nice to apply something like the central limit theorem. However, the numbers of hits in each skirmish do not constitute identically distributed variables, and I don't know how to aggregate them in a sensible way, since the n and p values vary from skirmish to skirmish. Normalising the values into percentages doesn't work, since then they are definitely not identically distributed. It may be possible to assume that the percentages approximate normally distributed variables with mean 0.5, though I'm not sure this is reasonable. At least the binomial distribution is symmetric so we wouldn't have to worry about skewness.
If we could apply the CLT then the approximation to the normal distribution could be used to say things like the probability of observing actual damage greater than 1 standard deviation above the expected value is 16%, or 32% for damage 1 standard deviation away from expected damage, or this could be inverted to say things like the probability of seeing a damage value this far away from the mean is X %.
Can anyone take this further?
On a related note I'd love to see a list of graphs and stats at the end of each scenario or multiplayer game that tells you how many units each side recruited, and killed, how much gold each side got and spent, and other stats. (like in Warcraft and Starcraft games). I think these stats would be very interesting for players to analyze afterwards.
You mean something like this feature request? https://savannah.nongnu.org/bugs/?func= ... m_id=11173quartex wrote:On a related note I'd love to see a list of graphs and stats at the end of each scenario or multiplayer game that tells you how many units each side recruited, and killed, how much gold each side got and spent, and other stats. (like in Warcraft and Starcraft games). I think these stats would be very interesting for players to analyze afterwards.
-
- Posts: 873
- Joined: July 4th, 2004, 9:14 pm
- Location: My imagination
- Contact:
Oh, yes, that reminds me, for campaigns it would be nice to be able to get the statistics for just the current scenario as well as for the whole campaign.quartex wrote:On a related note I'd love to see a list of graphs and stats at the end of each scenario or multiplayer game that tells you how many units each side recruited, and killed, how much gold each side got and spent, and other stats. (like in Warcraft and Starcraft games). I think these stats would be very interesting for players to analyze afterwards.
Play a Silver Mage in the Wesvoid campaign.
I was thinking of doing something like that and had offered to look at the code a while back. I could defo come up with something.
As a student of mathematics and having done a lot of theory of prob, my guess is that CLT applies quite well to skewed binomial distributions once the number of repititions hits about 1000. Most of the hit probabilities are from 30-70%, so the normal distribution is reasonably accurate.
A few theoretical nitpicks but the binomial distribution is measurable so CLT isn't a big issue.
As a student of mathematics and having done a lot of theory of prob, my guess is that CLT applies quite well to skewed binomial distributions once the number of repititions hits about 1000. Most of the hit probabilities are from 30-70%, so the normal distribution is reasonably accurate.
A few theoretical nitpicks but the binomial distribution is measurable so CLT isn't a big issue.
A witty saying proves nothing.
-Voltaire
-Voltaire
See a related thread for more on game statistics.