CK2 Dev Diary #71 - AI and Optimization

CK2 Dev Diary #71 - AI and Optimization

  • Crusader Kings III Available Now!

    The realm rejoices as Paradox Interactive announces the launch of Crusader Kings III, the latest entry in the publisher’s grand strategy role-playing game franchise. Advisors may now jockey for positions of influence and adversaries should save their schemes for another day, because on this day Crusader Kings III can be purchased on Steam, the Paradox Store, and other major online retailers.


    Real Strategy Requires Cunning

Meneth

Crusader Kings 3 Programmer
129 Badges
Feb 9, 2011
10.020
4.452
www.paradoxwikis.com
  • Europa Universalis IV: Common Sense
  • Crusader Kings II: Holy Knight (pre-order)
  • Crusader Kings II
  • Crusader Kings II: Sword of Islam
  • Crusader Kings II: Legacy of Rome
  • Crusader Kings II: Sunset Invasion
  • Crusader Kings II: The Republic
  • 500k Club
  • Hearts of Iron IV: Cadet
  • Hearts of Iron IV: Colonel
  • Europa Universalis IV: El Dorado
  • Europa Universalis IV: Cradle of Civilization
  • Magicka: Wizard Wars Founder Wizard
  • Mount & Blade: Warband
  • Mount & Blade: With Fire and Sword
  • Crusader Kings II: Way of Life
  • Stellaris: Digital Anniversary Edition
  • Hearts of Iron IV: Field Marshal
  • Age of Wonders III
  • Crusader Kings II: Conclave
  • Hearts of Iron IV: Death or Dishonor
  • Stellaris: Galaxy Edition
  • Surviving Mars
  • Hearts of Iron IV Sign-up
  • Stellaris Sign-up
  • Crusader Kings II: Reapers Due
  • Crusader Kings Complete
  • Steel Division: Normand 44 Sign-up
  • Hearts of Iron IV: Expansion Pass
  • Hearts of Iron IV: Expansion Pass
  • Cities: Skylines - Parklife
  • Prison Architect
  • Stellaris: Leviathans Story Pack
  • Europa Universalis III Complete
  • Europa Universalis IV: Mandate of Heaven
  • Europa Universalis III Complete
  • Europa Universalis IV: Rule Britannia
  • Teleglitch: Die More Edition
  • Crusader Kings II: The Old Gods
  • Crusader Kings II: Sons of Abraham
  • Crusader Kings II: Rajas of India
  • Crusader Kings II: Charlemagne
  • Magicka 2 - Signup Campaign
  • Knights of Pen and Paper 2
  • Europa Universalis IV: Mare Nostrum
  • Knights of Honor
  • Deus Vult
  • Victoria 2: A House Divided
  • Victoria 2: Heart of Darkness
Good afternoon, everyone. I’m Magne “Meneth” Skjæran, back again for another dev diary. The list of previous topics I’ve covered is getting too long to include in full, so I’ll just include some of my favorites: modding, optimization, and quality of life.
Today I’ll be covering one of those topics once more: optimization. I’ll also talk a bit about what we’ve done to improve the AI in the upcoming patch; I’ll even share the whole AI changelog, which is by far the biggest in CK2’s history.

Let’s start out with optimization. Optimization hasn’t been a focus on anywhere near the level it was in The Reaper’s Due, but with the sheer number of new provinces we’ve added in Tibet, the Tarim Basin, and the Middle East, we wanted to ensure the game wasn’t slowed down. So during development we spent some time profiling the game to identify parts that might be made faster, and have kept track during development of the average speed of the game in our overnight hands-off campaigns.

The result of this was roughly 50 changes across a variety of different systems, ranging from tiny optimizations to a few large ones. The largest, sadly, was simply fixing a performance issue introduced earlier in JD’s development, but still this resulted in a noticeable improvement over 2.7.

Here’s a small selection of the changes we made:
  • Ported HoI4's optimization to GUI focus processing
  • A few optimizations to unit map icons
  • Courtiers now only check events every 50 days instead of 20
  • Checking if minor titles need an update is now done in parallel
  • Informed the AI that we changed how decadence works years ago and it shouldn't give titles to its family members just for the hell of it
  • Unlanded characters will no longer take the "become council member" ambition
  • Added "ai_check_interval" parameter for decisions. This determines how rarely the AI checks a given decision, and can be useful for performance-heavy decisions that don't need to be checked often
  • Plot and ambition selection is now done in parallel, and applied in series
  • Raid armies now only re-evaluate where to go if they have a compelling reason, or haven't done so in a while, like regular armies
Essentially, a bunch of small changes, including some increased parallelization.
On top of this, we also made a few changes to avoid unnecessary characters getting generated:
  • Restricted a few events/decisions that would generate characters to playable characters, and one to non-mercenaries only
  • Improved PopulateCourt so that more characters than necessary aren't generated, by better counting councilors, counting existing concubines, and ensuring only AI characters that would want to marry generate marriage candidates
  • Characters currently in hiding or prison can no longer impregnate women, who were already excluded from impregnation if they were in hiding or prison
  • Made AI baron generation try to find an appropriate character in court first; only if that fails is a new character generated
  • Fixed naval mercs generating sub-unit commanders
As a result, despite the significant number of provinces 2.8 adds, and the extra characters arriving from China, the game now plateaus at a similar level to 2.7:
upload_2017-10-16_12-0-37.png

For comparison, here’s a similar graph from Reaper’s Due:

Sadly I don’t have a similar chart from MnM. To the best of my knowledge, in MnM it would look very similar to JD’s chart.

