Do I misunderstand the combat system?

Seraiel

If you want anything from I please ask in German
Joined
Sep 6, 2011
Messages
8,165
Hi everybody!

I'm just puking (literally speaken) really hard because of what happened in a beautiful round twice!

I can only give data on the 2nd series of combats, because the combat log doesn't go back far enough:

Conquistador 1 attacks LB with 75% chance: loss
Conquistador 2 attacks LB with 75% chance: loss
Conquistador 3 attacks XB with 78% chance: loss

Then:

Enemy HA attacks my fortified Formation Pikeman (!) with 8% chance: Pikeman wins but his health is only 0.6 / 6 so he lost 90% of his life in a fight where he had 90% chances to win.

After that:

2 Conquistadors attack wounded HAs with 99% chance, both get reduced to 75% health.

Next Conquistador attacks with 65% chance: loss.
Followed by Conquistador with 75% chance: win.
And again Conquistador with 85% chance: loss.
Conquistador with 85% chance: win.
Conq with 90% chance: win.
Conq with 90% chance: win.
Conq with 50% chance: loss.
Conq with 75% chance: win.
Conq with 99% chance: win but only 10% health, this was a GG.

Now I know this is wrong math (I can't do better, that's why I ask the mathematicians in this forum) but from just counting the % I've lost about 250% in 6 fights. How likely is this to happen?

Also, when I look at specific fights, like the HA against the fortified Formation-Pike (just think about that, the Pike from late medievil times and it's tripple promoted for anti-mounted while the HA is from ancient times and I think was double promoted, STR was 8 for the HA and 13 for the Formation Pike) , or the Conquistador-GG against a Catapult (!!!!) with 99% oods, where my Troops loose almost their whole life...

How in the world can this happen?

When I looked at the combat-odds for the next fight (just random-Conq against random-defender) , he had 40% chances to win, but 20% chances to be reduced to 10% life.

I'm asking you 3 questions:

1. A mathematician, please tell me, how likely are the results of the combats I've posted. It's real data, I didn't fake it, I just wanna know if it's something very very unlikely, or something which can happen from time to time, because if it's the last, I have to adapt.
I'm skeptical, because this actually happend twice in a row, first with Knights, having the same chances (I took notes about the chances because I was just so mad about it, I lost 75%, 85% and 95% in a row followed by 2 70% losses so 5 losses in 5 fights having over 70%) and then with the Conqs, so please, tell me the chances for this to happen 1 time, and the chances for 2 times in a row.

2. Why are my units loosing so much health? Why do I have a 40% chance on a win, but half of that chance, my unit is reduced to a minimum of life? Is there something I understand completely wrong, or how can a HAs be so successful against a Formation-Pike, how can a Conq fail so badly against a lousy Catapult. Is there something I can learn from this.

3.
Is there some sort of general advice you can give , like "if you attack with 80% odds, you need double numbers because loosing all your troops has a likehood fo 1:x" . Is AI cheating somehow or are there hidden modifiers not shown by the game-interface / BUFFY, or do I simply don't get it. I'm a student of medicine, I'm horrible at Maths, but I'm very good in repetition, can you give examples?

Appreciate your answers,

Seraiel
 
well probability and statistics combined with pseudorandom generator.

If you in the long run stay with 1 d : 3 kills then the game behaves somewhat normal.

I lost at points 98% battles from full health.

I remember seeing somewhere that drill promotions skews a bit the odds (not sure which way though).

There was in general section some thread about someone claiming that the odds are lies and the combat is skewed where people referenced to threads where other people made simulations of combat in the range of 1000's battles somewhat proving there is nothing bad going on.

I call it bad luck...can happen. usually you feel it everytime you run battle on edge.
And then you forget about those 25% wins where you had enough troops (those sacrifical lucky first ones).

I consider safe attacks around 90-95% anything bellow I just calculate as if i would lose first battle, but always hope for the better of course ;-).

As for why you lose so much health... the combat is done in rounds where it's kind of random who attacks, but influenced by power ratio and who wins the round does damage (I hope I got it right :-)).
if you look into detailed combat log you should see how the rounds went.

This is good since in this era you should have enough conquistadors, but imagine losing defending warrior on 7% odds for attacker where your warrior didn't attack at all and lost all rounds losing city 2 ;-)
 
Thx for the answer. I just won 12 80-90% fights in a row. I guess that makes up for it. I still would really be interessted though how the chances for my loss-series with 70%+ was, especially as it happend twice in a short amount of time. I guess it's at least 1:200 or so.

And you're 100% right, one feels it if one is battleing on the edge. Sometimes I just push so hard, that I count on wins from the first attackers and plan that the city falls with the fresh reinforcements that come 1 turn later. Guess that's really a little too hard :D
 
