AI 'handicap' on border forts goes too far.

  • 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.

TheMeInTeam

Field Marshal
54 Badges
Dec 27, 2013
30.274
18.949
  • Age of Wonders III
  • Crusader Kings II: Conclave
  • Hearts of Iron IV: No Step Back
  • Stellaris
  • Hearts of Iron IV: Cadet
  • Crusader Kings II: Reapers Due
  • Europa Universalis IV: Rights of Man
  • Hearts of Iron IV: Together for Victory
  • Crusader Kings II: Monks and Mystics
  • Europa Universalis IV: Mandate of Heaven
  • Europa Universalis 4: Emperor
  • Hearts of Iron IV: Death or Dishonor
  • Stellaris: Synthetic Dawn
  • Europa Universalis IV: Cossacks
  • Europa Universalis IV: Cradle of Civilization
  • Battle for Bosporus
  • Hearts of Iron IV: Expansion Pass
  • Europa Universalis IV: Rule Britannia
  • Europa Universalis IV: Dharma
  • Crusader Kings II: Holy Fury
  • Europa Universalis IV: Golden Century
  • Hearts of Iron IV: Expansion Pass
  • Prison Architect
  • Hearts of Iron IV: La Resistance
  • Crusader Kings III
  • Crusader Kings II: Horse Lords
  • Europa Universalis IV: Common Sense
  • Magicka 2
  • Crusader Kings II: Way of Life
  • Europa Universalis IV: El Dorado
  • Victoria 2
  • Europa Universalis IV
  • Crusader Kings II: Charlemagne
  • Crusader Kings II
  • 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
  • Europa Universalis IV: Art of War
  • Europa Universalis IV: Conquest of Paradise
  • Europa Universalis IV: Wealth of Nations
  • Hearts of Iron III
  • Magicka
  • Europa Universalis IV: Res Publica
  • Stellaris - Path to Destruction bundle
  • Victoria 2: A House Divided
  • Victoria 2: Heart of Darkness
It would be nice if they could code a difficulty to level higher than currently for players like you and me to have a higher functioning AI. But we are in the minority. Understanding game mechanics, discipline, and patience is all factored into skill when it comes to video games my friend. Especially the former.

It won't happen. If they could make such an AI, they'd use it in the base game instead and tune the difficulty differently.

Using big resources on making an AI several grades above other strategy titles in the market, and then leaving it as an option that only a small percentage of the player base will experience isn't a winning formula. It would make more sense to just use that AI and not work on two levels of AI at once, and give players handicaps if they can't handle it.
 
  • 3
Reactions:

Kirkegaard

Major
45 Badges
Mar 7, 2010
777
462
  • Knights of Pen and Paper +1 Edition
  • Europa Universalis IV: Common Sense
  • Cities: Skylines - After Dark
  • Europa Universalis IV: Cossacks
  • Cities: Skylines - Snowfall
  • Europa Universalis IV: Third Rome
  • Europa Universalis IV: Res Publica
  • Majesty 2 Collection
  • Magicka
  • For The Glory
  • Europa Universalis IV: Call to arms event
  • Europa Universalis IV: Wealth of Nations
  • Europa Universalis IV: Conquest of Paradise
  • Europa Universalis IV: Art of War
  • Europa Universalis IV
  • Dungeonland
  • Darkest Hour
  • A Game of Dwarves
  • Arsenal of Democracy
  • Cities: Skylines - Mass Transit
  • Europa Universalis 4: Emperor
  • Europa Universalis IV: Mandate of Heaven
  • Surviving Mars
  • Cities: Skylines - Green Cities
  • Europa Universalis IV: Rule Britannia
  • Cities: Skylines - Parklife
  • Europa Universalis IV: Dharma
  • Europa Universalis IV: Golden Century
  • Imperator: Rome
  • Cities: Skylines - Campus
  • Cities: Skylines - Natural Disasters
  • Europa Universalis IV: Rights of Man
  • Europa Universalis IV: Mare Nostrum
  • Humble Paradox Bundle
  • Pillars of Eternity
  • Magicka: Wizard Wars Founder Wizard
  • Europa Universalis IV: El Dorado
  • 500k Club
  • War of the Roses
  • Victoria 2
  • Stellaris
  • Europa Universalis IV: Cradle of Civilization
  • Cities: Skylines
  • Cities: Skylines Industries
  • Crusader Kings II
...Using big resources on making an AI several grades above other strategy titles in the market, and then leaving it as an option that only a small percentage of the player base will experience isn't a winning formula. It would make more sense to just use that AI and not work on two levels of AI at once, and give players handicaps if they can't handle it.

If they could make such an AI, they would more likely end up selling this skill instead of PC-games :)
 
  • 1
Reactions:

Frogbait

Gilad is my real handle
61 Badges
Aug 24, 2008
794
1.118
  • Crusader Kings II
  • Stellaris: Galaxy Edition
  • Stellaris: Galaxy Edition
  • Europa Universalis IV: Rights of Man
  • Europa Universalis IV: Mare Nostrum
  • Cities: Skylines - Snowfall
  • Europa Universalis IV: Cossacks
  • Cities: Skylines - After Dark
  • Europa Universalis IV: Pre-order
  • Europa Universalis IV: Third Rome
  • Victoria 2: Heart of Darkness
  • Victoria 2: A House Divided
  • Europa Universalis: Rome
  • Victoria: Revolutions
  • Europa Universalis IV: Res Publica
  • Majesty 2
  • 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
  • Europa Universalis IV
  • Europa Universalis IV: Art of War
  • Europa Universalis IV: Conquest of Paradise
  • Europa Universalis IV: Wealth of Nations
  • Europa Universalis IV: Call to arms event
  • Majesty 2 Collection
  • Cities: Skylines - Mass Transit
  • Stellaris - Path to Destruction bundle
  • Europa Universalis IV: Mandate of Heaven
  • Crusader Kings II: Monks and Mystics
  • Cities: Skylines - Natural Disasters
  • Stellaris: Leviathans Story Pack
  • Stellaris: Digital Anniversary Edition
  • Stellaris: Humanoids Species Pack
  • Crusader Kings II: Reapers Due
  • Stellaris Sign-up
  • Stellaris: Galaxy Edition
  • Imperator: Rome - Magna Graecia
  • Crusader Kings II: Conclave
  • Crusader Kings II: Horse Lords
  • Europa Universalis IV: Common Sense
  • Crusader Kings II: Way of Life
  • Europa Universalis IV: El Dorado
  • Stellaris: Apocalypse
  • 500k Club
  • Warlock: Master of the Arcane