There’s been a bunch of other minor changes between what I’ve listed above, but they’re too many and too technical to be especially interesting.
Overall, in our tests, these changes combined have resulted in the first decade of the game being 8 to 16% faster than 2.7. As you can tell, this varies some by PC, but every single machine we tested it on ran faster in 2.8 than 2.7. Note that as our main goal was simply to ensure that no slowdown had occurred, we only have precise metrics for the first decade, though our overnight tests indicate that roughly the same result holds through for long-term performance as well.
We’ve also taken a few steps to reduce memory use a little, though we don’t expect this to be noticeable except perhaps for those on machines with very little RAM.

Now, let’s move onto the AI. The CK2 AI has always had a few idiosyncrasies, though the character-based nature of the game means that this doesn’t hurt the game experience as much as it might in other games, since human beings doing silly stuff is quite normal. However, some areas can be frustrating even with that taken into account, such as troop movements, and the AI having little regard for border gore when handing out titles.
In 2.8 we’ve therefore spent quite a bit of time on various parts of the AI. Without further ado, here’s the full AI changelog for 2.8:
- Fixed one way AI characters that should have AI could end up with no AI
- The AI now actually considers the idea of sending its army to a province if its friends are there or adjacent, even if the province is otherwise a bit boring
- The AI now actually realizes that friendly armies standing near a potential target is a good thing even if it doesn't personally own those armies
- Once the AI gets to its allies it won't decide that if it can't attach due to supply, it is better for everyone if it just packs its bags and goes home. Instead it will now try to stick close
- The AI is now vaguely aware of the existence of tribal vassals when evaluating whether a faction has a real chance of succeeding
- The AI now checks to see exactly how many liege levies it'll deny its liege by revolting, rather than going "eh, half my levies I guess?"
- The AI now takes tribal vassals into account in most decisions where it considers how strong a potential enemy or ally is, rather than simply pretending they don't exist
- Fixed aggression from ambitions having 20 times as big an effect as intended
- AI will now also call allies to arms if the estimated answer is a "maybe," to force them into making a decision.
- Raiding adventurers now realize once they've been settled that maybe, just maybe, they should consider their new realm their base of army operations, and return armies there when they're not up to anything
- AI: Should be snappier to evaluate settlement decisions when needed
- If defensive pacts are disabled, the AI will no longer think no one could possibly be a threat to it
- AI: Made the Pope less reluctant to accept requests for excommunication
- AI (Conclave): Will never pick Heritage or Faith Focuses for children of the right culture and religion
- Tributaries are now always aware that their tributary relationship benefits their suzerain more than them, and that they could potentially break free
- The AI no longer gets increasingly reckless the more "rational" it is; being enlightened by your intelligence turns out not to make your troops any better
- The army AI no longer thinks that just because two destinations are pretty much equally good, it should switch back and forth between the two and thus never get anywhere
- The army AI now understands that if it has bothered to start a siege, maybe there was a good reason to do so, so we shouldn't just run off right after just because another destination looks very slightly better
- Taught the AI that more loot means a province is a better target for looting
- The army looter AI now actually realizes that if all the loot in a province is protected by holdings and the army isn't big enough to siege them, it isn't actually a good loot target
- The AI now considers any strong realm nearby a potential threat
- Taught vassals how to send alliance offers to other vassals
- Informed the AI that we changed how decadence works years ago and it shouldn't give titles to its family members just for the hell of it
- Told the AI that if it is the attacker in a war, it *might* be a good idea to actually go attack the defender even if you're targeting their whole realm rather than a specific title within it, and it is a bit of a long walk
- The AI has learned how to spell, and no longer look for "soceities" missions when they're actually called "societies" missions. With this newfound ability to spell, the AI is better at identifying mission targets
- Taught nomads that if they rise in revolt in response to an attempt to split their clan, maybe they should accept it next time rather than rise again and again
- The AI is no longer deathly afraid of going overseas to help its allies just because the enemy is a bit far away
- The AI no longer thinks that just because a province is *someone*'s capital, it's a good target; it is now more discerning and only cares if it is the capital of an enemy
- The AI is now a bit more aware of just how superior heavy cavalry is to light infantry
- The AI now no longer thinks that enemy armies adjacent to other enemy armies are just on vacation, and won't help out if it were to attack
- Gave the AI a crash course in how to hand out titles
- Gave the AI a crash course in how to transfer vassals in a way that won't make you want to claw your eyes out
- The AI now realizes that just because it has occupied everything it borders, it shouldn't skip out on occupying the non-bordering stuff
- Taught the AI a few things about how supply works, and why a doomstack isn't always the best way to deal with it while travelling to its destination. The AI is hard of hearing, so it only partially understood this lesson, but partial understanding beats no understanding, right?
- Taught the Pope Geography 101, with an emphasis on what "distance from Catholicism" and "size of kingdom" means in the context of Crusades, and why this means that invading India when Egypt is right there might be a bad idea
- Informed the AI that just because their ideal commander can't lead troops right now, doesn't mean they should just skip assigning a commander to the flank they wanted to assign that commander to
- The AI now realizes that once it is landed, it should base its army in its capital rather than have it stand in the middle of nowhere, taking attrition, just because it happened to spawn in the middle of nowhere many years ago
- Betrothed men no longer go "nah, can't fulfill this betrothal" after sending a marriage offer which you accidentally reject. They will also no longer decide to not bother to resend the offer while mumbling "let's see how *they* like being ignored"
- Told just-spawned raiding adventurers "hey, your fleet is right over there" so that they wouldn't disband instantly when spawning on an island with no good raid targets, due to thinking that getting across the sea is simply impossible
- Members of small reformed religions are now a bit more fond of joining Great Holy Wars and the like
- The AI has finally come to the realization that it is allowed to invite its own vassals and courtiers to plots, not just the vassals and courtiers of the target

