Comprehensive Retreat Study

BomberEscort

Don't be alarmed; this is a kindness
Supporter
Joined
Jul 28, 2003
Messages
1,139
Location
Kansas City
This thread is a deviation/continuation from the 'Chance To Retreat' thread.

I've tested the retreat bonus thouroughly... and there are problems...

PRELIMINARY TEST INFORMATION
Civilization I: Germans (Horseman)
Civilization II: Americans (Infantry)

Regular Horseman (2.1.2) v. Regular Infantry (6.10.1)
Unfortified on Grassland, Horseman always attacking...
Attack = 2.0
Modified Defense = 11.0
Random Seed Off
v1.21f PTW (Conditional Zenith used 1.27f for his test)

TESTING BREAKDOWN
Tested 50 units at a time on a Grassland map. Manually attacked with every unit and recorded the results... EDIT: Note from Post #23, both units have the same retreat bonuses...
  • 200 Trials w/ 100% Retreat Bonus
  • 400 Trials w/ 80% Retreat Bonus
  • 200 Trials w/ 66% Retreat Bonus
  • 200 Trials w/ 58% Retreat Bonus
  • 200 Trials w/ 50% Retreat Bonus
  • 200 Trials w/ 34% Retreat Bonus
  • 200 Trials w/ 0% Retreat Bonus

RAW DATA
===========================================
Total Trials: 1,600 Total Wins: 39 (2.4375%)
My Civ III Combat Calculator prediction is 2.852734%

200 Trials @ 100% Bonus
WIN: 5 LOSS: 65 DRAW: 130 (64.5%)
Civ III Combat Calculator prediction is 97.147266% Draw
Modified Civ III Combat Calculator prediction is 88.543818% Draw

400 Trials @ 80% Bonus
WIN: 10 LOSS: 163 DRAW: 227 (56.75%)
Civ III Combat Calculator prediction is 77.717813% Draw
Modified Civ III Combat Calculator prediction is 70.835055% Draw

200 Trials @ 66% Bonus
WIN: 4 LOSS: 91 DRAW: 105 (52.5%)
Civ III Combat Calculator prediction is 64.117196% Draw
Modified Civ III Combat Calculator prediction is 58.43892% Draw

200 Trials @ 58% Bonus
WIN: 5 LOSS: 118 DRAW: 97 (48.5%)
Civ III Combat Calculator prediction is 56.345415% Draw
Modified Civ III Combat Calculator prediction is 51.355415% Draw

200 Trials @ 50% Bonus
WIN: 5 LOSS: 113 DRAW: 92 (46%)
Civ III Combat Calculator prediction is 48.573633% Draw
Modified Civ III Combat Calculator prediction is 44.271909% Draw

200 Trials @ 34% Bonus
WIN: 3 LOSS: 135 DRAW: 62 (31%)
Civ III Combat Calculator prediction is 33.030071% Draw
Modified Civ III Combat Calculator prediction is 30.104898% Draw

200 Trials @ 0% Bonus
WIN: 7 LOSS: 193 DRAW: 0 (0%)
Civ III Combat Calculator prediction is 0% Draw
Modified Civ III Combat Calculator prediction is 0% Draw
===========================================

Conclusions:
  • It appears Conditional Zenith was correct in his test, there does appear to be an error with handling retreat bonuses of 100%, and may even be some problems with bonuses over 50%
  • The 100% retreat bonus should be a retreat from every losing battle. Just like the 0% bonus provides no retreat. The 0% is functioning properly, but the 100% is not.
  • At the very least Firaxis/Breakaway/Atari needs to look at the code governing retreat bonuses. I believe there is a coding problem. I for one would like to be able to mod a unit that always retreats.
  • What seems odd is that the veteran and elite bonuses (58% and 66% respectively) do not seem to be working properly either, this can cause some minor problems in unmodded gameplay...
  • The win percentage is very close to 'perfect accuracy', this lets me know that my calculator and the way Civ III handles combat are the same. Also, notice how my calculator comes very close to the actual retreat bonus in all cases. My calculations will always be lower than the bonus because of the infrequent wins by the horseman... I am currently using a beta-version of my calculator and will post it as soon as possible. See my signature.
  • Note that the bonuses for 50% and below are very close to the test results (e.g.- 50% retreat bonus resulted in 46% retreat), but how above 50% they start to skew greatly...
  • Maybe these are not percentage bonuses, but they will not accept input outside of the 0-100 range inclusive. This leads me to believe they are percentage bonuses.

Any comments about the analysis are appreciated...
 
I think I have never seen a retreat when both are almost dead (1 hp left). Seems that in that case the attacker gets crazy and tries to finish the defender off, regardless of his own health.

That should degrade the 100% retreat a bit, but I still think your numbers are quiet high even with respect to this.

And then again, I might be wrong anyway...
 
Originally posted by bike
I think I have never seen a retreat when both are almost dead (1 hp left)...

They won't

Originally posted by bike
That should degrade the 100% retreat a bit, but I still think your numbers are quiet high even with respect to this...

