Announcement

Collapse
No announcement yet.

Info: Combat (GL)

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Info: Combat (GL)

    Great Library: CivII combat
    This thread contains all the collective knowledge of combat in CivII, including the odds of a unit winning a battle. The information has been gathered from forum threads, discussions, and extensive testing.

    This is a special thread, please read Use of this thread below, which contains instructions for - you guessed it - how to use this thread. The following links will jump you to the combat information:

    Combat Modifiers and Calculation

    Basics Unit Combat Adjustment The Combat Additional Healing Hints andFalse
    Factors Factors Formula Considerations TipsStatements


    -----------------------------------------------------------------
    Use of this thread
    -----------------------------------------------------------------

    Use this thread to post your comments or insights about combat.

    You will post any suggestions :
    • to add new wisdom,
    • to mark/unmark insecure or unsettled wisdom,
    • to put new questions that should be answered,
    • remarks to mistakes or clarifications needed.

    I will integrate your suggestions into the main post.
    -----------------------------------------------------------------

    Please, clear your post if all its problems are solved and integrated into the first post (you must leave at least one letter there).

    Help me: if you think I forgot to integrate one of your ideas then edit your post, delete ideas I included already and write LOOK! in the beginning of post. Send me a personal message noting this.

    If I post a response to you (you are named), and you have read it and you think it may be cleared, let me know via personal message. I will clear the response post if there is no useful information for others.

    I suggest to mark your posts by numbers (Post 5, Post 6...) for easier reference.

    Links:
    This thread is an updated version. The original combat summary thread was in the CivII General/Help forum:
    The old GL Combat thread
    Some issues discussed in that thread still need resolution.

    Go to the Great Library Index
    Go to the Great Library Discussion thread
    Go to The Great Library: a hierarchical structure
    Last edited by Marquis de Sodaq; August 28, 2001, 10:17.
    The first President of the first Apolyton Democracy Game (CivII, that is)

    The gift of speech is given to many,
    intelligence to few.

  • #2
    BASICS
    1.1 Combat occurs when a unit with an attack value greater than 0 attempts to enter a square occupied by a unit of another, non-allied, civilization.

    1.2 A battle results in the destruction of one unit or the other. If the primary defender is destroyed, all other defenders (stacked) in the same square are also destroyed unless:
    • they occupy a city square, or
    • the square has the fortress or airbase improvement built on it.
    The primary defender is the unit with the greatest modified defense value at the moment of the attack.

    1.3 Units involved in combat usually sustain damage. Damage is shown in the unit's strength bar by color and percentage.[list=a][*] Green: 2/3 to full strength[*] Yellow: 1/3 to 2/3 strength[*] Red: less than 1/3 strength[/list=a]1.4 Except for air units, damaged units have reduced movement points approximately proportional to the damage. However, land units will never have less than 1 movement, and sea units will never have less than 2. The proportion of damage is rounded to the nearest integer, but never less than the minimum for that unit.

    CMP = CHP/HP * MP + 0.2

    CMP...current movement points
    CHP...current hit points
    HP...maximum hit points (from rules.txt)
    MP...maximum movement points (from rules.txt)

    1.5 Land units (domain 0) can attack any other unit on a land square, except airborne bombers.

    1.6 Air units (domain 1) can attack only land or sea units. Air units with the "Can attack air units" flag (fighters) can also attack other air units.

    1.7 Sea units (domain 2) can attack any unit occupying any adjacent square, except for airborne bombers. Units with the "Submarine advantages/disadvantages" (submarines, thus) cannot attack land units. When a sea unit attacks a land unit, it is called shore bombardment.

    1.8 Special domain 3 units can be attacked by any other unit, regardless of flags. Domain 3 units can attack any other unit, and they ignore city walls, SAMs, and coastal fortresses.

    1.9 Airborne bombers (any air unit with range > 1) can only be attacked by a unit with the „can attack air units (fighter) flag. This holds true regardless of what domain the attacking unit is.
    Last edited by Marquis de Sodaq; October 9, 2001, 22:11.
    The first President of the first Apolyton Democracy Game (CivII, that is)

    The gift of speech is given to many,
    intelligence to few.

    Comment


    • #3
      UNIT COMBAT FACTORS
      Units have four basic factors figured into the calculation of a combat result: attack strength, defense strength, hit points, and firepower.

      2.1 Attack strength is the likelihood of inflicting damage when attacking an opponent. Units with 0 attack strength cannot initiate combat.

      2.2 Defense strength represents the ability of a unit to defend itself when attacked; It is the likelihood that damage will be inflicted on an attacking unit.

      2.3 Hit points indicate how much damage a unit can withstand before it is destroyed. The true number of hit points is the hp value x10. A 2hp unit thus has 20 hit points.

      2.4 Firepower indicates how much damage a unit can inflict in a round of combat. A successful round reduces the opponent's total hit points by the value of the unit's firepower.
      The first President of the first Apolyton Democracy Game (CivII, that is)

      The gift of speech is given to many,
      intelligence to few.

      Comment


      • #4
        ADJUSTMENT FACTORS

        Many factors affect the four basic Unit Combat Factors, depending upon the circumstance of the battle. All factors that apply as percentages are multiplied together.

        3.1 Veteran units receive a x1.5 bonus for both attack and defense strengths

        3.2a Fortified land units receive a x1.5 bonus for defense strength. This bonus is superceded by fortress improvement (3.2b) and city walls (3.4). It can be used in combination with a SAM battery (3.5) or a coastal fortress (3.6).

        Notes:
        • This bonus applies only on the next turn, after the unit appears with the dirt entrenchment, not while in the process of fortifying.
        • It has been suggested, but not tested, that city defenders in multiplayer games do gain the bonus immediately if given the order to fortify with the 'f' key, but not the menu. (MdS suspects this is false in single player.)
        • Air units caught fortified in an air base do not enjoy this bonus. Fighters in unwalled cities may, however, gain the scrambling defense bonus, as if being attacked by a bomber - even if the attacker is a land or sea unit. (This point is still in contention, see posts 15 thru 17 and post 19, below.)

        3.2b The fortified bonus increases to x2 for a land unit occupying a fortress improvement, whether given the order to fortify or not. This improvement gives no bonus against an attack by an air unit. A city built on an existing fortress eliminates that fortress. If a city is built on a square where a fortress is in the process of being built, the fortress will have no effect.

        3.3 Terrain increases defense strength of all units by:[list=a][*] x1.5 if on forest, jungle, or swamp[*] x2 if on hills[*] x3 if on mountains[*] +0.5 if on a river, additively enhancing any other terrain bonus. For example, a rivered hill gives a x2.5 bonus, a x(2 + 0.5) multiplier.[/list=a]3.4 City walls triple the defense value of city defenders against attacks by land units only. This bonus can apply only to land units.

        3.5 SAM batteries double the defense value of city defenders against attacks by air units. This bonus applies to any unit defending a city except a scrambling fighter, which receives a separate defense bonus. When combined with an SDI defense (3.10), the defender's defense strength is quadrupled against missile attacks.

        3.6 Coastal fortresses double the defense value of city defenders against attacks by naval units. This bonus applies to any unit defending a city.

        3.7 Some flags (in rules.txt) can alter combat calculations as follows:
        • Negates city walls (howitzer): Self explanatory.
        • x2 on defense versus horse (pikemen): This is actually a limited bonus, x1.5 if the attacker is a land unit with move=2, hp=1.
        • Can attack air units (fighter): The unit can attack air units with range > 1. This also affects other combat circumstances, as follows:
          1. A fighter stationed in a city that is attacked by an air unit with range <> 1 scrambles, gaining a x4 defense bonus.
          2. A fighter stationed in a city scrambles and gains a x2 defense bonus when attacked by another fighter.
          3. Any helicopter (any air unit with range=0) attacked by a fighter suffers a x0.5 defense adjustment and has its firepower reduced to 1.
          4. A fighter cannot benefit from a SAM (3.5) adjustment unless attacked by a missile. This applies to any domain unit with this flag.
          Scrambling applies only to air units with the fighter flag.
        • x2 on defense versus air (AEGIS): An AEGIS cruiser gains a x3 bonus when attacked by an air unit, x5 if the attacker is a missile (destroyed after attacking).
        • Can make amphibious assaults (marines): The unit can attack from the sea (a ship). This does not count as shore bombardment (3.9). The attacking marine does not ignore city walls (3.4).

        3.8 Partisans (or any unit in the partisan slot of units.gif) gain an attack advantage against non-combat units (any with attack value = 0). Their attack value is increased eightfold (8x).

        3.9 Shore bombardment: When a naval unit attacks a land unit, both units have their firepower reduced to 1. A sea unit's firepower is also reduced to 1 when it is caught in port (or on a land square) by a land or air unit; The attacking unit's firepower is doubled in this case.

        3.10 SDI defenses thwart any nuclear attack (except those set by spies) within 3 squares of the city in which it is built. It also doubles a city defender's defense strength against non-nuclear missile attacks. When combined with a SAM Battery (3.5), the defender's defense strength is quadrupled against missile attacks.

        3.11 Nuclear missiles have a special attack value of 99. Unless thwarted by an SDI, this sidesteps any combat result calculations. If a missile attacks a target, a strike results. This kills all units within one square of the strike, causes pollution, and reduces the population of any city within the radius by half.

        3.12 Barbarians do not always attack and defend at normal unit strengths. Barbarian archers defend with a base value of 1, not the normal archer defensive value of 2. Other barbarian units have normal defense values. All barbarian attack factors are affected by the difficulty level of game being played:
        • Chieftan - 25% of normal
        • Warlord - 50%
        • Prince - 75%
        • King - 100%
        • Emperor - 125%
        • Deity - 150%


        3.13 Sneak Attack! A unit sneak attacking (attacking an enemy unit while a peace treaty is in effect) receives an attack bonus if the defender is one of a human player's units. The adjustment appears to be a doubling of attack strength.
        Last edited by Marquis de Sodaq; October 20, 2003, 21:13.
        The first President of the first Apolyton Democracy Game (CivII, that is)

        The gift of speech is given to many,
        intelligence to few.

        Comment


        • #5
          THE COMBAT FORMULA
          First, some background. The manual provides a simplified combat formula to approximate the likely outcome of a combat. This formula states that the total modified attack and defense factors are combined; The probability of victory is approximately the ratio of the unit's factor to the total. In other words,

          U / (a + d)

          where
          U = the unit's modified factor,
          a = the attacker's modified attack factor, and
          d = the defender's modified defense factor

          This approximation has proven insufficient for many Apolytoners. Much debate has resulted in a more detailed formula. First, an explanation of what it entails. For explanatory purposes, a combat is a single round, a battle the cumulative result of all combats.

          The attacker and defender each own a portion of the total modified attack and defense values proportional to their value, as the simplified formula, above, expresses. For each combat, a winner is determined by this ratio. In simple terms, the higher modified value is more likely to win a combat. For each combat won, the opponent reduces its hit points by the winner's firepower. This continues until one unit is reduced to zero hit points and is thus destroyed.

          Heated discussion of a simplified combat formula led to several ideas being put forth. The one that most closely gives the results of the complex formula is:

          Odds = (S + (S - W)) * Shp * Sfp / (W * Whp * Wfp)

          where:
          S = Stronger unit's modified attack or defense value
          W = Weaker unit's modified attack or defense value
          Shp = Stronger unit's hit points
          Sfp = Stronger unit's firepower
          Whp = Weaker unit's hit points
          Wfp = Weaker unit's firepower

          No playtesting results to test the accuracy of this formula have surfaced.

          On to the real calculation...
          Each unit gets a randomly generated number from 0 to its modified value minus one, multiplied by a constant. This constant has been best-guessed (based on play testing) to be 8. The unit with the higher random number wins the combat, ties going to the defender.
          • If the defense value is equal to or greater than the attack value, the probability (p) of the attacker winning the combat round is

            p = (A - 1) / 2D
          • If the attack value is greater than the defense value,

            p = 1 - ((D + 1) / 2A)

          Where A = (a * 8) and D = (d * 8). The resulting p is the odds of the attacker winning the combat. To calculate the odds of the attacker winning the battle, p is plugged into the equation

          P = SUMn(COMB(n-1,dh-1) * (p^dh) * (1-p)^(n-dh))

          Where "n" is summed from dh to dh+ah-1.

          ah = Attacker's modified hit points
          dh = Defender's modified hit points
          p = probability for attacker to win combat round
          P = probability for attacker to win battle

          Note: Modified hit points: An opponent's total hit points are divided by the unit's firepower. Thus an attacker with 2fp halves the defender's total hit points.


          Comments:
          This formula accounts for damaged units, as the input is the unit's current hit point total.

          In layman's terms, P is the sum of the probabilities of the all possible outcomes of the attacker winning; For example, the odds of the attacker winning ten straight combats, plus that of winning ten out of eleven, plus that of winning ten out of twelve, and so on, added together to produce a grand total. The maximum number of rounds is the attacker's and defender's total hit points minus one. Basically, until the winner is left with a single hit point after destroying the loser. The defender's chance is (1 - winner's probability).

          For those unable to decipher the above mathematics,
          • An advantage in hit points is slightly more beneficial that an advantage in firepower, other factors being equal. An increase in HP produces a greater range of values of n to be summed. Because FP is in the denominator of the fraction, its effect is less; Greater HP is all accounted for in the range, half of a greater FP is. The greater range of values means more COMBinations are calculated. COMB values increase at a greater rate than the final exponent ^(n-dh) reduces the total value in our equation.
          • The more total hit points involved in the battle, the more likely the unit with the greater modified value, the stronger unit, in other words, will win.
          • With an even attack to defense ratio, the higher the values, the better the odds for the attacker.


          Units with 0 defense can occasionally win because it generates a number between 0 and 0 (0, thus), and the attacker can also end up with a 0. The tie goes to the defender, meaning he wins that combat round. A damaged unit, or one attacking at partial strength (after using part of its movement allowance), can on rare occasions end up on the short end of this possibility.


          An Example
          Veteran Artillery and Armor units attacking veteran Riflemen behind city walls. The formula stacked up to artillery, but was off slightly with the armor results. Marko Polo tested ten sets of ten attacks with each unit. Other tests to verify this formula, excepting one, have used a minimum of 234 attacks.

          Artillery (10a, 1d, 20hp, 2fp) vs. Rifleman (5a, 4d, 20hp, 1fp): The formula predicts 82.5% victories, Marko Polo tests resulted in 79%.

          Armor (10a, 5d, 30hp, 1fp) vs. Rifleman (5a, 4d, 20hp, 1fp): The formula predicts 45.8% victories, Marko Polo tests resulted in 44%.

          Other tests of Cavalry vs. Armor, Fanatics vs. Musketeer, Fanatics vs. Alpine Troops, Warrior vs. Warrior, Catapult vs. Musketeer, and others all matched the formula closely.
          The first President of the first Apolyton Democracy Game (CivII, that is)

          The gift of speech is given to many,
          intelligence to few.

          Comment


          • #6
            ADDITIONAL CONSIDERATIONS

            5.1 A city's population is not reduced if the city has city walls and a defender loses a combat, or if the city is attacked from a sea square.

            5.2 A sacked city will have its population reduced by one. A size one city will usually be destroyed if sacked. There is unresolved discussion about when size one cities are captured instead of destroyed. See the thread
            City Razing Problem for more.

            5.3 Air units attacking land units ignore city walls and fortresses.

            5.4 Airbases provide no defense bonus.
            Last edited by Marquis de Sodaq; October 9, 2001, 22:19.
            The first President of the first Apolyton Democracy Game (CivII, that is)

            The gift of speech is given to many,
            intelligence to few.

            Comment


            • #7
              WHEN THE DUST SETTLES...
              After the battle, the victor is usually damaged. Units can heal as long as they do not move, not even along railroad. They heal at varying rates, depending on their proximity to a friendly city or barracks. Settlers and Engineers, the only units incapable of fortifying, heal while working.

              6.1 Land Units:
              1. 100% of total hit points healed every turn in a city with barracks.
              2. 40% of total hit points healed every turn in a non-barrack city
              3. 30% of total hit points healed every turn near a city with barracks (i.e. a square 7x7 squares)
              4. 20% of total hit points healed every turn near a non-barrack city
              5. 10% of total hit points healed every turn on normal square
              6. Fortress (3.2b) always adds an extra 10% to the rate (i.e. on a normal square, near a city, or near a city with barracks).

              6.2 Naval/Aerial Units:
              1. 20%/20% of total hit points healed every turn in a fortress or a city
              2. 10%/0% of total hit points healed every turn on normal square
              3. 100%/100% of total hit points healed every turn in a city with port facility/airport, respectively.
              4. Airbase and barracks have no effect.
              5. port facility/airport affects only the city square.


              6.3 Healing away from a city or fortress (by skipping that unit's turn) occurs immediately, before the next unit is available for an order. Barracks healing occurs at the end of the player's turn.
              Last edited by Marquis de Sodaq; August 28, 2001, 10:10.
              The first President of the first Apolyton Democracy Game (CivII, that is)

              The gift of speech is given to many,
              intelligence to few.

              Comment


              • #9
                LIES! LIES! LIES!

                Much discussion has surrounded figuring out how combat works. In the process, some misinformation has been spread. This section addresses these incorrect ideas.

                The following statements about CivII combat are all FALSE. Where applicable, a reference number before the statement directs you to the section where the correct information can be found:
                • The attack strength of the defender is figured into combat resolution.
                • The defense strength of the attacker is figured into combat resolution.
                • The terrain on which the attacking unit begins is figured into combat resolution.
                • (1.4) Damaged units have movement points proportional to their damage.
                • (3.2a) The defensive bonus of fortifying a unit enhances the city wall or fortress bonus.
                • (3.2a) The defensive bonus of fortifying is immediate.
                • (3.2b) A unit must be fortified in a fortress to gain the defensive bonus.
                • (3.3) The defensive bonus of rivered terrain is multiplied along with other adjustment factors.
                • (3.4) City walls increase the defense strength of any unit.
                • (3.7) The pikeman bonus works against all land units with more than one movement point.
                • (3.9) A ship caught in port has its defense strength reduced to 1.
                • The combat formula in the manual is correct.
                • (5.4) Marines attacking from a ship ignore city walls.
                • Defenders attacked by marines on a ship gain the coastal fortress bonus.
                • (6.2d) Air units gain a healing bonus in an air base.
                Last edited by Marquis de Sodaq; April 4, 2003, 12:48.
                The first President of the first Apolyton Democracy Game (CivII, that is)

                The gift of speech is given to many,
                intelligence to few.

                Comment


                • #10
                  Credits

                  The first linked thread, discussing the final formula, should be read if any clarification is needed about how it was found and what it means.

                  Eggman, Buenos, and Euclid provided the bulk of the math in this process. Thanks to SlowThinker and others for extensive testing to verify suspicions and ideas!

                  The following threads contributed to this topic:

                  The Civ2 Battle Equation Solution
                  Defense Multipliers
                  AI cheats on naval bombardment
                  The Pikeman's defense
                  Modifiers for Attack/Defense
                  What is the difference between firepower and attack points?
                  Barbarians and level of play
                  Veteran units... (Healing)
                  Hit points and firepower
                  Fortification bonus within walls or fortress
                  Defensive terrain for air and water units
                  Fighter vs. SAM
                  Civfanatics combat odds discussion and testing
                  Civfanatics Battle Simulation
                  Sneak Attack bonus in MP

                  This thread is an updated version. The original combat summary thread was in the CivII General/Help forum:
                  The old GL Combat thread
                  Last edited by Marquis de Sodaq; April 4, 2003, 12:46.
                  The first President of the first Apolyton Democracy Game (CivII, that is)

                  The gift of speech is given to many,
                  intelligence to few.

                  Comment


                  • #11
                    Keywords

                    {combat system}
                    {} {end1}

                    {combat formula}
                    {stack} {primary defender} {vet status} {healing}
                    {walls} {fortress} {coastal fortress} {SAM} {SDI} {fortify}
                    {city capturing} {attack and reduced population}
                    {plunder} {pillage}
                    {attack strength} {defense strength} {hit points} {firepower}
                    {end2} {Marquis de Sodaq}
                    Last edited by Marquis de Sodaq; August 28, 2001, 10:02.
                    The first President of the first Apolyton Democracy Game (CivII, that is)

                    The gift of speech is given to many,
                    intelligence to few.

                    Comment


                    • #12
                      deleted

                      Last edited by SlowThinker; August 7, 2001, 11:19.
                      Civ2 "Great Library Index": direct download, Apolyton attachment

                      Comment


                      • #13
                        Originally posted by DaveV
                        Mark Wagner wrote a battle odds calculator that I think is correct. It can be downloaded at http://www.geocities.com/SiliconVall...oads_Page.html
                        Civ2 "Great Library Index": direct download, Apolyton attachment

                        Comment


                        • #14
                          deleted

                          Last edited by SlowThinker; August 7, 2001, 11:18.
                          Civ2 "Great Library Index": direct download, Apolyton attachment

                          Comment


                          • #15
                            deleted

                            Last edited by SlowThinker; August 7, 2001, 11:19.
                            Civ2 "Great Library Index": direct download, Apolyton attachment

                            Comment

                            Working...
                            X