How does the random province bombing mechanic work?

  • We have updated our Community Code of Conduct. Please read through the new rules for the forum that are an integral part of Paradox Interactive’s User Agreement.

Mr_B0narpte

Field Marshal
12 Badges
Mar 15, 2009
4.689
325
  • Arsenal of Democracy
  • Cities in Motion
  • Darkest Hour
  • For The Glory
  • Hearts of Iron III
  • Rome Gold
  • Victoria 2
  • Rome: Vae Victis
  • 500k Club
  • Pride of Nations
  • Rise of Prussia
  • Hearts of Iron IV Sign-up
Can't edit title, replace "random province" with "area".

As in, is it completely random? Let's say there's 5 provinces in an area you're bombing, does it work on the basis that there is a 20% it'll target each province, or do other factors come into play (i.e. placement of enemy AA guns, proximity of enemy air bases)?
 

Commander666

Field Marshal
2 Badges
Nov 24, 2010
5.255
51
  • Arsenal of Democracy
  • 500k Club
In my games I noticed that:
1. Enemy bomber flight paths are to avoid AA when practical.
2. They do not concentrate strategic bombing on what I would dread most.
3. They repeat certain ground attacks to the point of becoming predictable.

Conversely, my bombers on Area missions don't prioritize the way I would like, so I hardly ever mission them that way (except naval patrol).
 

Mr_B0narpte

Field Marshal
12 Badges
Mar 15, 2009
4.689
325
  • Arsenal of Democracy
  • Cities in Motion
  • Darkest Hour
  • For The Glory
  • Hearts of Iron III
  • Rome Gold
  • Victoria 2
  • Rome: Vae Victis
  • 500k Club
  • Pride of Nations
  • Rise of Prussia
  • Hearts of Iron IV Sign-up
Yes I've certainly also encountered number 1, sometimes the bombers take ridiculous routes to get to targets, just to avoid AA on the way. That's mainly why I fear even random area bombing avoids provinces with AA in them. My issue is I'm playing an online game where we've banned the specific bombing of capitals due to the tremendous importance they have on the ESE of the entire military. Instead we only allow random area bombing in the vicinity of the capital, hence my fear that there's something hardcoded stopping my bombers from targeting the enemy's capital.

I don't full understand what you mean for 2. Are you referring to the AI strategically bombing you?

Number 3 suggests you are talking about the AI, in which case I completely agree. All AIs waste so much time, aircraft and supplies ground attacking fully stregnth, fully org, fully entrenched and fully supplied units.
 

Titan79

War is over! if you want it
48 Badges
Sep 11, 2005
3.377
298
  • Victoria 2: Heart of Darkness
  • Europa Universalis III Complete
  • Majesty 2
  • Europa Universalis III Complete
  • Europa Universalis IV: Res Publica
  • Victoria: Revolutions
  • Rome Gold
  • Sengoku
  • Sword of the Stars
  • Supreme Ruler 2020
  • Victoria 2
  • Victoria 2: A House Divided
  • Heir to the Throne
  • Warlock 2: The Exiled
  • 500k Club
  • Mount & Blade: Warband
  • Crusader Kings II: Way of Life
  • Pillars of Eternity
  • Crusader Kings II: Horse Lords
  • Crusader Kings II: Conclave
  • Achtung Panzer
  • Crusader Kings II: Reapers Due
  • Crusader Kings II: Monks and Mystics
  • Crusader Kings II: Jade Dragon
  • Darkest Hour
  • Hearts of Iron II: Armageddon
  • Cities in Motion
  • Crusader Kings II
  • Crusader Kings II: Charlemagne
  • Crusader Kings II: Legacy of Rome
  • Crusader Kings II: The Old Gods
  • Crusader Kings II: Rajas of India
  • Crusader Kings II: The Republic
  • Crusader Kings II: Sons of Abraham
  • Crusader Kings II: Sunset Invasion
  • Crusader Kings II: Sword of Islam
  • Arsenal of Democracy
  • Deus Vult
  • Europa Universalis III
  • Europa Universalis III: Chronicles
  • Europa Universalis III Complete
  • Divine Wind
  • Europa Universalis IV
  • Europa Universalis IV: Conquest of Paradise
  • Europa Universalis IV: Wealth of Nations
  • Europa Universalis IV: Call to arms event
  • For The Glory
  • Hearts of Iron III
