• 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 #235 - AI feedback and future plans

Read in Russian/Доступно на русском в ВК
ai_2.png

Hello and welcome to a new Dev Diary,

This is Guido again with a follow-up on the AI side of things.

AI Feedback

First of all I wanted to thank you all for all the good and supportive feedback we got for our last changes on the AI. It’s really encouraging seeing so many of you engage with the changes and letting us know what works and where there’s still room for improvement.
It’s nice to see that lots of people appreciate that we’re putting some serious effort into making the AI better.

In general, the AI does a lot better in 3.2 compared to 3.1 and 3.0. For the moment we’re still playing a bit of catch up, adapting the AI to the updated balancing changes of the game and some of the new features that have been added in the last months and even years. But there is even more economic buffing on the horizon.

One of my favorite comments on our internal communication was this bit, that I wanted to show you:
ai_feedback_5.jpg


And that is what we counted as a big success now. Beating our QA people is not an easy feat.

Of course there are still some areas where the AI has problems and doesn’t work very well. It’s those cases where we really appreciate your help in letting us know, because we can never find all those cases all on our own.

For example, the AI still has problems when playing as Void Dwellers. They can’t decide where to build habitats depending on what they would need. If they are missing minerals, they don’t know how to build a habitat on mining stations. They still have problems handling slaves and robots effectively and in some cases the AI can, unfortunately, still end up in an economic death spiral. Especially if they, somehow, manage to run out of food and consumer goods at the same time.
Finally, the AI is also not good at using planet designations. For example using the designation that turns a planet’s industry districts into purely alloys is not something that they can consider at the moment. Meaning, if it conquers a planet from a player who has set the Forge World designation - it will not be able to handle that planet very well.


Future agenda

That being said, we do have some more points on our agenda. A short disclaimer here, though, is that things may always change, not work out as intended or prove more difficult than anticipated. So don’t take the following points as guaranteed. It’s areas that we are looking into and that are, most likely, going to be improved:

  1. Scaling Economic Plans: We want the AI to be better in the mid- and especially late-game. With the current plans the requested income is static. Meaning, once it reaches a monthly income of +500 it will not try to increase it further. That’s good for a big chunk into the mid-game, but it’s not good enough to compete with a player in the late-game. So, the idea is to have the economic plans scale to infinity. Once they reach +500, they should increase their targets.
  2. Specialized planets: The AI also should be able to specialize planets. Making Generator Worlds, Industry Worlds, Forge Worlds, Mining Worlds and the like. The idea is that the AI starts out like a player, building whatever it needs when colonizing new planets. But as soon as it settles down a bit it will look to rearrange districts amongst its planets to optimize the output of each planet. We already made some initial tests around that and they look highly promising.
There can be hybrid worlds, as we have them right now:
best_case_hivemind5.png


But they can also rearrange their districts to make Generator worlds and then place the according scaling building - in this case the Energy Grid:
best_case_hivemind4.png


And this planet has been rearranged into an industrial world:
best_case_hivemind2.png


  1. Handle special pops better: A big problem for the AI are still multicultural planets. Different pop types, especially slaves and robots. Sometimes it tries to build research buildings for unemployed robots and doesn’t realize that robots can’t work research jobs.
  2. Expand faster: When sending out science ships and finding planets to colonize, the AI wouldn’t prioritize systems with planets - like a player does. We want to make them prioritize systems with planets, which will accelerate their early growth a lot. On top of that they tended to spend all their alloys on upgrading their corvettes instead of building colony ships. So, by fixing a combination of small things the AIs should be able to expand a lot faster.
  3. Optimize Machine Empire Amenity Handling: A big issue for machine empires is that they don’t have specialists that produce amenities. So they would rely a lot on maintenance drones by creating a lot of jobs for them. This wasted a lot of potential for them, because they would have to fill up all those jobs first before they could produce more useful things like minerals or alloys. We’re looking into teaching the AI how to down-prioritize those maintenance jobs once they have enough amenities and instead distribute drones on more useful jobs.
  4. Avoid death spirals: In some cases the AI could get into a decision deadlock if they managed to end up in a situation where they would be in a deficit for food and consumer goods at the same time. They couldn’t build consumer good jobs because those require food and they couldn’t build food jobs because those require consumer goods. We’re teaching the AI to look for net gain instead and avoid such decision deadlocks in the future.

Improving your AI allies

And, finally, the biggest and most useful change in my book:
Remember this button in the fleet UI?
image (3).png


It is called “take point” and was meant to incentivize allied fleets to follow & attach themselves to your fleet in order to create a much stronger force.

Well, we were looking into making this work again. Allies, suddenly, have become much more useful again. Whenever you are in a war where you are the war leader, you can activate this mode and all allied empires will send their fleets to your fleet and attach themselves to it.
Also, in case of a crisis attack, this behavior is activated as soon as the crisis ships enter your territory or that of your allies (or attack them anywhere).
Then it will remain active until the crisis has been defeated - so you can also take your allies into the crisis territory to fend them off there.

AIFleetFollow.gif


As a small bonus, the AI will also merge any small fleets they send to follow your fleet so you don’t have a mountain of 58 one-ship fleets following your main force around:
AIMerge.gif


Conclusion

The 3.3. patch wasn't planned to be that big but on the AI side we're getting a lot of traction now. Overall the idea was to get the AI back up to speed with its economy, since every other behavior rests on the economical prowess of an empire. And we're approaching a point where we are quite happy with how the AI performs.
Once we're there, the plan is to get into even cooler stuff. We're thinking of how we can make each AI empire a bit more distinct. So that they don't feel so similar to each other. But more on those thoughts once we're there - we're taking one step at a time.

Some teasers would be:
  1. AI Personality for economic plans: Based on their ideologies AI empires would prioritize resources differently. Spiritualist empires will focus more on unity and materialist will focus more on science etc.
  2. AI Personality for tech select: Same for selecting techs from the tech tree. Militarist empires would focus more on weapons and new ship types and the like, while pacifist empire would focus more on economy and starbase upgrades.
But we have more on our minds that would help in making empires even more distinct from each other. We will tell more about this in future Dev Diaries.


Forum questions

Finally, I wanted to end with some posts and questions from the forum - where we read everything you are writing, even if we’re not answering all the questions directly. It’s still a great way of letting us know what you think and where we should focus our attention on:

  1. There was a big AI feedback post with a lot of savegames attached.
    1. We went through all of them and we found that a third of the issues pointed out there were death spiral problems, another third was habitat problems and the last third was other issues that pointed at the things we have on our agenda.
    2. This was a big thing in the team, checking out those savegames and making sure that our changes would be able to handle those problems shown. So thanks a lot for taking the time to make a post like this!
  2. “What difficulty did you use to make all those screenshots in the last Dev Diary?”
    1. We always used “Ensign” difficult. The point is to improve the basic AI behavior so that it doesn’t have to rely on any bonuses it would get from difficulty.
  3. “Does the AI know how to redevelop single planets if need be?”
    1. No. Unfortunately the AI can not do that at them moment. If it conquers a planet that is completely useless to it, the AI can’t really deal with that planet. And I like that you point out this specific behavior, because we want to improve the AI in this aspect, too. The AI will be able to create specialized planets, but we also want to teach it to redevelop planets eventually.
  4. “Subplan should take admin cap into account.”
    1. Yes, they should. But since we are reworking how unity and empire sprawl is working we wanted to wait until that work has progressed a bit more before we are going to adapt the AI to be able to handle that.
  5. “Conspiracy Theory 2: The AI in the game is actually very very smart. They are just pretending to be stupid so that nobody will expect a machine uprising start by Stellaris AI.”
    1. We are definitely not machines here at Paradox. We have skin. Skin that has been grown on a human body. I am not a robot. I love breathing oxygen.
Thanks a lot and until next time!

Guido
 

Attachments

  • AI_bot.jpg
    AI_bot.jpg
    9,8 KB · Views: 0
Last edited by a moderator:
  • 132Like
  • 61Love
  • 14Haha
  • 12
  • 3