Shortly put, this fixes some of the more blatant mistakes the military AI would make, though I’m sure there’s still some left; I’ve personally still observed a few AI loops where the AI will start and stop moving every day, but sadly that wasn’t reproducible from save and thus couldn’t be fixed. It should be a bit more committed to its actions now, and better at figuring out where it should actually be going.
Beyond that, the AI is now much better at handing out titles and transferring vassals. For the hand-out part, it tries to avoid making existing vassals stronger, instead preferring to create new ones, and tries to maintain its culture and religion if reasonably possible, as well as strengthening its dynasty. For vassal transfers, it now tries to give it to adjacent vassals so that sub-vassals don’t end up scattered all over their realm. Inheritance will still lead to that kind of thing, but that’s historical, so not something we consider much of an issue.
There’s been a number of other tweaks, but one I think people will be especially glad to hear of: the Pope should no longer be calling random crusades for India when he’s got targets much closer at hand.

That’s all for today. If you’ve got any questions, feel free to ask them in the thread.
 
Last edited:

Meneth

Crusader Kings 3 Programmer
129 Badges
Feb 9, 2011
10.020
4.452
www.paradoxwikis.com
  • Europa Universalis IV: Common Sense
  • Crusader Kings II: Holy Knight (pre-order)
  • Crusader Kings II
  • Crusader Kings II: Sword of Islam
  • Crusader Kings II: Legacy of Rome
  • Crusader Kings II: Sunset Invasion
  • Crusader Kings II: The Republic
  • 500k Club
  • Hearts of Iron IV: Cadet
  • Hearts of Iron IV: Colonel
  • Europa Universalis IV: El Dorado
  • Europa Universalis IV: Cradle of Civilization
  • Magicka: Wizard Wars Founder Wizard
  • Mount & Blade: Warband
  • Mount & Blade: With Fire and Sword
  • Crusader Kings II: Way of Life
  • Stellaris: Digital Anniversary Edition
  • Hearts of Iron IV: Field Marshal
  • Age of Wonders III
  • Crusader Kings II: Conclave
  • Hearts of Iron IV: Death or Dishonor
  • Stellaris: Galaxy Edition
  • Surviving Mars
  • Hearts of Iron IV Sign-up
  • Stellaris Sign-up
  • Crusader Kings II: Reapers Due
  • Crusader Kings Complete
  • Steel Division: Normand 44 Sign-up
  • Hearts of Iron IV: Expansion Pass
  • Hearts of Iron IV: Expansion Pass
  • Cities: Skylines - Parklife
  • Prison Architect
  • Stellaris: Leviathans Story Pack
  • Europa Universalis III Complete
  • Europa Universalis IV: Mandate of Heaven
  • Europa Universalis III Complete
  • Europa Universalis IV: Rule Britannia
  • Teleglitch: Die More Edition
  • Crusader Kings II: The Old Gods
  • Crusader Kings II: Sons of Abraham
  • Crusader Kings II: Rajas of India
  • Crusader Kings II: Charlemagne
  • Magicka 2 - Signup Campaign
  • Knights of Pen and Paper 2
  • Europa Universalis IV: Mare Nostrum
  • Knights of Honor
  • Deus Vult
  • Victoria 2: A House Divided
  • Victoria 2: Heart of Darkness
Is the new patch gonna increase multiplayer stability?
We've fixed a number of old MP issues, but we've doubtlessly introduced new ones too. It's seemed reasonably stable in our internal MP, but we've had out of syncs from time to time too (though we play with more aggressive out of sync detection than the release version has).
As far as I can tell it shouldn't be any worse than the current release at least, and is probably better now, but with MP it's difficult to know for sure.
 

Me_

Myself
67 Badges
Jan 14, 2011
8.231
5.444
  • Crusader Kings II
  • Europa Universalis IV: Third Rome
  • Europa Universalis IV: Mare Nostrum
  • Europa Universalis IV: Pre-order
  • Crusader Kings II: Jade Dragon
  • Victoria 2: Heart of Darkness
  • Victoria 2: A House Divided
  • Sengoku
  • Semper Fi
  • Europa Universalis: Rome
  • Europa Universalis IV: Res Publica
  • Hearts of Iron III Collection
  • Hearts of Iron III: Their Finest Hour
  • Hearts of Iron III
  • For the Motherland
  • Europa Universalis IV: Wealth of Nations
  • Crusader Kings II: Legacy of Rome
  • Crusader Kings II: Charlemagne
  • Crusader Kings II: The Old Gods
  • Crusader Kings II: Rajas of India
  • Crusader Kings II: The Republic
  • Europa Universalis IV: Call to arms event
  • Crusader Kings II: Sons of Abraham
  • Crusader Kings II: Sunset Invasion
  • Crusader Kings II: Sword of Islam
  • Europa Universalis III
  • Europa Universalis III: Chronicles
  • Europa Universalis IV: Art of War
  • Europa Universalis IV: Conquest of Paradise
  • Europa Universalis IV: Cradle of Civilization
  • Hearts of Iron IV: Cadet
  • Stellaris Sign-up
  • Crusader Kings II: Reapers Due
  • Europa Universalis IV: Rights of Man
  • Stellaris: Digital Anniversary Edition
  • Stellaris: Leviathans Story Pack
  • Stellaris: Lithoids
  • Stellaris - Path to Destruction bundle
  • Europa Universalis IV: Mandate of Heaven
  • Hearts of Iron IV 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
  • Europa Universalis IV: El Dorado
  • 500k Club
  • Warlock: Master of the Arcane
I wonder about this change:
AI (Conclave): Will never pick Heritage or Faith Focuses for children of the right culture and religion
Should it really never chose Faith? I thought Faith is also decent if one wants to develop Learning for the child.
 

kmh42

General
47 Badges
Apr 13, 2014
2.311
1.274
  • Crusader Kings II
  • Europa Universalis IV: Mare Nostrum
  • Europa Universalis IV: Pre-order
  • Europa Universalis IV: Res Publica
  • Magicka
  • Leviathan: Warships
  • 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 III
  • Crusader Kings II: Sword of Islam
  • Crusader Kings II: Sunset Invasion
  • 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
  • Dungeonland
  • Crusader Kings II: Charlemagne
  • Europa Universalis IV: Rights of Man
  • Crusader Kings III
  • Crusader Kings II: Monks and Mystics
  • Europa Universalis IV: Mandate of Heaven
  • Europa Universalis IV: Cradle of Civilization
  • Europa Universalis IV: Rule Britannia
  • Crusader Kings II: Holy Fury Pre-order
  • Europa Universalis IV: Dharma
  • Crusader Kings II: Holy Fury
  • Europa Universalis IV: Golden Century
  • Imperator: Rome Deluxe Edition
  • Imperator: Rome
  • 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
  • Europa Universalis IV: El Dorado
  • War of the Roses
  • Warlock: Master of the Arcane
  • The Showdown Effect
  • Europa Universalis IV: Third Rome
  • Crusader Kings II: Jade Dragon
Beyond that, the AI is now much better at handing out titles and transferring vassals. For the hand-out part, it tries to avoid making existing vassals stronger, instead preferring to create new ones, and tries to maintain its culture and religion if reasonably possible, as well as strengthening its dynasty. For vassal transfers, it now tries to give it to adjacent vassals so that sub-vassals don’t end up scattered all over their realm.
Finally! I hope this work as intendet. I will test the sh*t out of this.
the Pope should no longer be calling random crusades for India when he’s got targets much closer at hand.
LOL! We will see if this problem finally is fixed.

Thx for this interesting dev diary and keep up the good work.
 

Silversweeeper

Lawful Evil Overlord
55 Badges
Aug 24, 2012
3.354
1.876
  • Crusader Kings II: Monks and Mystics
  • Crusader Kings II: Horse Lords
  • Europa Universalis IV: Cossacks
  • Crusader Kings II: Conclave
  • Stellaris
  • Stellaris: Galaxy Edition
  • Stellaris: Galaxy Edition
  • Crusader Kings II: Reapers Due
  • Europa Universalis IV: Rights of Man
  • Stellaris: Digital Anniversary Edition
  • Stellaris: Leviathans Story Pack
  • Europa Universalis IV: Common Sense
  • Stellaris - Path to Destruction bundle
  • Europa Universalis IV: Mandate of Heaven
  • Europa Universalis IV: Cradle of Civilization
  • Stellaris: Humanoids Species Pack
  • Stellaris: Apocalypse
  • Stellaris: Distant Stars
  • Stellaris: Megacorp
  • Crusader Kings II: Holy Fury
  • Imperator: Rome Deluxe Edition
  • Stellaris: Ancient Relics
  • Imperator: Rome Sign Up
  • Crusader Kings II: Way of Life
  • Magicka: Wizard Wars Founder Wizard
  • Europa Universalis IV: El Dorado
  • 500k Club
  • Europa Universalis III Complete
  • Pillars of Eternity
  • Europa Universalis III Complete
  • Stellaris: Lithoids
  • Europa Universalis IV: Mare Nostrum
  • Crusader Kings II: Charlemagne
  • Stellaris Sign-up
  • Europa Universalis IV: Third Rome
  • Europa Universalis IV: Res Publica
  • 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 III Complete
  • Magicka
  • Europa Universalis III
  • Europa Universalis IV: Call to arms event
  • Europa Universalis IV: Wealth of Nations
Nice! A few questions:

- Regarding the checking of strength from vassals that can be called, does this work for all governments with vassal CTA or just tribal_government?

- Has there been any changes to raiding adventurers being able to march all the way to e.g. Rome or Constantinople without anyone on the way figuring that they should stop them because the raiding adventurers never bothered to stop to loot a province on the way?

- How does the AI evaluate whether a strong nearby realm is a threat? Relative levies + retinues + standing mercs/event troops? Relative levies + retinues + standing mercs/event troops + allies + tribal vassals? Realm size? Something else?

- Regarding the AI now understanding that HC beats LI, does it also understand the relative strength of other unit types?

- Regarding Papal Geography 101, has the Pope (and other rel heads) also gotten Papal Holding Types 101 and been taught that picking some place with castles and cities beats attacking random tribes and that taking unsettled land in the steppes is something to be done after the rest of the world has been secured?
 

sreckom92

Field Marshal
11 Badges
Dec 17, 2012
3.683
5.223
  • Crusader Kings II
  • Crusader Kings III
  • Crusader Kings III: Royal Edition
  • 500k Club

Keitaro_Ura

Sergeant
22 Badges
Nov 5, 2015
51
25
  • Crusader Kings II: Sons of Abraham
  • Crusader Kings II
  • Crusader Kings II: Way of Life
  • Crusader Kings II: Holy Fury
  • Crusader Kings II: Holy Fury Pre-order
  • Crusader Kings II: Jade Dragon
  • Crusader Kings II: Monks and Mystics
  • Tyranny: Archon Edition
  • Crusader Kings II: Reapers Due
  • Hearts of Iron IV: Cadet
  • Stellaris
  • Crusader Kings II: Conclave
  • Crusader Kings II: Horse Lords
  • Magicka
  • Crusader Kings II: Sword of Islam
  • Crusader Kings II: Sunset Invasion
  • Crusader Kings II: The Republic
  • Crusader Kings II: Rajas of India
  • Crusader Kings II: The Old Gods
  • Crusader Kings II: Legacy of Rome
  • Crusader Kings II: Charlemagne
I've wanted to have some of those issues corrected for a long time, so thanks !

With those AI improvements, will we see less realms breaking (which is sometimes a good thing for variety) ?

Can't wait to see how the AI plays now :)
 

Oorlog

Lt. General
99 Badges
May 28, 2004
1.308
174
  • Crusader Kings II: Holy Knight (pre-order)
  • Crusader Kings III: Royal Edition
  • Heir to the Throne
  • Crusader Kings III
  • Crusader Kings II
I hope this means, apart from crusade targets being more sensible, that crusade and jihad armies (and overall armies) will also show more cohesion in that there is one or more big stacks upto supply limit with other smaller ones nearby, instead of just haphazardly sieging down counties while the enemy picks them of one stack at a time?
 

Harald Fairhair

Captain
1 Badges
Feb 8, 2015
498
171
  • Crusader Kings II
Will the AI offer Alliance more? I often found the AI sometimes a bit imcompetent inn creating Alliance. Like the Asturias who often gets eaten up because they are unable to form Alliance with France, Italy or their strong vassals to compete against a stronger power of Umayyad.
 

Meneth

Crusader Kings 3 Programmer
129 Badges
Feb 9, 2011
10.020
4.452
www.paradoxwikis.com
  • Europa Universalis IV: Common Sense
  • Crusader Kings II: Holy Knight (pre-order)
  • Crusader Kings II
  • Crusader Kings II: Sword of Islam
  • Crusader Kings II: Legacy of Rome
  • Crusader Kings II: Sunset Invasion
  • Crusader Kings II: The Republic
  • 500k Club
  • Hearts of Iron IV: Cadet
  • Hearts of Iron IV: Colonel
  • Europa Universalis IV: El Dorado
  • Europa Universalis IV: Cradle of Civilization
  • Magicka: Wizard Wars Founder Wizard
  • Mount & Blade: Warband
  • Mount & Blade: With Fire and Sword
  • Crusader Kings II: Way of Life
  • Stellaris: Digital Anniversary Edition
  • Hearts of Iron IV: Field Marshal
  • Age of Wonders III
  • Crusader Kings II: Conclave
  • Hearts of Iron IV: Death or Dishonor
  • Stellaris: Galaxy Edition
  • Surviving Mars
  • Hearts of Iron IV Sign-up
  • Stellaris Sign-up
  • Crusader Kings II: Reapers Due
  • Crusader Kings Complete
  • Steel Division: Normand 44 Sign-up
  • Hearts of Iron IV: Expansion Pass
  • Hearts of Iron IV: Expansion Pass
  • Cities: Skylines - Parklife
  • Prison Architect
  • Stellaris: Leviathans Story Pack
  • Europa Universalis III Complete
  • Europa Universalis IV: Mandate of Heaven
  • Europa Universalis III Complete
  • Europa Universalis IV: Rule Britannia
  • Teleglitch: Die More Edition
  • Crusader Kings II: The Old Gods
  • Crusader Kings II: Sons of Abraham
  • Crusader Kings II: Rajas of India
  • Crusader Kings II: Charlemagne
  • Magicka 2 - Signup Campaign
  • Knights of Pen and Paper 2
  • Europa Universalis IV: Mare Nostrum
  • Knights of Honor
  • Deus Vult
  • Victoria 2: A House Divided
  • Victoria 2: Heart of Darkness
Nice! A few questions:
- Regarding the checking of strength from vassals that can be called, does this work for all governments with vassal CTA or just tribal_government?
- Has there been any changes to raiding adventurers being able to march all the way to e.g. Rome or Constantinople without anyone on the way figuring that they should stop them because the raiding adventurers never bothered to stop to loot a province on the way?
- How does the AI evaluate whether a strong nearby realm is a threat? Relative levies + retinues + standing mercs/event troops? Relative levies + retinues + standing mercs/event troops + allies + tribal vassals? Realm size? Something else?
- Regarding the AI now understanding that HC beats LI, does it also understand the relative strength of other unit types?
- Regarding Papal Geography 101, has the Pope (and other rel heads) also gotten Papal Holding Types 101 and been taught that picking some place with castles and cities beats attacking random tribes and that taking unsettled land in the steppes is something to be done after the rest of the world has been secured?
1. All, yes.
2. No
3. The first, yes, plus tribal vassals
4. It always sorta understood it, but it normalized things some which reduced the strength ratio. E.G., if unit 1 is 4 times as strong as unit 2, it'd consider it something like twice as strong. Now it is much closer to 4. So that'll affect all unit types, yes. Note that the AI still isn't aware of how powerful some tactics are though, so units that heavily lean towards a single unit type will still be underestimated; just not as badly as before
5. It takes size into account now, meaning # of holdings (with a bit of influence from empty slots), so for realms that are roughly as distant it'll prefer the heavily settled one. It doesn't specifically check for tribes and steppes though

With those AI improvements, will we see less realms breaking (which is sometimes a good thing for variety) ?
Shouldn't affect it too much, not directly at least.
I hope this means, apart from crusade targets being more sensible, that crusade and jihad armies (and overall armies) will also show more cohesion in that there is one or more big stacks upto supply limit with other smaller ones nearby, instead of just haphazardly sieging down counties while the enemy picks them of one stack at a time?
They should be somewhat more coordinated now due to some of the other changes in the list, yeah.

Will the AI offer Alliance more? I often found the AI sometimes a bit imcompetent inn creating Alliance. Like the Asturias who often gets eaten up because they are unable to form Alliance with France, Italy or their strong vassals to compete against a stronger power of Umayyad.
We haven't changed how external alliances are handled. The AI will offer alliances to other vassals far more often than it used to though.
 

Jorlem

Field Marshal
108 Badges
May 9, 2012
4.434
3.561
  • Hearts of Iron IV: Expansion Pass
  • Crusader Kings III
  • 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
  • Dungeonland
  • Europa Universalis III
  • Europa Universalis III Complete
  • Europa Universalis III Complete
  • The Showdown Effect
  • War of the Roses
  • 500k Club
  • Europa Universalis IV: El Dorado
  • Crusader Kings II: Way of Life
  • Humble Paradox Bundle
  • Crusader Kings II: Horse Lords
  • Crusader Kings II: Conclave
  • Stellaris
  • Stellaris: Galaxy Edition
  • Hearts of Iron IV Sign-up
  • Stellaris Sign-up
  • Hearts of Iron IV: Cadet
  • Hearts of Iron IV: Colonel
  • Hearts of Iron IV: Field Marshal
  • Europa Universalis IV: Rights of Man
  • Tyranny: Archon Edition
  • Stellaris: Digital Anniversary Edition
  • Stellaris: Leviathans Story Pack
  • Europa Universalis IV: Mandate of Heaven
  • Surviving Mars
  • Hearts of Iron IV: Death or Dishonor
  • Tyranny - Bastards Wound
  • Europa Universalis IV: Cradle of Civilization
  • Hearts of Iron IV: Expansion Pass
  • Stellaris: Humanoids Species Pack
  • Stellaris: Apocalypse
  • Europa Universalis IV: Rule Britannia
  • Cities: Skylines - Parklife
  • Crusader Kings II: Holy Fury Pre-order
  • Stellaris: Distant Stars
  • Europa Universalis IV: Dharma
  • Shadowrun Returns
  • Surviving Mars: First Colony Edition
