Dev Diary 89: AI rework part 2, the Man-eating Androphagians and the Ides of March 1.9.2 update out now
Salvete!
Today we'll be talking about more great AI work by Anbeeld surrounding laws, national ideas and stances along with new content in a later update for the man-eating Androphagians and some more pirate content.
But first!
Happy Ides of March, the game is 70% off on Steam right now if you haven't purchased and have been waiting to check it out. Let's get player numbers up today, perhaps leave a good review if you're so inclined, and show Paradox that we still love our favorite grand strategy game.
As a reminder you can download the Imperator: Invictus mod from the following sources:
Steam workshop:
https://steamcommunity.com/sharedfiles/filedetails/?id=2532715348 (Recommended as it will auto-update, only for Steam players)
Nexusmods:
https://www.nexusmods.com/imperatorrome/mods/1?tab=files (Contains all old-versions of the mod too, does not auto-update but is available for everyone, delete your old mod before installing the new version)
Now with these ides of march,
the 1.9.2 save-compatible patch is out now containing:
Major changes:
- AI countries are now able to properly change laws. (Previously they couldn't do it at all, outside of events and alike. This especially affects Tribes who can now go down either Centralization or Decentralization)
- Implemented proper logic for state investment in AI countries and removed them ignoring the scaling gold cost
- Improved AI decision making regarding commerce economic policies.
- AI now properly bribes, gives free hands, gives out subsidies in order to prevent civil wars (they do have restrictions for roleplay purposes and to prevent them never having a civil war)
- AI now has to actually pay for character interactions like players do (AI is still far better at it than before)
- AI now has proper strategies for choosing diplomatic stances, they'll no longer swap constantly which caused them to waste Political Influence
- AI now no longer cheats to reform from being a tribe (combined with the new AI law strategy they'll still be able to reform)
- AI now has proper strategy for picking national ideas
- AI now properly performs sacrifices if they are below 50 stability (AI did not do it always before, and now they'll spend their excess Political influence on it)
- Many minor tweaks to the AI strategies introduced in the previous updates improving them even more, all thanks to Anbeeld
AI will now perform considerably better in several areas, will no longer cheat and performance remains the same.
Changes:
- New Coat of Arms, mainly for Iberians: Garmania, Oppidania, Mantasia, Lobetania, Deitania, Bardulia, Cempsia, Elbocoria, Mastia, Cynetia, Locri, Hipponion, Achola
- Made many improvements to the German translation of the mod
- Yuezhi now use the Sogdian levy template
- Military service law now only gives 7.5% levy size modifier instead of 10%
- Mercenary reliance now gives 4% levy size instead of 3.5%
- Noble retinues now give 15 cohort start experience instead of 10
- Carthage's Xanthippan Reforms law now no longer gives an extra 5 cohort start experience
- Mercantile stance now gives 20% commerce modifier instead of 25%
- Domineering stance now gives extra 25% tribute income modifier and integration speed increased to 0.35 from 0.25
- Nerfed many of Nepals modifiers and its Fiefdoms
- Italic and Puntic religious modifiers are now inline with other religions
- Forming Thessalian League now requires being of the Hellenic culture group
- Prevented tradegood events from firing for tradegoods that are not actually available in your country
- Slave revolts now properly keep track of amount of slaves that joined and are defeated
Bugfixes:
- Fixed dozens of smaller errors mainly causing error log spam
- Fixed a vanilla bug also affecting several mission trees breaking svalues (the numbers being checked in mission tasks would occasionally be wrong)
- Fixed misuse of the religious unity trigger
- Yuezhi should now always properly declare on a country when their invasion starts
- Fixed the Belgae civil war having a wrong name
- Fixed several modifiers not being actually given decide appearing in the mission task
- Fixed several spelling errors
Now onto the AI work by Anbeeld, all of which is in the update which just came out!
Filling in the missing pieces of AI
Hiya! Once again, Anbeeld there, continuing AI work described in the
previous dev diary. In this patch I worked on a number of systems one could call less significant, but together they lead to quite an impact: laws and tribal reform, diplomatic stances, state investment, character loyalty, economic policies, and more. Let’s dive into it!
Wild West? Wild Gaul!
I’ll start with a confession. Not only am I a
tall player, but I’m a
tribe player. I love to build
tribal utopias. I think
Rome is beautiful for tourism. So naturally, I appreciate tribal laws, with how many of them are there and how impactful some of them are.
But as it turns out, some players are not aware of tribal laws' existence at all. And first and foremost, I’m talking about all the AI countries in your games. This terrible realization struck me when I happened to check the law panel of various AI tribes, only to find out that it’s almost empty for all of them!
The horror didn’t end there. I started to dig deeper, and found monarchies and republics completely depending on rare occasions of laws changing in random parts of the code as their main source of directing the country’s course. This is where it became obvious to me.
Wow. There’s simply no system of AI enacting laws in the game. It doesn’t exist.
Okay. No big deal. That’s why I’m here. I’ll just create one of my own.
Being a tribe enjoyer, unsurprisingly I started with their laws, which is a joy considering how much freedom they have with changing them left and right. As I mentioned before, their law panels were almost empty – there are some events with options to change laws, which were the only source of bringing law to tribal lands, most notably the one leading to widespread disease of Adopt Human Sacrifice.
Instead of AI ignoring these events, I decided to make them part of the bigger question of choosing centralization vs decentralization. For those who don’t know, tribes can go one of these two paths with their laws, each giving completely different benefits. Centralization leads to higher civilization, more research points and eventually the ability to reform into a monarchy or republic. Decentralization is all about staying as a tribe and dragging others into the mud, thanks to levy size and morale bonuses, as well as the ability to migrate with minimal stability costs.
At the start of the game every tribe has a certain centralization value. To keep things simple, I designed their law management in a way that most of the tribes will double down on it, going negative or positive all the way depending on the starting value. There are exceptions, of course, like tribes that start with 0% centralization. These will have a chance to go either path, thanks to the law events that I mentioned earlier and events that give ticking (de)centralization modifier, bringing in an element of randomness.
As most of these laws offer quite good bonuses, on average tribes will be slightly stronger now compared to their Wild Gaul version where they had almost no laws. Good news for civilized nations is that there are barely any direct military bonuses, it’s all about internals like income, happiness, stability and so on.
Unless we are talking Steppe Horde.
Good luck for those in a way of a large horde. Until it collapses by itself, that is.
Tour de France with training wheels
As usual, such a drastic change led to even funnier things floating to the surface. Turns out, to compensate for AI tribes inability to found cities and enact laws, they had special decisions to reform into monarchy or republic with drastically lowered requirements compared to what players go through in the tribal reform mission tree. And now that they learnt to play properly, they abused it really hard.
Snowlet, the lead of the Invictus team, seemed somewhat unhappy about tribes mass reforming barely 100 years into the game. I love this guy, but he’s such a cold ice and constantly stops me from turning the game into Stellaris 2! Ugh.
So I fixed the issue by forcing the AI to meet all the same requirements as players do to reform the tribe, including stuff like ruler popularity and correct law corresponding with going monarchy vs republic. Some additional requirements were added as well, for example having a rank of at least regional power, to avoid AI countries looking like they are being played by an average OPM enjoyer.
In the end there are still tribes that reform naturally without help from cultural decisions and mission trees, but it’s more of an exception, which makes more sense historically than half of Europe turning into monarchies somewhere in 200 BC.
Just download more army, bro
While laws of monarchies and republics have much less going for them in the context of the AI, they too benefit from having an actual law changing system. Previously inventions that allow to enact new laws contained special effects for AI countries, where they would be forced to change towards them, because otherwise it would have never been done. This could lead to big problems with stability – if it happened to be already low by the moment of researching the invention, now after paying the price to change a law it’s gonna be put six feet under.
But in this new system stability is a key factor, and laws are only enacted when it’s high enough to not ruin the whole country by doing so, with thresholds varying depending on the importance of the specific law we’re looking forward to.
So after dealing with some funny things, like the monarchy.101 event apparently enacting Royal Army for every single monarchy that has the required invention, I managed to provide civilized AI countries with the logic for the most important law group, which is of course military reforms.
The main elements here are levy size and the ability to raise legions, so the AI will consider all the factors and choose what fits it the best. For example, a country that has most of its levy population inside the capital region doesn’t want a law that allows to raise legions outside of it, even if the country has the required invention, because it will lose the levy size bonus and thus its army will only get weaker.
Then there are military laws that are only useful as a part of a certain strategy, such as laws with mercenary bonuses, but we can’t rely on the AI making use of them, so instead it will prefer raw army numbers.
Me monarchy, me assimilate
Monarchies also have the very important Conversion Policy law group, unlocked with Proscribed Canon invention. It has insane value for any country with subpar cultural and/or religious unity, providing best in class bonuses for assimilation or conversion, depending on what law you’ll choose. The best strategy would be going for conversion first, as it’s a faster process overall, and then switch to assimilation – which is basically what I told AI monarchies to do.
This can lead to countries like Diadochi states becoming proper raid bosses by the very late game, granted they won’t get smashed into the ground before it, as increased percent of integrated pops means higher stability and much larger army. Beware!
Most other monarchy law groups are locked behind inventions. Some of them are just generally useful and thus AI countries will look to enact something in them after reaching the required invention, while others have drawbacks and again require some conscious strategy to make use of them, so the AI won’t bother with it.
As for republics, they have a fair share of law changes going on through events, which is why for them the system only touches military laws. Otherwise there could be conflicts, leading to losing stability without any value gained. Besides, while effects of republic laws are nice to have, there’s nothing comparable to the mighty Conversion Policy, for example. I may look into it a bit more in the future, but for now that’s how it goes.
Wanna some trade routes?
Another borderline shocking discovery I made is that not only AI barely uses state investment mechanic, but they also play darts with what exactly they will invest in. Literally! While usually there are at least some barebones conditions, for investments the AI weights looked like 1 and 1.5, like that’s it, just some number. This is no fit for state investments, where most of them are actually highly conditional – it’s only trade routes that you can spam and always gain at least something from it.
First I was forced to move all the logic around in the files, because it was glued to GUI, and there’s no proper way to control how often and under which conditions the AI presses the buttons you want it to press, in fact usually it prefers to ignore them. Just Paradox modding things.
Then the actual fun started, where I was making the AI realize that military investments help with fort limit and don’t do much otherwise, that you need some real overcrowding going on to make use of civic investments, that religious investments are only impactful when you have multiple built up cities, and on the contrary that trade routes are just good – so when in doubt, go for oratory investments.
Then there is another layer of limiting how eager AI countries are to invest in their states. They should do it only if they have some otherwise unused political influence on their hands or there are free investments, but also I limited how much investments they can get by a combination of country government type and state population, so we don’t end up with small German tribes having dozens of them.
And it worked, I guess? Said German tribes don’t invest into city building slots anymore, instead spending their few investments towards more useful things. Small Greek states with multiple cities, on the contrary, are likely to get some of these religious investments, allowing them to construct more nice buildings. Finally, all of them are now united in thinking that investing in the capital state is good, so they could better develop it and import more strategic goods.
Oratory investment with its trade routes really is a base option for the AI, so with the balance shifting towards it, the average AI country will have slightly higher income thanks to higher numbers of both imports and exports. Unfortunately, I’ve met a harsh limitation there, as it turns out AI trading is very heavy on performance. Because of this oratory investments are allowed only if the state has some trade routes already from other sources.
On this note, I’ve also adjusted AI logic for country commerce policy. Previously every country above city state defaulted to Free Trade for export income, but now they actually check if they have enough exports to make use of it. If not, they will use Trading Permits for 2 more capital import routes, leading to another small boost in AI trading capabilities. Again, because of performance concerns this has the same limitations as described above.
Keeping inner demons at bay
If you are tired like me of re-adjusting your trade routes because Carthage has a civil war again, you’ll love this segment. Inability of the AI to press these shiny “fix loyalty” buttons finally got me, so they received some lessons here as well.
AI countries were pretty ok at bribing people already, although it looked like they did it without a specific idea. But when more drastic measures were needed, they couldn’t do anything, falling into civil wars they could easily avoid. Turns out, they were not paying political influence for bribing and persuading! Life definitely gets easier when you cheat the system like this.
When I started to write my own AI logic for fixing loyalty, this became a big issue, as I needed to make up some random rules for them to not exploit this free bribing left and right. We decided to remove the cheating, because combined with improved decision making this could lead to overly high internal stability, and the need to pay political influence is an important factor by itself for designing the logic.
Now the AI is not only capable of making bribes just to keep loyalty at a decent level, but is also well equipped to combat civil wars. If bribes are not enough, free hands will be given – and revoked somewhere in the future, with governors having strict limits on corruption due to its impact on province loyalty. Where everything else fails, subsidies will be given to families, granted there’s enough gold in the treasury.
This doesn’t mean AI countries won’t have civil wars. While they are now better at dealing with disloyalty, I haven’t touched anything regarding what causes it, like improper management of offices and power base in general. And that’s completely fine – the government is often a synonym of corruption and incompetence, no reason to make it different here.
We also added some additional limitations to avoid AI countries being too stable. For example, none of the loyalty fixing can be applied to rivals of the current ruler, unless there’s stuff like the country facing an existential threat. In some cases this will result in civil wars, but this time – as the result of an actual political struggle, instead of any light breeze and the AI just not pressing the buttons for no reason as it was before.
The school of diplomacy
Another system that saw some improvements is diplomatic stances. We’ve adjusted the balance between them and added new modifiers in this patch, so it must be important to make the AI aware of these changes, isn’t it?
In vanilla every stance has its AI weight increased or decreased by small values under many different conditions. For me it looked shaky, with potential for close or even equal weights leading to switching back and forth. I reworked it into exclusive logic with a bit more elaborate, but still simple decision making. Now at any given moment the AI may want only one specific stance, and there are buffers in action to prevent it changing way too often.
High AE and is not attacking anyone? Appeasing until low enough.
Big war? Bellicose for lower war goal costs and AE impact.
Going really hard on subjugating other countries? Domineering.
Low on diplomatic relations or political influence? Neutral.
Old good money printing? Mercantile.
What a national idea!
For a long time there was a belief that we can’t control which nationals ideas the AI would pick, as no syntax was provided for that in the corresponding files. That is, until I semi-randomly tried to use the same syntax as we have in other systems… and it worked.
After realising this we discussed what national ideas would serve AI countries better, and implemented this in the form of AI weights. Unfortunately, it seems that the AI doesn’t update the ideas over time, instead sticking to the ones it got after initial setup, and there’s no workaround we could find. A pity, considering that late game ideas are substantially stronger.
Still, countries that changed their government type can benefit from this, as this process wipes one’s national ideas. Revolts start with them being blank as well, so civil wars can bring some fresh ideas to the table. Otherwise I just hope some way to fix this issue will be found in the future.
A few more bricks in the wall
As you can see, it’s nothing mind blowing. Some better law management, some smarter investments, a few civil wars prevented. But all this and other small fixes combined should further improve internal development of AI countries, so they could pose more challenge to you, the mighty player.
That’s it for today! Thanks for reading this one, and I hope to continue bringing you good news in the future.
Now onto the content side of things as presented by Zorgoball.
Hello everyone! Zorgo here with a peek at some of the new things I’ve been working on. Before I reveal the brand new tree, let’s take a look at something small but impactful that I recently added; in the next update, certain army units will have the ability to construct Pirate Havens.
Will this ability be available to everyone? No - it will only be unlocked via mission or event. I have gone through some old trees and added this ability where it makes sense, and because you’ll have to wait for a future dev diary to see *new* trees where this fun “mechanic” has been implemented, we return to that old chestnut, Pirate Illyria, to demonstrate.
Of course, your neighbors won’t really like you building Pirate Havens in your ports, so there will be a little bit of AE added every time you send the boys out with their pickaxes and bulldozers…but you don’t care about international opinion, you just want those sweet local taxes and population growth modifiers, don’t you?
I should also reiterate that adding this ability has certainly got the creative juices flowing on the dev team when it comes to new content, so definitely stay tuned for missions that will see the scourge of piracy become worse than it has ever been.
And now, on to the main course…I hope you're hungry! The next update of Invictus (not today’s update, as it was an AI focus - massive shoutout to Anbeeld) will have a tree for the migratory Androphagians, or “Man-Eaters”, entitled “Day Of The Cannibals”. Special thanks (in no particular order) to Shinymewtwo for fun flavorful suggestions, Julia for scripting assistance and to Mateusz/Snowlet for some excellent general feedback. Here’s a peek at the tree itself before we dive into the nitty gritty. Instead of rehashing what I’ve already written, we will let some of the in-game localization fill you in on a little bit of the tribe's history.
More on that tortured relationship with the Scythians later, but first, let’s discover one of the things that will make an Androphagian playthrough unique…
About those health risks…there’s an 80/20 chance that you’ll contract a random disease from eating someone alive. Oh, and if you thought your neighbors would be upset by you building Pirate Havens, they are really not going to like it when you eat prisoners alive. But your kinsmen will be happy and you'll be the most popular cannibal in the tribe! Good for you, upholding those traditional Androphagian values. In the end, “Devour” is basically a flavorful variation of the “Sacrifice” character interaction with some different rewards, but it makes the Androphagians feel unique and allows for some pretty fun campaigning.
Each potential illness that you can get from eating humans has its own localization, adding a bit of flavor to the rich fabric of your Ruler’s life story. The worst afflictions are rare, but please keep in mind that there is a chance you could get really, really sick. To get the above outcome to fire, I had to eat about twenty people, but I was very unlucky - this is one of the worst outcomes available. But let’s move on to the mission.
When the game starts, you only have three territories to your name and two Tribal Chieftain counterparts that don’t always agree with what you propose. At various points in the tree, you’ll have to make sure that both of these grouches are content in order to proceed, so have fun with that. The first task will see your leaders gathering to discuss the future, and two options will be presented; one Chief will want to migrate west, to the amber-rich and uninhabited territories of the coast, whereas the other will want to see you devastate and destroy the tribes living close to you.
You will, of course, have to do both and so much more in the course of the mission, but depending on which branch of the tree you want to explore first, you’ll get some bonuses to help get the ball rolling. Or, if you don't feel like choosing, you can petition the gods to make the selection for you, which will be revealed via dream in about one month’s time. But make no bones about it; one way or another, you will have to destroy your neighboring tribes while building up a coastal seat of power that is focused on exploiting the amber trade. Let’s ask your Chieftains what they’d like to do first.
Let’s take the less bellicose option for now and see what awaits you in the uncolonized wilderness where amber can be found. As you might imagine, once you start to settle the Ilmandu Superior province, there will be some tasks that will help you build up the infrastructure of your new home. Doing things like constructing ports and a road network will increase your centralization, but don’t worry - your greatest triumphs as a migratory tribe are still ahead of you. But do be mindful that some optional tasks will require you to have a certain amount of decentralization, so you'll have to choose your task order wisely, depending on what you want to do first. You will be faced with a small conundrum of sorts; will you start to centralize and get those sweet mission rewards, or will you explore some of the smaller branches that reward you for staying decentralized before settling down? I'll let you ponder the future as your tribesmen start rolling up their sleeves and get to work building up the amber trade.
If you want, you can select one of your new western territories to be your new capital.
As a madness for amber seizes your people, roads will be built in order to facilitate easy trade between your settlements.
Eventually, you’ll want to take this franchise to the seas, and ports will be built in the far north. As your fleets begin to explore the Oceanus Sarmaticus, there will be plenty of opportunities to raid and pillage the unsuspecting tribes living around you…especially those that produce amber, which by right should be yours! You have a good thing going with your monopoly on amber, and a hostile takeover of your competition is the best way to consolidate your bottom line. And you wonder why everyone hates the Androphagians.
Imagine the look of horror on the faces of the Germanic tribesmen as fleets of woad-streaked cannibals descend upon their settlements…*shudder*. The “Rightful Dominion” law requires -80 Centralization, however, and is one of those optional tasks that I mentioned, so don’t worry - you won’t be forced to expand into Scandia if you don’t want to, but the opportunity to raid far and wide will be there. We will naturally leave a few surprises for you to discover on your own in the Amber Coast, so let’s switch gears and see what happens if you start your campaign by waging war against the Scythians and the other tribes living to the south.
Even though you will probably have a dismal diplomatic reputation, it is in your best interest to find an ally to help you in your initial wars - the Melanchlaenians, your closest neighbors, are much stronger than you and will be jumping at the chance to destroy the cannibals on their borders.
Of course, when you do inevitably conquer them, you will have to decide what to do with the influx of foreign tribesmen living within your borders. Their levies would definitely augment your strength, but this approach might be decidedly un-Androphagian…as always, dissension amongst the Tribal Chiefs will have ramifications for your politics.
Arjune must’ve been a popular Androphagian name in the 340s BCE.
The Melanchlaenians also possessed one of the only iron-producing settlements in your neck of the woods, and your levies will benefit from exploiting the natural resources.
There are other development tasks involving your levies and pops - things like building farms so your diet won't subsist entirely of subjugated slaves, or training your cavalry to move swiftly through the forests of your homeland - but I’m not here to give it all away, just tease you with the promise of fun things to come. But rest assured that you’ll have things to do besides enslaving and destroying - like building your first true city, a proper capital.
You’re growing. You’re conquering. You’re enslaving. You’re eating good. Your reputation is spreading around the civilized world, as more and more people become aware of the growing threat from the migratory cannibals in the far north. Once you hit a certain milestone, the gloves will really come off and the dreaded Crimson Horde will be proclaimed.
Thanks to Shiny for making both of the flags for Androphagia! Once you’ve embraced your destiny as a horde, then it will be time to do horde-y stuff.
As it so often happens, one thing will lead to another, and your tribesmen will decide to take advantage of the chaotic wars in Anatolia in order to personally profit. I will say that, in my own playthroughs of the tree, it’s been tremendous fun running amok and causing pandemonium throughout the civilized world. So many superiority wars declared, so many enslaved pops…
By the by, something that we are testing at the moment and that might not make it in the final release is the chance of Pillaging allowing you to kidnap and imprison characters from a nation. There are some voices arguing that this is terribly broken and will be prone to abuse (and they’re probably correct) but boy is it fun eating random characters that you've yoinked from an enemy nation. I mean, you could do the nice thing and ransom them, but you aren’t truly living life until you’ve eaten a Bosporan Greek that you've kidnapped from his villa on the coast.
Sorry, Chairestratos…
You’ll burn, pillage and raze your way across the civilized world, absolutely wrecking Greece and making big stacks along the way. You’ll not only steal their wealth but also their technical know-how, something that they will never forgive you for. So many superiority wars declared, so many enslaved pops…
But let’s return to the thorny question of the Scythians, one of the most powerful tribes in your region when you first start and a true threat to your hegemony.
When the Achaemenids under Darius invaded their land, they cried out to you for help - which you declined - and now, two hundred years later, you’ll finish the job the Persians started and utterly destroy the Scythians and their allies before turning your eyes to the east. Your Chieftain, at this point drunk on power and seeking to destroy any challengers to your Androphagian supremacy, will launch a Grand Invasion of the Steppe in order to shatter the power of the Horse Lords. Your migratory ways will come to an end once you form a Steppe Horde, but at this point, your people will be ready to hang up their traveling shoes and settle down - what's the point of destroying the world if you can't enjoy the stuff you've taken? You'll be tasked with destroying the tribal confederacies that stood against the Persians and then look east in order to make sure that no one else seeks to emulate your example.
I could talk about the some of the Ilmaric religious tasks and even show you the Great Wonder that you will construct in honor of the Moon Goddess, an important deity in your pantheon, but instead, I’m going to show a little peek at an event chain that you’ll have the option of pursuing.
Your tribesmen might be bloodthirsty cannibals but they aren’t dumb, and they are very aware that you are not as technologically advanced as some of the kingdoms and empires that you are raiding. In order to rectify this, a fleet of Androphagian ambassadors, headed by your Tribal Chief, will sail around the Mediterranean in hopes of finding tutors that you can hire to teach at your newly-constructed academies. Make sure you have plenty of money, as well as the ability to follow the stars back home, before you go.
Oh, the adventures you’ll have! A swashbuckling tale of intrigue and mystery awaits you. Here, you’ll get to experience the ramifications of all of those Pirate Havens that people are building.
You’ll go on a shopping spree in the marketplaces of Carthage once you grease some palms…
You might even attend a philosophical lecture in the agora of Athens…
Anyways, that’s it from me - talk soon and see you in a future diary!