Anbeeld

Projects Articles Support Contact

Imperator: Invictus AI Dev Diary 1.10.1

Advanced AI game rule, road building system, fort placement optimization, and a comprehensive overview of all AI improvements.

One giant leap for AI-kind

Hello there! I’m Anbeeld, the Imperator: Invictus AI guy. Today we are gonna talk about the massive improvements for the patch 1.10.1: Advanced AI, roads, forts – and also give you an overview of everything we have achieved so far.

Consensually advanced AI

First, we have Advanced AI, a new game rule initially introduced in the last major update under the name of “AI Recruiting More Mercenaries”, and rapidly expanded in hotfixes. It improves the decision making of AI countries without any cheating, since giving bonuses to them is covered by difficulty settings – and you can combine both for maximum effect.

Advanced AI game rule option

Mercenaries remain the flagship feature there. With the rule enabled, AI countries hire far more of them, sometimes leaving none available around in the most heated of times. But the richest of AI countries can now deal even with that, by bribing mercenaries as a last resort.

AI bribing mercenaries as a last resort

Since this feature has been out for a while, the best argument in its favor is player feedback, which is very positive. As expected, the game becomes more challenging when AI countries on the brink of extinction recruit every mercenary they can afford, instead of doing nothing while you crush them.

Positive player feedback on Advanced AI

But Advanced AI is not just about mercs. It also improves internal development and stability: higher resistance to civil wars, more tribes reforming, manual pop movement into underused cities, and heavy usage of province investments – a game changer for small AI countries.

Advanced AI internal development and province investments

What’s more, the rule is fully configurable. You can disable individual features in the “Game Rules” tab, tailoring it to your liking. This is really important, as Advanced AI is mostly about higher difficulty, which is not for everyone, and sometimes leans on meta play. If you think a certain feature has no place in the game, you can simply turn it off.

Configurable Advanced AI features

Game rules must be set up every new playthrough.

All roads lead to the AI

Imperator: Rome is unique in letting you build roads yourself, which is crucial for a civilization builder. But AI countries almost never build them, and you can’t do it all by yourself, right? Especially if playing as a small country, watching Rome and Diadochi refuse to build road networks in their vast empires.

AI countries with no road networks

Well, no more! This update introduces a fully custom AI road building system. Countries with qualifying legions now actively build roads whenever they have enough money.

AI countries actively building roads

The process goes in stages. First, they connect all the regions they control, so every part of the realm has at least some roads. I jokingly call this levy delivery system, as levies are raised all over the country, and roads help them gather much quicker.

Regional road connections for levy delivery

Next, AI countries do the same on the province level, creating a dense road network for fast army movement. Finally, a number of roads will be constructed even between cities within the same province, especially in small but highly developed countries.

Dense provincial road networks

Enemy armies can of course use these roads too, but when moving from one edge of the empire to another takes many months, it’s a tradeoff worth taking.

Enemy armies using AI-built roads

Implementing this was a major technical challenge. The entire system was created from scratch: where to build, when, in what order, and of course pathfinding took a lot of time to get right. Fortunately, it seems to work quite well and with almost no impact on performance.

AI road building pathfinding system

Some players worried about aesthetics and historical plausibility of AI road networks. That’s where game rules come in again: you can disable AI road building entirely or limit its scope. Props to Zamensis, another Invictus team member, for helping me fine tune this, so that available options cover the needs of most players.

Game rules for AI road building

Game rules must be set up every new playthrough.

Forts are great, try them

Another big improvement in this patch is AI fort placement. I’m sure many of you have an experience of attacking an AI country, only to find it having too few forts, often protecting useless land instead of province capitals, populated cities and other key military targets.

AI country with poor fort placement

This issue stayed unresolved for years despite attempts of many modders, because the fort placement logic is hardcoded. It’s simply not accessible through modding, outside of a few variables that don’t have nearly enough influence to fix all the issues.

Hardcoded fort placement limitations

But what is hardcoding in the face of a workaround? Using a bit of wizardry as usual, I created a supportive algorithm with its own decision making and priorities. Its job is to optimize the positioning of existing forts, fixing shortcomings of vanilla AI and its inability to adapt after the territory it controls shifts.

Supportive algorithm optimizing fort positioning

The new priorities are centered around border provinces. Forts are expensive and AI budgets are tight, so while this exposes inner provinces, it’s better than the alternative which is leaving the door wide open. It also makes them easy to de-occupy with minimal forces, while the main battlefield is control over forts in border provinces.

