## Stats page

General feedback and discussion of the game.

Moderator: Forum Moderators

CaptC
Posts: 5
Joined: June 5th, 2009, 8:57 pm

### Stats page

Is there a description anywhere that describes exactly what is being calculated on the stats page? (I'm using 1.6.4 on Windows, and I'm talking about single player games.)

Most of the stats page is fairly obvious, but the "inflicted" and "taken" stats aren't completely clear to me. Is the denominator the expected amount of damage? The median amount of damage? Something else?

And is there a way to see the "this turn" stats at the end of the opponent's turn? Before they get reset at the beginning of the player's turn? I'm looking to see if the numbers agree with my intuitive feel for how well the AI did in it's turn.
jmegner
Posts: 49
Joined: May 24th, 2009, 1:15 pm

### Re: Stats page

CaptC wrote:Most of the stats page is fairly obvious, but the "inflicted" and "taken" stats aren't completely clear to me. Is the denominator the expected amount of damage? The median amount of damage? Something else?
The denominator is the expected value of damage. Let's say that in a turn the only thing that happens is your unitA attacks the enemy's unitB. unitA has a 8-5 attack and a 50% chance to hit. unitB has 0% resistance to unitA's attacks. 8*5*0.5*1.0 = 20. The denominator for 'damage inflicted' that turn will be 20. Same sort of thing for 'damage taken'. At least that's what my little experiment I just did made me conclude.
CaptC
Posts: 5
Joined: June 5th, 2009, 8:57 pm

### Re: Stats page

Thanks! I must be missing something. My experiments (not conclusively documented) don't come up with the numbers the stats page does. It's probably me not taking something into account. I just wanted to verify the formula, and I was hoping someone would know without me having to try to figure out the code.

Does the calculation include leadership, marksmanship, the effects of being slowed, and ToD adjustments, too? One would hope!
Max
Posts: 1449
Joined: April 13th, 2008, 12:41 am

### Re: Stats page

CaptC wrote:Does the calculation include leadership, marksmanship, the effects of being slowed, and ToD adjustments, too? One would hope!
yes, everything's taken into account, same goes for damage calculation (i'm not sure though if e.g customized abilities are handled).
silene
Posts: 1109
Joined: August 28th, 2004, 10:02 pm

### Re: Stats page

Max2008 wrote:
CaptC wrote:Does the calculation include leadership, marksmanship, the effects of being slowed, and ToD adjustments, too? One would hope!
yes, everything's taken into account, same goes for damage calculation (i'm not sure though if e.g customized abilities are handled).
Custom abilities are taken into account too, as long as their effect is visible before the fight and it doesn't change during the fight. In fact, from the point of view of the engine (that is, the AI, the battle prediction dialog, and the "expected" part of the statistics dialog), an ability like "marksmanship" is a purely customized one.

By the way, people often tend to forget the most important "ability": killing a unit. If you are attacking a unit that you have a chance to kill, then your expected damage will be lower than if you were attacking a unit with an infinite amount of hitpoints.
Max
Posts: 1449
Joined: April 13th, 2008, 12:41 am

### Re: Stats page

silene wrote:Custom abilities are taken into account too, as long as their effect is visible before the fight and it doesn't change during the fight.
so in other words the only way to confuse damage calculations/stats would be to use attacker/defender hits/misses events?
silene
Posts: 1109
Joined: August 28th, 2004, 10:02 pm

### Re: Stats page

Max2008 wrote:so in other words the only way to confuse damage calculations/stats would be to use attacker/defender hits/misses events?
Yes, that's the idea. For AI and battle prediction (but not for stats), confusion can also be introduced with the "attack" event.
CaptC
Posts: 5
Joined: June 5th, 2009, 8:57 pm

### Re: Stats page

silene wrote: By the way, people often tend to forget the most important "ability": killing a unit. If you are attacking a unit that you have a chance to kill, then your expected damage will be lower than if you were attacking a unit with an infinite amount of hitpoints.
I took that one into account, too. I tried it both ways to make sure.

I'm still off somewheres, but it's just a small amount, typically <1%. I'm gonna chalk it up to rounding errors.

I'd still like a way to see stats after the enemy's turns (other than the cumulative number for the campaign.) The easiest way I can see to do that is to retain and display the stats for the last turn as well as the current one. Very marginal usefulness, only for stats geeks like me, so not a serious request...
Max
Posts: 1449
Joined: April 13th, 2008, 12:41 am

### Re: Stats page

CaptC wrote:
silene wrote:I'm still off somewheres, but it's just a small amount, typically <1%. I'm gonna chalk it up to rounding errors.
you can't avoid rounding errors unless you calculate and round everything in exact the same order/way as wesnoth does. there are also some exceptions, e.g. attacks always deal at least one damage point.