<< Back to Help Forum   Search

Posts 1 - 13 of 13   
What is an In-epth Explanation on how Luck Works?: 2/27/2013 02:25:22

Sorrose
Level 2
Report
What are exactly the mechanics that play on luck's influence with the amount of rmies killed.
What is an In-epth Explanation on how Luck Works?: 2/27/2013 04:47:24


myhandisonfire 
Level 54
Report
You could ead the warlight iki for it, that could help.

http://wiki.warlight.net/index.php/Luck_Modifier
What is an In-epth Explanation on how Luck Works?: 2/27/2013 11:04:38


ps 
Level 60
Report
when setting the attack orders and you're unsure of the result it's useful to click the analyze button, it shows you two charts, your percentage of success in taking the territory and the quantity of armies you and the defender will lose. although tbh i always found that second chart a bit confusing.
What is an In-epth Explanation on how Luck Works?: 2/27/2013 13:20:31


Aranka 
Level 43
Report
Both charts are quite handy ps but they're used for different situations.

The top one is mostly used to see how many troops you minimally need to get a 100% chance to take a territory against either neutral territories or if you intend to break that area.

The other one is more to give an estimation for when an attack will be profitable for the attacker to take place even if he/she might not win the territory. For instance in the Europe map if Ireland is attacking Suor (which happens a lot) you might wonder if attacking 15 troops with 20 (after maximum deployment of troops) is profitable (meaning defender loses more then attacker). This can be seen by seeing if your army count is equal to or higher then the point where losses defender meets losses attacker.
If this is so, it's valid to attack. In certain cases constantly grinding down the enemy force by superior troop quantity is even better then breaking his bonus.
What is an In-epth Explanation on how Luck Works?: 2/27/2013 13:28:41


ps 
Level 60
Report
yes, i understand that part, i just find it hard to read and figure out from looking at it what is the exact outcome in real numbers. the top one is much clearer in that regard imho.
What is an In-epth Explanation on how Luck Works?: 2/27/2013 13:56:08

Qi 
Level 55
Report
The most inept answer: luck doesn't always work in your favor.
What is an In-epth Explanation on how Luck Works?: 2/27/2013 19:56:29

[16] Jasper 
Level 52
Report
I would like to second the request for a proper explanation how luck works in combat.

The wiki page is nice and gives you a global idea, but when you're really interested in knowing how this actually works, it's far too vague. It explains nicely how the luck based kill rate and the luck-less kill rate are interpolated based on the luck percentage, but it fails to mention how this "luck based kill rate" is established.

The graphs on the wiki page (and analyze results on an assortment of settings) could probably be used to reverse engineer the method used, but I think there is actually too little information to get an accurate result that way without doing some major guesswork.

I would very much prefer an explanation from the one man who actually knows how this system works.
What is an In-epth Explanation on how Luck Works?: 2/28/2013 05:07:13


Wenyun 
Level 59
Report
Here's how I've always simplified the formula for armies killed:

K = (R*L) + (E*[100%-L])

Where K is the amount of armies killed, R is the amount of successful rolls, E is the expected amount of kills, and L is luck (in percentage form.)

The "luck-based kill rate" is defined as R in my formula. Warlight finds R by randomly determining whether each army succeeds or fails in its attack. Warlight could use a random number generator from 1-100. If the kill rate is X%, every army that gets a number between 1 and X succeeds.* Warlight repeats this process for every army in the attack. The number of successes are then tallied up to find R. (Note: The luck percentage has nothing to do with finding R.)

To find E, simply multiply the kill rate by the number of armies attacking. For example, when 4 armies attack with a 60% kill rate, the number of armies expected to be killed is 4*60%, or 2.4 armies.

The luck percentage (L) determines how much the expected value and random value affect the final amount of kills. With lower luck percentages, the expected value is given more weight. This decreases the amount of deviation. Conversely, with higher kill percentages, the luck-based kill value is given more weight. This increases the amount of deviation.

K, or the total amount of kills, is calculated by the above formula. While the number that comes out of this formula can be a non-integer, K must be an integer. Thus, it rounds to an integer based on the rounding mode.
  • In weighted random, the rounding is random. The chances are based on the numbers after the decimal point.
  • In straight round, K is rounded up if the number after the decimal is .5 or more. K is rounded down if the number is less than .5

*This does break down on 0% kill rate (It would have a 1% chance of succeeding due to 1 being a number between 1 and 0), but obviously 0% kill rate means no armies will be killed. I could fix it by saying between 0 and X, but 1 is simpler and works for >99% of cases.
What is an In-epth Explanation on how Luck Works?: 2/28/2013 07:59:09


professor dead piggy 
Level 59
Report
I too have read the wiki and come away unsatisfied.

I read 101sts formula and it seems to indicate that with 16% luck and 60% kill rate that 3 armies could kill...between 1 and 2 defenders

K=R*16% + 1.8*84%
K=R*16% + 1.512
R can be 0,1,2 or 3. So the first bracket resolves to either 0, 0.16, 0.32, 0.48
so K can be 1.512, 1.672, 1.832, 1.992
And then I suppose this is where straight rounded/weighted rounding come in?
straight rounding you kill 2.

In weighted random you kill 1 about 25% of the time 2 about 75% of the time. So either I've messed up the maths by rounding to too few decimal places or something is wrong with the formula because in game 3kills 2 80% of the time.

Interesting, I guess this is just a good approximation? Would love to know the actual formula Fizzer...
What is an In-epth Explanation on how Luck Works?: 3/1/2013 03:45:25


Wenyun 
Level 59
Report
(1.512 + 1.672 + 1.832 + 1.992) / 4 = 1.752

I assume you used the above equation to calculate the percentage of killing 1 or 2 armies. However, what this equation fails to take into account is the fact that R is more likely to be some numbers than others. In this case, since it's a relatively simple problem, we can use a probability tree to illustrate this.



Note: P is for pass, F is for Fail. The numbers in brackets represent number of armies passed over the total number rolled so far.
Start:                      _[0]_
                         P /     \ F
                        (60%)   (40%)
                         /         \
Army #1:             _[1/1]       [0/1]_
                  P /      \ F P /      \ F
                 (60%)   (40%) (60%)   (40%)
                  /          \ /          \
Army #2:       [2/2]        [1/2]        [0/2]
            P /     \ F  P /     \ F  P /     \ F
           (60%)   (40%)(60%)   (40%)(60%)   (40%)
            /         \  /         \  /         \
Army #3: [3/3]       [2/3]        [1/3]        [0/3]



As we can see here, getting 0 kills here is the least likely, while 2 is the most likely. To be exact, we can calculate this by finding the probability of taking each path.

0 armies: 40%*40%*40% = 6.4%
1 army: (40%*40%*60%)*3 = 28.8%
2 armies: (40%*60%*60%)*3 - 43.2%
3 armies: (60%*60%*60%) = 21.6%

6.4% + 28.8% + 43.2% + 21.6% = 100%.

So, we would then weigh the numbers using the percentages above...

1.512*6.4% + 1.672*28.8% + 1.832*43.2% + 1.992*21.6% = 1.8 armies.

As expected, we end up with 1.8 armies, which is the number you put for E... and you will always end up with E. Thus, there isn't any point in using this formula to find out the average number of armies killed. This formula still holds up even on 100% luck - try plugging in 0, 1, 2, and 3 instead of those decimal numbers and you will still end up with 1.8 as the answer.

To find the average amount of armies killed, multiply the number of armies killed by the kill rate. (Yes, this is the same as finding E in my last post.)



What the formula I've posted above could be used for, however, is finding the minimum and maximum values for armies killed. For the minimum, simply replace R with zero and either round down (Weighted Random) or round normally (Straight Round). For the maximum, replace R with the number of armies you attack with, and round up (Weighted Random) or round normally (Straight Round).

As an example, here's why strategic 1v1 uses 16% luck: (Note: This is for 4v2)

On 16% luck: K=0*16% + 2.4*84% = 2.016 armies. This guarantees that 4 will kill 2 armies.
On 17% luck: K=0*17% + 2.4*83% = 1.992 armies. This means that 4 can fail to take 2 armies, although the chance is minuscule. (Usually, this will show up as 100% on the analyze graph, even though it isn't 100% - this is due to the fact that Warlight's analyzer simply simulates the situation hundreds of times, and shows the results.)
What is an In-epth Explanation on how Luck Works?: 3/1/2013 04:14:29


professor dead piggy 
Level 59
Report
Of course! Thanks for taking the time to do that.

"Warlight's analyzer simply simulates the situation hundreds of times, and shows the results." I noticed that too, interesting that Fizzer doesn't just write code to do the calculations you just did in 10 minutes one time for each combination of luck and numbers of attackers and end up using less computer power and get a more accurate result.

Your formula also lets me take the "offense luck" that is shown in the history with each attack and make some sense of it. Can you rearrange the formula to get L, R or E on their own?
What is an In-epth Explanation on how Luck Works?: 3/1/2013 06:33:10


Wenyun 
Level 59
Report
Finding L and E on their own is generally uninteresting, as the former is the luck percentage, given at the beginning of the game, and E is the expected amount killed, which has a simpler formula of (Armies*Kill Rate). Finding R would be interesting, but it is impossible to pinpoint to one number because of K's rounding. (This is also true when trying to find L and E.)

We can only see K as an integer - Warlight does not show us K as a decimal number, and it also does not show us R.*

  • In weighted random, K is up to 0.99... off, meaning 2 armies killed could have been anywhere from K=1.00...1 to K=2.99...
  • In straight round, K is up to 0.5 off, meaning 2 armies killed could have been anywhere from K=1.5 to K=2.499...



With that being said, if we just swap around the values a bit... R = K/L - E/L + E

Due to what I said above, K has been rounded, so we have to apply the margin of error. Remember that R must be an integer, as an army cannot pass a fraction of a roll.

Weighted Random: [K-1]/L - E/L + E < R < [K+1]/L - E/L + E and R ≤ (# of armies)
Straight Round: [K-0.5]/L - E/L + E ≤ R < [K+0.5]/L - E/L + E and R ≤ (# of armies)



interesting that Fizzer doesn't just write code to do the calculations you just did in 10 minutes one time for each combination of luck and numbers of attackers and end up using less computer power and get a more accurate result.

The problem with this is that the chances of each path start getting really small, and the number of ways to reach a certain number get pretty big. (For the latter, look up Pascal's Triangle)
Thus, my way of finding the number becomes very impractical when considering higher army counts, and wouldn't improve calculating times much, if at all. There is a way to shorten calculation time, but it involves a complex formula or two. (I don't believe anyone's figured it out yet.)



*Barring 100% luck, where K = R. This forces K to be an integer, and R is shown through K. Though I'm not sure you'd want to learn about luck if you solely play 100% luck games...
**This will fail with 0% luck because you're dividing by zero. Then again, the roll does not matter on 0% luck.
What is an In-epth Explanation on how Luck Works?: 3/2/2013 08:29:31


professor dead piggy 
Level 59
Report
Weighted Random: [K-1]/L - E/L + E < R < [K+1]/L - E/L + E and R ≤ (# of armies)

This is especially helpful, thank you.
Posts 1 - 13 of 13