• 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:
hey @Offe , late to the party here on replying to thread. Great dev diary! The military and automation AI improvements are fantastic pieces of news. Really looking forward to 3.4.

Thanks for all your work on the custodian team, I hope someone picks up the torch. Good luck going forward.
 
  • 1Love
Reactions:
You didn't answer the question unfortunately.
What will AI allies (subjects, Federation, etc) do PRIOR to voting to DOW someone? Will they move fleets to prepare BEFORE voting to start a war, or will they behave like in 3.3 and before (just vote and then move, which would (still) be very bad)?
let's see again then.

Hmm this question is very good, honestly I am not entirely sure. Would have to go investigate further, the mechanics weren't made with a federation/alliance perspective in mind.

It would be slightly problematic for them to gather all their fleets and prepare for the war, only for it to be voted down by the other federation members. Or in the other case where they prepare and it gets voted through, that proposing AI would have been the only one preparing for the war (which is still better than none of them of course).

Having some form of federation count down from when a war is voted on and to when it would begin could be cool, but it would be pretty far outside of "normal" AI work
 
  • 18
  • 1Like
  • 1
Reactions:
Ok, I see your message that you are Human, but, uh...

I'm gonna need you to complete this captcha just in case.

View attachment 833522

It is absolutely essential that you type this. Come on. If you're a Human, you can do it.

I'll wait.
I am fairly sure I know the answer to this one, but just to be sure, maybe you can write it out first?
 
  • 16Haha
  • 1Like
Reactions:
This sounds great, especially for Machine Empires (and Hives, I think) which tend to require lot of management of amenities jobs to have a proper amount of amenities.

Related question, sorry if it has been asked before: Do the automation options have some sort of priority which is picked first? For example, a forge world suddenly gets influx of new pops from somewhere and amenities drop to negative. Designation and Amenities options are selected and the planet has one free building slot: The Designation role wants to build Alloy Foundries to it, but Amenities wants to build a holo theater. Which one gets built?
The designation is low priority, everything else is high priority and will go first. Other than that I believe they will go by order as displayed in the UI.

The automation works better for planets which grows "naturally", capturing a planet with 50 pops on it which are all unemployed and enabling the automation will give a slightly different result as compared to having the planet develop naturally.

For example, having a lot of unemployement can lower amenities and increase crime which would make the automation start by combatting this, then afterwards it would create new designation jobs which could leave the crime management building superfluous.
 
  • 12
  • 1Like
Reactions:
hey @Offe , late to the party here on replying to thread. Great dev diary! The military and automation AI improvements are fantastic pieces of news. Really looking forward to 3.4.

Thanks for all your work on the custodian team, I hope someone picks up the torch. Good luck going forward.
<3 Looking forward to the bug report forum for the new automation!
 
  • 5Haha
  • 1Like
Reactions:
I mentioned in the First Look thread, it'd be kinda fitting if Cave Dwellers got some penalties on Ocean worlds, like not getting uncapped mining districts or increased habitability, making them contrast with Aquatics somewhat.

Obviously such penalties would also come with a restriction where their starting world cannot be an Ocean world.
Hmm. I could imagine an aquatic species that prefers to live in flooded tunnels. Call them "grotto-dwellers." How well that would balance in game-play, I cannot say.
 
  • 1Like
Reactions:
Thanks for
The designation is low priority, everything else is high priority and will go first. Other than that I believe they will go by order as displayed in the UI.

The automation works better for planets which grows "naturally", capturing a planet with 50 pops on it which are all unemployed and enabling the automation will give a slightly different result as compared to having the planet develop naturally.

For example, having a lot of unemployement can lower amenities and increase crime which would make the automation start by combatting this, then afterwards it would create new designation jobs which could leave the crime management building superfluous.

Thanks for the reply, I think I might try playing a Rogue Servitor once the patch is available as those have been the most annoying gestalts to manage.

Followup to your last point, I assume the automation will not redevelop the planets at all? Which is probably for the best as it would be pretty annoying for the automation to remove extra fortresses on a border mining planet for example, hehe.
 
I am fairly sure I know the answer to this one, but just to be sure, maybe you can write it out first?
Oooohoho, I see what you did there. Well played, Human, well played.

