On combat, why everyones calculations are wrong

Excilus

Chieftain
Joined
Nov 26, 2001
Messages
25
Update:

I made a boo-boo. That was only the probability that the attacker wins without any damage. The real probability is what the chance of win is with ANY amount of damage, as such, here is the formula:

p(attacker wins)~b(h(D);rolls, p) where p = attackVal/defenseVal+attackVal, h(d) = hitpoints of defender and h(a) = hitpoints of attacker.

=(rolls!/hitpoints_of_defender!(rolls-h(D))!)*
((p)^h(D))*((1-p)^(rolls-h(D)))

where rolls is a function of h(D), h(A), and p such that:

Sum of series(Sigma, for those of you who have taken high school math) with min rolls = x as the lower parameter and max rolls as a higher parameter, and the equation p(x)*((x!/hitpoints_of_defender!(x-h(D))!)*
((p)^h(D))*((1-p)^(x-h(D)))).

This is the same as replacing rolls with the expected (mean) value of rolls. This we will call r. So...

r=Sigma(x=min Rolls, max Rolls, (x*p(x)))
min Rolls = lowest hp of the two units
max Rolls = (h(A)+h(D))-1
p(x)=p(of a roll)~b((x;(Max Rolls, p)

For those of you not learned in stats this means that if the defender is higher:

p(x)=((Max Rolls)!/x!((Max Rolls)-x)!))*(p^(x))*((1-p)^(Max Rolls-x))

Plug all the answers and variables in and you have your probability. BTW, the chance that modernarmor loses to an elite spearmen, as you have seen, is much lower then you all seem to think. Expected rolls is only about 5.312, and the chance to win is around 0.03. (3%)
 
Careful about using the word everyone in your description. Over a month ago me and fellow programmers knew full well that you used the exact binomial probability theorem to determine the probability of the battle outcome. I was the one that described the equation in full to Xerxes, Thunderfall and a couple other who were working on the HTML battle percentage outcome programs. My description included HP values of the attacker and defender. Here are some links to the info in the forums....

http://forums.civfanatics.com/showthread.php?s=&threadid=7886

http://forums.civfanatics.com/showthread.php?s=&threadid=8068

Furthermore it looks like your equation (asside from being hard to read) is incomplete. You equation determines the probability on the battle outcome leaving the attacker unharmed and the defender dead. What about the the probability of the attacker winning with 1hp, 2hp, 3hp (if the attacker is a full health vetran unit) or 4hp (if the attacker is a full health elite unit)? In each of those cases the attacker still wins...but it's not included in your equation.

Lets say the attackers HP is called A and the defenders HP is called D. You need to determine
P(of a least D successes in (A+D-1) trials)....you equation only seems to determine the P(of exactly D successes in D trials).

The current issue is that the program that is being used in Civ3 to seed the RNG, or the RNG itself is quite crappy which is resulting in improbable outcomes occuring more often than what is probable.
 
I probably should have found a better way to print it, but frankly I have better things to do.

Also, in the update, I should have used a non general algorithm, but that would mean expanding the sum for each set of hitpoints(9). More readable, but bigger, and more of a pissoff :P

The rng program is pretty weird. It seeds the outcomes, and keeps the seeds in savegames(or memory)!.
 
It doesnt really matter what the technical odds are and I dont really care, Because it happens, and it happens frequently. Conscript its expected, regular, maybe, but vet and eleite no way.I had 6 Modern and tried to take an aztec city with only 4(I am sure during this process some died and they of course built new ones, vetran). spearmen in it. over and over and over they destroyed them, Over and over I built new ones and sent them to their impending doom. Switched to sending Infantry they did worse,Then sent rifleman that I had left over from conqureing and other civ, and boom, 2 rifleman took out the 4 Defenders that destroyed my tanks, Chariots, Knights, Horseman, Spearman, Warriors,and Infantry.That is total lunacy.My Infantry couldnt even damage them if they were full, then when my vet Infanrty fell they had not even been touched. Doesnt make sense that men wth sharp sticks can defeat men with semi automatic rifles,not without even getting touched.It really doesnt matter you can spout all the technical BS you want. Something is broken causeing the outcomes to come out improperly.
 
First off, everything has a chance of happening.
Second, you've exaggerated, sub-consiously or consiously(It's not uncommon, it's natuaral to exaggerate a state of disbelief).

Third, while the chances are different in real life, history is riddled with battles won by armies with enormous disadvantages:

Spartacus won many battles with an outnumbered force of peasants with sticks.

German warriors defeated what was thought to be an invincible army in the black forest.

The Mongols, in the lifespan of one man, defeated the world with an army of 250000, conquering the most powerful and most advanced culture of china, mowing down a persian army of half a million men, the defense in russia(not much), and the combined forces of europe.

A french peasant girl, entirely untrained in the ways of warfare, won the battle of orleans with an outnumbered, technically disadvantaged mob of disorganized and demoralized men.

In the american revolution, the leaders of the western world lose thier biggest colony to, basically, a bunch of peasants they stuck there to colonize it.

The alamo.

A zulu army of 10000 impis defeated a british one, armed with bolt action rifles, twice that size.

In ethiopia, an army of 20000 spearmen in the hills and mountains forces a retreat of an italian army of equal numbers, with wwi technology! They come again with tanks and marines and after months of hard fighting they barely conquer it, but are unable to colonize it.

In stalingrad, the most powerful nation in the world at the time was fighting against russia. The russians had lost 13 million or more by that time, the economy was drain from the war, and from the revolution, and through an untrained but loyal defense they held for 6 months

A hardend defense of swordsmen in(I forgot where, mongolia?), defeat russian tanks by, uhm, throwing rocks at them.

And in afganistan the combined efforts of all the soviet states, covering 1/3rd of the worlds land mass, and 1/7th of the population, cannot hold a tiny country, the poorest in the world, resisted by religous fanatics, the muhadjheen.
 
This is INSANE!

why would you people figure this stuff out? the exact equations.

guys, its a GAME! :)
 
When it come to combat, anything can happen. Sure, there are random events (whats the point of combat if a unit can be 100% sure to kill another?). Lets face it, even in a simple chess game, a pawn still has a chance to take a queen if the move is right!!

So, lets stop arguing about spearman killing tanks ;) As to those who experience a lot of unit being killed by some lone spearman, lets just say that you have bad luck (as in you get a series of bad roll). As I mentioned in some other thread, a 3% chance does not mean a sure 3 in 100 rolls. It can mean 30 in 1000, 300 in 10000 etc. So, if you have some bad luck and that 30 happen in a roll....but did you ever stop and think about those uncounted battle that you have won?? The more battle you fought, the higher chances that the killer spearman will appear! Due to the fact that most of my game are pretty peaceful (I am a Pasive guy:D ) the killer spearman hardly happen to me (It does happen, just to make everyone happy:p )

When you play a game or do anything in life for that matter, be prepare to accept losses when they are due. And of course, claim you victory when they are due too :lol:
 
Originally posted by Excilus
First off, everything has a chance of happening.
Second, you've exaggerated, sub-consiously or consiously(It's not uncommon, it's natuaral to exaggerate a state of disbelief).


Yup, that's so common that you spent all your post exaggerating and comparing orange and apple.


Third, while the chances are different in real life, history is riddled with battles won by armies with enormous disadvantages:


The history is riddled with example of armies winning against superior numbers, and is riddled with armies winning because they had a slight better technology. And is VERY scarse about armies losing while they had not technological advantage.


Spartacus won many battles with an outnumbered force of peasants with sticks.


Spartacus army was not "ounumbered force of peasants", it was a 100 000 men armies where a lot were gladiator (read : people trained to fight for their live). Roman legions WERE outnumbered, and finally vainquished him because of their superior equipement and tactical training.


German warriors defeated what was thought to be an invincible army in the black forest.

The Mongols, in the lifespan of one man, defeated the world with an army of 250000, conquering the most powerful and most advanced culture of china, mowing down a persian army of half a million men, the defense in russia(not much), and the combined forces of europe.


The "combined forces of Europe" were merely the Austrian empire, who destroyed the mongol invasion. Hardly the entire Europe itself.


A french peasant girl, entirely untrained in the ways of warfare, won the battle of orleans with an outnumbered, technically disadvantaged mob of disorganized and demoralized men.


There was not a technological difference, it's all about leadership inspiration. I hardly doubt that they would be able to take the city with a squadron of riflemen in it.