Border province fort priorities

Another major point is matching forts with province capitals, which is crucial because of how occupation works in the game. This is what the vanilla AI was meant to do already, but it lacked tools required to enforce the rule properly.

Forts matched with province capitals

You’ll also notice more high level forts now, especially in capitals, but also other densely populated provinces. This is again heavily restricted by the budget, but at least in core territories of large empires, like the Nile Delta, the defenses will be stronger than before.

High level forts in capitals

A big related change here is the AI now being able to move province capitals. The game often picks weird capitals after annexations, placing them in the middle of nowhere instead of a large city with a fort. Now AI countries have a set of priorities dictating where a province capital should be, and will fix the most problematic cases.

AI moving province capitals

While AI fort building can still be improved a lot, these changes are a huge step forward already, one that required an unexpected amount of effort to make. Wars against AI countries should be more challenging now, with their lands protected better, and Carthage not leaving its capital naked for decades due to subject integration shenanigans.

Look how far we’ve come

For those who haven’t been following my Invictus work closely, here’s a quick overview of AI improvements across the last few patches. I won’t go deep into details, since most of these changes have been covered in previous dev diaries, so check them out.

Overview of AI improvements

Building priorities were completely reworked. Early on, AI countries focus on research with Academies, Courts of Law and Libraries built to increase the output of nobles and citizens. Once research efficiency is high, they shift to freeman and slave buildings for manpower and income. Aqueducts and Granaries are widely used now, allowing cities to grow. Trade income is improved by building Mines and Farming Settlements wherever possible, and also Foundries when it’s worth the investment.

Reworked building priorities

Invention priorities were completely reworked as well. The AI now chooses actually useful ones, completing entire trees of universally and situationally strong inventions, gaining discipline, engineers, commerce and tax income, assimilation and conversion speed, population happiness, levy size, character loyalty, political influence, max research efficiency, and more.

Reworked invention priorities

A law changing system for AI countries was added, as it simply hasn’t existed before. Now tribes progress their centralization level in either direction, monarchies use the conversion and assimilation laws, and them and republics switch between military laws based on population and inventions.

AI law changing system

Character loyalty management of AI countries is on another level now, with various interactions like bribing being used to prevent civil wars. With Advanced AI they gain access to even more tools to ensure best possible realm stability.

Character loyalty management and civil war prevention

New decision making was implemented for city founding and upgrading to metropolises, which happens much more often now. I even had to add limits so that decentralized tribes don’t spam cities all over Germania. With Advanced AI they can also manually move pops to underused cities.

City founding and metropolis upgrading

Province investments are now properly used by AI countries, with them being able to pick the most suitable ones for each state. There are some limits as well so they don’t have too much fun, but those can be lifted with Advanced AI, allowing city states to stack some 50 building slots.

Province investment improvements

National ideas now have priorities for AI so they pick the fitting ones, something not even known to be moddable before.

AI national idea priorities

Improvements were made to AI decision making for diplomatic stances, with a focus on consistency so they don’t waste political influence on constant switching between them.

Diplomatic stance consistency

Governor policy AI was reworked, affecting player countries as well. The main goal was to improve its efficiency, but there’s also some roleplay based on governor traits, corruption, culture and religion.

Governor policy AI rework

Economic policy management was improved. AI countries now use correct Commerce policy based on trade routes, consider legions and mercenaries for Increased Army Maintenance, reduce tributes to improve relations with subjects they want to integrate, apply Harsh Taxation when over max research efficiency, and so on.

Economic policy improvements

Various AI issues and flaws were fixed, like not colonizing even when meeting all the conditions, not importing food and thus starving Latium to death, making counter-offers to bribed mercenaries at random, not using shiny buttons like Unit Reorganization or Hold Games, and a whole lot more.

Various AI bug fixes

Previously the AI also cheated on many occasions, like not paying political influence for character interactions, but all of this was fixed. They are still much better at using these systems now despite having to spend resources, as the decision making is just incomparably better than it was before.

This is my Roman Empire

And that’s all for today! Hope you liked the new changes, so don’t hesitate to try them out yourself, as the new Invictus update with all of them included is already up and available.

While the upcoming Europa Universalis V will for sure be a massive magnet for both players and modders, I’m sure it will leave some room for us to meet again, and thus – until next time!

Back to articles