Home › Articles › Imperator: Invictus AI Dev Diary 1.10
Mercenary recruitment, governor policy rework, research efficiency-based building decisions, and economic policy improvements using the new modifier: syntax.
Hiya, Anbeeld here. Patch 2.0.5 brought the big technical novelty – the ability to directly check values of most modifiers in the game with the modifier: syntax. For the AI it is very important, because it allows us to check various critical and previously unavailable data during the game, and these new variables can improve its decision making quite a lot.
The first change I would like to bring your attention to is the new “AI Recruiting More Mercenaries” game rule. While the name speaks for itself – and yes, this will definitely improve the strength of AI countries in wars! – there’s quite a few details to talk about.

At the moment I prefer to call this an experimental feature. It’s not just a few values adjusted in the vanilla recruiting algorithm, but a brand new, custom one instead. This allows for a full control of which mercenaries the AI will hire, but also brings challenges like checking if these mercs can reach the country in question, or if its budget can support their maintenance. Still, from internal testing it seems to work correctly in most cases.
Another point is how unhinged it can be, even completely draining the surrounding mercenary pool during active wars due to the AI really being into recruiting them to gain an advantage. This may also make the game pretty hard for players that are not that good with the war mechanics, as they may not be ready for such a resistance from AI countries.

Currently this really is a feature for veterans who are bored from how easy the game feels. If this sounds like you, I would LOVE you to try the game rule and give your feedback. The feature being experimental means I’m quite open to making even drastic changes if needed, based on how players will rate its influence on the gameplay itself.
What made this all possible is the new modifier checking system mentioned in the beginning, as checking various data related to limits and economy simply wasn’t possible before, but now AI countries can easily fetch these values on the fly to make the correct decisions.
Another big change is the rework of how governors choose which policies to implement both in AI and player countries. My main intention was to increase efficiency of their choices, but character traits still play quite a big role too. The most obvious example is corrupt governors preferring Acquisition of Wealth policy to increase their own income over Encourage Trade, which is more beneficial for the country than for the governing individual.
Then there’s the Harsh Treatment vs Local Autonomy distinction. While Harsh Treatment is more effective at solving state loyalty issues, not all governors are capable or willing to do it. Characters with traits such as Merciful or Submissive won’t choose it by their own will, instead suggesting Local Autonomy as the policy they personally think is more appropriate.

In regions where Religious Conversion and Cultural Assimilation are needed, pay attention to only appoint governors of country religion and primary culture, otherwise they’ll have no interest in implementing these policies. The same goes for disloyal governors, as they won’t be particularly fascinated about doing what the country expects from them.
Also be careful not to appoint a governor with a combination of multiple “evil” traits. This may not end so well for the population of the region under certain circumstances.

The new modifier checking system helped quite a lot here, allowing to get precise values of province loyalty monthly change from different sources, which is very important for taking measures at the right time and not when it’s too late. One caveat here is that governors don’t seem to change their policies too much after they choose one initially – a pity!
Another big change brought by it is the ability to calculate research efficiency of a country, something not possible before without burning player CPUs and bringing some really ugly stuff into the codebase. Yeah, you read that right, in previous patches it wasn’t possible to check if the AI is at 40% or 175% research efficiency, which is a huge issue for decision making regarding buildings.
The consequences of this didn’t go unnoticed by some players, who started questioning if AI countries really need this many Academies. The answer is often they didn’t, but without access to data there was no way of determining this during the game. As a compromise, back then I made them construct what I call “ratio” building based strictly on what rights the dominating culture in a city has.

This means the AI always wanted Academies in cities where a dominating culture has Noble rights, Court of Laws if it’s Citizen rights, and Forums or Mills for the rest of cases, based on how valuable the produced in the city goods are. For big AI countries this wasn’t as bad, because they often had trouble reaching research efficiency cap even with such a setup, but for smaller countries this ended up being very suboptimal.
But now with the access to current and max research efficiency – and a few workarounds later, with damn levies reducing research points by an arbitrary amount – the logic got vastly improved. Now AI countries stop focusing their cities on Academy or Court of Law as soon as they have a decent amount of research. Specifically decent, as these buildings affect pop ratio and thus their effect isn’t immediate, so the research will grow some more over time.
Instead they will start building Forums and Mills in cities that are still empty, which is “ratio” buildings focused on Freemen and Slaves respectively. This means more manpower and taxes instead of useless overcap research efficiency like it happened before, as well as lower food consumption and less issues with happiness. Hooray!

Now Library, a “modifier” building best suited for improving the output of cities that are already heavy on research, has some more relaxed rules, as its effect – on the contrary – is immediate. It’s also much cheaper, and it raises the value of previous investments made into “ratio” buildings. Because of this Library will continue to get built until research efficiency comes somewhat close to the max value available to the country.
As mentioned before, small countries are the ones where changes will have the most impact. Single province Greek states like Crete won’t build 5 cities filled with Academies anymore, but instead just one or a few of them, with the rest being focused on Forums and Mills instead. And if they end up having way too much research overtime anyways, I implemented the logic for the AI to use Harsh Taxation in such cases.

A number of other small changes and fixes were made, improving the overall performance of the AI. For example, it now has a very high priority on building Farming Settlements in states with a lot of buildings, which will hopefully forever stop Latium from starving. Logic related to constructing Aqueducts was improved as well, which will result in a higher amount of metropolises built by AI countries in the later stages of the playthrough.

Beware of this very thin, but very tall Parthia! It will, eh… research faster than you!

Very tall, I tell you! Maybe a bit hungry as well, but it’s hard to research with a full stomach.

I also re-enabled inventions to become Dictatorship for AI countries, as they stayed dormant for a few patches since AI reworks started. Great powers like Rome have quite a decent chance to take them, while for major powers the probability is much lower, albeit non-zero.

Many improvements were made to how the AI manages economic policies like Army Maintenance, Wages and even Tributes, saving money when possible and gaining subject opinion when it allows to integrate them.

These and other improvements and fixes should bring just a bit more oomph into your late game boss fights against AI opponents. Hope you enjoyed it and see you later!