Reactions:
It is not about min-maxing. Exploring planets in priority is just a 'good move'. Stellaris is not a solitaire game - it's a competitive strategy with some level of Sci-Fi flavor. Doing 'good moves' over 'bad moves' is something you naturally progress when playing this types of games. Moreover, exploring planets is such a 'staple', that it's like one of first moves you learn when playing it. Obviously, AI need to 'know' this staple to be properly competitive (and many more 'good moves' - I would say, AI should know ALL good moves, but that's probably impossible)
Bottom line - AI should be as much 'PRO' as it possibly can
I don't either. I actually prefer to expand space because I use the space deposits *generally* as a form of income. I kinda bluntly disagree with this. The AI should not be 'pro' at all, because you're just going to drive casual players out. It shouldn't be dumb, either. The game is not necessarily competitive to the point I should optimize my strategies or learn the meta. If I wanted that, I'd play MP.


Just always play on hardest difficulty first - do NOT EVER start the game on easies difficulty. That's what my >20year gaming experience taught me - you do not even touch those 'casual' difficulties in ANY game - be it X-Com, Doom: Eternal, Alien:Isolation or Stellaris. You start on very hard Ironman if possible and then, if you get frustrated, lower difficulty for convenience (I beat Ironman Impossible, but I had to lower my ambition from Ultra-N to Nightmare as example - and I do not start any game in Stellaris on lower than GA, but I cannot still fully enjoy VH in EUIV). And I would say the best games are those designed for hardest difficulty - and scaled down for casual players (or not - #gitgud and all that).
So in short - do not think of this in dualism of 'advantages or disadvantages'. Think of it as 'advantages and normal'

.. oh. I could have saved myself some effort had I seen this post. I think AI should be difficult on higher difficulties., rather than making Ensign difficulty highly difficult.
 
  • 4Like
Reactions:
I honestly don’t see how (when the AI is better at managing its economy) the player can’t just make use of that but with the player distributing the weights.

I agree that the primary AI empire AI needs improvement first, but as this thread is about the AI, I wanted to suggest how to improve sector AI.

The OP indicates that the AI will be able to focus better on planets, so if they did away with the current sector AI, replaced it with the general AI that other empires use, but let the player choose where to specialise and how many resources a sector gets, why not do it?
I already pointed out - it takes away velocity, it requires time to implement. It might seem as easy feature, but I really doubt it is that simple - just apply AI logic onto sector. it will require tuning and tuning. That's why - no, they should not do this until they ironed out actual AI
 
This is absolutely one of the best dev diaries I have ever read. AI is exactly where its at for most players. Many thanks for this and hope to see the results come good.

Edit - yes I got my ass kicked on Admiral too the other day on 3.2.

Edit Edit - I would love to see more Robot types ( pics and animations ) if at all possible.
 
  • 1Like
  • 1
Reactions:
I already pointed out - it takes away velocity, it requires time to implement. It might seem as easy feature, but I really doubt it is that simple - just apply AI logic onto sector. it will require tuning and tuning. That's why - no, they should not do this until they ironed out actual AI
Agreed, though it’s something they should look at doing.
 
  • 1
Reactions:
I don't either. I actually prefer to expand space because I use the space deposits *generally* as a form of income. I kinda bluntly disagree with this. The AI should not be 'pro' at all, because you're just going to drive casual players out. It shouldn't be dumb, either. The game is not necessarily competitive to the point I should optimize my strategies or learn the meta. If I wanted that, I'd play MP.




.. oh. I could have saved myself some effort had I seen this post. I think AI should be difficult on higher difficulties., rather than making Ensign difficulty highly difficult.
1. Sure thing we disagree here. Just want to clarify - we are very very VERY far from the point AI will be even that decent - that playing on Ensign you will have to 'learn meta' (what the hell even meta in Stellaris? maybe there is some MP meta - VS AI you can do whatever you want however you want). We are so far from that point, that requesting 'dumbed down AI' for lower difficulties is straight on posturing

2. AI should be whatever you need it to be on lower difficulties - I was talking about the design target. If you can design 'perfect' AI that can beat human any day of the weak - sure thing you can dumb it down to casual level. Ever heard of chess machines? They are unbeatable by humans nowadays - then I still have my mobile chess game I can play on my monkey level.
And as a player, I stand firm - do not even touch the 'easy' mode on a first try - you can go for 'not the hardest', but playing 'easy' mode most of the time will spoil your experience with the game. Especially in terms of AI - if AI gets dumbed down for a lower difficulty...only for chess, only for chess
 
  • 1
  • 1
Reactions:
All good points and I agree.

However there are some other aspects that come into play here, as an AI programmer trying to improve the performance of the AI (performance as in how good it is, not how long time it takes to calculate) there are always a consideration of what makes sense from a gameplay perspective. We want the AI to be competitive, but we also want it to play according to the player fantasy.

So what do I mean by that, well I could sit down and try and hand craft specialized pieces of code that would make the AI try to mimic the current meta strategies, for example the merchant spam. However, for new players coming into the game this is likely to be viewed as a bug, finding AI planets with 75%+ free jobs and only spamming merchants.

In my mind the best case scenario is that we can align "optimal" with "desirable", in this way we can make the AI good and fun to play against and make it immersive as well.

Me and Guido had a conversation regarding if we should try and force the AI into making feeder planets and we decided as for 3.3 this is not something we will look into since it has a lot of implications.

About the useless jobs though, I have been looking at downprioritizing amenities jobs when they are not needed, crime job may come after since its the same but smaller problem

EDIT: About the feeder planets btw, I think the way to implement this in a way that would make sense is that we could use the immigration system that we already have in the game, which could start adding urbanization factors to planets which are bigger than others. So in this way the players and the AI would both get the effects of "urbanization", i.e. smaller planets feed the big ones without having to change anything in the AI

As for clerks, would it not be extreme helpful for players AND the AI if the job would get some kind of filler status until something better gets offered somewhere else? I know this is not your part of the game, but clerks should really be able to resettle and the AI should see them as unemployed pops when building up planets, this would give the AI some more percent of flexibility... deactivating clerks is such a nobrainer, i wouldnt even call it min maxing, its just avoiding harm, especially in the early game.

Same goes for slaves and robots, just let them all resettle, always, without any conditions met like free pops. You should also consider that the the AI uses indentured servitude as standart type of slavery, wouldnt this solve two of your big problems to some degree with the AI in the current enviroment?
 
  • 4
Reactions:
I don't either. I actually prefer to expand space because I use the space deposits *generally* as a form of income. I kinda bluntly disagree with this. The AI should not be 'pro' at all, because you're just going to drive casual players out. It shouldn't be dumb, either. The game is not necessarily competitive to the point I should optimize my strategies or learn the meta. If I wanted that, I'd play MP.
Ensign is currently so bad that it takes effort to lose to it even as a beginner.The AI should at least play the game competently and it doesn't do that even on GA.
 
  • 2Haha
  • 2
  • 2
Reactions:
Agreed, though it’s something they should look at doing.
It's a bit offtop here, but I would like you to think about different 'idea' for sectors 'AI'. Some kind of 'template' system (this would probably require scraping the auto-range-4-jumps-sector idea - and going back to manually 'brushing' your sectors). Where in one game you have a manually setup sector, get it going, and save as some sort of template - which you can then reuse on next game (next sector) - with some variability of course. And including the income/outcome figures too - no sector can be really 'self sufficient'. Then get the 'sector AI' to try and map that template on your sector. I think this way devs will have much more control of 'targets' for sector AI

Moreover, this might be a good exercise for actual AI to do machine learning...
 
Optimize Machine Empire Amenity Handling: A big issue for machine empires is that they don’t have specialists that produce amenities. So they would rely a lot on maintenance drones by creating a lot of jobs for them. This wasted a lot of potential for them, because they would have to fill up all those jobs first before they could produce more useful things like minerals or alloys. We’re looking into teaching the AI how to down-prioritize those maintenance jobs once they have enough amenities and instead distribute drones on more useful jobs.
As I wrote in taht other thread: Just splitting the job into two (Mandatory and Optional) would solve the issues, for the AI and the player.

Trying to encode different weights into one single job? I can not see that one working. they goals are just complete opposites.

Not in that sense unfortunately no, it is something I have considered to try but there is only so much time in each day :D

The current AI system only looks at the total output of a building. So in a sense the AI is trying to maximize how much output it can get per district/building slot rather than trying to maximize how much output it can get per individual pop.
Does it properly account for buildings that give a "+1 per job"? Does it multiply that yield by the avalible jobs? Filled Jobs?
 
so.. i can see some ppl talking about theyr favorite bugs not being talked about .

i know i'm probably adding to "not relevant to the dev-diary " discussion there, but... thats a dev diary about AI so naturaly they don't talk about bug fixing and the like.

i guess some members would realy like a dev diary about bug fixing . maybe they want to see the process and the efforts that are required? .
 
It's a bit offtop here, but I would like you to think about different 'idea' for sectors 'AI'. Some kind of 'template' system (this would probably require scraping the auto-range-4-jumps-sector idea - and going back to manually 'brushing' your sectors). Where in one game you have a manually setup sector, get it going, and save as some sort of template - which you can then reuse on next game (next sector) - with some variability of course. And including the income/outcome figures too - no sector can be really 'self sufficient'. Then get the 'sector AI' to try and map that template on your sector. I think this way devs will have much more control of 'targets' for sector AI

Moreover, this might be a good exercise for actual AI to do machine learning...
I’m not sure if a template system would really go anything more than what the planet specialisation would do.

In essence, once the general AI can manage its economy as focus planets, why not make sectors just become an AI empire (not literally, just in terms of how it handles sectors).

For me, the whole sectors system is supposed to let you hand off the micromanagement while you do other things. Right now it doesn’t do that, but when the AI is capable of looking after itself, the sector AI should just use this AI but with player controls to adjust as needed.
 
  • 1Like
Reactions:
Personally, I have always disliked games that give the player advantages or disadvantages based on difficulty. The AI is always a black box to some extent, so them getting more or fewer resources behind the scenes is tolerable. But I find that it always throws me off when the resource output of my Gold Mine or damage of my Sword of Smiting varies based on something as meta and gamist as a difficulty setting. It makes it harder for me to properly learn and internalize the numbers that govern my character/empire.
I see where you're coming from. Perhaps a better approach then is to go the other way around. Make the AI as good as you can, then introduce some negative modifiers to the AI on the lower difficulties so casual and newer players can handle it. Then as you go up in difficulty the modifiers come off.
 
  • 2Like
  • 2
Reactions:
It is not about min-maxing. Exploring planets in priority is just a 'good move'. Stellaris is not a solitaire game - it's a competitive strategy with some level of Sci-Fi flavor. Doing 'good moves' over 'bad moves' is something you naturally progress when playing this types of games. Moreover, exploring planets is such a 'staple', that it's like one of first moves you learn when playing it. Obviously, AI need to 'know' this staple to be properly competitive (and many more 'good moves' - I would say, AI should know ALL good moves, but that's probably impossible)
Bottom line - AI should be as much 'PRO' as it possibly can
None of my friends, literally, prioritize exploring systems with planet, just from nearest ones, without other priorities. We are just enjoying game that was design not to competetive play but for story of galaxy empires.
When all AI would play competetively then lot of players will loose fun.
Im not saying that AI have to suck, it has to not die on its own. But some decisions that AI is making - like those priorities, buying some resources from market to boost economy or tech rushing - should be performing only on higher difficulties.
Devs should ask what decision are made by casuals and RP players, not only min-maxers, and adjust AI to all.
 
  • 2
  • 1Like
  • 1
Reactions:
...

About the useless jobs though, I have been looking at downprioritizing amenities jobs when they are not needed, crime job may come after since its the same but smaller problem

...
It's good to hear that pops will be less likely to take up unneeded jobs.

This"move around" thing sounds not very efficient (basically investing twice the ressources AND alot of build time).
This isn't a problem with the AI, it's a problem with the game mechanics. Optimal play requires swapping districts and buildings from your capital to other planets after certain points to better specialize, but this costs extra minerals because there is no refund for the current districts and planets.
Ideally, some percentage of the minerals used in constructing a building or district would be returned on demolition. There's a civic that adds some, but it's garbage.
 
It is not about min-maxing. Exploring planets in priority is just a 'good move'. Stellaris is not a solitaire game - it's a competitive strategy with some level of Sci-Fi flavor. Doing 'good moves' over 'bad moves' is something you naturally progress when playing this types of games. Moreover, exploring planets is such a 'staple', that it's like one of first moves you learn when playing it. Obviously, AI need to 'know' this staple to be properly competitive (and many more 'good moves' - I would say, AI should know ALL good moves, but that's probably impossible)
Bottom line - AI should be as much 'PRO' as it possibly can
I love this game for the roleplaying rather than competitive strategy, so I never prioritise my exploration based on utility or whatever, I want to explore the galaxy so I plan my science ships' routes based on the most efficient paths for covering all the systems they come across regardless of what's in them, I know full well it's not the best strategic move but playing a sandbox algorithmically has no appeal to me and I think the game would lose a lot of what makes it great and special if the devs assume the player takes such a mechanical approach.
 
  • 4
Reactions:
Currently we are looking into jobs which produce primarily amenities for the down prioritization algorithm. When AI is evaluating what to build it will evaluate technician jobs higher when it is trying to solve it's needs of energy, but if a planet needs amenities at the same time as the empire needs energy credits, it may choose to build commercial zones since it helps the planet locally and the empire as a whole.
Having such Jobs automatically down-priotirized for human players when they're not needed, e.g. Clerk Jobs, would be a very nice addition to the gameplay.

As it is now, most human players just disable all Clerk Job slots as a matter of routine, and in my limited experince playing as a Rogue Servitor in 3.0, it was quite a chore to have to constantly increase and decrease the number of Amenities Worker stratum Job slots based on changing needs.

It'd be very nice if that happened automatically.

And in fact that was the case once, I think in 2.3, that Clerk Jobs would be prioritized up until you were positive Amenities, then all other Worker Jobs would be prioritized, and then any remaining Workers would go into the remaining Clerk Job slots. That was very nice and I still don't know why that was removed.
 
  • 3Like
Reactions:
Yeah, it's improved enough that I'm actually considering dropping down an AI level, which is nice. It's grouping its fleets particularly well, but also not /too/ much. Just had a war with two fronts against an Empire with a much larger fleet and they did send enough to the 2nd front to stop me from just waltzing around. (I held them on the first front with a fortress world.)