Evasion Math question

General discussion about the game.
rhev
Posts: 7
Joined: Wed Jan 23, 2013 10:23 pm

Evasion Math question

Postby rhev » Wed Jan 23, 2013 11:23 pm

Hi there, first post and all that so let me get the basics out of the way;

omg, I love FTL
One of the best games evar
drool / love / slobber / etc.

Now, I made a post over on reddit about engine power and the evade chance.
Specifically about the diminishing returns that happen after five power in engines.

http://www.reddit.com/r/ftlgame/comment ... ine_power/


Now, on that thread a lot of math was thrown around and I figured that the only way to resolve it was to get an official answer.

How does evasion work? My guess is that combat works like this:

An attack is made.
For that attack a number is generated from 1 to 100.
If that number is OVER the evasion rating of the target, it hits. If it isn't, it's a miss.


However the other redditors seem to think the math is much more complex than this, with some sort of exponential growth to the evasion chance. Is there any way we could an official answer on how the math of hit / evasion works?

Also, as to my original reddit post, why are there diminishing returns on power levels 6-8 on engines, was the extra 5% evasion too overpowered?

Thanks in advance.
Maze1125
Posts: 144
Joined: Sun May 20, 2012 12:09 pm

Re: Evasion Math question

Postby Maze1125 » Thu Jan 24, 2013 1:55 am

Your understanding and the complex maths are the same thing.

Yes, the game simply takes your evasion score and rolls a d100 against it (or equivalent).
The upshot of this is that the later percentage points of evasion are much more valuable than the earlier points.

For example, assume 1000 shots are fired at your ship. You have 1% evasion and, if you spend some scrap, you can have an extra 1% on top making it 2%.
If you don't spend the scrap, 990 shots hit on average, if you do spend it then, on average, 980 of those shots will hit. Either way, it doesn't really matter, you're still dead.

Now, as a second example, assume 1000 shots are fired at your ship. You have 98% evasion and, if you spend some scrap, you can have an extra 1% on top making it 99%.
If you don't spend the scrap, all 20 shots hit on average, if you do spend it then, on average, 10 of those shots will hit. That is a significant difference, that extra 1% is halving the damage you take, even though it's still just being rolled against a d100. In fact, that's the very reason it works this way.

A single percentage point at the start is nearly worthless, but near the end it is incredibly valuable. And that's because it's just a simple number generation system.
Last edited by Maze1125 on Sat Jan 26, 2013 9:59 am, edited 1 time in total.
rhev
Posts: 7
Joined: Wed Jan 23, 2013 10:23 pm

Re: Evasion Math question

Postby rhev » Thu Jan 24, 2013 4:50 am

I don't believe you are correct, and please allow me to explain why.

First of all, you're falling into the classic gamblers fallacy, where a percentage for any specific event always remains constant, even after repeated instances. Using your impossible hypothetical, with an evasion of 1%, given 1000 shots, it is entirely possible to evade 1000 shots. Just like with 99% probability, it is possible to get hit 1000 times.

Obviously the likely hood of this is highly improbable, but it is possible, it is a potential outcome. Why?

Because each shot is going to roll the 1d100 (or whatever). Each time that die is rolled, there is a one in one hundred chance that it comes up a 1, or that it comes up a 100. EACH TIME. If you have 99% evasion, and you get hit, it doesn't mean that the next 99 hits will miss.

A single percentage point at the start is nearly worthless, but near the end it is incredibly valuable. And that's because it's just a simple number generation system.

Secondly, the idea that a single percentage point gains or loses value, depending on what other evasion you have, I also believe you to be mistaken on.

If we accept that the chance to evade a blow works as we listed above (d100, equal too or lower than evade = miss, above evade = hit) then literally every single percentage point is of the exact same value. Every single percentage point is exactly one point more that you have to evade by. Being at number 60 is of a better defensive value than 40 simply because you have 20 points. Not because that single percentage point from 59 to 60 is somehow better than the one that got you from 49 to 50.

The trap that you, and the people on the reddit thread, were falling into was thinking that since it's an increase in the percentage of your defense, that makes it more valuable than other given increases. It doesn't, not inherently at least. Every single point towards your defense (again assuming that we have the formula for evading correctly) is exactly as valuable as every other point.