Mr_B0narpte,

IIRC that's a rather old issue.

I don't remember exactly how that worked but maybe you could poke @Zsar1 asking him to enlighten us... (actually, you don't need to do anything - he should have been "summoned" by that already ;) ).
 

Zsar1

Major
52 Badges
Dec 19, 2014
659
199
  • Arsenal of Democracy
  • Victoria 2: Heart of Darkness
  • Victoria 2: A House Divided
  • Darkest Hour
  • Crusader Kings II: Jade Dragon
  • Hearts of Iron IV: Cadet
  • Hearts of Iron IV: Colonel
  • Crusader Kings II: Reapers Due
  • Stellaris: Digital Anniversary Edition
  • Stellaris: Leviathans Story Pack
  • Hearts of Iron IV: Together for Victory
  • Crusader Kings II: Monks and Mystics
  • Hearts of Iron IV: Death or Dishonor
  • Age of Wonders III
  • Stellaris: Galaxy Edition
  • Hearts of Iron IV: Expansion Pass
  • Stellaris: Humanoids Species Pack
  • Stellaris: Apocalypse
  • Stellaris: Distant Stars
  • Shadowrun Returns
  • Crusader Kings II: Holy Fury
  • Battle for Bosporus
  • Stellaris: Ancient Relics
  • Stellaris: Lithoids
  • Hearts of Iron IV: La Resistance
  • Stellaris: Federations
  • Stellaris
  • Europa Universalis IV
  • Victoria 2
  • Europa Universalis III: Collection
  • Crusader Kings II: Horse Lords
  • Crusader Kings II: Conclave
  • Crusader Kings II: Way of Life
  • Stellaris Sign-up
  • Crusader Kings II
  • Crusader Kings II: Charlemagne
  • Crusader Kings II: Legacy of Rome
  • Crusader Kings II: The Old Gods
  • Crusader Kings II: Rajas of India
  • Crusader Kings II: The Republic
  • Stellaris: Megacorp
  • Crusader Kings II: Sons of Abraham
  • Crusader Kings II: Sunset Invasion
  • Crusader Kings II: Sword of Islam
  • Europa Universalis III
  • Divine Wind
  • Heir to the Throne
  • Stellaris: Synthetic Dawn
  • King Arthur II
  • Stellaris - Path to Destruction bundle
Summoned, hè? Then were are my sacrifices!? ... Jesting.

Missions over more than one province use a scoring function to determine the best province to attack. AA capability in the province decreases the score, target availability increases it.

I have not yet investigated the code in detail, but there is a bug I should fix one of these days in that only constructed building sizes - but not current (e.g. partially destroyed from previous runs) sizes - are used for scoring in some of the missions (e.g. Industrial Bombardment correctly checks for current IC, but Installation Strike only checks for potential levels of affected buildings).

The algorithm goes about like this:
Code:
ourUnit = unitWithMission            // the unit that is checking whether to fly its mission and where to
score   = lowerBound(typeof(score))
target  = null                       // will be the province targeted when the unit actually departs

list<province> targetList = scopeOfMission // all the provinces selected in the mission scope

randomTarget = random(integral numbers) modulo targetList.size // generally NOT a uniform distribution
randomTargetProvince = null

for(province in targetList)
  --randomTarget

  if(not canTarget(province))
    continue
  else
    if(randomTarget == 0)
      randomTargetProvince = targetList[randomTarget]

    risk = simulateCombatWithRandomHostileUnit(ourUnit, province) // heuristic: "what if any hostile air unit would engage us here";
                                                                  // might pick 4 interceptors, might pick 4 transport planes
    check = addPotentialDamageSubtractPotentialLosses(risk, province)     // factoring in #targets, sum(AA), etc.

    check /= 2 + numberOfDivisionsAttackingToday(province) + ourUnit.size // reducing attractiveness of provinces targeted by other units

    if(check > score) // always true on the first pass
      score = check
      target = province

if(target == null && randomTargetProvince != null) // score is not significant, so we choose randomly
  target = randomTargetProvince

if(target != null)
  sendUnit(ourUnit, province) // actually makes the unit fly its mission
  numberOfDivisionsAttackingToday(province) += ourUnit.size
