• 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 #149 - Technical improvements

Hi everyone, this is Moah. I’m the tech lead on Stellaris and today I’m here to talk about the free 2.3 "Wolfe" update that will be arriving together with Ancient Relics, and what it brings to the table in terms of tech.

Stellaris is going 64 bits.
People have been clamoring for this for a while now, and various factors have led us to finally do this for this patch. I should temper your expectations though: while many have claimed that this would be a miracle cure for all their issues with Stellaris, the reality is somewhat more tame.

What does it mean?
The one solid benefit is that Stellaris is no longer limited to 4gb of memory, and won’t crash anymore in situations where it was reaching that limit. For people who play on huge galaxies, with many empires, many mods or well into 3000s, this will be a boon.

In terms of performance, though, it doesn’t change much. Without drowning you in technical details, let’s just say that some things go faster because you handle more data at once, some things go slower because you have more data to handle. In the end, our measurements have shown no perceptible difference.

Finally, the last effect of switching to 64 bits is that the game will no longer playable on 32 bits computers or OSes. We don’t think this will affect many people, but there you have it.


What about Performance?
I know that’s everyone’s favourite question, so let’s do our best to talk about it. First, let me dispel some notions floating around in various forums: Stellaris does use multithreading, and we’re always on the lookout for new things to thread. In fact between 2.2.0 and 2.2.7, a huge effort was made to thread jobs and pops, and it’s one of the main drivers of performance improvement between these version.

Pops and jobs are indeed what’s consuming most of our CPU time nowadays. We’ve improved on that by reducing the amount of jobs each pop evaluate. We’ve also found other areas where we were doing too much work, and cut on:
  • Ships calculating their daily regeneration when they’re at full health
  • Off-screen icons being updated
  • Uninhabitable planets doing the same evaluations as populated planets
Why do these seemingly pointless things happen? Well, we generally focus on getting gameplay up and working quickly so that our content designers can iterate quickly, and sometimes things fall through the cracks. Some of these systems are also quite complex and the scale of the new code is not so easily apparent. Sometimes, not limiting the number of targets is good enough because you’re not doing much but then, months later, someone adds more calculations or the number of objects explodes for unrelated reasons, and suddenly you’ve got a performance issue.

Modifiers
One thing that sets Stellaris apart from other PDS title is how much we use (or abuse) modifiers. Everything is a modifier. Modifiers are modified by other modifiers themselves modified by other modifiers, and sometimes by themselves. It’s quite hard to follow, and leads to every value being able to change at any time without your noticing.

“Why don’t you just compute jobs when a new one appears?” has often been asked around these parts. Well, a short answer to that is it’s really hard to know when a new job appears. You can get jobs from any modifier to: country, planet, pops. Each of these can get modifiers from ethics, traditions, perks, events, buildings, jobs, country, planets, pop, technology, etc.

Until now we were trying to calculate modifiers manually, forced to follow the chain in its entirety: when you recompute a country modifier, you then calculate their planets modifiers, and then each planet would recalculate their pops modifiers. Some of our freezes were just that tangled ball of yarn trying to sort itself out.

NexRiPkna2utTqAzF9H0DEjOCwHVsI4EejYO-vMQMh6QwUB-_uP7dXmpjkwXzOOKoiwDqkSzd9tlLmN3DlFN2R06A62od6XxWm8xh99XRDfRFRP3vVj42GBIaDaXSK7jjyKdS39b

This is our modifier flow charts. It’s not quite up to date, but gives you an idea of the complexity of the system (Unpolished because it’s a dev tool, and not made for the article).

No More!
For 2.3 “Wolfe” we have switched to a system of modifier nodes, where each node register what node they follow, and is recalculated when used, following the chain itself. We have modifiers that are more up to date, and calculated only when needed. This also reduces the number of pointless recalculations.

This system has shown remarkable promise, and cut the number of “big freezes” happening around the game (notably after loading, for example). It has some issues, but as we continue working with it, it’ll get better and help both with performance and our programmers’ sanity.

So, what’s the verdict?
In our tests, 2.3 “Wolfe” is between 10% and 30% faster than 2.2.7 right now. Hopefully it’ll stay that way until release, but the nature of the beast is that some of these optimizations break things and fixing the issues negate them, so we can’t promise anything.

IuIGuQ4cXPvjCEMWG_AowiNIFXhzpsPIcphmCVJD79vQqVMqUeZCqCoVfDlWDNZ3YNkAScYAJh2ebft947YsqoOhG7A_4pNBWxjZ6L9se5lkEEImNYZ4uOpTMWj-amEiwSYdirpd


Measurements provided by @sabrenity , using detailed info from the beta build. It’s worth noting the “SHIPS_SERIAL” purple line has since been eliminated.

AI
Another forum favorite, we have done some improvements to the AI. First, with @Glavius ’s permission, we’ve used his job weights to improve general AI job distribution. We’ve also done the usual pass of polish and improvements, and of course taught the AI how to use all our new features.


What else is new?
We’re also getting a new crash reporter that will send your crash report as soon as they happen rather than next time you start the game. We’ve improved our non-steam network stack for connectivity issues, etc.


All right, enough of my yammering. This has turned into a GRRM length novel, and even though there are many more areas we could cover, we’ll just turn this for your perusal.
 
Last edited:
  • 1
Reactions:
When it comes to AI empires building gateways, I wish they built fewer gateways and more productive Megastructures of their own.

Gateways are usefull of course, but it seems late game the AI spams them everywhere.
Maybe it would be useful to add some restruction on gateways.. maybe 3 jumps between any of them
Nearer and thr gates will explode like a supernova ;-)
 
why not consider trade value as an independent output? Just like goods,metals?
Because it's... not an output? It's literally just civilian economic activity.
 
Edit: And no thats not how we calc the basic table, would take too long time
As well as you never would use "each-to-each" lookup table of full routes due to size of it. I hope )
But if you do, well.. it will explain so frequent OOM CTDs ))

well sure, but not BFS as BFS, thats why its called a* O;P
Tbh, I doesn't get the clue.

I guessed with myself the pathfinding itself, but all guesses are ended up dead by the fact what there's a lot of other data that will push pathfinding data out of CPU cache all the time. And pathfinder also is used all the time:
The pathfinder itself is not slow, it just gets hammered with calls lol
Therefore it doesn't matter, how fast pathfinder would be, it will wait for caching every time it gets a call, pushing out other data that will be cached back almost immediately.

So the problem isn't about pathfinder, but rather about the whole structure of data and data query flows.

You already restructuring modifiers. Good call. Hope you wouldn't stop at it :)
 
Great news! One of the exceptional devs out there who truly deserve massive respect for how you manage to cooperate with your community. There is only one thing that I wish you could add in upcoming update and probably most of the players have asked the same previously. As you know, in mid and late game, your population grow faster and faster with each new planet colonized, but when these planets reached their limits, there is a problem with unemployment and then you have to relocate each pop individually. In order solve this issue, could you add a button in planet menu, so you can be able to send all pops or only unemployed pops from one or even multiple planets to other places on your choice? I guess it may sound easy at first sight, but probably require a lot of work. Anyway, can we expect such kind of feature in future updates after "Wolfe" or you have an alternative solution to this issue?
 
there is a problem with unemployment and then you have to relocate each pop individually.
You do not have to do this. Just turn on Pop Controls and call it a day.

It's enough to reach 99.5% efficiency. Going for the full 100% efficiency will ALWAYS demand a lot of painful micro from the player.
 
Yeah, pretty much use population controls, that's why they are there. That .5% isn't going to be noticeable enough. Hell, pair it up with higher living standards if you haven' switched off of decent to make the unemployed pops less of an issue, while you wait for them to migrate elsewhere.
 
I'm still cranky that I couldn't buy Stellaris on 1.44MB floppy

I'm cranky that you can't get it on CD. Unlike you, though, I am not joking.
 
Our stats show less than 1% of users are still on 32 bit systems. The intent is never to abandon anyone, but ultimately tech needs to move on to allow further development, and our other option was to abandon all Mac users, period. That is not going to be done.

Speaking as a Mac user, thank you very much.
 
You do not have to do this. Just turn on Pop Controls and call it a day.

It's enough to reach 99.5% efficiency. Going for the full 100% efficiency will ALWAYS demand a lot of painful micro from the player.

Yeah, pretty much use population controls, that's why they are there. That .5% isn't going to be noticeable enough. Hell, pair it up with higher living standards if you haven' switched off of decent to make the unemployed pops less of an issue, while you wait for them to migrate elsewhere.
Alright, I understand what you mean, but it is not about going full efficiency, it just about making some things a little bit less annoying. Pop control option is quite useful only when you don’t want any excess growth, but you reach to that point at very end of session when the whole galaxy under your control. Migration cannot solve the issue neither, as it only works with organic species and limited per planet. I have played 3 sessions already to the 2600s and by now this pop management is most hated thing for me in the game. I will give you an example of my way of playing, which may be the typical strategy for most players. At the begging, I always try to find new habitable planets and quickly colonized them, usually there are 2 or 3 of them, depending on start settings, then after researching terraforming, I terraform at least 4 planets, colonized them and then I generate new jobs at very high rate, so I need more pops to move them to that planets, but by this time one or two planets already have maximum districts and buildings with no more jobs. Now, I want that my planets to have full speed growth for new jobs, but I have to move my pops from those planets with no jobs every time they become available to maximize profits, as I also have fleets with other things to pay for with energy credits, which mostly comes from pops that are working. Hope you get my point, your advices are good enough, but again, they cannot solve the problem I described.
 
Hope you get my point,
Yes, I do get your point. I got your point from the start. I'm just disagreeing with it. Even if Paradox made an auto-resettle, minmaxers will just find some OTHER tedious nigh-unnoticable bit of micro that they want automated to achieve 100% efficiency.
 
Pop controls costing stab is a disincentive no matter how you see it. The point of pop controls eventually is to lessen your micro and it does cut down on your pool of available pops meaning it is a loss already. I would say if anything it should give you a stab bonus to encourage its use.
 
Pop controls costing stab is a disincentive no matter how you see it.
Yeah, it's the trade-off you pay for not needing to worry about that planet anymore.
I would say if anything it should give you a stab bonus to encourage its use.
??? Because forcibly disallowing your people to have as many kids as they might want would somehow make a planet MORE stable?!
 
Yes, I do get your point. I got your point from the start. I'm just disagreeing with it. Even if Paradox made an auto-resettle, minmaxers will just find some OTHER tedious nigh-unnoticable bit of micro that they want automated to achieve 100% efficiency.
Actually, I don’t ask for auto-resettle, you right that automating one function, plyers will then want another one and another one to be automated, till the whole game is run by itself. As I previously mentioned, I just want a simple option that allows me to move multiple pops from one or several planets around other places. You see, it not the same as auto-resettle or anything like that, I still have to manage it by myself, the only difference is that there is a little less mouse-clicking activity. Maybe it is just me who ask too much, considering that such option still has not been added in game, seems like related to technical question.
 
Yeah, it's the trade-off you pay for not needing to worry about that planet anymore.
There is already a trade-off. Less pops. And if all that planets are, trouble, then the game should do sth to fix that.

??? Because forcibly disallowing your people to have as many kids as they might want would somehow make a planet MORE stable?!
No. Because the game should be helping the player help themselves. Its use is sth that should be encouraged to help decrease micro. With disincentives it does the opposite. The game can either offer automated ways to handle unemployment without losing out (and less pops is a big loss) or incentivize you to take that loss in order to avoid the micro. Disincentivizing that is bad game design.