





🌟 Special thanks to our amazing supporters:
✨ $10 Tier: [Geeks Love Detail]
🌈 $5 Tier: [Arch Toasty][Benedikt][David Martínez Martí]
Welcome to this week's Dev Diary! Today I'm back to talk about some of the changes we've made to the AI for 1.34.
National Ambitions
For a long time, there has been code and script for the AI to be aware of the conditions of its missions and decisions and try to achieve some of them. But because of various issues this has not had a significant impact.
For 1.34, weve made sure the AI takes many of these conditions into account, especially those related to conquests. We also made the AI pursue cultural unification, depending on government rank. These changes will work together with the AIs more organic desires to shape its ambition and strategy. The result is an effect which is just noticeable in terms of AI behavior, but compounds over time to create AI empires - sometimes historically reminiscent - that provide a real challenge to players who continue into the late game.
We were a little worried that this might cause games to all look the same, but our hands-off overnight games look arguably even more varied than before.
Here are a bunch of recent hands-off 1821 maps, only slightly cherry-picked:
It makes us happy and proud to see the AI form historical countries such as Germany, Italy and Qing.
Typically, these AIs balance off each other nicely. If your plan as a player is to Kill Ottomans early, then chill, you may find that youve just aided some other AI in taking their place as your end-game boss. Admittedly though, a downside of this more opportunistic AI is less clean borders.
Peace Negotiation
What started out as an investigation into why AIs often left OPMs alive in peace deals, turned into a slightly bigger project.
When the AI is winning a war, and making demands, it has a bunch of preferences that it tries to balance against each other for an optimal peace deal. This is unlike when it is losing, where it will only care about objective measures such as war score cost. However, when the AI is winning, but receives an offer, it has previously relied on very coarse-grained expressions for whether the offer matches its preferences:
Objective #1: Avoid foreign territory.
Objective #2: Avoid enemy armies on home territory.
Objective #3: Avoid attrition (with a big margin if possible).
But then single-province subjects with big armies would stay and take attrition (especially if another country is also standing there), as well as when enemy armies are approaching. So the objectives were reordered:
Objective #1: Avoid enemy armies on home territory.
Objective #2: Avoid attrition (with a big margin if possible).
Objective #3: Avoid foreign territory.
And it turns out the AI knows you cant take attrition while fighting a battle So passive subjects would sometimes actively seek out enemy armies on foreign territory in order to avoid attrition!
Other
There have been a number of improvements to for example army and navy handling. This Dev Diary is already long enough, but the biggest bug worth mentioning is when the AI would just lock its armies in place near the coast, while its navy was too afraid (often irrationally) to come and pick them up. This easily caused e.g. Denmark/England/Spain not making themselves useful in wars.
Historically, many AI bugs have been caused late in the development cycle of a patch, perhaps because they often need time to be found. Right now, were quite happy with the state of the AI in our internal builds so we will try not to repeat that mistake by stirring things up before 1.34 releases.
Patch Notes
Here are roughly the AI-related patch notes so far. This is still WIP and a more final and curated list will be released in connection with the update as usual.
Buildings
- AI will now properly calculate when to construct Docks based on a multitude of factors such as sailor percentage, idea group choices, capital position and more.
- Fixed that AI sometimes deleted all forts right after a bad war.
- Fixed another case of AI deleting forts unnecessarily.
- Fixed bug that 'Conqueror' ruler personality made AI delete all/most forts.
- AI less keen to build fort in capital (though still preferred). This will somewhat reduce the fort slog in Central Europe.
Budgeting
- Changed AI budgeting algorithm to be more flexible. Fixes e.g. small CNs sometimes not colonizing when they should.
Geopolitics - Declare wars
- Fixed some cases of AI declaring war over provinces it can't/won't take.
- Made AI less likely to declare war on island nations it lacks the transports to invade.
- Fixed bug that revolutionary AI could declare war on coalition target with any cb, thinking coalition members would join.
- AI is no longer blocked from declaring independence when at war.
- Fixed bug that sometimes made aggressor AI erroneously think HRE allies would refuse to join when attacking HRE minors.
Geopolitics - Missions and Decisions
- Added AI weights to mission trees which make them now more considerate which mission they want to strive for and how much (for context related reasons).
- AI now understands and tries to achieve army_size and army_size_percent triggers in missions.
Geopolitics - Other
- Fixed bug that AI couldn't get hostile towards, and hence rarely attacked, others vassals and some other subjects.
- AI is now better at evaluating when to annex/integrate a subject.
- Fixed bug that catholic AI colonial nations avoided expanding into overlord's Tordesilla regions.
- Reduced AI avoidance of having interest in provinces that are vital to allies.
- AI Duchies are now permanently interested in provinces of their culture, Kingdoms their entire culture group, and Empires also all provinces on their border.
Peacemaking
- Fixed some issues with AI peace acceptance 'wants other concessions than gold' and 'does not want anything else', causing AI to often leave OPMs in peaces.
- Fixed bug sometimes preventing AI from taking the last enemy province.
- AI warleaders are now more happy to make separate peaces with non-cobelligerents.
- AI will unconditionally surrender in more cases.
Army
- Fixed one bug that made AI send armies far away instead of defending home.
- Made AI more likely to reinforce adjacent battles.
- Improved AI attrition handling. Should get both less attrition and less confused behavior.
- Fixed bug that AI helped allies with rebels even when at peace.
- AI overlord now treat subjects' rebels like their own in more cases.
- Fixed bug that made AI ignore flanking when evaluating battle.
- Fixed multiple cases of AI subjects being stupid when set to Passive or Defensive.
- Increased preferred size of AI armies, especially late game.
- Increased AI desire to disrupt sieges, especially with high progress.
- Improved AI logic for when to abandon sieges.
- Made AI armies prioritize coordinated offensives more.
- Made army AI try to stay close to enemy armies when it has nothing else to do.
- AI somewhat more likely to defend homeland.
- Improved AI for consolidation before battle.
- Fixed instance of AI armies going back and forth when sieging.
- AI vassals no longer delete exiled armies if they can get home.
- Fixed issues with autonomous sieging and rebel suppression missions.
- Fixed case of AI armies canceling movement every other day
Navy
- Fixed some issues with AI naval invasions.
- Made AI better at understanding when a naval invasion risks being intercepted.
- Fixed bug that made AI often unassign general when naval invading.
- Fixed yet another case of AI naval invasion stalling forever.
- Made AI fleets consider troops further away when protecting straits.
Trade Company
- Fixed bug that AI sometimes wouldn't ever core Trade Company provinces.
- AI will no longer accidentally remove trade companies by creating states.
Cheats
- Fixed bug that AI could add provinces to HRE when emperor, even if not a member.
- Fixed bug that AI could use Break Alliance for Favors diplomatic action with Leviathan disabled.
That's it for today. I hope you found this Dev Diary interesting!
Next week my colleague Pava will be showing all the new Monuments that will be added in the 1.34 Update, along with some game balance and changes we want to share and discuss with the community, coming also for free in the update.[ 6078 ]
[ 1321 ]
[ 4049 ]