Note that the score originally began at 0.f, until I adjusted it to quick&dirty(TM) fix the installation strike issue. As you can see, for single province targets, a random province cannot be picked due to wrong order of the decrement of randomTarget. As the risk assessment already introduces a random component, I decided against a fix by putting that decrement at the end and instead fixed the score to always produce a tangible result.

All the air missions have roughly this shape, it is almost impossible to spot differences on the fly (hè). One of my eventual goals here is to drastically cut down on redundancy as per the DRY principle, and at that point it will be sensible to further tweak the algorithm. I intend to open a feedback tread on that matter, once we have actually reached a situation wherein we can apply such feedback.
 
Last edited:
  • 1
Reactions:

Titan79

War is over! if you want it
48 Badges
Sep 11, 2005
3.377
298
  • Victoria 2: Heart of Darkness
  • Europa Universalis III Complete
  • Majesty 2
  • Europa Universalis III Complete
  • Europa Universalis IV: Res Publica
  • Victoria: Revolutions
  • Rome Gold
  • Sengoku
  • Sword of the Stars
  • Supreme Ruler 2020
  • Victoria 2
  • Victoria 2: A House Divided
  • Heir to the Throne
  • Warlock 2: The Exiled
  • 500k Club
  • Mount & Blade: Warband
  • Crusader Kings II: Way of Life
  • Pillars of Eternity
  • Crusader Kings II: Horse Lords
  • Crusader Kings II: Conclave
  • Achtung Panzer
  • Crusader Kings II: Reapers Due
  • Crusader Kings II: Monks and Mystics
  • Crusader Kings II: Jade Dragon
  • Darkest Hour
  • Hearts of Iron II: Armageddon
  • Cities in Motion
  • Crusader Kings II
  • Crusader Kings II: Charlemagne
  • Crusader Kings II: Legacy of Rome
  • Crusader Kings II: The Old Gods
  • Crusader Kings II: Rajas of India
  • Crusader Kings II: The Republic
  • Crusader Kings II: Sons of Abraham
  • Crusader Kings II: Sunset Invasion
  • Crusader Kings II: Sword of Islam
  • Arsenal of Democracy
  • Deus Vult
  • Europa Universalis III
  • Europa Universalis III: Chronicles
  • Europa Universalis III Complete
  • Divine Wind
  • Europa Universalis IV
  • Europa Universalis IV: Conquest of Paradise
  • Europa Universalis IV: Wealth of Nations
  • Europa Universalis IV: Call to arms event
  • For The Glory
  • Hearts of Iron III
Thank you very much for the detailed answer!

Also:
All the air missions have roughly this shape, it is almost impossible to spot differences on the fly
Appreciated that.
 

Commander666

Field Marshal
2 Badges
Nov 24, 2010
5.255
51
  • Arsenal of Democracy
  • 500k Club
Are you referring to the AI strategically bombing you?

Yes, my points 1-3 refer to AI flights. I thought I had clarified that by beginning with "Enemy bombers..." I guess if on MP then "Who the enemy is?" might be a bit more complicated than my playing just SP." :) The last sentence conversely describes player initiated flights.

ANYWAY, loss of ESE across whole map because of bombing enemy capital (capital ESE reduced) is fair game because it is realistic. Player can repair it.
But the situation of nuking capital and AI not relocating capital is most unrealistic, and unplayable too. There is nothing wrong (realistically or game wise) with nuking a capital. But the AI or player unable to relocate to new capital elsewhere is a serious flaw.
 

Commander666

Field Marshal
2 Badges
Nov 24, 2010
5.255
51
  • Arsenal of Democracy
  • 500k Club
.Missions over more than one province use a scoring function to determine the best province to attack. AA capability in the province decreases the score, target availability increases it.

This is reasonable... except what is deciding the mission type? Mission type is extremely important. The AI's major fault has to do with wasting its air force to the point of self annihilation doing useless Ground Attack missions on embedded troops. This has no significant impact on player's country or fighting ability other than to possibly distract him. Meanwhile, the AI continues these missions to the point of the bombers reaching pitiful remaining strength. I suggest hard code game so AI will NEVER do ground attack for an easy and quick fix to instantly greatly improve AI effectiveness.

Strategic bombing by AI is the other discussion, but this post too long already... except I will say that the target priority for provinces selected is not very good - whether it is AI or player setting mission for a month.
 

Zsar1

