Fuzzy math?

TastelessRamen

Chieftain
Joined
Dec 4, 2005
Messages
4
Sometimes, I see my units, after calculations, having a higher attack # than the defenders defend #. But the game will tell me that I have a 38% or 47% chance to win.

Could someone explain this to me? If after calculating promotions and terrain my # is higher, shouldn't my chance to win be higher as well?

This has only happened to me while attacking.
 
This is probably due to the other unit having first strikes, which increase their chances of winning, but do not directly affect their unit's strength.
 
I don't know but sometimes it seems that the computer cheats and wins despite the odds. Just today I attacked Tokugawa's Archers in his unwalled cities with my lovely Keshiks, and the computer gave me a 75% chance of winning... Well, I conquered five cities with this, repetitious pattern: The first unit is defeated by the archer (despite the 75% chance of winning) and leave it at one archer. Then the second, and third. After this, I send my remaining Keshiks to kill the solo Archers. This exactly same pattern occurred every time.

Thus, I kept reserve Keshiks and attacked only when I had the troops to kill off the wounded. However, logically, I shouldn't have to send in my reserve Keshiks! I shouldn't even lose as many units as the computer, because I had 75% chances of winning! Either I'm just unlucky or the computer cheats on Prince.
 
i think its just luck, 1 in 4 times the pc will win :(. I had a pretty bad run last night, 5 units lost on 95% chances and another few on 90% chances, far more than would be statsically probable, but hey thats randomness for you!
 
The AI doesn't cheat, it is that the probability calculator should never be trusted.
 
The chance to win is non-linear. For example, the odds of a modern armor (strength 40) losing to a spearman (strength 4) is not 10 : 1, but actually 3,922,030,042 : 1. (0.00000000025497%).

With the exception of first strikes (there's a bug in their formula for those) the odds displayed in the game are accurate. You can check this yourself simply by placing two stacks of units in the world builder and stack-attacking one against the other. The outcome matches the displayed odds.

There's more info on combat in the Combat Explained.... thread. The results have changed slightly with the 1.52 patch (damage is now dependent on max strength, rather than current/damaged strength), but overall it's the same. For example, here is the chance-to-win curve, dependent on the ratio of attacker's strength to the defender's strength (R = A / D):

attachment.jpg

The jumps in the curve are due to the rounds-of-combat method for calculating damage and winners. 24 damage per combat round against 100 HP takes 5 hits to win, add one more damage (25 per round) and it takes 4 hits. A single formula to calculate results would probably be more efficient and accurate, but hey, who knows.
 
I lost a 97% win chance onceand hardly damaged the opponent!

What's your most improbable result?
 
a lvl 3 german blitzkrieg panzer losing to a barbarian archer Oo (ok, has been damaged to ~3 hp though ;))

most commonly are cavs losing against longbowmen barraged down to ~4.5 hp. the odds are about 95% and still you lose way often.

but it also happens the other way. had a catapult take out a city defender (and conquering it) with odds of 0.1% :eek:
 
what are the odds on getting damaged? If I attack with a 100% chance of winning half the time it still does quite reasonable damage to my unit, more than I'd expect :\
 
For effective and proper warfare, you need to understand the difference between % Chance to Win, and the extent to which units damage each other.

In a 2:1 battle, let's say a Spearman vs. Warrior, there is a 97% chance the spear will win. This is not to say however, that the Spearmen simply smote them down like ripe stalks of wheat, he took a beating too. But that's just the thing, "97.0% chance of victory" only means that when the battle is over, 97% of the time the spearman will not be dead.

Let us analyze this battle using the information provided in "Combat explained":
With a strength ration of 2:1, in each round of combat there is a 2/3 chance the spearman will strike the warrior, and a 1/3 chance the warrior will strike the spearman. When either unit wins a round they deal their damage to their foe.

The damage dealt also depends on the strength ratio. For this battle, the Spearman will deal 28 damage, and the warrior about 14. The Warrior will die in 4 hits, the Spearman, 8.

So, to see how this battle might play out: For easy analysis, let's assume the Spear will win this one. For evey 2 hits the Spear deals, the Warrior will deal 1. The Spear has only to deliver 4 hits to win, so we can estimate that the warrior will deal 2 hits in return. Warrior dies, spear takes 28 damage.

In general, you can estimate a 2:1 battle will end up with you victorious but being reduced to 72% health. Not too bad, but still annoying.

Now, let's say that you are now facing the other end of the stick. For whatever reason (deity lvl?), you find yourself fighting off a marauding enemy Knight with your brave and noble Axemen. You quail at the odds displayed to you. You are going into war with only a 3% chance of success?!!:suicide:

But fear not, for you have numbers on your side, and that is only the survival chance for the first Axeman.;)

Axe1: 1:2 combat ratio. Axe1 gets hewn limb from limb and mercilessly trampled, but knocks Knight down to 72% in process. (tripping over corpses no doubt).

Axe2: 5:7.2 combat ratio, close to 2:3. Since 1.52 patch is installed, damage dealt is the same as the first battle. This Axe too goes down in 4 hits, but manages to return the favor 2-3 times. Let's be pessimistic and assume 2. Axe2 is killed, but knight is worn down to 44%. Now we're making progress.

Axe3: 5:4.4 combat ratio. Things are looking good, it's only gonna take 4 hits to kill the knight now, just as many as it takes for your Axe to die. Furthermore, you will be trading blows at about 1 for 1, so this battle is close to a 50-50. You may win, or you may not. Since this is a pessimistic analysis, you lose. Knight takes 3 hits before delivering the killing blow to your Axe.

Axe4: Combat ratio is 5:0.2, or 25:1. The knight will go down in 1 hit, but still needs to score 4 hits on your axe. The chance that the knight can deliver 4 perfect hits is about 1 in 400,000. Needless to say, it dies.

So...It looks like it takes about 3-4 units to win a 1:2 engagement. Those odds suck, yes, but are not entirely impossible. Sure Axe1 only had a 3% chance of survival, but his sacrifice gave you victory in the end.

Another good usage for the idea of %Win vs. Damage Dealt, is the use of units that can retreat. A chariot with Flanking 1&2 will be able to retreat about 50% of the time. This is very useful, since it it can basicly deal damage for free most of the time. Even if you send it into a battle with only a 32% chance for victory, it will have a 66% chance of survival. Warfare only really costs you something if your unit dies, so retreat abilities greatly enhance your ability to fight. Wound with the Chariot, then finish off with an Archer. Even if the chariot does die, as long as it hurts its target enough to ensure that the second unit wins, it will have been about an even trade.

So, in summary, even in the most hopeless battles that you fight, you will almost invariably damage your foe. %Chance of Winning is merely how likely it is that you'll also actually walk away from the encounter.
 
thats a really good and useful post, thanks very much for taking the time to write it! :) It explains alot!
 
Nice clear exaplantion there Hans :goodjob: .
 
My post could certainly do with some editing, but thanks.

One thing that I want to add though, and this too comes from the "Combat Explained" thread (which is a good read), is about First-strikes.

First-strikes are what they say. They are a chance to attack your foe with impunity. They won't always hit, but they will usually help. It has been determined that the game calculates first-strikes as basicly rounds of immunity. A Samurai, with 2 first strikes, will fight 2 rounds of combat normally, but if it loses, it merely takes no damage. This is also the best way to think about it; how many rounds of protection does the unit have?

Since I was posting about %Win and damage, it makes sense to explain how first-strikes will change this. Simply put, when a unit with first-strikes wins, it will win taking less damage, and when it loses, it will have dealt more damage. This is often not decisive in a 1 on 1 engagement; in an even-strength battle, 1 first-strike offers a %Win slightly less than if you were just 10% stronger. In multi-unit engagements however, the damage prevented by the first-strikes can become invaluable, especially when outnumbered.

The effect of first-strikes varies depending on the strength-ratios involved. At ratios closer to 1:1, first-strikes will have a bigger effect on your %Win, but at larger ratios, they will have a greater effect on the damage recieved in combat.

Let us imagine a situation, like the knight-vs.-axe of my last post, but where first-strikes will be involved. I give you: Axeman vs. Samurai.

Samurai: str. 8, 2FS, +50% vs. melee.
Axeman: str. 5, +50% vs. melee.

Since I am ignoring any effects of terrain, the +50% bonuses will cancel against each other.

We face a 1:1.6 combat ratio. With no FS involved, this would be close to a 90%Win for the Samurai. The Samurai will deal 25 damage with each hit (the lucky bastard cleared a jump-point), the Axeman will deal about 16. The Axe will die in 4 hits, the Samurai in 7.

Axe1: Given the combat ratios, for the 4 hits the Samurai deals to kill the Axe, the Axe will give about 2-3 in return. We're looking at about 6-7 rounds of combat here, 2 of which will be done under the protection of first-strike. When everything is factored in, one can assume that only about 2 Axe-hits make it through, and so this battle concludes with the Samurai at 68%.

Axe2: This looks like a more even battle, the Samurai is only fielding about 5.5 strength, and will go down in 5 hits. Since I can't predict a "probable winner" here, I will take a different interperetation to the first-strikes. The Samurai takes 2 pot-shots at the Axe with about a 50% chance of success. Let's assume 1 hits. The fair-fight begins and the Axe will go down in 3 hits, the Samurai in 5. With obvious favoritism, and making a mockery of the gaussian curve, I will say that the Axe dies, and the Samurai takes 3 hits, now reduced to 20%.

Axe3: This will finish the Samurai most likely. We are looking at a 3.1:1 strength ratio here. The Samurai will die in 2 hits. There is about a 1/2 chance that the Samurai will be able to get a successful first-strike off, and about another 50% chance it'll give a hit in regular combat. Let's assume that at least one of these worked. The Samurai dies, and the Axe is left with 75% health.


The effect that the first-strikes had here was mainly that the Samurai took a little less damage than would have a Maceman, but also that the axemen had a harder time. In that first battle, a Mace might have actually taken 3 hits, and so fared much worse in the coming fight, and may have died to the 2nd one. Regardless, the 3rd Axe would have probably gotten off unscathed. The effect was somewhat subtle, but I'm certain you would notice a statisticly larger number of Axemen dieing to Samurai than to Macemen. Also, the more first-strikes that are involved, the more significant their effect becomes. If it had 4 first-strikes, the Samurai would surely have gone on to at least a 4th Axe.
 
Back
Top Bottom