It won't happen. If they could make such an AI, they'd use it in the base game instead and tune the difficulty differently.

Using big resources on making an AI several grades above other strategy titles in the market, and then leaving it as an option that only a small percentage of the player base will experience isn't a winning formula. It would make more sense to just use that AI and not work on two levels of AI at once, and give players handicaps if they can't handle it.
Yeah, I wasn't saying it was realistic. I'm fully aware that there are dreams that cannot be but damnit I can still hope eventually :p
 
  • 2
Reactions:

tman144

Major
43 Badges
Jun 10, 2012
516
407
  • Crusader Kings II: Charlemagne
  • Europa Universalis IV: Mare Nostrum
  • Europa Universalis IV: Pre-order
  • Europa Universalis IV: Res Publica
  • Magicka
  • Europa Universalis IV: Wealth of Nations
  • Europa Universalis IV: Conquest of Paradise
  • Europa Universalis IV: Art of War
  • Crusader Kings II
  • Crusader Kings II: Sword of Islam
  • Crusader Kings II: Sons of Abraham
  • Crusader Kings II: The Republic
  • Crusader Kings II: Rajas of India
  • Crusader Kings II: The Old Gods
  • Crusader Kings II: Legacy of Rome
  • Europa Universalis 4: Emperor
  • Stellaris - Path to Destruction bundle
  • Europa Universalis IV: Mandate of Heaven
  • Crusader Kings II: Monks and Mystics
  • Europa Universalis IV: Cradle of Civilization
  • Europa Universalis IV: Rule Britannia
  • Cities: Skylines - Parklife
  • Europa Universalis IV: Dharma
  • Crusader Kings II: Holy Fury
  • Europa Universalis IV: Golden Century
  • Prison Architect
  • Crusader Kings III
  • Crusader Kings III: Royal Edition
  • Europa Universalis IV: Rights of Man
  • Crusader Kings II: Reapers Due
  • Stellaris Sign-up
  • Stellaris
  • Crusader Kings II: Conclave
  • Europa Universalis IV: Cossacks
  • Crusader Kings II: Horse Lords
  • Europa Universalis IV: Common Sense
  • Crusader Kings II: Way of Life
  • Magicka: Wizard Wars Founder Wizard
  • Europa Universalis IV: El Dorado
  • 500k Club
  • Europa Universalis IV
  • Crusader Kings II: Jade Dragon
  • Cities: Skylines
I'm beginning to think that forts should only be able to be built in specific provinces. Like how we have estuaries in certain provinces, only some provinces would be tagged as fort provinces. It would take a lot of time up front to go through the map and decide where forts should go, but I think it would fix a lot of problems with the AI not knowing where to put forts and wonky pathing with putting forts too close together.
 
  • 1
Reactions:

Arumba

Colonel
75 Badges
Mar 10, 2012
804
1.074
  • Crusader Kings II
  • Warlock 2: The Exiled
  • Victoria 2: A House Divided
  • Majesty 2 Collection
  • Magicka
  • Divine Wind
  • Europa Universalis III Complete
  • Crusader Kings II: Way of Life
  • Imperator: Rome - Magna Graecia
  • Victoria 2
  • Crusader Kings II: Holy Fury
  • Europa Universalis IV: Third Rome
  • Warlock: Master of the Arcane
  • 500k Club
  • Crusader Kings III
  • Europa Universalis IV: El Dorado
  • Prison Architect
  • Age of Wonders III
  • Pillars of Eternity
  • Stellaris: Distant Stars
  • Europa Universalis IV: Common Sense
  • Crusader Kings II: Horse Lords
  • Cities: Skylines - Mass Transit
  • Crusader Kings II: Conclave
  • Europa Universalis 4: Emperor
  • Tyranny: Archon Edition
  • Hearts of Iron IV: Cadet
  • Europa Universalis IV: Golden Century
  • Hearts of Iron IV: Expansion Pass
  • Surviving Mars
  • BATTLETECH - Digital Deluxe Edition
  • Hearts of Iron IV: Death or Dishonor
  • Europa Universalis IV
  • Crusader Kings II: Jade Dragon
  • BATTLETECH
  • Europa Universalis III Complete
  • Battle for Bosporus
  • Age of Wonders: Planetfall
  • Europa Universalis IV: Dharma
  • Stellaris: Apocalypse
  • Europa Universalis III Complete
  • Hearts of Iron IV: Expansion Pass
  • Ancient Space
  • Heir to the Throne
  • Crusader Kings II: Rajas of India
  • Crusader Kings II: The Old Gods
  • Europa Universalis IV: Cossacks
  • Cities: Skylines - Snowfall
  • Europa Universalis III
  • March of the Eagles
I'm beginning to think that forts should only be able to be built in specific provinces. Like how we have estuaries in certain provinces, only some provinces would be tagged as fort provinces. It would take a lot of time up front to go through the map and decide where forts should go, but I think it would fix a lot of problems with the AI not knowing where to put forts and wonky pathing with putting forts too close together.

