Air Combat in BtS explained

Stormreaver

Warlord
Joined
Nov 5, 2001
Messages
171
Location
Stockholm
Air combat explained
This is my attempt to clarify how air units works. Please point out any erros and I'll try to remedy them. I don't even mind you spelling out any errors in my english (pun intended), in fact I appreciate it, but I do have one request: please do NOT clutter this thread with "air combat in Civ4/BtS sucks, it should work this way", not even if you have a valid argument based on realism, gameplay or common sense. Those discussions belong in another thread, this one is about the mechanics that are in place, and how you use those efficiently! Just to be efficient, I've started another thread for this very purpose where I outline some complaints I have.

The article is split into two parts, first I go through the mechanics of air combat without too many conclusions. I will also include a couple of examples to illustrate. After that I'll post some observations and ideas on how to use and defend air combat. The latter part is very much open for discussion, and I intend to update it with other players ideas.

Everything is based on the BtS 3.13 plus whatever forum threads and such I've found, but should apply reasonably well to 3.17 too since the change log mentions only some unit specific changes, more specifically nerfing of Airship air strikes and interception chance given to Machine Guns/Anti-Tank units. I will include these changes below, but please have this in mind if you're still on v3.13.

The options of air combat
There are at most five missions available to air units: Rebasing is fairly straight forward, you move your unit to another base, using the entire turn for the unit. Valid rebasing options are your own or allied cities, and for some units carriers (fighters) or subs/missile cruisers (missiles). There are three offensive missions, all of which are handled more or less the same way detailed below. Finally there's a defensive mission, Intercept, which puts the unit on alert to strike at any enemy units performing one of the offensive missions within the interceptors range. You always issue missions to your air units one by one, there is no such thing as a fleet attack or fighters escorting bombers. Once you send your bomber on a run, it is on its own until the mission is completed, or aborted. Paradrops are also subject to interception, but I've decided not to get into that in this article (not in the first revision of it, at least).

Offensive missions
Missions is carried out the same way. A recon mission can not be intercepted, it seems. An air strike or a bombard also gives the added benefit of a Recon mission on the same tile you attacked.

1. Choose mission, strike/bombard/recon
2. Choose target tile
3. Test for interception
4a. If intercepted, perform intercept combat
4b. Else carry out mission

There is no way you can survive an interception and go on with the mission, even if no damage is inflicted by the intercepting unit the mission is aborted as soon as an interception is made.

Interception
Units that can intercept are either other enemy air units stationed within their operational range and put on Intercept missions the turn before, or ground units in the targeted tile with an interception chance (for example SAM Infantry, Mobile SAM, Mech Infantry and as of 3.17 Anti-Tank and Machine Guns). There is always only one unit who gets to try for the interception, no matter how many eligible defenders there are, but it's always the one with the best chance to intercept. In case of a tie in interception chance, the outcome is random or possibly that earlier built units seem to intercept first (only because they are earlier in the unit list looped through, and later units need a larger intercept chance to be assigned the role as main interceptor). Strength does not factor in here.

For ground units, the interception chance is always the percentage specified (SAM Inf, for example, has a 40% interception chance at full health as well as at 1 HP). For air units, the interception chance is lowered linearly if the unit is damaged. A fighter with an intercept chance of 100% when healthy, has a 30% shot to intercept at 30 HP, and if these two units were the eligible defenders the SAM Inf would be chosen, no matter its health. Ground units who moved the previous turn can not intercept, nor can ground units intercept more than once in a turn (air units on Intercept can intercept 'til they die - note that if a first mission gets them damaged, their interception percentage goes down for further missions).

For attacking air units with an evasion probability, this is tested for first. If you have a 50% evasion chance (Stealth Bomber) you have a one in two shot to just go on with your business, no matter how many eligible interceptors there are or how big a chance they have of intercepting.

Example: I have three Bombers and a Stealth Bomber I want to bombard an enemy city, which except for pure ground defense have one Fighter on intercept duty, as well as a fortified SAM Infantry. The first attack is by the Stealth Bomber, who has a 50% evasion chance. He fails the evasion check and is automatically countered by the Fighter (100% interception chance, once evasion is out of the way). There is a round of air to air combat, but let's say the defending Fighter survives at 25 HP (this exact outcome is actually impossible, but let's pretend). The second Bomber has no evasion, and the remaining best interceptor would be the SAM Inf. He has a 40% chance, but misses, and the second Bomber can bombard. The third Bomber goes up, yet again vs the SAM Inf, who this time manages to intercept and intercept combat is performed. When the fourth Bomber makes his run, the SAM Inf has already made it's interception, leaving the previously damaged Fighter the lone remaining interceptor, at 25%.

