Civilization 2 - Defense modifier calculations

Taurean

Chieftain
Joined
Apr 28, 2023
Messages
20
Hello :) This is my first post on this forum.

I'm currently playing civ2 a lot. I will try to keep this a s short as possible, and may update the thread as i have more questions.

Simple example first. Is this calculation correct?

Phalanx fortified, in a forest with fortress:

Defense factor = 2

+ 50% fortification = 3
+ 50% forest = 4
+ 100% fortress = 8

Is this correct?
 
Here is our understanding of the combat calculation.

The defender is eligible to receive only one of the following three adjustments, which are checked in the following order:
  1. City Walls. If the defender's domain is 0 (Ground) and the defender is located in a city that has the City Walls improvement (or currently receives the benefit of City Walls due to the Great Wall wonder), and the attacker's domain is 0 (Ground) and the attacker does not have the "Negates city walls (howitzer)" flag, then the defender receives a configurable adjustment. By default this is a x3 adjustment (bonus) but TOTPP permits this to be modified in the @COSMIC2 section, using the "CityWallsDefense" key. Correctly documented, other than TOTPP support for a configurable adjustment, in (3)(e) plus (3)(h)(i).
  2. Fortress. If the defender's domain is 0 (Ground) and the defender is located on a tile with the Fortress improvement, and the attacker's domain is 0 (Ground) or 2 (Sea) and the attacker does not have the "Negates city walls (howitzer)" flag, then the defender receives a configurable adjustment. By default this is a x2 adjustment (bonus) but TOTPP permits this to be modified in the @COSMIC2 section, using the "FortressDefense" key. Documented, other than TOTPP support for a configurable adjustment, in (3)(c). However, the reference there excludes the fact that an attacker with the "Negates city walls (howitzer)" flag also negates the Fortress bonus, in addition to its more obvious ability to negate the City Walls bonus.
  3. Fortified. If the defender's domain is 0 (Ground) and the defender is Fortified, it receives a configurable adjustment. By default this is a x1.5 adjustment (bonus) but TOTPP permits this to be modified in the @COSMIC2 section, using the "FortifyDefense" key. Correctly documented, other than TOTPP support for a configurable adjustment, in (3)(b).
Terrain. This adjustment is the only one in which there may be two components which are added together, first, before the final result is multiplied alongside any and all other adjustments.
  1. Base terrain type. The defender receives an adjustment determined by the base terrain of the tile on which it is located. The amount of the adjustment is defined in the @TERRAIN section Rules.txt for each terrain type; it may be less than 1 (i.e. a penalty), equal to 1 (no effect), or greater than 1 (i.e. a bonus) depending on that value. Furthermore, TOTPP supports two additional configuration elements. If the defender's domain is 1 (Air) and the @COSMIC2 section contains the "TerrainDefenseForAir" key set to 0, then the adjustment is automatically equal to 1 (meaning the terrain has no effect). Similarly, if the defender's domain is 2 (Sea) and the @COSMIC2 section contains the "TerrainDefenseForSea" key set to 0, then the adjustment is automatically equal to 1 (meaning the terrain has no effect). Correctly documented in (3)(d)(i) through (iii), other than TOTPP support for suppressing the adjustment in certain situations. Also, the reference there implies that terrain factors are static and doesn't note that they are configurable for each terrain type, although this is widely known.
  2. River. If the tile on which the defender is located contains a river, the amount of the terrain adjustment is increased by 0.5 (as noted above, this is an addition that occurs as part of the calculation of the terrain adjustment, before it is multiplied with other adjustments). Note that the @COSMIC2 keys referenced in the previous point do not eliminate the river bonus. Correctly documented in (3)(d)(iv), except that a "%" sign should not be included near the end of the line.

The correct calculation in your example is:
2*2*1.5 = 6
(2 base defense)*(2 fortress fortification bonus)*(1.5 forest defense bonus)

Different defense bonuses are multiplied together, and only one of fortified/fortress/city walls is available.
 
Here is our understanding of the combat calculation.




The correct calculation in your example is:
2*2*1.5 = 6
(2 base defense)*(2 fortress fortification bonus)*(1.5 forest defense bonus)

Different defense bonuses are multiplied together, and only one of fortified/fortress/city walls is available.
Thank you very much. I never knew only one of those instances were added. I guess that makes it more important when there is more activity and you don't always get one turn to fortify a unit. Otherwise i guess it is less point in spending time to make a fortress when not necessary.

But there is one more question:
1) Does the game use the best modifier at any time? I.e., if fortified within either city walls or fortress, do you get the fortification bonus (+50%), the fortress bonus (+100%) or city walls bonus (+300%)? I take it the unit does not have to be fortified in order to get the fortress or city walls bonus?

And another bonus question:
2) Does the game add decimals to calculations with odd numbers? I.e. A) Warrior fortified in desert square; 1 + 50% = 1.5? Or B ) musketeers fortified in forest square; 3 + 50% (4.50) + 50% = 6.75? Are these numbers rounded up or down?
 
But there is one more question:
1) Does the game use the best modifier at any time? I.e., if fortified within either city walls or fortress, do you get the fortification bonus (+50%), the fortress bonus (+100%) or city walls bonus (+300%)? I take it the unit does not have to be fortified in order to get the fortress or city walls bonus?
I just tested with TOTPP's ability to change the defensive values of Fortifying, Fortresses, and City Walls, by making fortifying give a x30 defense bonus. Turns out that the game uses City Walls/Fortress even if fortify would give a better defense bonus. (This doesn't surprise me, since the original game didn't give the options to change these.)

And another bonus question:
2) Does the game add decimals to calculations with odd numbers? I.e. A) Warrior fortified in desert square; 1 + 50% = 1.5? Or B ) musketeers fortified in forest square; 3 + 50% (4.50) + 50% = 6.75? Are these numbers rounded up or down?
The game multiplies the initial values by 8, then rounds down when doing division. In practice, this means you can have 3 different 1.5 multiplications and still get an exact result. Based on this, I think the only times you get rounding are either an attacker with less than 1 movement point left, or a defender with veteran, fortification, terrain, and pikeman bonuses.
 
Okay so, reaching end-game again, now focusing on defenses. Worried about stealth bombers, howitzers and battleships. Not taking hp/fp into account, are these calculations correct?

Veteran mechanized infantry, fortress, forest square

9 x 2 = 18 + 50% = 27


Veteran mechanized infantry, fortified, forest square

9 + 50% = 13.5 + 50% = 20.25
 
Top Bottom