To illustrate. Lets say that instead of having to roll 'under' your evade, the game generates a list of numbers from 1 to 100. Your ship has an evade rating of 15%. For every % point you have in the evade skill, it randomly hands you one of those numbers. So for the sake of the argument, it gives you the numbers randomly; 4, 12, 23, 24, 27, 41, 42, 44, 52, 55, 69, 72, 81, 84, and 92. Then when an attack is made, it rolls that d100. If the roll comes up as one of the assigned 'evade' numbers, then the attack misses, otherwise, it hits. This is absolutely NO different than saying your evade is a number between one and fifteen, and that if the die roll is fifteen or less, then the attack is evaded. There is ZERO difference in those two examples.

Yet, it illustrates that the hypothetical 'evade number' of 92 is absolutely the same as the 'evade number' of 12. There's no value in a higher evade number. Just like there's absolutely no inherint value in 1% of evade, OTHER THAN THE ONE PERCENT OF EVADE. It doesn't matter if it's taking you from 1% evade to 2%, or from 97% evade to 98%



See?
Shakis
Posts: 11
Joined: Tue Jan 15, 2013 4:59 pm

Re: Evasion Math question

Postby Shakis » Thu Jan 24, 2013 10:26 am

Given enough time all probable outcomes will happen, no matter how improbable.

Flipping 1 coin you have a 50/50 chance of heads or tails

Flipping 2 coins each coin has a 50/50 chance of being heads or tails but if you look at the whole system your outcomes are different:

H = Heads
T= Tails

1: H H, H T, T H , T T

Now hopefully you can see that every possible outcome has the exact same probability however the probability of flipping a H H is 1 in 4 and not just 50%

2: H H H, H H T, H T H, H T T, T H H, T H T, T T H, T T T.

Again the odds of flipping either heads or tails are the same (50%) but flipping any one of these combinations is now 1 in 8.



I'm really sorry but I did have a point and forgot what it was while chatting on skype and writing this lol... If I remember I will post, but for now you can look at this :P
Well these videos sum up an average game for me, these are the first videos of a play through I've made.

Sector 1 - Start - http://www.youtube.com/watch?v=awgg00_xq48

Sector 5 - DEATH - http://www.youtube.com/watch?v=A3-ywySoQMI
Maze1125
Posts: 144
Joined: Sun May 20, 2012 12:09 pm

Re: Evasion Math question

Postby Maze1125 » Thu Jan 24, 2013 10:57 am

rhev wrote:I don't believe you are correct, and please allow me to explain why.

First of all, you're falling into the classic gamblers fallacy, where a percentage for any specific event always remains constant, even after repeated instances. Using your impossible hypothetical, with an evasion of 1%, given 1000 shots, it is entirely possible to evade 1000 shots. Just like with 99% probability, it is possible to get hit 1000 times.

Obviously the likely hood of this is highly improbable, but it is possible, it is a potential outcome. Why?

Because each shot is going to roll the 1d100 (or whatever). Each time that die is rolled, there is a one in one hundred chance that it comes up a 1, or that it comes up a 100. EACH TIME. If you have 99% evasion, and you get hit, it doesn't mean that the next 99 hits will miss.


Which is why I used the phrase "on average". There is no fallacy if you're talking about the mean, which I was.

A single percentage point at the start is nearly worthless, but near the end it is incredibly valuable. And that's because it's just a simple number generation system.

Secondly, the idea that a single percentage point gains or loses value, depending on what other evasion you have, I also believe you to be mistaken on.

If we accept that the chance to evade a blow works as we listed above (d100, equal too or lower than evade = miss, above evade = hit) then literally every single percentage point is of the exact same value. Every single percentage point is exactly one point more that you have to evade by. Being at number 60 is of a better defensive value than 40 simply because you have 20 points. Not because that single percentage point from 59 to 60 is somehow better than the one that got you from 49 to 50.

The trap that you, and the people on the reddit thread, were falling into was thinking that since it's an increase in the percentage of your defense, that makes it more valuable than other given increases. It doesn't, not inherently at least. Every single point towards your defense (again assuming that we have the formula for evading correctly) is exactly as valuable as every other point.



To illustrate. Lets say that instead of having to roll 'under' your evade, the game generates a list of numbers from 1 to 100. Your ship has an evade rating of 15%. For every % point you have in the evade skill, it randomly hands you one of those numbers. So for the sake of the argument, it gives you the numbers randomly; 4, 12, 23, 24, 27, 41, 42, 44, 52, 55, 69, 72, 81, 84, and 92. Then when an attack is made, it rolls that d100. If the roll comes up as one of the assigned 'evade' numbers, then the attack misses, otherwise, it hits. This is absolutely NO different than saying your evade is a number between one and fifteen, and that if the die roll is fifteen or less, then the attack is evaded. There is ZERO difference in those two examples.

Yet, it illustrates that the hypothetical 'evade number' of 92 is absolutely the same as the 'evade number' of 12. There's no value in a higher evade number. Just like there's absolutely no inherint value in 1% of evade, OTHER THAN THE ONE PERCENT OF EVADE. It doesn't matter if it's taking you from 1% evade to 2%, or from 97% evade to 98%



See?

No percentage point is more valuable than the last?
Okay, then what about the one that takes you from 99% to 100%?
If you have 99% evasion, then shots can still hit you, if you have 100%, then you are completely impervious. That is literally infinitely more valuable than any of the percentage points that came before it.
The point from 98%-99% is just a less extreme version of the one from 99%-100%, and the one from 97-98% less extreme than that.

And, yes, you're right, misses on 15 random numbers is exactly the same as misses on numbers 1-15 and, as such, the exact same principle applies. The key issue is not to look at the numbers that misses occur on, but to look at the numbers that hits occur on.
If you have 0% evade, then hits occur on every number, so if you take one of those numbers away as a miss (increasing your evade by 1%) it is basically irrelevant as you're still getting hit on the other 99 numbers.
On the other hand, if you have 98% evade, then hits only occur on two numbers and so, if you take one of those two numbers away (increasing your evade by 1%) you're outright halving the number of times you get hit.

Going back to the example of getting shot 1000 times, each evade point reduces the number of times you get hit on average by 10. The first evade point takes the average from 1000 to 990, the point from 98% to 99% takes the average from 20 to 10. In both cases the reduction is a matter of 10 hits, which is what you're thinking of, but those last 10 hits are much more valuable to remove than the first 10. Because at that point you're getting hit so rarely that any further reduction has a significant effect.
rhev
Posts: 7
Joined: Wed Jan 23, 2013 10:23 pm

Re: Evasion Math question

Postby rhev » Thu Jan 24, 2013 12:12 pm

0% and 100% weren't something you mentioned. They also don't fit into the schema of value, because they don't represent what we are talking about, which was the value of a single % point on a scale. 0% and 100% aren't 'on' that scale, they are the ends of the scale. They basically denote if something is on or off. 0% means nothing in one direction (no evasion) and 100% means nothing in the other direction (no hits). Going from 99% to 100% or going from 1% down to 0% isn't the same as anywhere off the scale, because you're basically stepping off the end of the scale.

That is obvious enough that I didn't think it would need to be mentioned.



But, since it isn't allow me to correct my statement from my above post. Instead of:
There's no value in a higher evade number. Just like there's absolutely no inherit value in 1% of evade, OTHER THAN THE ONE PERCENT OF EVADE. It doesn't matter if it's taking you from 1% evade to 2%, or from 97% evade to 98%


As long as you're on the scale from 1% to 99%, meaning on the scale between on and off. There's no value in a higher evade number. Just like there's absolutely no inherit value in 1% of evade, OTHER THAN THE ONE PERCENT OF EVADE. It doesn't matter if it's taking you from 1% evade to 2%, or from 97% evade to 98%


Finally, you've said this and so have the redditors, talking about how going from 98% to 99% means you've 'doubled your effective defense' as if that 1% is somehow more valuable from 1% to 2%. This is just an incorrect way of thinking. Assuming you think of things as working out to a PERFECT average, (like you've set up in your hypothetical, ie out of 1000 shots 99% evasion means only 10 hits) you're right in the sense that yes, your defensive capability has doubled.

But what you don't realize is that it doesn't matter. What your effective percentage of defense is in comparison to the previous rating doesn't matter. The only thing that matters is what your evasion % is. 99% evasion is only 1% better than 98%. Just like 66% is better than 65%, just like 33% is better than 32% and 2% is better than 1%.

Getting wrapped up in 'how much better' any given 1% is on that scale from 1%-99% is a trap. It's what I've been trying to explain over on reddit (but get downvoted till my comments are invisible) and trying to explain to you here. I don't know how else to explain it. I've used examples that you even acknowledge are right, but keep falling back into a misconception about relative values of perceived worth of any given single point.

Allow me to give you one last example. Lets say there's a candy factory. In this factory there's a machine that puts out 100 candy bars at a time. The candy bars are all the same in every way, shape, and form, and even come off the machine all at the same time. The only single distinction between the 100 candy bars is that they have a paper wrapper around them with a unique number on it ranging from 1 to 100. Now, if I tell you that you can take 99 of those candy bars, does the candy bar with the label 99 have inherit value on it over any other candy bar? No, candy bar number 99 is the same as candy bar 62, 33 or 1. The only thing that might matter is if I let you take zero candy bars, or all of them. Because then one of us would have none.

I don't want to go over it again, you'll either understand what I'm saying or you wont. I just was hoping someone knowledgeable with the mathematics / coding of the game could give some clarification on how a shot hits a ship / how evasion works in game.
honk
Posts: 2
Joined: Thu Jan 24, 2013 1:52 pm

Re: Evasion Math question

Postby honk » Thu Jan 24, 2013 2:07 pm

0% and 100% aren't 'on' that scale, they are the ends of the scale. They basically denote if something is on or off. 0% means nothing in one direction (no evasion) and 100% means nothing in the other direction (no hits). Going from 99% to 100% or going from 1% down to 0% isn't the same as anywhere off the scale, because you're basically stepping off the end of the scale.

That's simply wrong. Of course 0% and 100% are valid values and hence "on the scale".
Even if not, the example you were given in the beginning was 1%-2% and 98%-99%. You just didn't accept it.

But what you don't realize is that it doesn't matter. What your effective percentage of defense is in comparison to the previous rating doesn't matter. The only thing that matters is what your evasion % is. 99% evasion is only 1% better than 98%.

Of course it's only 1 point better, and no one said differently. It STILL gets you from 20 to 10 hits on average. That's halving the damage taken.

0->1: 10/1000 dodged -> 1/100 fewer hits
0->2: 10/990 dodged -> 1/99 fewer hits
...
96->97: 10/40 dodged -> 1/4 fewer hits
97->98: 10/30 dodged -> 1/3 fewer hits
98->99: 10/20 dodged -> 1/2 fewer hits
99->100: 10/10 dodged -> 1/1 fewer hits

As you can see, 0% and 100% are very much behaving like any other value. Every point in evade only increases your evade chance by exactly 1%. AND your hits taken decrease by a constant amount (10 hits on avg in the example).
BUT the relation "old hits/new hits" does not increase linearly.


Getting wrapped up in 'how much better' any given 1% is on that scale from 1%-99% is a trap. It's what I've been trying to explain over on reddit (but get downvoted till my comments are invisible) and trying to explain to you here. I don't know how else to explain it. I've used examples that you even acknowledge are right, but keep falling back into a misconception about relative values of perceived worth of any given single point.

Maybe you should consider, that you are in fact mistaken.

I don't want to go over it again, you'll either understand what I'm saying or you wont. I just was hoping someone knowledgeable with the mathematics / coding of the game could give some clarification on how a shot hits a ship / how evasion works in game.

Considering that you have an "evade chance" of a given, absolute percentage value, there is really only one way it CAN work. And that's the simple way described above.
If it did work any other way, the value in game would simply be wrong.


Allow me to give you one last example. Lets say there's a candy factory. In this factory there's a machine that puts out 100 candy bars at a time. The candy bars are all the same in every way, shape, and form, and even come off the machine all at the same time. The only single distinction between the 100 candy bars is that they have a paper wrapper around them with a unique number on it ranging from 1 to 100. Now, if I tell you that you can take 99 of those candy bars, does the candy bar with the label 99 have inherit value on it over any other candy bar? No, candy bar number 99 is the same as candy bar 62, 33 or 1. The only thing that might matter is if I let you take zero candy bars, or all of them. Because then one of us would have none.

This example is not related to the problem at hand though. At all.

Try this instead:
Your candy bar machine. Same amount of bars, same numbers.
I pick one bar at random and you have to guess the number. If you guess correctly, you win the game!
Chance to guess correctly:1/100 = 1%

Now let's reduce the amount of bars produced by 1%. Chance to guess correctly?
Chance to guess correctly: 1/99 = 1.01%
Increase in your chance to guess correctly? About 0.01% points

Remove 1% production again:
Chance to guess correctly: 1/98 = 1.02%
Increase in your chance to guess correctly? About 0.01% points

...skip a few steps...

Chance to guess correctly: 1/50 = 2%
Remove 1% production again:
Chance to guess correctly: 1/49 = 2.04%
Increase in your chance to guess correctly? About 0.04% points

...skip a few steps...
Chance to guess correctly: 1/5 = 20%
Remove 1% production again:
Chance to guess correctly: 1/4 = 25%
Increase in your chance to guess correctly? About 5% points


Your chance to guess correctly does not increase linearly, even though every step only one more bar is removed. What you are trying to argue for is that reducing the production from 5 bars to 4 has the same effect on your chance to win the game as the reduction from 99 to 98. This is not true. One case will increase your chances to win by 0.01% points, the other by 5% points!
rhev
Posts: 7
Joined: Wed Jan 23, 2013 10:23 pm

Re: Evasion Math question

Postby rhev » Thu Jan 24, 2013 2:27 pm

Even though I said ;
I don't want to go over it again, you'll either understand what I'm saying or you wont.


I just have to address this:
Maybe you should consider, that you are in fact mistaken.


I have. When I hear a dozen people or more taking one side opposite me, I can't help but consider that. It would be the height of narcissism and ego to simply assume you're right and not consider that you might be mistaken when faced with a single dissenting opinion, let alone dozens.

Which is why I've spoken with several colleagues of mine, teachers, two of which are college level math professors. I even showed the reddit thread to a mathematics professor the other day and he openly laughed at what some of the people there wrote. The math I've given plays out. Any given percentage point on a scale is no more or less valuable than any other other than the point it gives.


Now. I didn't come here to rehash the same argument ad nauseum. The question I had, and hoped to get answered by a moderator / dev / someone who knows how the game is coded is simple.

How does evasion work?



Thanks.
honk
Posts: 2
Joined: Thu Jan 24, 2013 1:52 pm

Re: Evasion Math question

Postby honk » Thu Jan 24, 2013 2:32 pm

Try at least reading the my entire post. There is only one way it can work, and that has been described above. It's straight forward and totally obvious.

And quite frankly.. you haven't given any math at all. You did some hand-waving, said 0% and 100% were "off the scale" and ignored any answer you got. That's not maths. And what you did say isn't wrong. It's just a different point of view. In absolute values, every point IS worth the same. Just not when seen as chance relative to the rest. :)
Maze1125
Posts: 144
Joined: Sun May 20, 2012 12:09 pm