I'm currently working on a mod that will adjust AI building preference, and one thing I've done is prevent the AI from building a fort while another building is being built in an adjacent province. Buildings are fairly fast to build, outside of forts, and what it has done through testing so far is prevent adjacent forts. Unfortunately I haven't been able to figure out how to force it to stop building forts that end up with competing zones of control, but it is still improved over vanilla.
 
  • 2
Reactions:

FleetingRain

Field Marshal
58 Badges
Aug 2, 2014
3.063
5.882
  • Europa Universalis IV
  • Surviving Mars
  • Stellaris: Federations
  • Crusader Kings III
  • Crusader Kings II
  • Stellaris
  • Pillars of Eternity
  • Imperator: Rome Sign Up
I'm currently working on a mod that will adjust AI building preference, and one thing I've done is prevent the AI from building a fort while another building is being built in an adjacent province. Buildings are fairly fast to build, outside of forts, and what it has done through testing so far is prevent adjacent forts. Unfortunately I haven't been able to figure out how to force it to stop building forts that end up with competing zones of control, but it is still improved over vanilla.

Maybe don't let it build forts in provinces with adjacent provinces that already are adjacent to a fort province?
 

grommile

Field Marshal
66 Badges
Jun 4, 2011
22.451
38.866
  • Europa Universalis IV
  • Crusader Kings III
  • Stellaris
  • Shadowrun Returns
  • Teleglitch: Die More Edition
  • Victoria 2
  • 500k Club
  • March of the Eagles
  • Knights of Pen and Paper 2
  • Crusader Kings II
  • Europa Universalis III
  • Hearts of Iron IV: Cadet
  • Cities: Skylines
  • Prison Architect
I'm beginning to think that forts should only be able to be built in specific provinces. Like how we have estuaries in certain provinces, only some provinces would be tagged as fort provinces. It would take a lot of time up front to go through the map and decide where forts should go, but I think it would fix a lot of problems with the AI not knowing where to put forts and wonky pathing with putting forts too close together.
To me, this idea seems to contain essential conceptual flaws, since either the density of "permissible fort" provinces is low enough to guarantee no adjacent forts in which case it's plausible for a country to exist which isn't allowed any forts, or it isn't, in which case you haven't actually solved the problem of over-dense fort packing.

(Worse, you could plausibly end up with a situation where both problems exist in different parts of the map.)
 

Arumba

Colonel
75 Badges
Mar 10, 2012
804
1.074
  • Crusader Kings II
  • Warlock 2: The Exiled
  • Victoria 2: A House Divided
  • Majesty 2 Collection
  • Magicka
  • Divine Wind
  • Europa Universalis III Complete
  • Crusader Kings II: Way of Life
  • Imperator: Rome - Magna Graecia
  • Victoria 2
  • Crusader Kings II: Holy Fury
  • Europa Universalis IV: Third Rome
  • Warlock: Master of the Arcane
  • 500k Club
  • Crusader Kings III
  • Europa Universalis IV: El Dorado
  • Prison Architect
  • Age of Wonders III
  • Pillars of Eternity
  • Stellaris: Distant Stars
  • Europa Universalis IV: Common Sense
  • Crusader Kings II: Horse Lords
  • Cities: Skylines - Mass Transit
  • Crusader Kings II: Conclave
  • Europa Universalis 4: Emperor
  • Tyranny: Archon Edition
  • Hearts of Iron IV: Cadet
  • Europa Universalis IV: Golden Century
  • Hearts of Iron IV: Expansion Pass
  • Surviving Mars
  • BATTLETECH - Digital Deluxe Edition
  • Hearts of Iron IV: Death or Dishonor
  • Europa Universalis IV
  • Crusader Kings II: Jade Dragon
  • BATTLETECH
  • Europa Universalis III Complete
  • Battle for Bosporus
  • Age of Wonders: Planetfall
  • Europa Universalis IV: Dharma
  • Stellaris: Apocalypse
  • Europa Universalis III Complete
  • Hearts of Iron IV: Expansion Pass
  • Ancient Space
  • Heir to the Throne
  • Crusader Kings II: Rajas of India
  • Crusader Kings II: The Old Gods
  • Europa Universalis IV: Cossacks
  • Cities: Skylines - Snowfall
  • Europa Universalis III
  • March of the Eagles
Maybe don't let it build forts in provinces with adjacent provinces that already are adjacent to a fort province?

This would be tricky to do, I think. Right now it looks like this:

Code:
modifier = {
            factor = 0
            any_neighbor_province = {
                owned_by = ROOT
                OR = {
                    has_building = fort_15th
                    has_building = fort_16th
                    has_building = fort_17th
                    has_building = fort_18th
                    has_construction = building
                }
            }
        }

This checks if any adjacent province has a fort in it of any level, or if it is building *any* building (unfortunately can't check for specific building, we tried that and it didn't work), and if it is says you can't build here. If the building blocking the construction of the fort was a temple or something it just waits a year to start the fort (once the building finishes the block is gone).

Perhaps a nested adjacency check might work.. I'll try something like this:
Code:
modifier = {
    factor = 0
    any_neighbor_province = {
        owned_by = ROOT
        any_neighbor_province = {
            owned_by = ROOT
            OR = {
                has_building = fort_15th
                has_building = fort_16th
                has_building = fort_17th
                has_building = fort_18th
                has_construction = building
            }
        }
    }
}
Something like this might work, but I think this would actually check back on the initial province as well... but if there's no building started it wouldn't block it. It's weird.

*edit*
Just tried it and the AI started building adjacent forts. Will continue to mess with it ,but that bit up there doesn't work.
 
Last edited:

ChildeR