The numbers are accurate, its all mathematical statistics, and statistics don't lie :D Plus, a 100% retreat-unit will never lose in this situation. He will be victorious or retreat...

See Catt's Retreat Explanation for retreating details...
 
I believe bike is correct. If the defender is at 1 HP, the attacker will not retreat regardless of quality. Thus a 100% retreat-unit would have the following results: Win, Retreat, or Lose to a 1-hp defender.
 
Originally posted by Segal
I believe bike is correct. If the defender is at 1 HP, the attacker will not retreat regardless of quality. Thus a 100% retreat-unit would have the following results: Win, Retreat, or Lose to a 1-hp defender.

Do you have a link where you got this information... I'd like to confim or deny this if possible...

AFAIK the retreat ability of the offensive unit has nothing to do with the defensive units hp... I had a row of 50 horsemen and 50 Infantry and attacked. There was only one horseman vs. one infantry 50 times over and over again with different modifiers...

I will test tonight if horsemen can retreat from 1hp Infantry... if this is true, this will effect the numbers... but only by about 9% less on the Draw outcomes, there will still be a large discrepancy...

EDIT: I've read Civ III v1.17b readme and it does not say anything about the 1hp defender preventing retreat... Testing to follow...
 
Massive personal experience shows that an unit with retreat ability will not retreat if the enemy unit (attacker OR defender) is down to 1 hp. I believe this was true even when fast units always retreated. Thus, back then (ca. 1.16) fast units retreated in all situations except when the enemy unit was at 1 hp.

I believe you might also want to try another test, horsemen vs. spearmen. They have equal attack and defense ratings, and those (esp attack for horseman and defense for spearman) may be variables that need to be controlled.
 
I made the Attack/Defense difference large so I would minimize the times the horseman would win, and maximize the times a horseman would retreat or lose...

I have not been able to find any info on this 1hp slow-defender ability to deny a retreat... I know about the 1hp fast-attacker not retreating... but like I said above the difference would result only in about a 9% drop in Draws and a 9% increase in losses.

This still is nowhere close to the 100% retreat bonus. If what you are saying is true the results for a 100% retreat bonus under the conditions of the first post should be WIN: 2.5% LOSS: 9% DRAW: 88.5% (approximaely)

Also, the chance of the horseman reducing the infantry to 1hp is about 9% (8.603%) but in the first post I note 65 out-of 200 encounters are losses (32.5%). If this is true this numbers should be very close and they are not. Something else is happening here...
 
I have no doubt about the 1 hp defender preventing attacker retreat. But that's just my experience (in the thousands of situations over the years). I don't think anyone could say that they have ever seen a fast unit retreat from a defender that was down to 1 hp.

The horsemen/spearmen situation really needs to be tested.
I can do it if you like ;)
 
Originally posted by Krayzeenbk
I have no doubt about the 1 hp defender preventing attacker retreat. But that's just my experience (in the thousands of situations over the years). I don't think anyone could say that they have ever seen a fast unit retreat from a defender that was down to 1 hp.

I will test this tonight... not that I don't believe you :D, I'm just from the show-me-state...

Originally posted by Krayzeenbk
The horsemen/spearmen situation really needs to be tested.
I can do it if you like ;)

Feel free to test all you want :D... any help is appreciated. But since the test of this thread is to force retreat. I think the values of attack and defense should be large. The best test being a regular Horseman v. regular Infantry (highest Defense slow-moving unit IIRC)
 
Originally posted by BomberEscort


I will test this tonight...

Feel free to test all you want :D... any help is appreciated. But since the test of this thread is to force retreat. I think the values of attack and defense should be large. The best test being a regular Horseman v. regular Infantry (highest Defense slow-moving unit IIRC)

I understand this will be a much more painful and time-consuming test than infantry. Watching for 1 hp situations will make it much slower.

EDIT: Screw sleep today, thinking and swimming tomorrow ;) I think I'll go for it ;)
 
What I am going to do, since I alreay have a map with 50 Horseman and 50 Infantry on it (all grassland). I will change all 50 Infantry in the editor to one hp and leave the horseman regulars. If I get 0 retreats, I'll call it good and modify my calculator accordingly... There still will be a large discrepancy, but I will slay that dragon after this one is dead :D

BTW, it took me about 1 hour to do 1,600 trials...
 
Due to a huge number of various situations, I am only going to count whether a horseman that could retreat did in fact retreat or continued to fight.

(For example, a particularly hard situation is when the attacker wins with 1 hp remaining. Obviously, it did not retreat for whatever reason, but that reason could be one of two things: the defender had 1 hp, in which case the point is removed from the statistic, or the RNG said no, in which case it's a valid point).
(This means battle animations are on, grr).
 
Originally posted by Krayzeenbk
Due to a huge number of various situations, I am only going to count whether a horseman that could retreat did in fact retreat or continued to fight.

I don't see how this matters. If the horseman does retreat we can assume the infantry had 2hp or more.

If the horseman does not retreat then the reason as you pointed out is the defender had 1hp or the RNG said no (either way will force a WIN/LOSS scenario) to a 1 hp horseman vs a 2-3hp Infantry... Either way, there will be no retreat...

I don't see WHY he doesn't retreat matters... If he wins with one hp remaining he stills wins, no retreat was possible since it was calculated in the round before... what needs to be expressed in a formula for retreat is: The chance that the attackers hp will equal one, the chance that a defenders hp will be greater than one, the retreat percentage based on experience. Maybe I am not understanding correctly :confused:
 
Because I am trying to isolate the retreat roll, not the combat rolls that cause one or the other of the combatants to cross the 2hp/1hp line first. So far the test results are coming out pretty straightforward, I don't know if I should continue in light of this comment ;)

EDIT: Never mind that I am now getting some funkiness *triple checks modded rules*
 
I will post the test results I have obtained so far just in case you want to continue them (I am in GMT +5. It is after practice and I am unable to think or stay awake for much longer ;) ).

Preliminary Test Results
The test was conducted on Regent difficulty, preserve random seed off. All defenders were on grasslands, which were modified to have a defense bonus of 0%.
Attacker: Egyptian Regular Horseman (2.1.2)
Defender: Roman unfortified Regular Spearman (1.2.1)

The first observation that was made was that no Horseman ever withdrew if the Spearman being attacked by it reached 1 hp first (before the Horseman). It may be concluded that fast units only get a chance to withdraw if and when they reach 1 hp first (more testing may be in order).

Retreat data
Regular (Horseman) chance to retreat: 50%
500 trials yielded 247 valid cases (cases where the Horseman reached 1 hp before the Spearman). 49.4% of cases were valid cases.
In 131 (53.04% of) cases, the Horseman retreated.
In 116 (46.96% of) cases, the Horseman continued to fight.

Regular (Horseman) chance to retreat: 100%
250 trials yielded 128 valid cases. 51.2% of cases were valid cases.
In 90 (70.31% of) cases, the Horseman retreated.
In 38 (29.69% of) cases, the Horseman continued to fight.



I will conduct 250 more trials of 100% and up to 500 trials of 0% (probably less if it does look as if the Horsemen never retreat at 0%). Then I may conduct more tests of 100% to get the percentage closer to what it should be. I may also conduct tests of other percentages, but all this will have to wait until Sunday, when I will have plenty of time. Check back here then for a big fat edit if I do do it ;)
 
Originally posted by Krayzeenbk
I have no doubt about the 1 hp defender preventing attacker retreat...

This has been confirmed... :thumbsup:

Originally posted by Segal
I believe bike is correct. If the defender is at 1 HP, the attacker will not retreat regardless of quality. Thus a 100% retreat-unit would have the following results: Win, Retreat, or Lose to a 1-hp defender.

He was, and so are you :thumbsup: Thanks for the help...

Originally posted by Krayzeenbk
I will conduct ... 500 trials of 0%

This is not neccessary, I did 200 trials at 0% retreat in my first test and no horseman ever retreated...
 
Originally posted by Krayzeenbk
Regular (Horseman) chance to retreat: 100%
250 trials yielded 128 valid cases. 51.2% of cases were valid cases.
In 90 (70.31% of) cases, the Horseman retreated.
In 38 (29.69% of) cases, the Horseman continued to fight.

The result from my calaculator at 100% retreat are:

Win: 50.000000%
Loss: 18.750000%
Draw: 31.250000%

70.31% (Retreats) * 51.2% Valid Cases = 36.00%

So, 36% of all encounters will lead to retreat... This is similar to what the calculator predicts. Good Work Krayzeenbk :goodjob:, what it seems I failed to take into consideration was the fact that fast-units cannot retreat from 1hp slow-units...

Originally posted by Krayzeenbk
Regular (Horseman) chance to retreat: 50%
500 trials yielded 247 valid cases (cases where the Horseman reached 1 hp before the Spearman). 49.4% of cases were valid cases.
In 131 (53.04% of) cases, the Horseman retreated.
In 116 (46.96% of) cases, the Horseman continued to fight.

The result from my calaculator at 50% retreat are:

Win: 50.000000%
Loss: 34.375000%
Draw: 15.625000%

53.04% (Retreats) * 49.4% Valid Cases = 26.2%

So, 26.2% of all encounters will lead to retreat... This is similar to what the calculator predicts also... a little off... also assuming my calculator is right :rolleyes: To be statistically signifigant we would need approximately 500 valid cases before we can finalize the results but we are heading in the right direction... I would feel more comfortable if the numbers were closer. I'm going to check my calculator and make sure it is handling retreats properly (I'm 99% sure it is)

At the very least the retreat bonus of 100% is misleading... It means that of all the battles he can retreat from, he will. The rules governing retreat are as follows:

Retreat is not possible (no matter the experience of the unit); these instances are:

(1) When the fast-mover has only 1 HP left (at the beginning of the attack)

(2) When both units are fast-movers

(3) When there is no available tile for retreat

(4) When the fast-mover is fortified in a city (or colony?)

(5) When the Defender has 1hp remaining.

If the battle meets all the above criteria, and the bonus is 100% the unit will retreat...
 
Cool - this stuff is good!

You should really link this from the old thread so that people who subscribed there will see this.
 
Back
Top Bottom