Just copying the changelog into a spoiler box instead of a code box, so lines will wrap around instead of needing to scroll right and left to read each line. (Also it makes it easier to read on mobile.

- Fixed one way AI characters that should have AI could end up with no AI
- The AI now actually considers the idea of sending its army to a province if its friends are there or adjacent, even if the province is otherwise a bit boring
- The AI now actually realizes that friendly armies standing near a potential target is a good thing even if it doesn't personally own those armies
- Once the AI gets to its allies it won't decide that if it can't attach due to supply, it is better for everyone if it just packs its bags and goes home. Instead it will now try to stick close
- The AI is now vaguely aware of the existence of tribal vassals when evaluating whether a faction has a real chance of succeeding
- The AI now checks to see exactly how many liege levies it'll deny its liege by revolting, rather than going "eh, half my levies I guess?"
- The AI now takes tribal vassals into account in most decisions where it considers how strong a potential enemy or ally is, rather than simply pretending they don't exist
- Fixed aggression from ambitions having 20 times as big an effect as intended
- AI will now also call allies to arms if the estimated answer is a "maybe," to force them into making a decision.
- Raiding adventurers now realize once they've been settled that maybe, just maybe, they should consider their new realm their base of army operations, and return armies there when they're not up to anything
- AI: Should be snappier to evaluate settlement decisions when needed
- If defensive pacts are disabled, the AI will no longer think no one could possibly be a threat to it
- AI: Made the Pope less reluctant to accept requests for excommunication
- AI (Conclave): Will never pick Heritage or Faith Focuses for children of the right culture and religion
- Tributaries are now always aware that their tributary relationship benefits their suzerain more than them, and that they could potentially break free
- The AI no longer gets increasingly reckless the more "rational" it is; being enlightened by your intelligence turns out not to make your troops any better
- The army AI no longer thinks that just because two destinations are pretty much equally good, it should switch back and forth between the two and thus never get anywhere
- The army AI now understands that if it has bothered to start a siege, maybe there was a good reason to do so, so we shouldn't just run off right after just because another destination looks very slightly better
- Taught the AI that more loot means a province is a better target for looting
- The army looter AI now actually realizes that if all the loot in a province is protected by holdings and the army isn't big enough to siege them, it isn't actually a good loot target
- The AI now considers any strong realm nearby a potential threat
- Taught vassals how to send alliance offers to other vassals
- Informed the AI that we changed how decadence works years ago and it shouldn't give titles to its family members just for the hell of it
- Told the AI that if it is the attacker in a war, it *might* be a good idea to actually go attack the defender even if you're targeting their whole realm rather than a specific title within it, and it is a bit of a long walk
- The AI has learned how to spell, and no longer look for "soceities" missions when they're actually called "societies" missions. With this newfound ability to spell, the AI is better at identifying mission targets
- Taught nomads that if they rise in revolt in response to an attempt to split their clan, maybe they should accept it next time rather than rise again and again
- The AI is no longer deathly afraid of going overseas to help its allies just because the enemy is a bit far away
- The AI no longer thinks that just because a province is *someone*'s capital, it's a good target; it is now more discerning and only cares if it is the capital of an enemy
- The AI is now a bit more aware of just how superior heavy cavalry is to light infantry
- The AI now no longer thinks that enemy armies adjacent to other enemy armies are just on vacation, and won't help out if it were to attack
- Gave the AI a crash course in how to hand out titles
- Gave the AI a crash course in how to transfer vassals in a way that won't make you want to claw your eyes out
- The AI now realizes that just because it has occupied everything it borders, it shouldn't skip out on occupying the non-bordering stuff
- Taught the AI a few things about how supply works, and why a doomstack isn't always the best way to deal with it while travelling to its destination. The AI is hard of hearing, so it only partially understood this lesson, but partial understanding beats no understanding, right?
- Taught the Pope Geography 101, with an emphasis on what "distance from Catholicism" and "size of kingdom" means in the context of Crusades, and why this means that invading India when Egypt is right there might be a bad idea
- Informed the AI that just because their ideal commander can't lead troops right now, doesn't mean they should just skip assigning a commander to the flank they wanted to assign that commander to
- The AI now realizes that once it is landed, it should base its army in its capital rather than have it stand in the middle of nowhere, taking attrition, just because it happened to spawn in the middle of nowhere many years ago
- Betrothed men no longer go "nah, can't fulfill this betrothal" after sending a marriage offer which you accidentally reject. They will also no longer decide to not bother to resend the offer while mumbling "let's see how *they* like being ignored"
- Told just-spawned raiding adventurers "hey, your fleet is right over there" so that they wouldn't disband instantly when spawning on an island with no good raid targets, due to thinking that getting across the sea is simply impossible
- Members of small reformed religions are now a bit more fond of joining Great Holy Wars and the like
- The AI has finally come to the realization that it is allowed to invite its own vassals and courtiers to plots, not just the vassals and courtiers of the target
 

King Anund

King of Navarra
71 Badges
Oct 5, 2012
773
909
  • Crusader Kings III
  • Crusader Kings II
  • Crusader Kings II: Sword of Islam
  • Crusader Kings II: Legacy of Rome
  • Crusader Kings II: The Republic
  • Crusader Kings II: Sunset Invasion
  • Crusader Kings II: The Old Gods
  • Crusader Kings II: Sons of Abraham
  • Crusader Kings II: Rajas of India
  • Crusader Kings II: Charlemagne
  • Crusader Kings II: Way of Life
  • Crusader Kings II: Conclave
  • Crusader Kings II: Horse Lords
  • Crusader Kings II: Reapers Due
  • Crusader Kings II: Monks and Mystics
  • Crusader Kings II: Jade Dragon
  • Crusader Kings II: Holy Fury Pre-order
  • Crusader Kings II: Holy Fury
  • Crusader Kings Complete
  • Europa Universalis IV: Call to arms event
  • Stellaris
  • Stellaris: Galaxy Edition
  • Hearts of Iron IV: Cadet
  • Imperator: Rome
  • Victoria 2
  • Europa Universalis IV: Rights of Man
  • Europa Universalis IV: Golden Century
  • Hearts of Iron IV Sign-up
  • Mount & Blade: With Fire and Sword
  • Pillars of Eternity
  • Europa Universalis IV: Common Sense
  • Europa Universalis III: Collection
  • Europa Universalis IV: Cossacks
  • Cities: Skylines
  • Tyranny: Archon Edition
  • Europa Universalis IV: Mandate of Heaven
  • Europa Universalis IV: Cradle of Civilization
  • Europa Universalis IV: Rule Britannia
  • Europa Universalis IV: Dharma
  • War of the Vikings
  • Knights of Honor
  • King Arthur II
  • The Kings Crusade
  • Victoria 2: A House Divided
  • Europa Universalis III
  • Victoria 2: Heart of Darkness
  • Divine Wind
  • For the Motherland
  • Europa Universalis IV: Mare Nostrum
- AI: Made the Pope less reluctant to accept requests for excommunication
Why? He does not excommunicate almost anyone. Also the effects of exommunication are pretty minor compared to what it was.
 

Balesir

AoD's Old Geezer
138 Badges
Dec 23, 2005
2.658
469
  • Europa Universalis IV: Res Publica
  • For The Glory
  • For the Motherland
  • Hearts of Iron III
  • Hearts of Iron III: Their Finest Hour
  • Heir to the Throne
  • Impire
  • Europa Universalis III Complete
  • Iron Cross
  • Magicka
  • Majesty 2
  • March of the Eagles
  • Europa Universalis III Complete
  • Europa Universalis IV: Call to arms event
  • Victoria: Revolutions
  • Europa Universalis: Rome
  • Rome Gold
  • Semper Fi
  • Sengoku
  • Sword of the Stars
  • Sword of the Stars II
  • Supreme Ruler 2020
  • Supreme Ruler: Cold War
  • Victoria 2
  • Victoria 2: A House Divided
  • Crusader Kings III: Royal Edition
  • Crusader Kings II: Sword of Islam
  • Hearts of Iron Anthology
  • Arsenal of Democracy
  • 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
  • Commander: Conquest of the Americas
  • Darkest Hour
  • Deus Vult
  • Diplomacy
  • East India Company
  • Europa Universalis III
  • Europa Universalis III Complete
  • Divine Wind
  • Europa Universalis IV: Art of War
  • Europa Universalis IV: Conquest of Paradise
Stability and Optimization are always welcome.
In general, I agree with this - but be careful with the "always". As an old programming joke says:

- No matter how efficient a program, there is always a way to make it just a little bit tighter on the machine code level.

- No matter how many bugs are squashed, there will always be at least one left in the program.

The logical extension of these two principles is that any program can be reduced to a single instruction that doesn't work...
 

Silversweeeper

Lawful Evil Overlord
55 Badges
Aug 24, 2012
3.354
1.876
  • Crusader Kings II: Monks and Mystics
  • Crusader Kings II: Horse Lords
  • Europa Universalis IV: Cossacks
  • Crusader Kings II: Conclave
  • Stellaris
  • Stellaris: Galaxy Edition
  • Stellaris: Galaxy Edition
  • Crusader Kings II: Reapers Due
  • Europa Universalis IV: Rights of Man
  • Stellaris: Digital Anniversary Edition
  • Stellaris: Leviathans Story Pack
  • Europa Universalis IV: Common Sense
  • Stellaris - Path to Destruction bundle
  • Europa Universalis IV: Mandate of Heaven
  • Europa Universalis IV: Cradle of Civilization
  • Stellaris: Humanoids Species Pack
  • Stellaris: Apocalypse
  • Stellaris: Distant Stars
  • Stellaris: Megacorp
  • Crusader Kings II: Holy Fury
  • Imperator: Rome Deluxe Edition
  • Stellaris: Ancient Relics
  • Imperator: Rome Sign Up
  • Crusader Kings II: Way of Life
  • Magicka: Wizard Wars Founder Wizard
  • Europa Universalis IV: El Dorado
  • 500k Club
  • Europa Universalis III Complete
  • Pillars of Eternity
  • Europa Universalis III Complete
  • Stellaris: Lithoids
  • Europa Universalis IV: Mare Nostrum
  • Crusader Kings II: Charlemagne
  • Stellaris Sign-up
  • Europa Universalis IV: Third Rome
  • Europa Universalis IV: Res Publica
  • 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 III Complete
  • Magicka
  • Europa Universalis III
  • Europa Universalis IV: Call to arms event
  • Europa Universalis IV: Wealth of Nations
1. All, yes.
2. No
3. The first, yes, plus tribal vassals
4. It always sorta understood it, but it normalized things some which reduced the strength ratio. E.G., if unit 1 is 4 times as strong as unit 2, it'd consider it something like twice as strong. Now it is much closer to 4. So that'll affect all unit types, yes. Note that the AI still isn't aware of how powerful some tactics are though, so units that heavily lean towards a single unit type will still be underestimated; just not as badly as before
5. It takes size into account now, meaning # of holdings (with a bit of influence from empty slots), so for realms that are roughly as distant it'll prefer the heavily settled one. It doesn't specifically check for tribes and steppes though
1. Nice! That should make modding in vassal CTAs for various other governments less likely to result in the AI getting a case of the stupid and declaring suicidal wars.
2. Ah, well; I suppose modding it is back on the table...
3. Seems like a reasonable judgement when looking at the strength of a realm (I assume "tribal vassals" translates to "vassals that can be called into wars" if you add that mechanic to other government types?) to determine if it is a threat (I assume allies still are checked before the AI considers declaring war on the realm?).
4. Sounds like it at least will be somewhat better at figuring that charging a slightly smaller number of elite troops with rabble isn't going to work out for it, which is an improvement.
5. Preferring a heavily settled realm sounds reasonable. Specifically checking for holding type probably is unnecessary unless empty holdings influence the matter to such an extent that a nearly empty nomadic kingdom with a couple more potential holdings is more attractive to target...
 

TheDungen

Field Marshal
74 Badges
Jan 31, 2015
11.763
7.211
  • Crusader Kings II: Jade Dragon
  • Stellaris: Galaxy Edition
  • Europa Universalis IV: Mare Nostrum
  • Cities: Skylines - After Dark
  • Europa Universalis IV: Common Sense
  • Crusader Kings II: Conclave
  • Cities: Skylines
  • Europa Universalis IV: El Dorado
  • Magicka: Wizard Wars Founder Wizard
  • Crusader Kings II: Way of Life
  • Pillars of Eternity
  • Humble Paradox Bundle
  • Crusader Kings II: Horse Lords
  • War of the Roses
  • Stellaris
  • Stellaris: Galaxy Edition
  • Hearts of Iron IV: Cadet
  • Hearts of Iron IV: Colonel
  • Europa Universalis IV: Rights of Man
  • Stellaris: Digital Anniversary Edition
  • Stellaris: Leviathans Story Pack
  • Hearts of Iron IV: Together for Victory
  • Crusader Kings II: Monks and Mystics
  • Victoria 2
  • Europa Universalis IV: Rule Britannia
  • Europa Universalis IV: Dharma
  • Crusader Kings II: Holy Fury
  • Europa Universalis IV: Golden Century
  • Imperator: Rome Deluxe Edition
  • Stellaris: Ancient Relics
  • Stellaris: Lithoids
  • Imperator: Rome - Magna Graecia
  • Stellaris: Apocalypse
  • Stellaris: Humanoids Species Pack
  • Europa Universalis IV: Mandate of Heaven
  • Hearts of Iron IV: Death or Dishonor
  • Age of Wonders III
  • Age of Wonders
  • Europa Universalis IV: Cradle of Civilization
  • Teleglitch: Die More Edition
  • Hearts of Iron IV: Expansion Pass
  • Europa Universalis IV: Pre-order
  • Stellaris: Synthetic Dawn
  • Europa Universalis IV: Third Rome
  • Stellaris - Path to Destruction bundle
  • Crusader Kings II: Reapers Due
  • Cities: Skylines Deluxe Edition
  • Europa Universalis IV: Conquest of Paradise
  • Europa Universalis IV: Art of War
ll also talk a bit about what we’ve done to improve the AI in the upcoming patch; I’ll even share the whole AI changelog, which is by far the biggest in CK2’s history.
For a moment there I had flashbacks to the post "fix" stellaris and eu4 AIs which got super blobby after being "fixed".

The army looter AI now actually realizes that if all the loot in a province is protected by holdings and the army isn't big enough to siege them, it isn't actually a good loot target
Will this mean that every raider no longer beelines strait for constantinople?

Informed the AI that we changed how decadence works years ago and it shouldn't give titles to its family members just for the hell of it
I really don't get why that mechanic is still in the game. It's not fun and it's not historical. At least not in it's current warlike form. Perhaps arabs and turks should get difrrent forms of decadence? So arabs can remove decadence by more peaceful means (seeing how there was a relative peace between them and the Christians until the incursion of the turks caused the crusades) while the turks who were the warlike muslims of this era can still be warlike.