Re: Evasion Math question

Postby Maze1125 » Thu Jan 24, 2013 3:16 pm

rhev wrote:Which is why I've spoken with several colleagues of mine, teachers, two of which are college level math professors. I even showed the reddit thread to a mathematics professor the other day and he openly laughed at what some of the people there wrote.

Did you professors you talk to specialise in probability?
Did they look at the issue in depth? Or did they just glance at it?
Have they personally studied this phenomenon of probability, like I have?

Maths isn't a single subject, nor is it a simple one. Certainly any maths professor worth their salt could see what was being said if they put their time into it, but that doesn't mean that they can understand it at a glance, they almost certainly saw the level of rigour used in the proofs and dismissed the entire argument from there. And you came asking them to dismiss the argument, so you primed them to see it that way. Hardly a fair situation for them to make a valid judgement.

If you want, you can ask them to personally discuss it with me, and I can assure you that they will quickly agree with what I'm saying.

But hey, for now, lets look at it another way.
The ships in game have 30hp, and lets assume you're being attacked with 1 damage missiles.
With 0% evasion it takes exactly 30 shots to be destroyed.
With 1% evasion it takes an average of 30.3030... shots to be destroyed.
...
With 50% evasion it takes an average of 60 shots to be destroyed.
With 51% evasion it takes an average of 61.2245... shots to be destroyed.
...
With 80% evasion it takes an average of 150 shots to be destroyed.
With 81% evasion it takes an average of 157.8947... shots to be destroyed.
...
With 98% evasion it takes an average of 1500 shots to be destroyed.
With 99% evasion it takes an average of 3000 shots to be destroyed.
And, of course, with 100% evasion you can't ever be destroyed.

The difference should be very clear at this point. That first 1% protects you from less than a third of a shot, while the 1% from 98%-99% protects you from 1500.

Now. I didn't come here to rehash the same argument ad nauseum. The question I had, and hoped to get answered by a moderator / dev / someone who knows how the game is coded is simple.

How does evasion work?
.

And you got your answer, the game is coded exactly as you thought, but that doesn't change the principle being discussed.