Major
52 Badges
Dec 19, 2014
659
199
  • Arsenal of Democracy
  • Victoria 2: Heart of Darkness
  • Victoria 2: A House Divided
  • Darkest Hour
  • Crusader Kings II: Jade Dragon
  • Hearts of Iron IV: Cadet
  • Hearts of Iron IV: Colonel
  • Crusader Kings II: Reapers Due
  • Stellaris: Digital Anniversary Edition
  • Stellaris: Leviathans Story Pack
  • Hearts of Iron IV: Together for Victory
  • Crusader Kings II: Monks and Mystics
  • Hearts of Iron IV: Death or Dishonor
  • Age of Wonders III
  • Stellaris: Galaxy Edition
  • Hearts of Iron IV: Expansion Pass
  • Stellaris: Humanoids Species Pack
  • Stellaris: Apocalypse
  • Stellaris: Distant Stars
  • Shadowrun Returns
  • Crusader Kings II: Holy Fury
  • Battle for Bosporus
  • Stellaris: Ancient Relics
  • Stellaris: Lithoids
  • Hearts of Iron IV: La Resistance
  • Stellaris: Federations
  • Stellaris
  • Europa Universalis IV
  • Victoria 2
  • Europa Universalis III: Collection
  • Crusader Kings II: Horse Lords
  • Crusader Kings II: Conclave
  • Crusader Kings II: Way of Life
  • Stellaris Sign-up
  • Crusader Kings II
  • Crusader Kings II: Charlemagne
  • Crusader Kings II: Legacy of Rome
  • Crusader Kings II: The Old Gods
  • Crusader Kings II: Rajas of India
  • Crusader Kings II: The Republic
  • Stellaris: Megacorp
  • Crusader Kings II: Sons of Abraham
  • Crusader Kings II: Sunset Invasion
  • Crusader Kings II: Sword of Islam
  • Europa Universalis III
  • Divine Wind
  • Heir to the Throne
  • Stellaris: Synthetic Dawn
  • King Arthur II
  • Stellaris - Path to Destruction bundle
AI mission weight depends slightly on available division types and mostly on ai/air_marshal softcode. I think it has all the variables to change that behaviour (including suicidal sorties), but of course there might be hidden bugs inside.

E.g. for no Ground Attack missions, just set groundattackdesirability to 0. For more careful sorties raise destructionriskthreashold [sic]. For more careful target selection decrease <mission type>losstolerance.
 

Commander666

Field Marshal
2 Badges
Nov 24, 2010
5.255
51
  • Arsenal of Democracy
  • 500k Club
I got my USA strategic bombers based in Philippines currently strategically bombing oil rich Japanese controlled Borneo. I have them on Area mission, but after watching them mostly bomb provinces devoid of oil, I conclude that the soft code priorities don't match my strategy. How nice if we could give them instructions of what to prioritize when using Area selection.
 

Mr_B0narpte

Field Marshal
12 Badges
Mar 15, 2009
4.689
325
  • Arsenal of Democracy
  • Cities in Motion
  • Darkest Hour
  • For The Glory
  • Hearts of Iron III
  • Rome Gold
  • Victoria 2
  • Rome: Vae Victis
  • 500k Club
  • Pride of Nations
  • Rise of Prussia
  • Hearts of Iron IV Sign-up
Thank you for your posts and answers, they have been very helpful!
 

Commander666

Field Marshal
2 Badges
Nov 24, 2010
5.255
51
  • Arsenal of Democracy
  • 500k Club
I assume you mean Zasr1 who is the true helpful. At best my posts might be termed "interesting" as I try to bring in the player oriented experience.

Yes, I was surprised that my STR on "strategic mission" hit Kuching repeatedly when the Area option (North Borneo) was selected as 2 other province there are very oil rich. Kuching has no oil, but the only airport on Borneo.

That predictable situation was begging for Jap fighters to do something about it. The risks weren't worth it, and I changed to Region bombing (includes North and South Borneo Areas, Celebes Island, and 3 smaller islands further east). As all the other islands have no resources, now I was hitting oil provinces even less - but at least my bombers were no longer predictable.

In the end, I really only succeeded in my aim of wrecking Borneo's oil production by having a proper "target briefing" with the bomber crews every day prior to launching their missions. Now, if some soft code could do that (like trades can prioritize resources) that would be devilishly wonderful. :cool: