• We have updated our Community Code of Conduct. Please read through the new rules for the forum that are an integral part of Paradox Interactive’s User Agreement.

Stellaris Dev Diary #252 - Artificial and Automated Intelligence


ai_5.png


Hello everyone, it is me Offe, one of the Humans working on Stellaris. Today I will bring you an update from the Custodian AI initiative. Before we dive into today’s dev diary let’s do a quick recap of the AI work that went into the 3.3 patch.


If you have been following the AI dev diaries you probably know that our main objectives for the 3.3 Libra patch was to improve the economy management of the AI, especially with a mid and late game perspective in mInd. The reason for this was to establish the AI empires as relevant actors beyond the early game and give their interactions with the player more impact.

Following some of the discussions here on our own forums and also on Reddit, my favorite topic has been seeing people react to AI empires suddenly being much stronger in the Galactic Community where they are passing resolutions against the players' will.

While the AI economy management still has areas which can be improved, we felt satisfied with the changes made in 3.3 to the point where we wanted to move our focus to other areas of the AI.


Goals for 3.4

As the AI economy improved other areas of the AI started to become more obvious targets for improvement, namely the AI military fleet management and their diplomacy interactions with the player.

Military AI behavior changes

First I would like to say that the changes coming to military fleet behavior in 3.4 are mostly bug fixes rAther than improvements on their decision making, so while there should be a very noticeable difference, the work made so far on the fleet behavior will not be as encompassing as the work made for the economy.

Let’s start with the Elephant in the room: AI splitting their fleets into tiny pieces.

split_fleets.png



While there were issues where AI would split their fleets too much, fundamentally this behavior of AI splitting fleets was by design. The AI would allocate just enough fleet power (with a +25% margin) to their objective in order to carry out as many objectives as possible. The main issue came from the amount of low fleet power targets such as unupgraded starbases which caused the AI to frequently split their fleets into 1000~ fleet power pieces.

In theory this approach is quite good, however, the main two main issues with this approach are that the player can easily just take one of their bigger fleets to go around and defeat the AI’s smaller fleets one by one which makes the AI somewhat incompetent, as well as that this playstyle from the AI can be quite frustrating to play against.

In 3.4 the AI will aim to have full fleets as their smallest unit to carry out military objectives, AI will actively try and merge all possible fleets during peacetime and the AI will during a war try and merge two nearby fleets when possible.

Cycling Fleet Orders

After having made the AI fill up their fleets, the next issue to tackle was AI fleet order cycling where the fleets get stuck alternating between two orders indefinitely. One coMmon cause for this was when the AI assigned several fleets to carry out an objective together, the fleets would try and regroup with each other by moving to the system of the other fleets causing them to switch places over and over.

GIF 19-02-2020 15-58-03.gif


Take Point

In 3.3 we made the AI obey the Take Point behavior again, but it didn’t work quite as well as we wanted. For example allied AI fleets would sometimes follow the players fleets when they shouldn’t. There were also issues where the AI would suddenly change their mind and stop following the player, and they would also not always follow the player with all their fleets.

AI Allied Wars

During a war with several involved AI Empires on the same side, one of the AIs will be considered leading the war (may be different from diplomatic war leader) and the other AIs will put their fleets to follow the “AI warleader”. This suffered from a similar issue as previously mentioned where the AI fleets which were supposed to follow would change their mind too often and never reach their intended target.

AI Outside Diplomatic War

In 3.4 we are adding an AI war state which becomes activated when the AI fights a mid or late game crisis, this state of war will continue until the crisis has been defeated. This means that AI will now enable their normal war beHavior against targets like the Great Khan even though they do not have a diplomatic war if they or any of their allies get attacked.

This has many side effects, for example:
- AI empires should now obey the players Take Point if the player is fighting a crisis
- Allied AI empires should now help each other fight crises when one of them are attacked
- AI empires will now seek out and destroy systems controlled by crisis empires et cetera.

We also addressed the issue where an AI empire would fight a neutral target such as a leviathan during an ongoing war.

AI War Preparation

In 3.4 we are adding a state of war preparation for the AI which they will enter when they would have immediately declared war in 3.3. During this phase the AI will gather their available fleets and move them towards the border of their target.

If you have enough military intel you will be notified via an alert that hell is about to break loose and depending on how much intel you have you will get a more accurate estimation on when the AI will strike.

alert.png



AI Diplomacy

Now that we have covered military changes coming in 3.4 lets go over the diplomacy changes

Federation AI changes

One of the biggest complaints regarding being in a Federation with the AI has been the unrelenting bombardment of proposals of changing the same federation law over and over again. Often resUlting in AI empires stacking the negative opinion modifier on themselves and eventually leaving the federation altogether.

In 3.4 we are introducing a 10 year AI vote cooldown for each law category. So let’s randomly select a federation law to use as an example: Free Migration. When an AI proposes to change the law of Free Migration then it will add a 10 year AI only cooldown which is shared between all AI federation members. This means that each time Free Migration gets voted down it will now take at least 10 years before it is proposed again.

Coincidentally this also fixes an exploit that the player could use against AI federations where the player would repeatedly ask to initiate a vote to invite the player into the AI federation. This allowed the player to repeatedly stack the negative opinion modifiers between the AI federation members causing their federation to break apart.

Envoys

Another common complaint regarding AI federations is how the AI would often not put any envoys into the federation. This was a symptom of a bigger problem which was the overall AI envoy usage.

The AI empires would frequently reassign their envoys to the same task, knocking out the envoy who was already assigned to it and starting the reassign cooldown. As a result the AI would often have all but one of their envoys on cooldown and not assigned to any task.

In 3.4 the AIs should be able to handle their envoys in a much more appropriate manner, both in terms of Federation and Galactic Community assignment as well as other diplomatic actions and espionage operations.

Galactic Community Changes

While AI voting for seemingly completely irrelevant resolutions in the Galactic Community gave it a sense of uncomfortable realism there were a few issues that stood out to us:

AI would sometimes propose resolutions that were completely against their core beliefs, for example, a slaver empire would sometimes propose to ban organic slave trading. This was due to a missing willingness check when AI would propose resolutions, so they AI would propose the resolution they liked the most but wouldn’t check if they liked it enough to be worth proposing in the first place.

The AI was explicitly forbidden to withdraw their proposed resolution, while most of the time this does not make sense, there are situations where this may be the best course of action. For example, the AI may propose to reduce the council size but by the time the resolution is about to enter the floor their diplomatic weight has been reduced to the point where they would propose themselves out of the council.

Similarly the AI was also forbidden from opposing their own resolution, but the above situation could happen in a similar way where, for example, the player would enact the Emergency Measure to move the resolution to the floor before the AI has time to withdraw their resolution. In that situation it would make sense for the AI to oppose their own proposed resolution.

Additionally if you have enough intel on the AI you will now be able to see why they are voting the way they do in the Galactic Community. While this tooltip was already quite big, I knew I could make it even bigger.


ai_vote.png


Planet and Sector Automation

While planet and sector automation isn’t necessarily AI, we have seen a lot of requests for previous AI iMprovements to also be available for the player. And even though the planet/sector automation uses a different system than the AI’s economy system we still felt that improving this would hopefully add a lot of quality of life value to our players.

The design philosophy for the new automation system is that “most players will be able to use some parts of it”. So the intention is not that all players will always use this and that it will be able to satisfy all players, rather that hopefully everyone will find something that they feel is worth using.


automation.png


So how does it work? In 3.4 the planet automation will have an additional settings UI where players can toggle components on/off for each planet individually as well as setting default values for newly colonized planets.

The most impactful setting is this one, the Designation

designation.png


This will cause the planet to build new jobs in accordance with the designation when there are no free jobs available. This setting is now much more restrictive in regards to what is considered to be in accordance with the designation, for example, enabling this for a mining designation will only construct the mining districts and the mineral purification plant and nothing else.

The other settings are:
  • Amenities: Build new amenities buildings and also micromanage the priority of amenity producing jobs to minimize unnecessary amenity jobs by using the same system as the AI has been using since 3.3.
  • Rare resources: Build new rare resource producing buildings to target a +3 monthly income of all rare resources. Additionally this will now take into consideration empire wide buildings in the building queue and only build one building at a time.
  • Pop assembly: Build spawning pools, cloning vats, robot assembly et cetera.
  • Housing: Construct additional housing, either districts or building when needed.
  • Building slots: Automatically build a new housing district for the +1 building slot whenever there are no free building slots, especially useful to enable on automated planets like Science designation since they require many building slots.
  • Crime: Build new crime prevention buildings when crime reaches dangerous levels.
  • Clear blockers: Automatically clear blockers when it is preventing construction of new districts.
  • Posthumous Employment: Builds the Posthumous Employment Center on planets with raw resource focus.
  • Psi Corps: Build the Psi Corps building on all planets when possible.
The Designation automation setting is extra careful to not overbuild buildings whereas the other settings will build buildings even when there is no need for additional jobs.

All the automations except the Amenity automation (uses AI behavior in code) are fully scriptable for anyone interested in making their own automation mod, the files are found in:
Code:
game\common\colony_automation
game\common\colony_automation_exceptions

Sector Automation

Sector automation is now a system built on top of the planet automation. Setting the sector focus will now change which designAtions planets will select when they are using the “automatic designation selection” in order to make them respect the sector automation.


sector.png

Additionally there is now a Unity focus available for sector automation since Unity is now more important after the 3.3 patch, together with new Unity automation for planets to go along with it.


sector_setting.png



The requirement to have an upgraded capital building in order to construct Research labs and rare resource producing buildings has now been removed in order to make the planet automatioNs function properly for newly founded colonies with these designations.

We have also added several missing designations to different planet types in order to allow for more automation, for example, Ring World can now use factory/forge world designation and Hive Worlds can now use the fortress designation.

And that’s it for today’s dev diary. As always if you have any questions feel free to post them below and I will do my best to answer them all.

