More useful damage statistics

Brainstorm ideas of possible additions to the game. Read this before posting!

Moderator: Forum Moderators

Forum rules
Before posting a new idea, you must read the following:
Post Reply
Invisible Philosopher
Posts: 873
Joined: July 4th, 2004, 9:14 pm
Location: My imagination
Contact:

More useful damage statistics

Post by Invisible Philosopher »

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?
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.
ott
Inactive Developer
Posts: 838
Joined: September 28th, 2004, 10:20 am

Post by ott »

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 obeys

Code: Select all

Pr[X=x*d] = (n!/(x!*(n-x)!))*(p^x)*((1-p)^(n-x))
where 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?
Dave
Founding Developer
Posts: 7071
Joined: August 17th, 2003, 5:07 am
Location: Seattle
Contact:

Post by Dave »

Code that adds recording and display of more statistics would be welcome. This has been an area that has been under-developed for some time.

David
“At Gambling, the deadly sin is to mistake bad play for bad luck.” -- Ian Fleming
quartex
Inactive Developer
Posts: 2258
Joined: December 22nd, 2003, 4:17 am
Location: Boston, MA

Post by quartex »

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.
sanna
Posts: 425
Joined: June 5th, 2004, 9:59 am
Location: Halmstad, Sweden

Post by sanna »

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.
You mean something like this feature request? https://savannah.nongnu.org/bugs/?func= ... m_id=11173
Invisible Philosopher
Posts: 873
Joined: July 4th, 2004, 9:14 pm
Location: My imagination
Contact:

Post by Invisible Philosopher »

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.
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.
Play a Silver Mage in the Wesvoid campaign.
blackjack
Posts: 179
Joined: February 11th, 2004, 11:12 am

Post by blackjack »

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.
A witty saying proves nothing.
-Voltaire
ott
Inactive Developer
Posts: 838
Joined: September 28th, 2004, 10:20 am

Post by ott »

See a related thread for more on game statistics.
Post Reply