Thx for the answer. I just won 12 80-90% fights in a row. I guess that makes up for it. I still would really be interessted though how the chances for my loss-series with 70%+ was, especially as it happend twice in a short amount of time. I guess it's at least 1:200 or so.

I'm afraid not. It should happen more frequently than 1 in 100.
 
As I wrote once the game random generator has some peculiarities. For example I am absolutely sure it favors getting great spies over great prophets even when the "official" probabilities are 2:1 in the prophets favor.
But as a rule it is random indeed. The "random" is not evenly distributed (if it was so the casinos would go broke at the first night).

PS. It happens sometimes to huts to give me zillions of scouts. I pop the 1st hut and it gives me a scout. "Great!" think I and after a while the scout pops a second scout. "Even greater" think I until after a while both scouts pop 5-6 scouts more:-)
 
A couple observations

75% chance of winning is equivalent to losing 1 time in 4. Losing twice in a row at these odds should be 1 in (4*4) = 1 in 16. Losing three times in a row at these odds should be 1 in 4*4*4 = 1 in 64.

Second - random number generation in this game is a two phase process. First is to generate a random number that can be used for anything, and then second to actually use it.

The implementation of the random number generator itself is absolutely bog standard; it's coded to match one of the standard examples for linear congruential generators (a particular kind of computer randomness). I haven't run any statistical tests, but I'd be startled if there were a problem there.

The second half is in the interpretation - basically the problem of taking a number between zero and eleventy bazillion and turning it into "heads or tails". In this step, the conversion odds aren't exactly right in most cases - you can end up with eleventy half-bazillion numbers that mean heads, and eleventy half-bazillion minus one numbers that mean tails. So rather than 50:50, you get 50.0000000001 : 49.9999999999 or something. An error, but a negligibly small one.[1] The error is real, and predictable, but the UI doesn't usually display the precision necessary to see it, and the code makes no effort to do so.

Additionally, the actual mechanics of how the number is used; those can cross things up too. For instance, the out of the box religious autospread mechanic has a slight bias favoring Judaism, because Judaism is listed first in the CIV4ReligionInfo.xml file.

Every combat experiment I've done, and every well designed combat experiment I've seen, they all agree that the combat engine is delivering results consistent with the promised odds (within reasonable limits of precision).

GP production is a much harder mechanic to verify; the code logic has appeared correct each time I've reviewed it.



[1] Bad example - the computer is working with base two numbers, so coin flips (1 in 2) should be exact.
 
I would swear I saw somewhere the implementation of "getSorenRandNum", but can't find it right now...

from what we can see in SDK it returns short int with first parameter being the limiter.

However how the smaller range (0 - NUM-1) is mapped to the expected 0 - 2^32-1 range is a bit unknown until we see the code.
 
That's just how statistics work, you're just as likely to win with only 25% odds as you are to lose with 75, but you're unlikely to ever fight much at lower odds so you only end up seeing unlikely results when they aren't in your favor.
 
And there is the trick with the combat odds which some times are calculated weirdly - for example vs some city defending archers a swordsman with 2 combat and a shock promotions gets a much higher chances compared to a swordsman with 3 city raider promotions.
Should not be even close but don't know for which reason in some cases different but equal as percentage points promotions cancel each other which favors the unit with the lower base strength.
But I guess it is not the OPs question:-)
 
I flip a coin 100 times. I win 50 times. I lose 50 times. Therefore I've lost 50% x 50 = 2500%. This is absurd, probabilities only go up to 100%.
 
There's also the basic psychological factor of you only notice problems/adverse events. If you win 10 fights at 80% you don't usually think 'the RNG is biased in the player's favour', you basically don't even notice.
 
I flip a coin 100 times. I win 50 times. I lose 50 times. Therefore I've lost 50% x 50 = 2500%. This is absurd, probabilities only go up to 100%.

Looks who skipped his second grade school:-)

There's also the basic psychological factor of you only notice problems/adverse events. If you win 10 fights at 80% you don't usually think 'the RNG is biased in the player's favour', you basically don't even notice.

LOL... This happens all the time in the MMORPG where a lot of events are probability based. Third of the those games forum complains are about the random not being really random.
 
I flip a coin 100 times. I win 50 times. I lose 50 times. Therefore I've lost 50% x 50 = 2500%. This is absurd, probabilities only go up to 100%.

I think this refers to me counting the percentages. What you didn't know is, that I count them for both sides, so in your example, you'd have lost 2500% and won 2500% so you'd be at exactly 0 = in 100% probabilities.

VoU showed me the math to "get" the odds for what happened to me:

1st fight: 75% = 1:4
2nd fight: 75% = 1:4 so 1:16
3rd fight: about 75% = 1:4 so 1:64

Now I assume that I loose 2 more units with the same chances:

1 to about 250 is the chance for the next fight.
1 to about 1000 is the chance to loose 5 fights with 75% odds in a row.