Field Marshal
59 Badges
Dec 19, 2012
6.160
1.643
  • Crusader Kings II
  • Europa Universalis III Complete
  • Europa Universalis IV
  • Tyranny: Archon Edition
  • Crusader Kings III
  • Tyranny: Archon Edition
  • Surviving Mars
  • Age of Wonders III
  • Europa Universalis IV: Rule Britannia
  • Cities: Skylines - Parklife Pre-Order
  • Cities: Skylines - Parklife
  • Shadowrun Returns
  • Shadowrun: Dragonfall
  • Shadowrun: Hong Kong
  • Imperator: Rome
  • Prison Architect
  • Imperator: Rome Sign Up
  • Hearts of Iron IV: Cadet
  • Hearts of Iron IV Sign-up
  • Stellaris
  • Europa Universalis IV: Mare Nostrum
  • Knights of Pen and Paper 2
  • Europa Universalis IV: Common Sense
  • Pillars of Eternity
  • Magicka: Wizard Wars Founder Wizard
  • Europa Universalis IV: El Dorado
  • 500k Club
  • War of the Roses
  • Warlock: Master of the Arcane
  • Teleglitch: Die More Edition
  • Europa Universalis III Complete
  • Europa Universalis III Complete
Just tried it and the AI started building adjacent forts. Will continue to mess with it ,but that bit up there doesn't work.
You need both code blocks if you want to stop both adjacent and separated by one province forts.

(With only the second one it is possible an adjacent province is not adjacent to any other adjacent province.)
 

BarrosRodrigues

aka marcoan7onio
47 Badges
Dec 17, 2011
4.556
2.212
  • Crusader Kings II
  • Rome: Vae Victis
  • Victoria 2: Heart of Darkness
  • Victoria 2: A House Divided
  • Sengoku
  • Semper Fi
  • Rome Gold
  • Victoria: Revolutions
  • Europa Universalis IV: Res Publica
  • March of the Eagles
  • Hearts of Iron III: Their Finest Hour
  • Hearts of Iron III
  • For the Motherland
  • Europa Universalis IV: Conquest of Paradise
  • Cities in Motion
  • 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
  • Europa Universalis IV: Wealth of Nations
  • Europa Universalis IV: Art of War
  • Battle for Bosporus
  • Stellaris Sign-up
  • Hearts of Iron IV Sign-up
  • Hearts of Iron IV: Cadet
  • Europa Universalis IV: Rights of Man
  • Hearts of Iron IV: Death or Dishonor
  • Hearts of Iron IV: Expansion Pass
  • Europa Universalis IV: Dharma
  • Hearts of Iron IV: Expansion Pass
  • Imperator: Rome - Magna Graecia
  • Stellaris
  • Europa Universalis IV: Mare Nostrum
  • Europa Universalis IV: Cossacks
  • Europa Universalis IV: Common Sense
  • Crusader Kings II: Way of Life
  • Europa Universalis IV: El Dorado
  • 500k Club
  • Warlock 2: The Exiled
  • Victoria 2
  • Europa Universalis IV
  • Europa Universalis IV: Third Rome
  • Hearts of Iron III Collection
I'm beginning to think that forts should only be able to be built in specific provinces. Like how we have estuaries in certain provinces, only some provinces would be tagged as fort provinces. It would take a lot of time up front to go through the map and decide where forts should go, but I think it would fix a lot of problems with the AI not knowing where to put forts and wonky pathing with putting forts too close together.
Yeah that seems to be like be a great solution (and moron proof too) .
 

BarrosRodrigues

aka marcoan7onio
47 Badges
Dec 17, 2011
4.556
2.212
  • Crusader Kings II
  • Rome: Vae Victis
  • Victoria 2: Heart of Darkness
  • Victoria 2: A House Divided
  • Sengoku
  • Semper Fi
  • Rome Gold
  • Victoria: Revolutions
  • Europa Universalis IV: Res Publica
  • March of the Eagles
  • Hearts of Iron III: Their Finest Hour
  • Hearts of Iron III
  • For the Motherland
  • Europa Universalis IV: Conquest of Paradise
  • Cities in Motion
  • 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
  • Europa Universalis IV: Wealth of Nations
  • Europa Universalis IV: Art of War
  • Battle for Bosporus
  • Stellaris Sign-up
  • Hearts of Iron IV Sign-up
  • Hearts of Iron IV: Cadet
  • Europa Universalis IV: Rights of Man
  • Hearts of Iron IV: Death or Dishonor
  • Hearts of Iron IV: Expansion Pass
  • Europa Universalis IV: Dharma
  • Hearts of Iron IV: Expansion Pass
  • Imperator: Rome - Magna Graecia
  • Stellaris
  • Europa Universalis IV: Mare Nostrum
  • Europa Universalis IV: Cossacks
  • Europa Universalis IV: Common Sense
  • Crusader Kings II: Way of Life
  • Europa Universalis IV: El Dorado
  • 500k Club
  • Warlock 2: The Exiled
  • Victoria 2
  • Europa Universalis IV
  • Europa Universalis IV: Third Rome
  • Hearts of Iron III Collection
To me, this idea seems to contain essential conceptual flaws, since either the density of "permissible fort" provinces is low enough to guarantee no adjacent forts in which case it's plausible for a country to exist which isn't allowed any forts, or it isn't, in which case you haven't actually solved the problem of over-dense fort packing.

(Worse, you could plausibly end up with a situation where both problems exist in different parts of the map.)
Ofc capitals would be allowed to build any type of fort so they would at least have 1.
 

Chaingun

Field Marshal
47 Badges
Jul 15, 2002
3.796
2.513
  • Knights of Honor
  • 500k Club
  • Europa Universalis III: Collection
  • Europa Universalis IV: El Dorado
  • Magicka: Wizard Wars Founder Wizard
  • Mount & Blade: Warband
  • Mount & Blade: With Fire and Sword
  • Europa Universalis IV: Common Sense
  • Europa Universalis IV: Cossacks
  • Europa Universalis IV: Mare Nostrum
  • Europa Universalis IV: Rights of Man
  • Steel Division: Normandy 44
  • War of the Vikings
  • Europa Universalis IV: Third Rome
  • BATTLETECH
  • Surviving Mars
  • Age of Wonders III
  • Europa Universalis IV: Rule Britannia
  • Europa Universalis IV: Dharma
  • Imperator: Rome Deluxe Edition
  • Imperator: Rome
  • Prison Architect
  • Imperator: Rome - Magna Graecia
  • Crusader Kings III
  • Europa Universalis III Complete
  • Europa Universalis III
  • Europa Universalis III: Chronicles
  • Europa Universalis III Complete
  • Divine Wind
  • Europa Universalis IV
  • Europa Universalis IV: Art of War
  • Europa Universalis IV: Conquest of Paradise
  • Europa Universalis IV: Wealth of Nations
  • Europa Universalis IV: Call to arms event
  • Hearts of Iron III
  • Heir to the Throne
  • Crusader Kings II
  • Magicka
  • Europa Universalis III Complete
  • Europa Universalis IV: Res Publica
  • Victoria: Revolutions
  • Rome Gold
  • Supreme Ruler 2020
  • Victoria 2
  • Victoria 2: A House Divided
  • Victoria 2: Heart of Darkness
  • Rome: Vae Victis
Yeah, I wasn't saying it was realistic. I'm fully aware that there are dreams that cannot be but damnit I can still hope eventually :p

Actually had to move some of the Condottieri AI to Hard after QA got destroyed by it in their MP campaign. So Normal will definitely not have the hardest AI the way it looks now. (We're also looking at adding Very Hard as mentioned earlier which will be a pure modifier boosted AI in most cases, but unsure of whether it will get into 1.16 or the followup patch.)

Don't get your hopes up though regarding the AI's competence, the fact QA lost is probably because they're unfamiliar with counter-strategies. :p
 
  • 3
Reactions:

Arumba

Colonel
75 Badges
Mar 10, 2012
804
1.074
  • Crusader Kings II
  • Warlock 2: The Exiled
  • Victoria 2: A House Divided
  • Majesty 2 Collection
  • Magicka
  • Divine Wind
  • Europa Universalis III Complete
  • Crusader Kings II: Way of Life
  • Imperator: Rome - Magna Graecia
  • Victoria 2
  • Crusader Kings II: Holy Fury
  • Europa Universalis IV: Third Rome
  • Warlock: Master of the Arcane
  • 500k Club
  • Crusader Kings III
  • Europa Universalis IV: El Dorado
  • Prison Architect
  • Age of Wonders III
  • Pillars of Eternity
  • Stellaris: Distant Stars
  • Europa Universalis IV: Common Sense
  • Crusader Kings II: Horse Lords
  • Cities: Skylines - Mass Transit
  • Crusader Kings II: Conclave
  • Europa Universalis 4: Emperor
  • Tyranny: Archon Edition
  • Hearts of Iron IV: Cadet
  • Europa Universalis IV: Golden Century
  • Hearts of Iron IV: Expansion Pass
  • Surviving Mars
  • BATTLETECH - Digital Deluxe Edition
  • Hearts of Iron IV: Death or Dishonor
  • Europa Universalis IV
  • Crusader Kings II: Jade Dragon
  • BATTLETECH
  • Europa Universalis III Complete
  • Battle for Bosporus
  • Age of Wonders: Planetfall
  • Europa Universalis IV: Dharma
  • Stellaris: Apocalypse
  • Europa Universalis III Complete
  • Hearts of Iron IV: Expansion Pass
  • Ancient Space
  • Heir to the Throne
  • Crusader Kings II: Rajas of India
  • Crusader Kings II: The Old Gods
  • Europa Universalis IV: Cossacks
  • Cities: Skylines - Snowfall
  • Europa Universalis III
  • March of the Eagles
You need both code blocks if you want to stop both adjacent and separated by one province forts.

(With only the second one it is possible an adjacent province is not adjacent to any other adjacent province.)

Awesome, with some testing I got it to work! I also made it so the AI will always build a fort in their capital regardless of adjacency, because a level 1 fort is silly for a capital province.
I present to you my new and improved AI fort placement logic. It now does the following:

Doesn't build forts on islands.
Always builds forts in their capital
Really doesn't want to build forts with overlapping zones of control
Prefers to build forts in open terrain so that it can smash your face in when you try to siege it. (Just like I prefer to do)
Prefers to build forts in provinces with lots of building slots so it can build better stuff in low building slot provinces.
Doesn't always prioritize adjacency to the enemy, instead preferring large zones of control. After the large zones of control are filled it will still fill in overlapping zones, but never intentionally makes adjacent forts.

A bit more testing is needed to determine if preventing overlapping zone of control *period* is a good idea or not. It might be better to just 'strongly discourage' it.
Code:
fort_15th = {
    cost = 200
    time = 30
    modifier = {
        fort_level = 2
    }
   
    onmap = yes
   
    influencing_fort = yes
   
    ai_will_do = {
        factor = 1800
        modifier = {
            factor = 10
            is_capital = yes
        }
        modifier = {
            factor = 1.05
            num_free_building_slots  = 4
        }
        modifier = {
            factor = 0
            island = yes
            NOT = { is_capital = yes }
        }           
        modifier = {
            factor = 0.1
            is_overseas = yes
        }   
        modifier = {
            factor = 0
            any_neighbor_province = {
                owned_by = ROOT
                OR = {
                    has_building = fort_15th
                    has_building = fort_16th
                    has_building = fort_17th
                    has_building = fort_18th
                    has_construction = building
                }
            }
            NOT = { is_capital = yes }           
        }
        modifier = {
            factor = 0.5
            any_neighbor_province = {
                owned_by = ROOT
                any_neighbor_province = {
                    owned_by = ROOT
                    OR = {
                        has_building = fort_15th
                        has_building = fort_16th
                        has_building = fort_17th
                        has_building = fort_18th
                        has_construction = building
                    }
                }
            }
            NOT = { is_capital = yes }
        }
        modifier = {
            factor = 0.5
            OR = {
                has_terrain = forest
                has_terrain = hills
                has_terrain = mountain
                has_terrain = marsh
                has_terrain = highlands
                has_terrain = jungle
            }
        }
    } 
}
 
Last edited:
  • 3
Reactions:

Arumba

Colonel
75 Badges
Mar 10, 2012
804
1.074
  • Crusader Kings II
  • Warlock 2: The Exiled
  • Victoria 2: A House Divided
  • Majesty 2 Collection
  • Magicka
  • Divine Wind
  • Europa Universalis III Complete
  • Crusader Kings II: Way of Life
  • Imperator: Rome - Magna Graecia
  • Victoria 2
  • Crusader Kings II: Holy Fury
  • Europa Universalis IV: Third Rome
  • Warlock: Master of the Arcane
  • 500k Club
  • Crusader Kings III
  • Europa Universalis IV: El Dorado
  • Prison Architect
  • Age of Wonders III
  • Pillars of Eternity
  • Stellaris: Distant Stars
  • Europa Universalis IV: Common Sense
  • Crusader Kings II: Horse Lords
  • Cities: Skylines - Mass Transit
  • Crusader Kings II: Conclave
  • Europa Universalis 4: Emperor
  • Tyranny: Archon Edition
  • Hearts of Iron IV: Cadet
  • Europa Universalis IV: Golden Century
  • Hearts of Iron IV: Expansion Pass
  • Surviving Mars
  • BATTLETECH - Digital Deluxe Edition
  • Hearts of Iron IV: Death or Dishonor
  • Europa Universalis IV
  • Crusader Kings II: Jade Dragon
  • BATTLETECH
  • Europa Universalis III Complete
  • Battle for Bosporus
  • Age of Wonders: Planetfall
  • Europa Universalis IV: Dharma
  • Stellaris: Apocalypse
  • Europa Universalis III Complete
  • Hearts of Iron IV: Expansion Pass
  • Ancient Space
  • Heir to the Throne
  • Crusader Kings II: Rajas of India
  • Crusader Kings II: The Old Gods
  • Europa Universalis IV: Cossacks
  • Cities: Skylines - Snowfall
  • Europa Universalis III
  • March of the Eagles
Nice work Arumba. There's currently a modder on our beta team looking at improving the buildings script, so I will forward it to him.
Can you confirm that the nested adjacent province thing shouldn't cause a lot of strain on the game? How often does the AI check these things. From my experience it's not slowing anything down, but I want to make sure before I invest more time into this solution.
 

Chaingun

Field Marshal
47 Badges
Jul 15, 2002
3.796
2.513
  • Knights of Honor
  • 500k Club
  • Europa Universalis III: Collection
  • Europa Universalis IV: El Dorado
  • Magicka: Wizard Wars Founder Wizard
  • Mount & Blade: Warband
  • Mount & Blade: With Fire and Sword
  • Europa Universalis IV: Common Sense
  • Europa Universalis IV: Cossacks
  • Europa Universalis IV: Mare Nostrum
  • Europa Universalis IV: Rights of Man
  • Steel Division: Normandy 44
  • War of the Vikings
  • Europa Universalis IV: Third Rome
  • BATTLETECH
  • Surviving Mars
  • Age of Wonders III
  • Europa Universalis IV: Rule Britannia
  • Europa Universalis IV: Dharma
  • Imperator: Rome Deluxe Edition
  • Imperator: Rome
  • Prison Architect
  • Imperator: Rome - Magna Graecia
  • Crusader Kings III
  • Europa Universalis III Complete
  • Europa Universalis III
  • Europa Universalis III: Chronicles
  • Europa Universalis III Complete
  • Divine Wind
  • Europa Universalis IV
  • Europa Universalis IV: Art of War
  • Europa Universalis IV: Conquest of Paradise
  • Europa Universalis IV: Wealth of Nations
  • Europa Universalis IV: Call to arms event
  • Hearts of Iron III
  • Heir to the Throne
  • Crusader Kings II
  • Magicka
  • Europa Universalis III Complete
  • Europa Universalis IV: Res Publica
  • Victoria: Revolutions
  • Rome Gold
  • Supreme Ruler 2020
  • Victoria 2
  • Victoria 2: A House Divided
  • Victoria 2: Heart of Darkness
  • Rome: Vae Victis
If it's a performance thief we can always cache it (pre-calculate and store the result when some input changes). Caching is more complicated and risks introducing bugs so it's usually not done until there is a confirmed problem.
 
  • 2
Reactions:

Arumba

Colonel
75 Badges
Mar 10, 2012
804
1.074
  • Crusader Kings II
  • Warlock 2: The Exiled
  • Victoria 2: A House Divided
  • Majesty 2 Collection
  • Magicka
  • Divine Wind
  • Europa Universalis III Complete
  • Crusader Kings II: Way of Life
  • Imperator: Rome - Magna Graecia
  • Victoria 2
  • Crusader Kings II: Holy Fury
  • Europa Universalis IV: Third Rome
  • Warlock: Master of the Arcane
  • 500k Club
  • Crusader Kings III
  • Europa Universalis IV: El Dorado
  • Prison Architect
  • Age of Wonders III
  • Pillars of Eternity
  • Stellaris: Distant Stars
  • Europa Universalis IV: Common Sense
  • Crusader Kings II: Horse Lords
  • Cities: Skylines - Mass Transit
  • Crusader Kings II: Conclave
  • Europa Universalis 4: Emperor
  • Tyranny: Archon Edition
  • Hearts of Iron IV: Cadet
  • Europa Universalis IV: Golden Century
  • Hearts of Iron IV: Expansion Pass
  • Surviving Mars
  • BATTLETECH - Digital Deluxe Edition
  • Hearts of Iron IV: Death or Dishonor
  • Europa Universalis IV
  • Crusader Kings II: Jade Dragon
  • BATTLETECH
  • Europa Universalis III Complete
  • Battle for Bosporus
  • Age of Wonders: Planetfall
  • Europa Universalis IV: Dharma
  • Stellaris: Apocalypse
  • Europa Universalis III Complete
  • Hearts of Iron IV: Expansion Pass
  • Ancient Space
  • Heir to the Throne
  • Crusader Kings II: Rajas of India
  • Crusader Kings II: The Old Gods
  • Europa Universalis IV: Cossacks
  • Cities: Skylines - Snowfall
  • Europa Universalis III
  • March of the Eagles
If it's a performance thief we can always cache it (pre-calculate and store the result when some input changes). Caching is more complicated and risks introducing bugs so it's usually not done until there is a confirmed problem.

Okay, I'm going to let a game run for a few hundred years now and see how the AI handles my changes. Should be interesting to see the results!
 

DanubianCossak

DaputinCozzak Specyal Snowflake
34 Badges
Nov 16, 2009
12.412
3.646
  • Crusader Kings II
  • Europa Universalis IV: Pre-order
  • Europa Universalis IV: Third Rome
  • Europa Universalis IV: Res Publica
  • Heir to the Throne
  • Europa Universalis IV: Wealth of Nations
  • Europa Universalis IV: Conquest of Paradise
  • Europa Universalis IV: Art of War
  • Cities in Motion
  • Divine Wind
  • Europa Universalis III Complete
  • Darkest Hour
  • Hearts of Iron IV: Expansion Pass
  • Europa Universalis IV: Mandate of Heaven
  • Hearts of Iron IV: Death or Dishonor
  • Europa Universalis IV: Rights of Man
  • Age of Wonders III
  • Europa Universalis IV: Cradle of Civilization
  • Hearts of Iron IV: Expansion Pass
  • Europa Universalis IV: Rule Britannia
  • Europa Universalis IV: Dharma
  • Europa Universalis IV: Golden Century
  • Hearts of Iron IV: Field Marshal
  • Hearts of Iron IV: Colonel
  • Hearts of Iron IV: Cadet
  • Hearts of Iron IV Sign-up
  • Europa Universalis IV: Mare Nostrum
  • Europa Universalis IV: Cossacks
  • Europa Universalis IV: Common Sense
  • Europa Universalis IV: El Dorado
  • 500k Club
  • Europa Universalis III Complete
  • Europa Universalis III Complete
  • Europa Universalis IV
Awesome, with some testing I got it to work! I also made it so the AI will always build a fort in their capital regardless of adjacency, because a level 1 fort is silly for a capital province.
I present to you my new and improved AI fort placement logic. It now does the following:

Doesn't build forts on islands.
Always builds forts in their capital
Really doesn't want to build forts with overlapping zones of control
Prefers to build forts in open terrain so that it can smash your face in when you try to siege it. (Just like I prefer to do)
Prefers to build forts in provinces with lots of building slots so it can build better stuff in low building slot provinces.
Doesn't always prioritize adjacency to the enemy, instead preferring large zones of control. After the large zones of control are filled it will still fill in overlapping zones, but never intentionally makes adjacent forts.

A bit more testing is needed to determine if preventing overlapping zone of control *period* is a good idea or not. It might be better to just 'strongly discourage' it.
Code:
fort_15th = {
    cost = 200
    time = 30
    modifier = {
        fort_level = 2
    }

    onmap = yes

    influencing_fort = yes

    ai_will_do = {
        factor = 1500
        modifier = {
            factor = 10
            is_capital = yes
        }
        modifier = {
            factor = 1.05
            allowed_num_of_buildings = 4
        }
        modifier = {
            factor = 0
            AND {
                island = yes
                NOT = { is_capital = yes }
            }
        }        
        modifier = {
            factor = 0.1
            is_overseas = yes
        }
        modifier = {
            factor = 0
            AND {
                any_neighbor_province = {
                    owned_by = ROOT
                    OR = {
                        has_building = fort_15th
                        has_building = fort_16th
                        has_building = fort_17th
                        has_building = fort_18th
                        has_construction = building
                    }
                }
                NOT = { is_capital = yes }
            }        
        }
        modifier = {
            factor = 0.8
            AND {
                any_neighbor_province = {
                    owned_by = ROOT
                    any_neighbor_province = {
                        owned_by = ROOT
                        OR = {
                            has_building = fort_15th
                            has_building = fort_16th
                            has_building = fort_17th
                            has_building = fort_18th
                            has_construction = building
                        }
                    }
                }
                NOT = { is_capital = yes }
            }
        }
        modifier = {
            factor = 0.8
            OR = {
                has_terrain = forest
                has_terrain = hills
                has_terrain = mountain
                has_terrain = marsh
                has_terrain = highlands
                has_terrain = jungle
            }
        }
    }
}

First of all, i love you, won a free copy of Art of War on your stream XD

Second you have a couple of instances of redundant coding there, AND = {} and "NOT = { is_capital = yes }" when you can simply put "is_capital = no" :)

Third your base factor is 1500 when everything else is 100 which in itself is not a problem;

However, fourth, your terrain modifiers of 0.80 is rendered irrelevant by it, because if you reduce 20% from 1500, it will still outweigh everything else (by something like 10x for base values), and might get picked anyway, no?

And fifth if i was you, i would add a certain limiting factor if you insist on terrain being used like that; make sure that owner is on a certain continent (say Europe for example) because if you leave it like that (and reduce base factor) you might cause AI to not build forts at all (edit: rather build them at a sub optimal rate) in places where you have a high concentration of those terrain types.
 

Arumba

Colonel
75 Badges
Mar 10, 2012
804
1.074
  • Crusader Kings II
  • Warlock 2: The Exiled
  • Victoria 2: A House Divided
  • Majesty 2 Collection
  • Magicka
  • Divine Wind
  • Europa Universalis III Complete
  • Crusader Kings II: Way of Life
  • Imperator: Rome - Magna Graecia
  • Victoria 2
  • Crusader Kings II: Holy Fury
  • Europa Universalis IV: Third Rome
  • Warlock: Master of the Arcane
  • 500k Club
  • Crusader Kings III
  • Europa Universalis IV: El Dorado
  • Prison Architect
  • Age of Wonders III
  • Pillars of Eternity
  • Stellaris: Distant Stars
  • Europa Universalis IV: Common Sense
  • Crusader Kings II: Horse Lords
  • Cities: Skylines - Mass Transit
  • Crusader Kings II: Conclave
  • Europa Universalis 4: Emperor
  • Tyranny: Archon Edition
  • Hearts of Iron IV: Cadet
  • Europa Universalis IV: Golden Century
  • Hearts of Iron IV: Expansion Pass
  • Surviving Mars
  • BATTLETECH - Digital Deluxe Edition
  • Hearts of Iron IV: Death or Dishonor
  • Europa Universalis IV
  • Crusader Kings II: Jade Dragon
  • BATTLETECH
  • Europa Universalis III Complete
  • Battle for Bosporus
  • Age of Wonders: Planetfall
  • Europa Universalis IV: Dharma
  • Stellaris: Apocalypse
  • Europa Universalis III Complete
  • Hearts of Iron IV: Expansion Pass
  • Ancient Space
  • Heir to the Throne
  • Crusader Kings II: Rajas of India
  • Crusader Kings II: The Old Gods
  • Europa Universalis IV: Cossacks
  • Cities: Skylines - Snowfall
  • Europa Universalis III
  • March of the Eagles