Intercept combat is pretty well described in the referenced thread if you want an explanation outside this thread, but just like ground combat it is decided in rounds. However, the number of rounds is capped at 5 (set in the global variable INTERCEPTION_MAX_ROUNDS). Before the combat begins the respective combat odds and damage is calculated , just like ground combat, although the formulas differ. The odds for winning a round are calculated using the relative strengths, which for air units is base strength plus modifiers for combat promotions, all multiplied by current health. For ground units it's using the normal strength calculation, including health, fortification and terrain modifiers. The odds of the attacker inflicting damage each round is his strength divided by total strength. The damage inflicted each won round is calculated completely regardless of the strength, it's instead calculated by the inteception percentage only: it's simply the percentage multiplied by the constant MAX_INTERCEPTION_DAMAGE from GlobalDefines.xml (which is 50). There's also a MIN_INTERCEPTION_DAMAGE, set to 10, which is being used for the attacker if it has very low or no interception capability (like Bombers). Since interception percentage is affected by health for air units, also inflicted damage per round is affected. Ground units intercepting never take any damage - the benefit for an attacking plane of winning rounds is merely not getting hit.

Disclaimer: I'm not 100% on the defensive modifiers on strength for ground interceptors, though. I'll revise this later if needed.

Example I: A Fighter (str 12) is intercepted by a Jet Fighter (str 24), both at full health. The strength ratio is 2-to-1, meaning the attacking Fighter wins 1/3 of the rounds. Damage is 50HP/round both ways, since both planes have an interception capability of 100%. This means that there is no way both planes survives this combat, since after three rounds one is bound to have been hit twice, and the damage being 50HP per round - crash, boom, bang. Say the Jet Fighter wins round one (~67% probability), he inflicts 50HP damage to the Fighter. This does not affect the Fighter for now, and let's say he wins round 2 (still a ~33% chance), retailiating with the same amount of damage. This leaves us with both planes at half health and the one who wins the last round will fly home. For those curious or mathematically bored, the odds of the Fighter winning vs a Jet Fighter is 7/27 = 26%, where he takes one hit in the process in 4 of those 27 statistically perfect battles.

Example II: A Jet Fighter is intercepted by a SAM Inf (str18). Neither have any promotions, and the target tile is a plains so no other bonuses apply. The Jet Fighters odds to win a round is 24/(24+18)=4/7, about 57%. Damage per hit is calculated like above (The SAM Inf would inflict 20HP of damage each hit due to its 40% interception chance, Jet Fighters damage per hit is irrelevant since no damage is applied to ground interceptors).

Mission: Recon
No too much to say about this one, there is no risk of interception. You can recon any square within your range without fear of violating airspace on non-open border neighbours and trigger a DoW or so. All air units can recon and all seem to have the same sight range.

Mission: Air strike
This one, surprisingly, is all about striking ground units. You select your tile and hope for the best. If you manage to avoid interception, the strongest defender on the tile is targeted. Strike damage is calculated using unit strength, where the attacking strength (A) is calculated as in an intercept mission - modified by promotions and health. The defending strength (D) is also calculated normally, like intercept battles, except that health modifier is not included. Then a factor F is calculated to be (A+D+1)/2, and damage inflicted finally (A+F)/(D+F) multiplied by the constant AIR_COMBAT_DAMAGE (30). There is a cap to how damaged a ground unit can end up from air strikes, similar to collateral, which is defined by the tag iAirCombatLimit in CIV4UnitInfos.xml. It is 30 for Airships, 50 for all planes and 100 for Guided Missiles (they can outright kill units!). There are no random elements in the air strike damage calculation.

Disclaimer: There is a line in the code applying some kind of city defense modifier to air strike damage, however I can't find if this is ever set to anything but zero.

In case the striking air unit has collateral capabilities (Bomber, Stealth Bomber), these are added just like for siege units. The damage calculation process is as follows: the collateral damage strength (A) is determined to be the base strength of the attacker, without modifiers for promotions or health. The maximum number of affected units (N) is also determined, which is 5 for Bombers, 6 for Stealth Bombers. The originally targeted unit (the best defender) can of course not be subjected to collateral. For each possible collateral target, a random number is multiplied by the health, and then the units are sorted by this total, highest to lowest. The N units with highest numbers are subjected to collateral. If any of those N units are immune to collateral, they are excepted, but still count for "number of units hit" and as such they potentially protect other, more vulnerable units just by being there. The defending units strength (D) when calculating collateral damage is the base strength, just like for the attacker. The damage done is determined in a way similar to air strike damage, the factor F is (A+D+1)/2, and damage is (A+F)/(D+F) multiplied by the constant COLLATERAL_COMBAT_DAMAGE (10). Collateral damage can never reduce unit health below the attacking units collateral damage limit (50 for both kinds of bombers). There are no random elements in the collateral damage calculation.

Disclaimer: 3.17 changes the flanking damage calculation, making the strength of the defending unit (i.e. best defender) determine flanking damage. I am not sure (don't have 3.17 SDK) whether a similar change is, or is not, done to collateral damage.

Example I: A Fighter is not intercepted while airstriking a SAM Inf on a hill. The Fighter has strength 12, while the SAM Inf has a calculated strength of 18*1.25=22.5 (25% hill defense bonus). The factor F is (12+22.5+1)/2=17.75 and damage is 30*(12+17.75)/(22.5+17.75)=22.174. The SAM Inf ends up taking 22HP damage.

Example II: The same as above, except that the SAM Inf does not intercept and the plane happens to be a bomber. The air strike damage ends upp being 25% instead, since the bomber has strength 16 instead of 12, but the bomber also inflicts collateral damage. Except the SAM Inf, there's also 3 healthy riflemen (R), 1 riflemen (r) with 55 HP and 3 machine guns (M). The randomizer makes them come out sorted like this: RMMRrMR (remember, this is completely random except for the health modifier, but the hurt rifleman still ends up above one machine gun and a healthy rifleman. The first five units are then subjected to collateral. For the 2 healthy riflemen, F is worked out to 15.5 ((16+14+1)/2) and damage is 10*(16+15.5)/(14+15.5)=10.7, which is truncated to 10 HP. The 2 affected Machine Guns are immune to collateral and is not damaged, but the last rifleman is in effect protected by their prescence. The hurt rifleman gets 5 HP worth of damage, since he cannot be reduced below the collateral damage limit of 50 HP.

Mission: Bombard
And finally there's the bombard, used to reduce cities' cultural defenses or take out terrain improvements ("Hello, Oil Well, let me introduce you to Mr. Bomber..."). When bombarding a city, there's not so many calculations involved. If you're not intercepted you decrease the cultural defenses with the value iBombRate (Bomber: 16, Stealth Bomber: 20) from CIV4UnitInfo.xml. This is decreased with health ratio though, if damaged. When targeting an improvement a random number is drawn from 1 to the iBombRate which is then compared to another random number ranging from 1 to the improvements iBombDefense (CIV4ImprovementInfos.xml). This is typically 5 for most early improvements, while 10 for Mines, Quarries, Wells and Oil Platforms and 20 for Forest Preserves. If the bombard number is larger - boom.

Reference:
This Apolyton thread helped out, but most information is from the SDK.
 
Nice thread.
 
Great artcile Stormreaver! I'd been looking for an air combat explained thread for a while. It answered a few critical questions I had.

I have a few comments.
Firstly, this is a very minor nitpick but for memory you can only use the rebase mission on missiles from city to city. For missile cruisers and submarines you must load the missiles from a city or fort.

Secondly, I was bit surprised by your example of the intercept battle between the full strength fighter and jet fighter. Is it really the case that whichever scores a hit they would do 50HP? This doesn't seem very illogical when compared with ordinary ground combat. From the battles I remember this seems to be the case but I find it very strange.

I found it an interesting point that units immune to collateral damage could effectively protect other units in bombing runs.

I also never realised there was no random element in the collateral calculation but now that I think about it makes sense. Bombers always seemed to be very effective at dishing out a similar amount of collateral damage each time I used them!
 
Mission: Bombard
And finally there's the bombard, used to reduce cities' cultural defenses or take out terrain improvements ("Hello, Oil Well, let me introduce you to Mr. Bomber..."). When bombarding a city, there's not so many calculations involved. If you're not intercepted you decrease the cultural defenses with the value iBombRate (Bomber: 16, Stealth Bomber: 20) from CIV4UnitInfo.xml. This is decreased with health ratio though, if damaged. When targeting an improvement a random number is drawn from 1 to the iBombRate which is then compared to another random number ranging from 1 to the improvements iBombDefense (CIV4ImprovementInfos.xml). This is typically 5 for most early improvements, while 10 for Mines, Quarries, Wells and Oil Platforms and 20 for Forest Preserves. If the bombard number is larger - boom.
So, essentially, whether an improvement is lost is calculated as rolling two random numbers, one in the range of 1-16 (for Bombers) and the other in the range of 1-10 (for Oil). Just to take one example...

What is the probability, then, of RAND(16) > RAND(10)? (That a non-intercepted Bomber takes out an Oil Well)

And what increase in probability does a Stealth Bomber bring; i.e. how much better is RAND(20)>RAND(10)?
 
So, essentially, whether an improvement is lost is calculated as rolling two random numbers, one in the range of 1-16 (for Bombers) and the other in the range of 1-10 (for Oil). Just to take one example...

What is the probability, then, of RAND(16) > RAND(10)? (That a non-intercepted Bomber takes out an Oil Well)

And what increase in probability does a Stealth Bomber bring; i.e. how much better is RAND(20)>RAND(10)?

Exactly, although the numbers in question might be 0-15 and 0-9 instead. Anyway, the percentage for a Bomber vs Well would be 65.6%, while using a Stealth Bomber increases the odds to 72.5%, if my very hasty calculations are correct.
 
About bombardement, you forgot something important imho: forts have 20 for iBombDefense :)

Great article otherwise, thanks a lot
 
I made a basic simulation (confirming your numbers along the way):

Bomber vs Oil Well success: 65.6%
Stealth vs Oil Well success: 72.5%
Bomber vs Oil Fort success: 37.4%
Stealth vs Oil Fort success: 47.5%
 
:goodjob:

Great thread!

I don't get into many air battles so I was oblivious to most of this. Good info here. Thanks.
 
or ground units in the targeted tile with an interception chance

How come when multiple ground-based interceptors are selected sometimes the adjacent tiles are lit up in a style similar to aircraft movement. I thought that this suggested that and ground-based interceptors could protect within a 1 sq radius, but your statement appears to refute that. Could someone please verify that ground-based interceptors do indeed only protect the square they are on and NOT any adjacent tiles.

If they do protect adjacent tiles, then it would also be useful to know if a ground-based unit could protect an adjacent coastal tile
 
I always like these threads that explain game mechanics. Thanks for the research. :goodjob:
 
Great article Stormreaver, very enlightening.

Example II: The same as above, except that the SAM Inf does not intercept and the plane happens to be a bomber. The air strike damage ends upp being 25% instead, since the bomber has strength 16 instead of 12, but the bomber also inflicts collateral damage. Except the SAM Inf, there's also 3 healthy riflemen (R), 1 riflemen (r) with 55 HP and 3 machine guns (M). The randomizer makes them come out sorted like this: RMMRrMR (remember, this is completely random except for the health modifier, but the hurt rifleman still ends up above one machine gun and a healthy rifleman. The first five units are then subjected to collateral. For the 2 healthy riflemen, F is worked out to 15.5 ((16+14+1)/2) and damage is 10*(16+15.5)/(14+15.5)=10.7, which is truncated to 10 HP. The 2 affected Machine Guns are immune to collateral and is not damaged, but the last rifleman is in effect protected by their prescence. The hurt rifleman gets 5 HP worth of damage, since he cannot be reduced below the collateral damage limit of 50 HP.

The strength factor F=(A+D+1)/2 is also an integer and will be truncated for all further calculations (15.5-->15). Machine Guns are only immune to collateral damage from siege weapons, AFAIK there is no unit in the unmodded game that has that kind of immunity for air attacks.


If they do protect adjacent tiles, then it would also be useful to know if a ground-based unit could protect an adjacent coastal tile

SAM and Mobile SAM both have a Range of 1, this means they can intercept air missions that target adjacent tiles. A test revealed that this protection also extends to coastal improvements. But they won't be able to intercept when loaded as cargo in Transports.
 
Just found something in the SDK:
Code:
int CvUnit::airMaxCombatStr(const CvUnit* pOther) const
{
	...

	iModifier = getExtraCombatPercent();

	...

	if (getExtraCombatPercent() != 0)
	{
		iModifier += getExtraCombatPercent();
	}
It seems like the Combat Promotions are factored in twice during air combat. Can anyone confirm this? Should that be forwarded to Solver?
 
...
It seems like the Combat Promotions are factored in twice during air combat. Can anyone confirm this? Should that be forwarded to Solver?

It sure seems a bit suspicious. My computer is due to me moving not set up and I can't check myself right now. (It also meant no finished BOTM7 for me. Argh.) I'll look into it in a couple days though if noone beats me to it...

I'll also update the main article with the findings above as soon as I can. Thanks for the input everyone.
 
A quick WB test revealed that Combat 6 Airships (= str 10) performed surprisingly well against intercepting Fighters and Combat 6 Fighters (= str 30) just smashed Jet Fighters on patrol...
S O L V E R !!!
 
If you think it is unbalanced just don't use it... Either way how frequent is to get combat 6 air units? clearly a minor issue......

/a certain forum member :lol:

Seriously, major bug....
 
It seems like the Combat Promotions are factored in twice during air combat. Can anyone confirm this? Should that be forwarded to Solver?

This is clearly undocumented in the civilopedia and thus seems a bit buggy.

However, I still kind of like it. There are only very few promotions to help you win air combat and because air combat is won in very few rounds, the combat promotions won't help a lot (that's a mathematical issue). Using the rules explained by the OP Stormreaver, a combat III fighter only has a little bit better than 50% chance of winning combat against an unpromoted fighter. This means that you can't do a lot to make your fighters better than the opposing fighters or to gain air superiority. Using double effect combat promotions helps a bit.

A quick WB test revealed that Combat 6 Airships (= str 10) performed surprisingly well against intercepting Fighters and Combat 6 Fighters (= str 30) just smashed Jet Fighters on patrol...
S O L V E R !!!

Combat 6 fighters? That's like fighters commanded by Rambo (or the Red Baron). They should beat anything. ;) ;) ;)

Using the rules explained by the OP, combat 5 fighters (the best normally attainable promotions for a fighter) should have strength 18 versus strength 24 jet fighters. Using the actual double effect promotions, combat 5 fighters have strength 24 versus strength 24 jet fighters: an equal fight. I don't have a problem that fighters with maximum normally attainable promotions have a 50-50 chance against completely unpromoted jet fighters. That's 26 experience versus 0 experience. Unpromoted fighters also have a 26% chance of victory against jet fighters. For 26 experience, they managed to get a 50% chance of victory. That doesn't sound overpowered or something. In every area of land combat, you can do better with 26 experience.

Compare with combat 5 axemen (7.5) versus unpromoted macemen (8), combat 5 musketmen (13.5) versus unpromoted riflemen (14), combat 5 riflemen (21) versus unpromoted infantry (20) and note that there are better promotions to take in these cases for the lower tech unit.

Combat 5 airships should have strength 6, but due to the semi-bug they have strength 8. They can never shoot down a fighter or jet fighter because they can only win a maximum of 5 rounds doing 10 hitpoints of damage per round. They only need to lose 2 rounds out of 5 against superior strength unpromoted fighters (12) to be shot down. They will likely go down. There's no issue there.

IMHO, the double effect combat promotions are a good thing for air combat because they give the option to somewhat improve your odds to win air combat when you have an excellent training facility. The only issue that I have is that it's undocumented and that they might be strong compared to the normal bonus promotions versus gunpowder units and armoured units which are also available to airplanes. Or are these promotions also doubled in effect?
 
I think that this is not intended, due to the syntax.... if it was intended we would get a "*2" in the first line instead of a crazy check if there is a promo bonus or not for the second time.....
 
Stormreaver: Disclaimer: I'm not 100% on the defensive modifiers on strength for ground interceptors, though. I'll revise this later if needed.

For ground interceptors strength is determined as:
iTheirStrength = pInterceptor->currCombatStr(NULL, NULL);
Both arguments are NULL which means the strength is only modified by combat promotions. Defensive modifiers due to the plot (terrain, city) and for fighting a certain attacker are not factored in, also fortification has no effect.

IMHO, the double effect combat promotions are a good thing for air combat because they give the option to somewhat improve your odds to win air combat when you have an excellent training facility. The only issue that I have is that it's undocumented and that they might be strong compared to the normal bonus promotions versus gunpowder units and armoured units which are also available to airplanes. Or are these promotions also doubled in effect?

The effects of bonus promotions vs Gunpowder units and Tanks (Pinch & Ambush) are not doubled. But any Air-strike targets will also suffer from the doubling, and that's why I think it should be fixed. (+ I share rolo's opinion about the syntax.)
 
Top Bottom