This is a bit ...: 9/11/2012 15:57:55 
mosquitero_retired
Level 40
Report

... embarassing for me but i have to admit after nearly 3K games: i still dont know exactly how the luck modifier works. Sure, i read WarLight Wiki too, but i still dont know exactly how the Luck Modifier (LM) influences the number of armies left after the attack. More precisely, i m talking about the number of attacking troops, NOT about the number of defending troops. The Wiki holds no information about that, it only tells me how the LM influences the outcome of an attack with respect of defending troops.

This is a bit ...: 9/11/2012 16:17:05 
Richard Sharpe
Level 59
Report

The luck modifier works the same in both directions.
Basically, it determines the possible variance from the expected outcome. If you have ten armies defending or attacking with standard kill rates, they are expected to kill 7 or 6 armies respectively. The luck modifier determines how far from that value the actual outcome can be.
So on offense with 16% luck, the expected outcome is 6 kills and minimum is 5.04 (6*(1.16)). With 75% luck, the expect outcome is still 6 but the minimum is now 1.50
On defense with 16% luck, the expected outcome is 7 kills and minimum is 5.88 while at 75% it drops to 1.75.
In all cases, the decimal point is done separately to my understanding so this last instance gives 75% of 2 and 25% of 1 should the worst luck occur. Basically, the round number given is the minimum possible kills when either attacking or defending. (the same math can be used going up but it is bounded by the number of attacking armies so gets a bit more confusing)

This is a bit ...: 9/11/2012 16:25:12 
I∂ƒ∂oggY
Level 46
Report

Mosq, if you want, you can set up a game with me and we can go over the strategies involved with modified luck.

This is a bit ...: 9/11/2012 16:28:07 
Fizzer
Level 58
Warzone Creator
Report

The number of armies left over after an attack is simply the number that the defenders didn't kill. For example, if you attack with 30 and the defenders kill 10, you'll have 20 left over to occupy the new territory.
To figure out how many the defenders will kill, multiply the number of defending armies by 0.7. For example, 20 defending armies will kill on average 14.
The luck modifier just determines how far off from 14 the actual result will be. In 0% luck, it will always be 14. With higher luck values, it can be higher or lower than 14, but 14 will always be the most likely result.

This is a bit ...: 9/11/2012 18:03:36 
mosquitero_retired
Level 40
Report

So do i understand correctly: the LM is with regard of defending / attacking troops uncorrelated?
An example: LM is 75%. "BLUE" territory, 18 troops, is attacked from "RED" territory with 14 attack troops. Bad luck for blue: After the attack BLUE and RED each have 7 troops left. But it could also be possible BLUE still has 15 troops left and RED loses all attack troops and has only 1 troop in the territory from which he attacked left? Or BLUE has 7 troops left and RED loses all attack troops?

This is a bit ...: 9/11/2012 18:10:38 
I∂ƒ∂oggY
Level 46
Report

For specific situations, you can always check by using the "analyze" option during an attack; And yeah, don't attack 15vs18 haha

This is a bit ...: 9/11/2012 18:17:23 
Richard Sharpe
Level 59
Report

Mosq, you are essentially correct.
Say you are playing on 100% luck meaning ten armies can kill anything from 0 to 10 (though over time it should average to 6). It is entirely possible that 18 attacking armies could kill zero while 15 defending armies could kill 15. Conversely, it is entirely possible that 18 attacking armies could kill all 15 defenders and those defenders kill 0 attackers.
Both scenarios are highly unlikely to play out but they are possible.

This is a bit ...: 9/11/2012 18:22:31 
mosquitero_retired
Level 40
Report

Doggy ... i sure have some experience with all this. Roughly estimated i performed several 100K attack on neutrals or opponents :). The question was/is: Is the LM applied seperately in a random manner (influenced by the LM) on attacking and defending troops or if there is some correlation.
If there is no correlation, like it is with the Micro Luck randomizer, as i now suppose, then the range of results of such an attack is much wider than if there were a correlation. Bottom line: Almost everything is possible with such an attack with 75% LM.

This is a bit ...: 9/11/2012 18:39:57 
I∂ƒ∂oggY
Level 46
Report

Exactly. Hence people don't like that settings as much as lower luck.

This is a bit ...: 9/11/2012 20:41:10 
RvW
Level 46
Report

To the best of my knowledge, the luck modifier is applied to the offence and the defence calculation of an attack completely independently; there is no correlation.
I'm not familiar with "the Micro Luck randomizer" (or, at least, I don't know it by that name).

This is a bit ...: 9/11/2012 22:06:49 
mosquitero_retired
Level 40
Report

Micro Luck randomizer i call the randomized rounding mode.

This is a bit ...: 9/11/2012 23:45:12 
RvW
Level 46
Report

Ah okay, now I understand. That, too, has zero correlation with the other probabilities.

This is a bit ...: 9/12/2012 00:39:13 
Richard Sharpe
Level 59
Report