In the american revolution, the leaders of the western world lose thier biggest colony to, basically, a bunch of peasants they stuck there to colonize it.


England was far to be the leaders of the western world, and the most powerful nation of Europe (France) was fighting the England side to side with the American revolters in this war.


The alamo.


Not really a good example of VICTORY for the underdog.


A zulu army of 10000 impis defeated a british one, armed with bolt action rifles, twice that size.


LOL, the English were TEN TIMES less numerous than the Impis (eight times in fact, about 1500 vs 10 000).


In ethiopia, an army of 20000 spearmen in the hills and mountains forces a retreat of an italian army of equal numbers, with wwi technology! They come again with tanks and marines and after months of hard fighting they barely conquer it, but are unable to colonize it.


That's the only example valuable so far.


In stalingrad, the most powerful nation in the world at the time was fighting against russia. The russians had lost 13 million or more by that time, the economy was drain from the war, and from the revolution, and through an untrained but loyal defense they held for 6 months


Sorry, but the Red Army was twice or three times the size of the Wermarcht, and it suffered immense losses before being able to held the Germans. They basically were able to stop them because of determination, numbers, the winter and the lack of maintenance of German tanks. I don't see what it proves here about technology difference, considering that when the Russians were able to fight back the German they had the T-34 and the IL-Sturmovick, that were both superior technologically to their german counter-part.


A hardend defense of swordsmen in(I forgot where, mongolia?), defeat russian tanks by, uhm, throwing rocks at them.


Never heard of this one, and you don't see to know a lot about it too. Waiting for further informations.


And in afganistan the combined efforts of all the soviet states, covering 1/3rd of the worlds land mass, and 1/7th of the population, cannot hold a tiny country, the poorest in the world, resisted by religous fanatics, the muhadjheen.

Yes, they lose 15 000 men and the mujahidin (spelling ?) lose more than one million. What a victory indeed.
Russians were pulled back because they were tired of the war and because fo the international pressure, not because they lost the war. Exactly the same in Viet-nam.

Next time you want to prove something in history, just learn a little more about the facts you throw.
 
The "combined forces of Europe" were merely the Austrian empire, who destroyed the mongol invasion. Hardly the entire Europe itself.

Merely the Austrian Empire? The Austrian empire did not exist in the time that mongol hordes invaded. And the Austrian duchy of the time never faced mongolians in battle. No Europe was pretty much lucky. After taking Hungary, Ogadei(son of Ghengis) died. And a rule of the Mongols was that when the ruler died, everyone had to return to Mongolia to elect a new ruler. After that they never returned. For what reason I don't know.

Also

In ethiopia, an army of 20000 spearmen in the hills and mountains forces a retreat of an italian army of equal numbers, with wwi technology! They come again with tanks and marines and after months of hard fighting they barely conquer it, but are unable to colonize it.

Ethiopia had an army of 82,000 rifle- and sword-armed infantry, 20,000 spearmen and 8,000 cavalry. They even had some artillery pieces against something like 15,000 italians.

When Italy came back with tanks they subdued the country in 6 months. Sure there may have been some poor suckers in the Ethiopian army weilding spears, but that hardly makes their army just a bunch of spearmen.

Forgot to add, spearmen beating tanks doesn't bother me that much. What bothers me is there are still spearmen around when I make my tanks. No one can show you an organized spearman division killing an organized tank division because there has never been such a confrontation. It never will. So what is more unrealistic?
 
Don't forget, Italy only invaded Ethiopia because Mussolini was getting it in the neck domestically, and a foreign war which Italy won would take the people's minds off other problems closer to home.
And they still made a hash of it.

Another point, I've found that when a warrior fights against a fortified warrior in a city, and they are both regulars, the attacker may take a point or two of the defender, and die. One-on-one, then, is suicidal. But I have twice seen my last warrior of a big stack, fighting the last warrior in the city, take two points off the defender when he himself is on his last point, and go on to take the city. Picture me whooping with delight, but thinking "How lucky is that?" It seems massively unlikely to me.
 
I know that I have had, many times, the experience of some rogue spearman taking out a weakened tank, but on the flip side I have had the delight of Archers taking out the invincible greek Hoplite in a size 12 city. So I guess it does work both ways, and these rare events occur maybe %20 of the time. Not too bad.

ironfang
 
Back
Top Bottom