Is this correct?

I could look at the combat odds again after I have finished the game and get the Knights combat again. There, my first Knight had 70% chances and lost, 2nd had 90% chances and lost. I guess, the chances for this to happen are already terrible, but like with the Conq example, I lost my whole forces of 5 units in 5 fights having over 70% chances, and now I know the odds for that.

What I take home for now is, that I must have had some incredibly bad luck with those series of fights which lies in the range of 1:200 - 1:1000 . This is proof for me, that I can still fight the way I'm used to and attack with those odds, because chances for this to happen again to me in the same game must be like 1:1billion :D .

Sera
 
I think this refers to me counting the percentages. What you didn't know is, that I count them for both sides, so in your example, you'd have lost 2500% and won 2500% so you'd be at exactly 0 = in 100% probabilities.

VoU showed me the math to "get" the odds for what happened to me:

1st fight: 75% = 1:4
2nd fight: 75% = 1:4 so 1:16
3rd fight: about 75% = 1:4 so 1:64

Now I assume that I loose 2 more units with the same chances:

1 to about 250 is the chance for the next fight.
1 to about 1000 is the chance to loose 5 fights with 75% odds in a row.

Is this correct?
No and yes.

There are two main types of probability, conditional probability and non-conditional probability. An example of conditional probability would be a soccer match, with two things you are trying to predict, who will score first and who will win. If team A score first, then that directly influences the probability of who will win.

Non-conditional probability would be tossing a coin. If you end up heads the first time, then this doesn't affect the chance of the next coin toss. It's still 50-50.

1 to about 250 is the chance for the next fight - this is wrong, you're stating one, single event. The chance of losing this one is the same as any other 75% battle.

1 to about 1000 is the chance to loose 5 fights with 75% odds in a row - this is correct - you are stating your proposition beforehand, that you will lose the next 5 fights. It's an important difference :)

Things get a bit more interesting if you make the proposition more complex. Let's say "what are the chances of losing 3 out of 5 battles with 75% chance of winning?" The answer is one in 11.3, so that's rare but not massively unlikely. The sum for that is 0.75*0.75*0.25*0.25*0.25 then multiply the whole thing by 10 (why 10? Because there are 10 possible combinations for the proposition to happen, eg WWLLL, WLWLL, LLWWL and so on - google binomial distribution for more info :))

The main thing here though, as others have stated, is that it's not the numbers being screwy but the person. Perception bias meaning people pick up on the oddities more.
 
And OFC, there is the fact that most players will see far more fights in the 70-100% area than on the 0-30% due to the fact that rationality demands that you war with the best units possible ;) Thus it is less probable for those players to see miraculous 5 consecutive wins @ 5% than rotten luck 5 consecutive 95% losses ;)
 
The problem with civ IV battles isn't that they're random outcomes, but rather that the game is designed in such a way that there are situations that occur where a few or even a single outcome can have huge implications on the game or end it outright. Early rushes (or rush defenses) and barbs are probably the most flagrant examples, although watching the AI intercept 5 tactical nukes in a row twice in one turn (IE 2 5 intercept stretches) is a later-game example if you really, really needed that city cleared.
 
I've read that the combat odds are misleading under two circumstances:

1. Drill promotions. I assume that these are simply not factored in to the winning percentage... e.g. that a badly wounded Drill IV infantry will stand a much better chance of defeating that last defending full-health catapult than the odds would suggest.

2. Two-movement terrain modifications. Let's say that you're HA rushing a city from two tiles away. You're presented with 75% odds, but once you move next to the city you have to cross a river. The game won't provide you with the modified odds, although it does factor in the defense bonus should you choose to attack.

Perhaps someone better informed on combat mechanics could confirm or refute these exceptions?
 
It's about the same thing with RNG as with Democracy - it's a bad system, but the best system we have for the game.

for example vs some city defending archers a swordsman with 2 combat and a shock promotions gets a much higher chances compared to a swordsman with 3 city raider promotions.

Picking that up as it's actually very interesting - i do remember that there was something with the promotions that made it actually better for the attacker to chose combat if he's attacking a very weak unit, as CR weakens the defender and does not strengthen the attacker ->

Praet vs. Archer non-fortified in a city

Combat 1: 8.8 strength, 0.8 strength gained relative to the archer
CR1: -20% for the Archer (so it's not 3 * 1.5 combat strength for him but 3 * 1.3) -> 0.6 strength gained for the praet relative to the archer

BUT that's only useful if you're only fighting very weak units like said archers, if you're fighting vs. Axes or LBs, CR becomes much better again. At least when attacking cities, ofc ;)

Read it here @ "Defender's modified strength": http://www.civfanatics.com/civ4/strategy/combat_explained.php

Your example could be true if the Archer's already damaged.
 
Back
Top Bottom