ksz, all values would not be equal probability. They would form a bell curve with 6 being the most likely outcome and 3/9 being equally low. As for how to compute the odds, I am not certain but I believe it would be a binomial distribution to determine what the 'luck' figure was. Once determined, the luck figure is combined with the expected value according to the luck percentage.
Think of it as a series of coin tosses where heads is a successful attack and tails a failure. To get a 3 or 9 you would have to get all heads or all tails (10 in row is 1 in 1000 odds)... to get a 6 you just need 5 of each which is the expected outcome.

This is a bit ...: 9/12/2012 07:20:14 
aper
Level 56
Report

I have a question about luck, too.
I checked those graphs here:
http://wiki.warlight.net/index.php/Luck_Modifier#Analysis
and I'm still unclear in what range the luck modifier works. According to the graphs, for example, the number of armies killed when attacking with 100 (50% luck) can vary from 52 to 68.
If the formula was 60(1+0.5) => the range should be from 30 to 90...but it's not that.
Also, according to previous posts, attacking with 1000 armies with 100% luck could end up (theoretically) with killing 0 armies, which to me doesn't sound right, because it's a huuuge deviation.
tl;dr in what range does the luck modifier works.

This is a bit ...: 9/12/2012 13:08:10 
Richard Sharpe
Level 59
Report

Y is immaterial to the equation.
N = X*B*(1A) with the answer of the right portion being rounded down to the nearest whole number.
A = .16, B = .60, N = 10; thus X = 20
On standard settings, you must attack with 20 to guarantee killing 10 defending armies.
A = .16, B = .60, N = 2; thus X = 4 (well known that 4v2 is 100% certainty)
A = .75, B = .60, N = 2; thus X = 14, you must attack with 14 to mathematically ensure victory.

This is a bit ...: 9/12/2012 13:32:03 
Richard Sharpe
Level 59
Report

Looking at your question again, the above solution is only partial... it determines the minimum armies killed by X attackers (or inversely, the minimum required to kill N defenders)
The probability of each would require using a binomial distribution.
http://en.wikipedia.org/wiki/Binomial_distribution
For example, use 4 attacking armies and 60% kill rate, 75% luck. Here are your possibilities:
2.6% of 0 successful attacks.
15.4% of 1 successful attacks
34.6% of 2 successful attacks
34.6% of 3 successful attacks
13.0% of 4 successful attacks
Rounding errors give a 100.2% total.
Then take the expected outcome (2.4 kills) and multiply by 1luck (.25).
Multiple the successful attacks by the luck figure (.75)
Add these two numbers together.
2.6% of ending with 0.6
15.4% of 1.35
34.6% of 2.10
34.6% of 2.85
13.0% of 3.60
Now those remainders are the odds of rounding up or down.
1.04% of 0 kills (2.6% * 40%)
11.57% of 1 kill (2.6*60% + 15.4%*65%)
41.72% of 2 kills (15.4%*35% + 34.6%*90% + 34.6%+15%)
38.07% of 3 kills (34.6%*10% + 34.6%*85% + 13%*40%)
7.8% of 4 kills (13%*60%)

This is a bit ...: 9/13/2012 03:28:23 
RvW
Level 46
Report

So know i'm curious if anyone know(fizzer for sure:P) and would share this knowledge, how to calculate excat probabilty value for killing (at least) N armies when attacking X unit with army of Y. Assume that luck modifier is A and offense kill ratio is B. Looks like nice math task :D
I once tried that, got pretty far too..., but didn't succeed in figuring out the last few details. The calculation is rather complex and extremely ugly. One of these days (I've been saying that for half a year now though, so don't hold your breath :s ) I'll finish it completely.
And no, Fizzer (who, when I was almost done, invented a second rounding mode, which gave me even more stuff to figure out ;) ) doesn't have that formula himself either. The best he can do for you (and has done, in the "Analyse" window) is simply trying a hundred times, counting how many of those tries succeed and use that as an approximation.
ps. What Richard says is correct... but he "hides" one important detail: how to calculate the binomial itself. Doing that for small numbers is easy enough and with a computer you can do it for any number you're likely to find in a small or medium WL game, but in big games you will encounter numbers of armies for which it is not so easy any more.
Also, what I've been really breaking my head over is "If my opponent has X armies, the (offence) kill rate is Y and I want to be at least Z% sure the attack will succeed, with how many armies should I attack?". If you can find that formula, please share it with everyone!
you must attack with 14 to mathematically ensure victory.
Please note that when Richard says "mathematically ensure", he really means it. Especially on high luck settings, if you can live with a oneinamillion chance of your attack failing, a far lower number of attackers will suffice. (In the extreme case of 100% luck, no amount of attackers will guarantee a victory; even a thousand attackers are not guaranteed to defeat even a single defender.)

This is a bit ...: 9/13/2012 04:52:15 
Mythonian
Level 55
Report

I'm seeing a big misconception in this thread (unless the wiki is severely out of date).
From the Wiki:
When an attack happens, WarLight calculates the "expected" number of armies that should get killed, assuming an average roll. The attack is also randomed as normal and these two numbers are interpolated based on the luck percentage.
...
If a player attacks with 100 armies, it is expected that it will kill 60 of the defending armies, but let's assume the random number generator determined that only 54 would get killed.
In a game with a luck percentage of 100%, WarLight will simply use the 54. However, in a game where the luck percentage had been reduced to 50%, WarLight would take the average of these numbers and would use 57 instead. If the luck percentage were 0%, WarLight would simply ignore the random and use the 60 every single time.
That means that even in 100% luck, getting wide variance like killing 0 is not simply the standard bell curve, but also you must take into account the random number which would need to be interpolated together with it.
This means that for 99% of the time, it's totally impossible to get a result of 0 kills with 10 attacking, at any luck values. It doesn't simply have a low percentage based purely on the luck, but also you need to account the possibility of where the random number would be at, and then compare that with the expected outcome and the luck modifier value.
What this ends up causing is the bell curves becomes significantly steeper, with anything after the first standard deviation becoming effectively negligible. (i.e., the true likelihoods of widely varying results are notably lower than would be expected based only on the luck value).

This is a bit ...: 9/13/2012 12:11:30 
Krzysztof
Level 66
Report

ps. What Richard says is correct... but he "hides" one important detail: how to calculate the binomial itself. Doing that for small numbers is easy enough and with a computer you can do it for any number you're likely to find in a small or medium WL game, but in big games you will encounter numbers of armies for which it is not so easy any more.
Also, what I've been really breaking my head over is "If my opponent has X armies, the (offence) kill rate is Y and I want to be at least Z% sure the attack will succeed, with how many armies should I attack?". If you can find that formula, please share it with everyone!
Could you precise how big those 'big numbers' are? I've written program to calculate
chance for killing (at least) X armies with given number of armies, luck and killRatio(your problem looks far more complicated at this moment). And it looks like it's working with as much as about 1500 armies(with standard killRatio, higher killRatio means it will fail with lower number of armies). For me 1500 looks quite enough(and even as i'm not 100% for this, i think i can increase it)
Also i've run some simulations and noticed strange(at least for me) thing. Even with 99% luck there is 99% chance that 100 armies will kill between 37 and 63 armies. Is this correct or something is wrong with calculation?
I've used this http://upload.wikimedia.org/math/6/8/d/68d0ba6ef5dfb8c654702c3290128b10.png for calculating 'default' probability that n armies will kill k units with p killratio. (this parts looks ok).
Those values are then modified wtih luck as described by Richard.
Probability for killing at least X units is obtained by simply adding probabilites for higher numbers(here can be some error because of adding many very small floatingpoints numbers, but it should'nt be significant).
Any hints?:P

This is a bit ...: 9/16/2012 00:07:30 
RvW
Level 46
Report

@Mythonian:
The wiki should not use a bell curve, that's indeed misleading (or: implicitly assuming a (nonstandard!) killrate of 50%).
That means that even in 100% luck, getting wide variance like killing 0 is not simply the standard bell curve, but also you must take into account the random number which would need to be interpolated together with it.
Example, we're doing an attack; "expectedvalue" says "kill 8" and (digitally) throwing a few dices gives (for this particular attack!) makes "luck" say "kill 0".
I haven't yet told you what luck modifier this game uses, but you already know this attack will kill somewhere between 0 (inclusive) and 8 (inclusive) armies. On standard 75% luck we'd get 75% * 0 + 25% * 8 = 2 kills. But in the extreme case of 100% luck, the interpolation is degenerated into simply taking the "luck" value. Of course, technically it's still an interpolation: 100% * 0 + 0% * 8 = 0 kills, but it might not "feel" like an interpolation. I think this is were your misunderstanding comes from.
In practice, for moreorless large numbers, it practically never happens all the roles fails, so you're incredibly unlikely to ever see it happening, even if it theoretically could. For instance, a 100vs1 attack, with 50% kill rate and 100% luck fails with chance 1 / ( 1/2 ^ 100 ), quite literally a oneinamillion chance (or "1 in 1048576" if you're feeling pedantic ;) ).
On the other hand, especially for small numbers, it's not necessary to kill 0.000 armies; anything strictly smaller than 1 has a chance of being rounded to 0 (on stochastic round) / anything strictly smaller than 0.5 will always be rounded to 0 (on straight round).
@kszyhoo:
If you write your own code (and can use something called "Extended precision floating point numbers", 16378 armies will work, 16379 armies will fail. The problem is not with the final result of the calculation, that's a (relatively) small number. The problem is halfway through the calculation, you have to work with insanely huge numbers, which simply get too big to handle (without special tricks).
If you cannot use extended precision (but are stuck with double precision) you top out much sooner, but I don't have the exact number readily available.
Regarding your other question:
That looks symmetric around n = 50, did you use a kill rate of 50%? If so, yes, that's to be expected! You see, there's not that much of a difference between 99% luck and 100% luck. And 100% luck and a kill rate of 50% means you get a "Normal distribution" (also know as the "(Gaussian) bell curve"). Sure, in theory it's probability of any particular result never reaches zero, but more than two or three standard deviations from the middle, those chances get incredibly small.

This is a bit ...: 9/17/2012 00:34:24 
General Arun {Warlighter}
Level 2
Report

n00b!

Post a reply to this thread
Before posting, please proofread to ensure your post uses proper grammar and is free of spelling mistakes or typos.

