• 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 #24 - AI

Hello everyone and welcome to yet another development diary for Stellaris! Today, I'll be talking about AI, and not of the robotic kind. I'm talking of course, of the game AI, which is currently being developed by myself and @merni who is the dedicated Stellaris AI programmer, while I'm just temporarily on the project to flesh out certain aspects of the AI before launch.

Artificial Personalities
A major challenge when making the Stellaris AI has been the randomized nature of the game. With thousands of different combinations of ethoses and traits, there's a risk that every AI Empire ends up feeling the same to the player, or fall into a very basic categorization of 'aggressive aliens' and 'peaceful aliens'. I as the AI programmer might know that an AI with Fanatic Collectivism makes their decisions differently from with plain old vanilla Collectivism, but it might all look the same to a player who doesn't have this foreknowledge.

In order to address this problem, we've implemented a system of AI Personalities that govern almost every aspect of how they behave, such as who they'll pick a fight with, which trade deals they are interested in and how they budget and utilize the resources available to them. This personality is determined by their ethos, government form and traits, and will be shown to the player when diplomatically interacting with that Empire. To feel recognizeable to the player, all of the personalities are rooted in sci-fi tropes, so that you'll immediately know who the Klingons are to your United Federation of Planets.
6ZK8UQS.png


Personalities naturally have a bigger impact on diplomacy than anything else - if your goal is to form a Federation, it'll be much easier to do so with an Empire of Federation Builders than a bunch of Ruthless Capitalists, and forget getting Xenophobic Isolationists to agree to any such proposal unless they have a very pressing reason. You can tell how an Empire feels about you from their Attitude, which is primarily driven by opinion, and affects factors such as what diplomatic offers they'll consider and how fair a shake they will give you in trade deals.
h76nTL1.png


In addition to the regular personalities, there is also a special set of personalities for Fallen Empires. Instead of the usual mix of Ethoses, each Fallen Empire has only a single Fanatic Ethos - the single remaining ideal they hold to after centuries of seeing what the galaxy has to offer. This Ethos determines their personality, which in turn affects how they view your actions. For example, a Xenophobic Fallen Empire will want nothing to do with you or anyone else and will be very upset if you start encroaching on their borders, while a Spiritualist Fallen Empire will consider themselves the protectors of the galaxy's holy sites, and will not look kindly on your colonists trampling all over their sacred planets. If you think angering a Fallen Empire is harmless because they won't conquer you - think again. Fallen Empires get a special wargoal to force you to abandon planets, and will be more than happy to cut your upstart species down to size if you don't show sufficient respect for your elders.
KViqQD9.png


Threats and Rivals
So what then, is a pressing reason for an AI to go against their personality? Well, one such reason is Threat. Threat is a mechanic somewhat similar to Aggressive Expansion in Europa Universalis 4. Conquering planets, subjugating other Empires and destroying space installations will generate Threat towards other Empires. The amount of Threat generated depends both on how far away the Empire is from what's happening and on their Personality. Xenophobic Isolationists won't care if you're purging aliens half a galaxy away, but if all the planets around them being swallowed up by an expanionistic Empire, they'll definitely take note. Empires that are threatened by the same aggressor will get an opinion boost towards each other, and will be more likely to join in Alliances and Federations - if you go on a rampage, you may find the rest of the Galaxy uniting to take you down, and while Threat decays naturally over time, there's no guarantee that the alliances formed by your imperialism will break up even if you take a timeout from conquering... so expand with care.

Another feature borrowed from EU4 to drive AI behaviour is Rivals. Any independent Empire that are you not allied to can be declared a Rival, up to a maximum of 3 Rivals at the same time. Having an Empire as a Rival will give you a monthly increase of Influence, with the amount gained based on how powerful they are relative to yourself - having a far weaker Empire as your antagonist will not overly impress your population. It is further modified by Ethos, with Militarist Empires benefitting significantly more from Rivalries than Pacifist ones (but paying more influence to be part of an Alliance). Naturally, Empires won't be particularly happy about being declared a Rival, and are pretty likely to rival you right back. Having a Rival will improve relations with their enemies and worsen relations with their friends, so the Rivalry system will act as a primary driver of conflict and alliance in the galaxy.
pEIgTBV.png


AI Economics
Finally, I wanted to cover the topic of the AI's bookkeeping. While it may be far less exciting and far less visible to the player than its diplomatic behaviour, having solid economics is one of our biggest priorities for the Stellaris AI, for multiple reasons. Firstly, so that the AI is able to compete reasonably with the player without resorting to outright cheating. True, the AI will never be as good as an experienced player, but there is a big difference between the player being able to outproduce one AI Empire and the player being able to outproduce five of them together. Secondly, because of the Sector mechanic that was covered in DD 21, the AI will actively be making construction and management decisions on the player's planets, and while - again - it will never be as good as an experienced player making the decisions themselves, it needs to be good enough that the player doesn't feel like the AI is actively sabotaging their Empire.

In order to accomplish all this, a huge amount of time has been put into the AI's budgeting system. Every single mineral and energy credit that the AI takes in is earmarked for a particular budget post such as navies or new colonies, with the division between the posts being set according to the AI's personality and what it needs at the time. The AI is only permitted to spend appropriately budgeted resources, so it'll never fail to establish new colonies because it's too busy constructing buildings on its planet, or miss building a navy because mining stations are eating up its entire mineral income. In times of dire need, it can move resources from one budget post to another - if it's at war and its navy gets destroyed, expect it to pour every last mineral into building a new one.

When making decisions about what to construct, the AI looks primarily at what resources it has a critical need for (such as Energy if it's running a deficit), secondarily at what resources it's not producing a lot of compared to what it expects an Empire of its size to produce, and lastly at whatever it deems useful enough for the mineral investment. Sectors have additional logic to ensure they produce more of the resource you've set them to focus on, so an Energy sector will naturally overproduce Energy - you told it to, after all.
12eo2mu.png


Alright, that's all for today. Next week we'll be talking about debris and the fine art of reverse engineering.
 
Last edited by a moderator:
  • 156
  • 128
Reactions:
How involved will fallen empires get? Will they get upset over certain techs? Like for example a fallen empire that decayed thanks to AI seeing that my empire have started to research sentinent AI show up and tells me to stop or they will wreck me.
 
  • 3
Reactions:
How involved will fallen empires get? Will they get upset over certain techs? Like for example a fallen empire that decayed thanks to AI seeing that my empire have started to research sentinent AI show up and tells me to stop or they will wreck me.


Great thought! Will they warm against late game disasters? Could a fallen empire have gotten to that state after they themselves defeated one of these late game events and stagnated due to the sheer horror of it?!

I can't wait for this game!!!
 
You mentioned the improbability of getting +1000 opinion with another empire without resorting to cheats, can the same be said for being able to get -1000?

You'd be amazed how much easier it is to offend people even more, compared to impressing them on an ever increasing scale.
 
  • 3
Reactions:
Pff, the internet doesn't care about UKIP these days. You should instead say something about them wanting to build a yuuuuuuuuuge wall around Space Mexico.



I don't think Collectivist means wants to make Federations. I guess it's more about the type of social organisation within their empire (i.e. are they the Swarm or the Network?) than about their attitude to other empires (which I guess is more dependent on Xenophile/Xenopobe).
I'm not talking about federations I'm talking about vassals, I'm talking about stepping in and absorbing a lesser race to their collective. And the soviets used that kind of propaganda often enough.
 
Last edited:
I just have two questions: will there be a beta, and if so, how can I maximize my chance of being able to participate?
Its in closed beta, and participants are chosen on their past dealings with them, most likely
 
I just have two questions: will there be a beta, and if so, how can I maximize my chance of being able to participate?

The game entered beta sometime before February, there was no post and almost certainly won't be one for beta invites for Stellaris. I'm a bit bummed by this too, but I know that if I got into the beta, I'd have a hard time repetitively doing the same one or two actions over and and over and over and over again just to figure out what sequence of events caused a bug to happen for 3% of the gaming community.

That is what a proper beta tester does, most people that get into betas just play the game and if they report a bug they only report the barest details that are not nearly as effectively as carefully screened/trained QA
 
  • 9
Reactions:
You'd be amazed how much easier it is to offend people even more, compared to impressing them on an ever increasing scale.
I figured as much, just wanted to see if he would clarify it
 
I just have two questions: will there be a beta, and if so, how can I maximize my chance of being able to participate?

People shouldn't downvote you for asking an honest question. But here's the short version: Paradox does not have a tradition of doing open betas and there is no known method of becoming one of the small, closed circle they do use.

There are many downfalls of betas and early access, one of which is that people have a distorted idea of what they are and that normal users are not generally good beta testers. It is a somewhat viable release method for new companies, not big, old established ones.
 
  • 2
Reactions:
I know it's maybe way way too early to be talking about expansions, but a neat feature for down the line a bit would be to allow sectors to build and maintain small defense fleets. Nothing major, just enough to buy some time for the navy to arrive. Like a space Limitanei.

It would also be really cool to at some point be able to give out titles to the sector governors. As a monarchy, you could name counts, dukes, marquis in the case you list, etc.

Unrelated, I think I remember some previous talk about how Fallen Empires can occasionally begin progressing again. Is this still the plan?

I just had another thought. Will it be possible to observe AI games? I know this might sound strange, but I'd love to be able to slap together an AI empire, toss them into the galaxy with a bunch of others and root for them as they play through the game while I watch. I have a bit of a fascination with watching AIs duke it out with each other.
 
Last edited:
  • 7
Reactions:
Collectivism and Individualism are internal creeds. It does not reflect greatly in foreign policy. That's what xenophobia and xenophilia are for.

A Fallen Empire, no matter how xenophobic or xenophile, materialist or spiritualist it is, will consider you a lesser species worth of being stumped on or below the capacity for true enlightenment. They will not unite with you or make you vassals, for even the latter you are not worthy of. In general, you do not make a pet out of a cockroach.
I was more about that a collectivist race would interact with others as a collective as an empire, if one unlikely to interfere in the afairs of lesser beings, while individualists would be more likely to be encountered as individuals doing their own thing (eg the doctor).
And if we look at collectivist states on earth they have often enough had some sort of global perspective on it. And if you want to have a behaviour for a collectivist FE then something like that is probably what you have to go with. Or like the Q continuum, or the ancient collective. Those all care about the lesser species if being unwilling to meddle in their affairs. Instead believing that when the lesser species eventually prove themselves worthy they'll join the collective.
And I doubt that most fallen empires in the game are remotly as powerful as those two, in fact I doubt the ancients would consider the technolgical diffrence betwen their own pre ascension selves (the most techinologically advanced civilisation in the stargate franchise) and modern man to be even mentionable.
 
I don't think Collectivist means wants to make Federations. I guess it's more about the type of social organisation within their empire (i.e. are they the Swarm or the Network?) than about their attitude to other empires (which I guess is more dependent on Xenophile/Xenopobe).
I don't think that collectivist/individualist can be totally removed from the equation as to how they will behave in external politics. Neither do I think that xenofobe xenophile will not affect internal politics (in fact we know the latter the be true we know it affects issues such as slavery).
 
I was more about that a collectivist race would interact with others as a collective as an empire, if one unlikely to interfere in the afairs of lesser beings, while individualists would be more likely to be encountered as individuals doing their own thing (eg the doctor).
And if we look at collectivist states on earth they have often enough had some sort of global perspective on it. And if you want to have a behaviour for a collectivist FE then something like that is probably what you have to go with. Or like the Q continuum, or the ancient collective. Those all care about the lesser species if being unwilling to meddle in their affairs. Instead believing that when the lesser species eventually prove themselves worthy they'll join the collective.
And I doubt that most fallen empires in the game are remotly as powerful as those two, in fact I doubt the ancients would consider the technolgical diffrence betwen their own pre ascension selves (the most techinologically advanced civilisation in the stargate franchise) and modern man to be even mentionable.

I doubt it.

In terms of human culture, American culture is rather individualistic on a global scale, but national diplomacy is still as much negotiations with the central government as it is with more collectivist countries such as China. Internal collectivism does not mean a nation is externally extroverted or vice versa.

The Xenophilia/xenophobia and Pacifism/Militarism axis are far more related to degree of external relations and the nature thereof. A collectivist may communicate better with another collectivist and an individualist better with an individualist, sure as being very spiritual probably helps communication with other spiritual nations and put you at odds with materialists.

The nature of stagnated empires seem very much to be the same as on Earth historically: Complete isolation and a spurred desire to continue evolving with no external pressure to do so.
 
  • 2
  • 2
Reactions:
It would also be really cool to at some point be able to give out titles to the sector governors. As a monarchy, you could name counts, dukes, marquis in the case you list, etc.

Unrelated, I think I remember some previous talk about how Fallen Empires can occasionally begin progressing again. Is this still the plan?

I just had another thought. Will it be possible to observe AI games? I know this might sound strange, but I'd love to be able to slap together an AI empire, toss them into the galaxy with a bunch of others and root for them as they play through the game while I watch. I have a bit of a fascination with watching AIs duke it out with each other.

considering previous games have this option(with the observe console command), i'd assume stellaris will ahve it too.
 
  • 4
Reactions:
I was looking at this game, looks like a great game. I've played MOO (the newest one) Galactic Civ, Sins of the Solar Emire and Homeworld. I loved those games, and looking at this, this looks like the best of all of those. What I am wondering, is the planets. In SOASE their galaxy was...Very odd. One sun surrounded by like 50 planets. Now that's just not realistic, you would have 1 star surrounded by like 10 at a max of planets. In Stellaris, how are the planets and stars set up?