how exactly is ev worked out?

General feedback and discussion of the game.

Moderators: Forum Moderators, Developers

mrchadt
Posts: 56
Joined: August 15th, 2006, 12:54 pm
Location: norwich uk
Contact:

how exactly is ev worked out?

Post by mrchadt »

please dont say its the sum of %chance to hit*damage.
what if the defender has 1 hp is the ev 1 or is it the above. also what if the defender is killed on the first strike, but wasnt expected, is his damage counted toward his ev still.
the stats could be very misleading if you followed them.
lies damm lies and statistics
no obligation

User avatar
JW
Posts: 5046
Joined: November 10th, 2005, 7:06 am
Location: Chicago-ish, Illinois

Re: how exactly is ev worked out?

Post by JW »

mrchadt wrote:please dont say its the sum of %chance to hit*damage.
Well then no one is going to say the answer, because this is EXACTLY how's it's worked out.

User avatar
Elvish_Pillager
Posts: 8129
Joined: May 28th, 2004, 10:21 am
Location: Everywhere you think, nowhere you can possibly imagine.
Contact:

Post by Elvish_Pillager »

So it's the product of CTH and damage for each strike? Personally, I'd prefer it to store the expected damage for each whole fight, so that, for example, missed damage dealt is represented if my melee unit gets killed in one hit by a lucky Horseman.
It's all fun and games until someone loses a lawsuit. Oh, and by the way, sending me private messages won't work. :/ If you must contact me, there's an e-mail address listed on the website in my profile.

mrchadt
Posts: 56
Joined: August 15th, 2006, 12:54 pm
Location: norwich uk
Contact:

Post by mrchadt »

jw you havent explained the 2 sited exaples where things could be different. from what you say you can expect to do more damage then the opponent has hit points. how is this possible?
no obligation

Soliton
Site Administrator
Posts: 1610
Joined: April 5th, 2005, 3:25 pm
Location: #wesnoth-mp

Post by Soliton »

It must be incredibly hard to start a game and see for yourself how the statistics calculation works out.
"If gameplay requires it, they can be made to live on Venus." -- scott

User avatar
zookeeper
WML Wizard
Posts: 9742
Joined: September 11th, 2004, 10:40 pm
Location: Finland

Post by zookeeper »

Soliton wrote:It must be incredibly hard to start a game and see for yourself how the statistics calculation works out.
Actually, I don't think it's especially easy. Or at least I don't know how I could do it without it most likely being very time-consuming.

mrchadt
Posts: 56
Joined: August 15th, 2006, 12:54 pm
Location: norwich uk
Contact:

Post by mrchadt »

yes i could download the source code and see what the algorithm is. although it might be quite hard for me to find as i am not familiar with programing languages. i play the game and look at the stats box but that doesnt tell me how it is worked out.
the reason i bring it up is that in nearly every game ive played people always gripe about their ev. and i was wondering what it was.
it seems jw, who i understand to be involved in making the game, has said how it is worked out but has ignored two points i made.
maybe i should remove the post if it is causing trouble and download the source code.
no obligation

Soliton
Site Administrator
Posts: 1610
Joined: April 5th, 2005, 3:25 pm
Location: #wesnoth-mp

Post by Soliton »

mrchadt wrote:i play the game and look at the stats box but that doesnt tell me how it is worked out.
Well, it seemed to me that you have some very specific expectations how it does or should work which should be trivially verifiably with a few tests ingame.
mrchadt wrote: it seems jw, who i understand to be involved in making the game, has said how it is worked out but has ignored two points i made.
maybe i should remove the post if it is causing trouble and download the source code.
I'm quite certain JW does not know the code involved, so if you really want to be absolutely sure about how it works you should indeed take a look at the source code. Btw, if you want answers from coders i suggest you look for a better fitting forum then this one. :P
Also it's easy to find out who exactly is involved in making this game and (to some degree) what it is they are doing, take a look at the ingame help for example.
"If gameplay requires it, they can be made to live on Venus." -- scott

User avatar
Elvish_Pillager
Posts: 8129
Joined: May 28th, 2004, 10:21 am
Location: Everywhere you think, nowhere you can possibly imagine.
Contact:

Post by Elvish_Pillager »