If it's a performance thief we can always cache it (pre-calculate and store the result when some input changes). Caching is more complicated and risks introducing bugs so it's usually not done until there is a confirmed problem.

Hmm, I'm getting a runtime error now.
R6025
-pure virtual function call

This happens when I start a game, give some cash to castile, and then observe. When I tag back into castile and go to look at the buildings hes built, it gives me that error as soon as my mouse hits the buildings macrobuilder. Wasn't happening before I added in the nested adjacent provinces function so I'm assuming the two are related. Any clue what this error means?
 

Arumba

Colonel
75 Badges
Mar 10, 2012
804
1.074
  • Crusader Kings II
  • Warlock 2: The Exiled
  • Victoria 2: A House Divided
  • Majesty 2 Collection
  • Magicka
  • Divine Wind
  • Europa Universalis III Complete
  • Crusader Kings II: Way of Life
  • Imperator: Rome - Magna Graecia
  • Victoria 2
  • Crusader Kings II: Holy Fury
  • Europa Universalis IV: Third Rome
  • Warlock: Master of the Arcane
  • 500k Club
  • Crusader Kings III
  • Europa Universalis IV: El Dorado
  • Prison Architect
  • Age of Wonders III
  • Pillars of Eternity
  • Stellaris: Distant Stars
  • Europa Universalis IV: Common Sense
  • Crusader Kings II: Horse Lords
  • Cities: Skylines - Mass Transit
  • Crusader Kings II: Conclave
  • Europa Universalis 4: Emperor
  • Tyranny: Archon Edition
  • Hearts of Iron IV: Cadet
  • Europa Universalis IV: Golden Century
  • Hearts of Iron IV: Expansion Pass
  • Surviving Mars
  • BATTLETECH - Digital Deluxe Edition
  • Hearts of Iron IV: Death or Dishonor
  • Europa Universalis IV
  • Crusader Kings II: Jade Dragon
  • BATTLETECH
  • Europa Universalis III Complete
  • Battle for Bosporus
  • Age of Wonders: Planetfall
  • Europa Universalis IV: Dharma
  • Stellaris: Apocalypse
  • Europa Universalis III Complete
  • Hearts of Iron IV: Expansion Pass
  • Ancient Space
  • Heir to the Throne
  • Crusader Kings II: Rajas of India
  • Crusader Kings II: The Old Gods
  • Europa Universalis IV: Cossacks
  • Cities: Skylines - Snowfall
  • Europa Universalis III
  • March of the Eagles
First of all, i love you, won a free copy of Art of War on your stream XD

Second you have a couple of instances of redundant coding there, AND = {} and "NOT = { is_capital = yes }" when you can simply put "is_capital = no" :)

Third your base factor is 1500 when everything else is 100 which in itself is not a problem;

However, fourth, your terrain modifiers of 0.80 is rendered irrelevant by it, because if you reduce 20% from 1500, it will still outweigh everything else (by something like 10x for base values), and might get picked anyway, no?

And fifth if i was you, i would add a certain limiting factor if you insist on terrain being used like that; make sure that owner is on a certain continent (say Europe for example) because if you leave it like that (and reduce base factor) you might cause AI to not build forts at all (edit: rather build them at a sub optimal rate) in places where you have a high concentration of those terrain types.

Hey thanks for the feedback!

All of the base factors were adjusted in my mod because the game does wonky things with fractional factor, and I found it to perform better when there is a larger integer spread between buildings. So they are all still balanced against each other, just with a higher initial value.

AFAIK most of the coding requires you to do that sort of nonsense like "Not = { is_capital = yes }", and I don't know why. I just used the modding subforums list of scopes/triggers etc, and saw things like this:

has_empty_adjacent_province = yes #can only use yes, using no doesn't work. Instead use NOT = { has_empty_adjacent_province = yes }

It's safe to assume its more than just one function that works weirdly like that, so... better safe than sorry.
 
  • 1
Reactions: