[interface/engine] Advanced damage inflicted/taken hit count statistics
Moderators: Forum Moderators, Developers
Forum rules
Before posting a new idea, you must read the following:
Before posting a new idea, you must read the following:
Re: [interface/engine] Advanced damage inflicted/taken hit count statistics
Yes.
I’ll try, though explaining uncertainty, isn’t my forte...
It’s from the sum of adding these percentages
I thought you wanted to calculate true luck, based from numbers that a player did.
There’s no easy way to determine luck, when its calculated by overall CTH values.
So I tried to make independent adjustments, before merging their values.
30% CTH and 80% CTH, as an example, have very different values, their luck probability will interfere wit each others average.
Maybe I’m overthinking this.
Orcish Grunt and Dark Adept have different ways to be calculated due to their own different hit rate and they both can’t retaliate with each other.
I assumed "each of the three possible results" meant, explaining probability for every hit chance.
Basically, I didn’t understand how to explain it. Sorry for the trouble cause.
If you’re interested, can you explain your aim on asking about Orcish Grunt vs Dark Adept?
Re: [interface/engine] Advanced damage inflicted/taken hit count statistics
You're right that the cth has to be taken into account, so a miss of a 30% strike would weigh less than a miss of an 80% strike, but that's what already happens. The number of hits at 70% is multiplied by 0.7, the number of hits at 30% is multiplied by 0.3.Mawmoocn wrote: ↑May 24th, 2019, 1:34 pmI thought you wanted to calculate true luck, based from numbers that a player did.
There’s no easy way to determine luck, when its calculated by overall CTH values.
So I tried to make independent adjustments, before merging their values.
30% CTH and 80% CTH, as an example, have very different values, their luck probability will interfere wit each others average.
Maybe I’m overthinking this.
I meant: suppose a Grunt attacks an Adept. There are three possible results: two misses, two hits, one hit and one miss. What would the UI show in each case? I asked this to try and get you to explain your proposal on a welldefined simple example. At this point, however, I'd like to ask a different question: do you have any comments on the implemented algorithm?Mawmoocn wrote: ↑May 24th, 2019, 1:34 pmOrcish Grunt and Dark Adept have different ways to be calculated due to their own different hit rate and they both can’t retaliate with each other.
I assumed "each of the three possible results" meant, explaining probability for every hit chance.
Basically, I didn’t understand how to explain it. Sorry for the trouble cause.
If you’re interested, can you explain your aim on asking about Orcish Grunt vs Dark Adept?
Re: [interface/engine] Advanced damage inflicted/taken hit count statistics
That's actually 4 results.
Disclaimer: My comment is heavily based on assumption that something could go wrong.
Average result would mess up with luck or percentage shown.
I think most of my comments doesn't relate to implemented algorithm...
I think percentage colors are confusing?
12% can be green but why is it considered positive?
Some percentages show red at higher percentages?
Their basis for these are luck?
I guess it needs consistency on coloring percentages?
Re: [interface/engine] Advanced damage inflicted/taken hit count statistics
This has been merged to 1.15. Screenshot: https://github.com/wesnoth/wesnoth/pull ... 500751546
Question. The percentages are colored on a redtogreen scale. Currently, they're colored so green means the RNG favored the opponent's, that is, if you win and the stats are green that means you won in spite of the RNG, you won due to skill, not luck. Two alternatives have been proposed: to color it so RNG means the RNG favored the player (the reverse of the current coloring, green means you were lucky, red means the opponent was lucky), or to color it so green means the actual result was close to the expected value and red means it was far. Any preferences or other ideas?
Question. The percentages are colored on a redtogreen scale. Currently, they're colored so green means the RNG favored the opponent's, that is, if you win and the stats are green that means you won in spite of the RNG, you won due to skill, not luck. Two alternatives have been proposed: to color it so RNG means the RNG favored the player (the reverse of the current coloring, green means you were lucky, red means the opponent was lucky), or to color it so green means the actual result was close to the expected value and red means it was far. Any preferences or other ideas?

 Posts: 18
 Joined: October 21st, 2010, 5:04 pm
Re: [interface/engine] Advanced damage inflicted/taken hit count statistics
First of all: I haven't read through the entire topic, but maybe that is a plus!
I think the statistics are very confusing. Would it perhaps be possible to add ingame explanations? Maybe when hovering the mouse over, or through a "Details" button that pops up another, larger window?
The same goes for the coloring. Without an explanation, it's very hard to understand.
From this image, I still don't understand the numbers. You attacked with a Silver Mage's magical attack, which means 70% hit rate. You hit 3/4 (expected value 2.8 ). Then what is 34.8%? And what 24.0%?
I think the statistics are very confusing. Would it perhaps be possible to add ingame explanations? Maybe when hovering the mouse over, or through a "Details" button that pops up another, larger window?
The same goes for the coloring. Without an explanation, it's very hard to understand.
From this image, I still don't understand the numbers. You attacked with a Silver Mage's magical attack, which means 70% hit rate. You hit 3/4 (expected value 2.8 ). Then what is 34.8%? And what 24.0%?
Re: [interface/engine] Advanced damage inflicted/taken hit count statistics
Hi!
The hits table already has tooltips: https://github.com/wesnoth/wesnoth/blob ... #L567L568
In English, 34.8% is the probability of the Silver Mage hitting 0, 1, or 2 times. 24% is the probability of the Silver Mage hitting 4 times.
The hits table already has tooltips: https://github.com/wesnoth/wesnoth/blob ... #L567L568
In English, 34.8% is the probability of the Silver Mage hitting 0, 1, or 2 times. 24% is the probability of the Silver Mage hitting 4 times.

 Posts: 18
 Joined: October 21st, 2010, 5:04 pm
Re: [interface/engine] Advanced damage inflicted/taken hit count statistics
Okay, got it. And the colors just scale from 0% (green) to 100% (red) for the first statistic, and the other way around for the second percentage, right?
How would i interpret the numbers?
If the first percentage is high, it means i got lucky, if it's low, it means i got unlucky.
For the second one the other way around: high > unlucky, low > lucky.
Or is there more it can tell me? Sorry if this was previously explained (i can't seem to find it)
How would i interpret the numbers?
If the first percentage is high, it means i got lucky, if it's low, it means i got unlucky.
For the second one the other way around: high > unlucky, low > lucky.
Or is there more it can tell me? Sorry if this was previously explained (i can't seem to find it)
Re: [interface/engine] Advanced damage inflicted/taken hit count statistics
@josteph
This numbers are another measure of luck. However, damage statistics is more precise measure of luck, isn't it? Because luck is not only hit or miss, but how much damage was dealt/not dealt by the hit. Even more precise measure of luck would be statistics of important hits (kill, advancement).
But the idea here is actually opposite, isn't it? RNG doesn't know what hits were important or not, so showing hit stats would be less frustrating comparing to damage stats. (UPD. On the long run we can expect hits stats to be more "fair" comparing to damage stats. But that's not guaranteed.)
That was just observations. I think having both hit stats and damage stats are better than only damage stats.
What concerns me is complexity of the table. I don't think that it is user friendly. Damage stats shows how greater or lesser the actual damage is comparing to the expected damage measured in percents of the expected damage. But the hits stats shows two values (instead of one), which are probability of hitting less or more comparing to the expected number of hits. First of all, those values are harder to understand, they are not so intuitive. Secondly, they provide inconsistent user experience.
I can imagine thoughts of the users:
Why only one % value is used for damage and two % values for hits? Why damage % is white and hits % are green / red? Why damage % means ratio of damages and hits % means probability?
Perhaps it would be better to use the same approah as for damage stats, don't you think?
Update
This topic made me think more about RNG and luck. My conclusion is that luck is not only the RNG "fairness", but also importance of the RNG outcome in a particular situation. Hits stats is more about RNG "fairness", while damage stats is more about luck. At least how we, as a human beings, recognizing luck.
Example
Let's say I can make two attacks 401 and 85 all with 50% chance to hit.
Case #1
401 hits, 85 all misses. damage (actual / expected) = 40 / 40 , hits (actual / expected) = 1 / 3
I feel that I had an average luck.
Case #2
401 misses, 85 all hits. damage (actual / expected) = 40 / 40 , hits (actual / expected) = 5 / 3
I feel that my luck was exactly the same.
This numbers are another measure of luck. However, damage statistics is more precise measure of luck, isn't it? Because luck is not only hit or miss, but how much damage was dealt/not dealt by the hit. Even more precise measure of luck would be statistics of important hits (kill, advancement).
But the idea here is actually opposite, isn't it? RNG doesn't know what hits were important or not, so showing hit stats would be less frustrating comparing to damage stats. (UPD. On the long run we can expect hits stats to be more "fair" comparing to damage stats. But that's not guaranteed.)
That was just observations. I think having both hit stats and damage stats are better than only damage stats.
What concerns me is complexity of the table. I don't think that it is user friendly. Damage stats shows how greater or lesser the actual damage is comparing to the expected damage measured in percents of the expected damage. But the hits stats shows two values (instead of one), which are probability of hitting less or more comparing to the expected number of hits. First of all, those values are harder to understand, they are not so intuitive. Secondly, they provide inconsistent user experience.
I can imagine thoughts of the users:
Why only one % value is used for damage and two % values for hits? Why damage % is white and hits % are green / red? Why damage % means ratio of damages and hits % means probability?
Perhaps it would be better to use the same approah as for damage stats, don't you think?
Update
This topic made me think more about RNG and luck. My conclusion is that luck is not only the RNG "fairness", but also importance of the RNG outcome in a particular situation. Hits stats is more about RNG "fairness", while damage stats is more about luck. At least how we, as a human beings, recognizing luck.
Example
Let's say I can make two attacks 401 and 85 all with 50% chance to hit.
Case #1
401 hits, 85 all misses. damage (actual / expected) = 40 / 40 , hits (actual / expected) = 1 / 3
I feel that I had an average luck.
Case #2
401 misses, 85 all hits. damage (actual / expected) = 40 / 40 , hits (actual / expected) = 5 / 3
I feel that my luck was exactly the same.
Last edited by sergey on June 11th, 2019, 5:12 pm, edited 2 times in total.
Author of SP scenario Dragon Fight and SP campaign Captured by a Nightmare.
Created The Rise of Wesnoth (alternative mechanics) version of the mainline campaign.
Created The Rise of Wesnoth (alternative mechanics) version of the mainline campaign.
Re: [interface/engine] Advanced damage inflicted/taken hit count statistics
Don't apologizeCrossBreed wrote: ↑June 11th, 2019, 3:48 pmOkay, got it. And the colors just scale from 0% (green) to 100% (red) for the first statistic, and the other way around for the second percentage, right?
How would i interpret the numbers?
If the first percentage is high, it means i got lucky, if it's low, it means i got unlucky.
For the second one the other way around: high > unlucky, low > lucky.
Or is there more it can tell me? Sorry if this was previously explained (i can't seem to find it)
Yes, you understood correctly. In inflicted, the first number is greentored (0% would be green, 100% would be red) and the second redtogreen. In taken, the first number is redtogreen and the second greentored. This way, green means the player was unlucky and red means the player was lucky. The commit message explains this in different words: https://github.com/wesnoth/wesnoth/comm ... c9c3f93e39
Re: [interface/engine] Advanced damage inflicted/taken hit count statistics
The RNG is rolled once per strike. The hits table shows the statistics in terms of strikes, that is, the "raw" statistics, not weighted by the number of hitpoints of the attack. The statistics of only "important" strikes would indeed be interesting, but it's not easy to come up with a workable definition of "important". With units like the Dwarvish Dragonguard basically every time they play it's an important attack, isn't it, in terms of the effect on play?sergey wrote: ↑June 11th, 2019, 4:32 pm@josteph
This numbers are another measure of luck. However, damage statistics is more precise measure of luck, isn't it? Because luck is not only hit or miss, but how much damage was dealt/not dealt by the hit. Even more precise measure of luck would be statistics of important hits (kill, advancement).
But the idea here is actually opposite, isn't it? RNG doesn't know what hits were important or not, so showing hit stats would be less frustrating comparing to damage stats.
That was just observations. I think having both hit stats and damage stats are better than only damage stats.
I don't think showing the result of dividing actual number of hits by expected number of hits (like 3 by 2.8 ) is very interesting, really. It will always be a number close to 1.0 because of regression to the mean. (This is also true for the damage table. When you view the "All Scenarios" stats of a campaign the damage stats are always around +1%/1%. From a UI point of view, there's no reason to show the damage percentage if it's almost always the same value.)sergey wrote: ↑June 11th, 2019, 4:32 pmWhat concerns me is complexity of the table. I don't think that it is user friendly. Damage stats shows how greater or lesser the actual damage is comparing to the expected damage measured in percents of the expected damage. But the hits stats shows two values (instead of one), which are probability of hitting less or more comparing to the expected number of hits. First of all, those values are harder to understand, they are not so intuitive. Secondly, they provide inconsistent user experience.
I can imagine thoughts of the users:
Why only one % value is used for damage and two % values for hits? Why damage % is white and hits % are green / red? Why damage % means ratio of damages and hits % means probability?
Perhaps it would be better to use the same approah as for damage stats, don't you think?
Yes, I don't expect users to guess what the percentages mean (although Konrad2 did, correctly). That's why there's a tooltip explaining what they are.
I wonder if we should make the damage table look like the hits table, that is, have it show two percentages like the hits table does. Maybe that makes sense, but something tells me this idea will be a hard sell
Re: [interface/engine] Advanced damage inflicted/taken hit count statistics
I don't even sure it is possible. E.g. if a unit dies where chance to kill was 1% for that particular attack, but there were 2 other units ready to finish him anyway. That kill was very unlikely, but not so important.
Another example. Mage missed 3 times in a row and didn't kill a unit, but that was not critical. Or mage missed 3 times and because of that the whole plan was ruined.
I proposed to show 0%, not 1. (actual / expected  1) * 100%. Also I updated my previous post with an example that shows why it may make sense.josteph wrote: ↑June 11th, 2019, 4:56 pmI don't think showing the result of dividing actual number of hits by expected number of hits (like 3 by 2.8 ) is very interesting, really. It will always be a number close to 1.0 because of regression to the mean. (This is also true for the damage table. When you view the "All Scenarios" stats of a campaign the damage stats are always around +1%/1%. From a UI point of view, there's no reason to show the damage percentage if it's almost always the same value.)
Please don't do that. Majority of the players are not mathematician professors.josteph wrote: ↑June 11th, 2019, 4:56 pmYes, I don't expect users to guess what the percentages mean (although Konrad2 did, correctly). That's why there's a tooltip explaining what they are.
I wonder if we should make the damage table look like the hits table, that is, have it show two percentages like the hits table does. Maybe that makes sense, but something tells me this idea will be a hard sell
Author of SP scenario Dragon Fight and SP campaign Captured by a Nightmare.
Created The Rise of Wesnoth (alternative mechanics) version of the mainline campaign.
Created The Rise of Wesnoth (alternative mechanics) version of the mainline campaign.
Re: [interface/engine] Advanced damage inflicted/taken hit count statistics
In general, if you make six attacks with 50% cth and get one hit and five misses, then you've been very unlucky. The probability of this outcome is 1/64. That's also the probability of one miss and five hits, but in that case you'll have been very lucky.sergey wrote: ↑June 11th, 2019, 4:32 pmExample
Let's say I can make two attacks 401 and 85 all with 50% chance to hit.
Case #1
401 hits, 85 all misses. damage (actual / expected) = 40 / 40 , hits (actual / expected) = 1 / 3
I feel that I had an average luck.
Case #2
401 misses, 85 all hits. damage (actual / expected) = 40 / 40 , hits (actual / expected) = 5 / 3
I feel that my luck was exactly the same.
It's true that if you consider just the damage dealt then you'd view this as neutrally lucky, but so what? Examples cut both ways. Imagine that a Thunderer and a Dragonguard both attack a unit on 50% defense. The Thunderer misses and the Dragonguard hits. How lucky was that, neutrally lucky (if we count by hits) or lucky (if we count by damage)?
Re: [interface/engine] Advanced damage inflicted/taken hit count statistics
We can’t actually compare your luck against your enemy. As your luck is independent from their luck. Skill can’t be realised with these stats alone.
Hypothetically if we do want to compare it, we need to get an average hit percentage for the enemy and compare it to the player’s average. Colors would be coloured based on who was the highest percentage of hitting. It could pose some problems if the enemy never gets lucky .
I think this is much easier to understand but poses the same problems mentioned earlier.
I think both have problems, but since we didn’t consider enemy comparison, I think it could add another layer of complexity.
Technically, aren’t they nearly similar? So probably no problems at the second option.
Well you can probably change hits taken colors, to fit with the enemies luck, based on expected result.
So the result is, Inflicted and Taken have different colors, and should be dependent based on showing that, Taken is for how well did you protect your units and Inflicted to show how well you killed your enemies troops.
edit: added new info
Re: [interface/engine] Advanced damage inflicted/taken hit count statistics
I would say that I got RNG results below expectations. I will still consider myself lucky if all five misses were unimportant (like saurian throwing a spear at a skeleton during a day) and the hit was important (like the last chance of killing a high level unit, which in turn levels up my nearly dead unit). As I said earlier, I don't think it is possible to measure importance of a hit in a general case.
I will get rid of the term "luck" in my answer. It is a more preferable outcome (damage stats) of an average RNG result (hit stats).josteph wrote: ↑June 11th, 2019, 5:55 pmIt's true that if you consider just the damage dealt then you'd view this as neutrally lucky, but so what? Examples cut both ways. Imagine that a Thunderer and a Dragonguard both attack a unit on 50% defense. The Thunderer misses and the Dragonguard hits. How lucky was that, neutrally lucky (if we count by hits) or lucky (if we count by damage)?
Author of SP scenario Dragon Fight and SP campaign Captured by a Nightmare.
Created The Rise of Wesnoth (alternative mechanics) version of the mainline campaign.
Created The Rise of Wesnoth (alternative mechanics) version of the mainline campaign.