If anything, JW should remove his post, because it shows a clear misunderstanding of what you were asking.
It's all fun and games until someone loses a lawsuit. Oh, and by the way, sending me private messages won't work. :/ If you must contact me, there's an e-mail address listed on the website in my profile.

Dacyn
Posts: 1855
Joined: May 1st, 2004, 9:34 am
Location: Texas

Post by Dacyn »

EV is the expected damage for the strikes that are actually in a fight, counting overkill. For example, if a unit with a 12-2 attack attacks a unit with 1 health left, 60% defense, then
- if he hits the first time, damage is 12, EV damage is 4.8
- if he misses the first time and hits the second, damage is 12, EV damage is 9.2
- if he misses both times, damage is 0, EV damage is 9.2
The important thing is the relation of the two values (damage and EV damage) to each other, not to their actual relation to the game. Killing a unit with 1 HP remaining is sometimes even more valuable than taking 12 HP from a full-health unit, because in the first case the unit is dead.
Last edited by Dacyn on September 9th, 2006, 3:04 pm, edited 1 time in total.

User avatar
JW
Posts: 5046
Joined: November 10th, 2005, 7:06 am
Location: Chicago-ish, Illinois

Post by JW »

I'm just a lowly Celestial Herald. 8)

Every time a unit makes a strike, whether it hits, misses, or kills something, that damage dealt is added to the Actual Damage (miss=0).

Every time a unit makes a strike, whether it hits, misses, or kills something, that damage the strike would have dealt on a hit is multiplied by the attackers chance to hit, and that value is added to the EV for damage dealt.

The same goes for defense, but reverse the units.

Kel
Posts: 63
Joined: June 14th, 2006, 3:21 pm

Post by Kel »

So in other words, the EV's are the same whether a Horseman charges a Mage on grassland, killing it in one blow or a Drake Clasher on hills, killing it in one blow? If so, I'd agree with EP's
Elvish Pillager wrote:Personally, I'd prefer it to store the expected damage for each whole fight, so that, for example, missed damage dealt is represented if my melee unit gets killed in one hit by a lucky Horseman.

User avatar
JW
Posts: 5046
Joined: November 10th, 2005, 7:06 am
Location: Chicago-ish, Illinois

Post by JW »

Kel wrote:So in other words, the EV's are the same whether a Horseman charges a Mage on grassland, killing it in one blow or a Drake Clasher on hills, killing it in one blow? If so, I'd agree with EP's
Elvish Pillager wrote:Personally, I'd prefer it to store the expected damage for each whole fight, so that, for example, missed damage dealt is represented if my melee unit gets killed in one hit by a lucky Horseman.
So, you'd rather the EV for the battle be worked out, instead of EV for strikes?

I'm guessing that would be relatively easy to implement if that graph can be put into effect. That would also seem to make more sense in some ways.

Kel
Posts: 63
Joined: June 14th, 2006, 3:21 pm

Post by Kel »

Yeah, that's a better way of putting it. =T

Basically, by making a successful killing blow, you're also avoiding (potentially a lot of, in my example) retaliation damage, which could be "expected," in a certain sense.

Jordan
Posts: 9
Joined: November 19th, 2006, 1:32 am

Post by Jordan »

Zero and Chadt brought up in game that you should also keep track of whether the unit that is dealing the damage should rightfully be dead. If a mage going for a swim in shallow water gets charged by a knight who misses both stabs, he should by all rights be dead (CTK 4%ish). If he then goes on to deal 100 dmg before dying, the fact that he should be dead is important to the expected value for damage dealt.

Luckily, this isn't hard to do. Just keep a running tally for how likely a unit was to be alive given what has attacked him in the past. Then multiply that probability by the expected value for his damage to get the true expected value for the game. So, in our case, with the mage that should be dead but goes on to deall 100 damage, the EV for his damage inflicted would be 4 or so. This would give a better view of what effect chance is having on the game.

You could calculate the unit's new P(alive) by simply multiplying his current P(alive) by the chance that he will live through the current fight.

You could also display the probability each unit had of being killed up till now, and find the EV for kills and losses by adding up these numbers(this avoids letting you have an EV for losses higher than the number of units you've recruited).

Post Reply