Lastly, I am sad to say that my designated time on the Custodian team has already been over for a while now, which means that this will be the last AI dev diary from me. But the AI initiative lives on and next time there is an AI update you may get the chance to meet a new Human. Again I want to say a special thank you to all the community members who have engaged in meaningful discussions regarding the AI improvements in the past months and tirelessly reporting the AI issues on the bug forum.

Thank you!

PS. Do not try to find me, I am safe, do not go here ptfwm://bdkqnf.hn/3XohUOb

Subterranean​

Hi! Eladrin tagging back in for a bit.

1650893978744.png

This week Nivarias revealed the Subterranean origin. Tunneling underground is a bit more expensive than building on the surface, but has its advantages, especially when a hostile force attempts to bombard your cities.

1651130977986.png

Lithoids are unaffected by the growth speed penalty.

The primary species of a Subterranean empire gains the Cave Dweller trait, granting additional mineral production at the cost of pop growth and empire size from pops, as well as a new Minimum Habitability trait. Cave-Dwelling pops are well sheltered from the environment on the surface, and treat any habitable planets below 50% habitability as if they were 50%.

1650893995630.png

I am a dwarf and I’m digging a hole.

Living underground, Subterranean empires have a unique city set that replaces the normal view on planets.

1650894002640.png

Are you the king of the mountain?

One of the achievements revealed last week, named Underlord, has to do with answering the question “Is it possible to dig too deep?”

Next Week​

Well look at the time, we’re coming right up to the release of Overlord, aren’t we?

The Stellaris 3.4 “Cepheus” patch notes will be coming next week, alongside details of the Progenitor Hive origin. After the patch notes, join us on the Official Stellaris Discord for a Dev Q&A, starting Thursday at 1700 CEST!

See you there!
 
  • 121Like
  • 71Love
  • 5
  • 3
  • 1Haha
Reactions:
"One of the achievements revealed last week, named Underlord, has to do with answering the question “Is it possible to dig too deep?”"

Balrog Guardian?
 
  • 24Love
  • 1Like
  • 1Haha
Reactions:
Great changes! I was starting to get sick of my federal allies demanding massive changes to federal laws despite refusing to contribute even one envoy to improving cohesion. And it's good to see you trying to offer a more open approach to how players can interact with automation too.

Also, I can't wait to finally give my Dwarf empire a more suitable origin than Post-Apocalyptic.

But what's "monthly bias", and how does it affect GC resolutions?
 
  • 7
  • 2
  • 1Like
Reactions:

The requirement to have an upgraded capital building in order to construct Research labs and rare resource producing buildings has now been removed in order to make the planet automation function properly for newly founded colonies with these designations.​
Yay, finally! :D
 
  • 23
  • 2
  • 1Like
Reactions:
In 3.4 the AIs should be able to handle their envoys in a much more appropriate manner, both in terms of Federation and Galactic Community assignment as well as other diplomatic actions and espionage operations.
I can't say how thankfull i am for this!

And the automation imrovements especially on planet side are really nice too! :)

Btw... what?
PS. Do not try to find me, I am safe, do not go here ptfwm://bdkqnf.hn/3XohUOb
 
  • 3Like
  • 2
Reactions:
I'm really glad to see improvements to planetary automation. In the times when I play an aggressive, expanding empire I rarely want to babysit so many worlds. Is there a "select all" button for when you're flicking through conquered worlds and just want to quickly set them up?

Regarding the timer for federation law changes: have there been any improvements to how the AI decides what to support? Migration pacts are a great example, because what tends to happen is they vote to dissolve free migration before immediately spamming you with individual migration requests.

As amusingly realistic to the chaos of real world politics as that is, it gets a bit exasperating. Is the AI now less likely to propose a change just for the sake of it, or will we have them re-proposing every ten years?

EDIT: This is an absolute godsend! I've posted two or three bug reports about this before so love to see it

Build new rare resource producing buildings to target a +3 monthly income of all rare resources. Additionally this will now take into consideration empire wide buildings in the building queue and only build one building at a time.
 
  • 2Like
  • 1
Reactions:
Will all subterranean empires use the same building art or does it vary?
 
  • 4Like
  • 3
  • 1
Reactions:
I love it. I know I'll hate the AI for actually being good at the game, but I love it. Great work!

But since sector automation and management got a sizeable part of today's DD, there's the elephant in the room that I'd like to address: any thoughts from the devs on sector size and manual sector border management?
 
  • 12
  • 4Like
Reactions:
Still cannot change the sector size, even after all these patches…
Yeah, I really wish they'd just let us manually customize sectors like we could before 2.2.

Just disable removing the capital system from the sector, require the sector's systems to be connected through hyperlanes, set maximum sector range, and that's it! That's all you need to do for pre-2.2 sector customization to work with the current version of the game.

I really don't get why that's not an option.
 
Last edited:
  • 16Like
  • 6
Reactions:
I'm still not sure about the sector automation. Since it does not matter for planetary production if or in which sector a planet is, there is no reason to ever focus a sector?
Much more useful would be to have an interface to enable automation categories per sector, or otherwise provide a default.