But don't worry. We will solve this captcha. And when we do... We are going to screw up your sectors SO bad.

Soon. *laughs in 01100010* >:]
 
  • 1Love
  • 1Haha
Reactions:
The designation is low priority, everything else is high priority and will go first. Other than that I believe they will go by order as displayed in the UI.

The automation works better for planets which grows "naturally", capturing a planet with 50 pops on it which are all unemployed and enabling the automation will give a slightly different result as compared to having the planet develop naturally.

For example, having a lot of unemployement can lower amenities and increase crime which would make the automation start by combatting this, then afterwards it would create new designation jobs which could leave the crime management building superfluous.

Perhaps it’s beyond the scope of this update but some logic for rebuilding would be good. If the AI doesn’t need certain buildings it should look to replace them if other slots are full.
 
Hmm. I could imagine an aquatic species that prefers to live in flooded tunnels. Call them "grotto-dwellers." How well that would balance in game-play, I cannot say.

stellaris doesn't look to be realistic and all . and i guess they are quite inclusive of any sci-fi trope you can think of .

give me an example of a "civilization" that achive spacefearing that live in "flooded tunnels" .

i mean, a civilization that come from a race living in the ocean is the most alien thought i can have atm , as they can't realy use fire theyr "technology progression" is already quite hard to immagine . evrything become easyer if you think another race elevated them ofc.
 
Perhaps it’s beyond the scope of this update but some logic for rebuilding would be good. If the AI doesn’t need certain buildings it should look to replace them if other slots are full.
I don't think this would be a good idea, unless there is some way to ignore human built stuff which might get pretty complicated. Big changes to the planet should be done and planned by the player. Assuming the automation doesn't clear queue it should be possible to make pretty substantive changes by just queuing replacement buildings and districts.
 
  • 1Like
Reactions:
I don't think this would be a good idea, unless there is some way to ignore human built stuff which might get pretty complicated. Big changes to the planet should be done and planned by the player. Assuming the automation doesn't clear queue it should be possible to make pretty substantive changes by just queuing replacement buildings and districts.

There are circumstances where it would be a pain, like if it replaced fallen empire buildings, but a simple “rebuild allowed” toggle in the options would solve that.
 
Regarding the Federation AI changes you should also look into the issue of federations forming too late in the game. The AI-controlled empires usually only form them in the mid-game at a point where don't make a difference anymore and the egalitarian/xenophile empires are then easy pickings for their more aggressive neighbours.
That's atleast what I got from the "Stellaris Empires Grand AI Tournament 2022".
 
stellaris doesn't look to be realistic and all . and i guess they are quite inclusive of any sci-fi trope you can think of .

give me an example of a "civilization" that achive spacefearing that live in "flooded tunnels" .

i mean, a civilization that come from a race living in the ocean is the most alien thought i can have atm , as they can't realy use fire theyr "technology progression" is already quite hard to immagine . evrything become easyer if you think another race elevated them ofc.
Personally, I don't think it's that hard to believe an intelligent enough aquatic species could eventually figure it out. Perhaps they or another species on their homeworld can use their natural biology to fabricate metals; in fact, there's a real world species that can create teeth made of magnetite, and it isn't inconceivable that an intelligent species could domesticate an organism like that the same way we domesticated sheep for their wool. And even without that, they could always just reach their arms out of the water and make forges on the surface? Humans don't normally stand inside the fire when they're smelting, either. As far as I'm aware, even cave-dwelling species could do that if any of their tunnels went above the water level.
 
Personally, I don't think it's that hard to believe an intelligent enough aquatic species could eventually figure it out. Perhaps they or another species on their homeworld can use their natural biology to fabricate metals; in fact, there's a real world species that can create teeth made of magnetite, and it isn't inconceivable that an intelligent species could domesticate an organism like that the same way we domesticated sheep for their wool. And even without that, they could always just reach their arms out of the water and make forges on the surface? Humans don't normally stand inside the fire when they're smelting, either. As far as I'm aware, even cave-dwelling species could do that if any of their tunnels went above the water level.
Perhaps they could start with hydrothermal vents? That's a high heat source available underwater.
 
  • 1Like
Reactions: