## how exactly is ev worked out?

**Moderators:** Forum Moderators, Developers

### how exactly is ev worked out?

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

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

### Re: how exactly is ev worked out?

Well then no one is going to say the answer, because this ismrchadt wrote:please dont say its the sum of %chance to hit*damage.

**EXACTLY**how's it's worked out.

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

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.

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.

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

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:i play the game and look at the stats box but that doesnt tell me how it is worked out.

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.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.

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

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

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.

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.

- 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.

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.

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?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.

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.

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).