Stellaris Dev Diary #149 - Technical improvements

  • Crusader Kings II Expansion Subscription

    Subscribe to the CK II Expansion and enjoy unlimited access to 13 major expansions and more!


  • Crusader Kings III Available Now!

    The realm rejoices as Paradox Interactive announces the launch of Crusader Kings III, the latest entry in the publisher’s grand strategy role-playing game franchise. Advisors may now jockey for positions of influence and adversaries should save their schemes for another day, because on this day Crusader Kings III can be purchased on Steam, the Paradox Store, and other major online retailers.


    Real Strategy Requires Cunning

Moah

Platypus Admirer
49 Badges
Sep 20, 2011
662
2.901
  • Crusader Kings II
  • Europa Universalis IV: Pre-order
  • Sengoku
  • Semper Fi
  • Europa Universalis IV: Res Publica
  • Magicka
  • Heir to the Throne
  • Hearts of Iron III
  • Europa Universalis IV: Call to arms event
  • Europa Universalis IV: Wealth of Nations
  • Europa Universalis IV: Conquest of Paradise
  • Europa Universalis IV: Art of War
  • Divine Wind
  • Cities in Motion
  • Europa Universalis III: Chronicles
  • Europa Universalis III
  • Crusader Kings II: Sword of Islam
  • Crusader Kings II: Sunset Invasion
  • Crusader Kings II: Sons of Abraham
  • Crusader Kings II: The Republic
  • Europa Universalis III Complete
  • Crusader Kings II: Rajas of India
  • Crusader Kings II: The Old Gods
  • Crusader Kings II: Legacy of Rome
  • Crusader Kings II: Charlemagne
  • Stellaris: Galaxy Edition
  • Stellaris - Path to Destruction bundle
  • Stellaris: Leviathans Story Pack
  • Stellaris: Galaxy Edition
  • Crusader Kings II: Way of Life
  • Stellaris: Synthetic Dawn
  • Tyranny - Bastards Wound
  • Shadowrun Returns
  • Shadowrun: Dragonfall
  • Shadowrun: Hong Kong
  • Prison Architect
  • Stellaris
  • Crusader Kings II: Horse Lords
  • Europa Universalis IV: Common Sense
  • Pillars of Eternity
  • Europa Universalis IV: El Dorado
  • 500k Club
  • Victoria 2
  • Europa Universalis III Complete
  • Europa Universalis III Complete
  • Europa Universalis IV
  • Stellaris: Galaxy Edition
  • Stellaris Sign-up
  • Tyranny - Tales from the Tiers
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:

WhapXI

Captain
87 Badges
Sep 7, 2012
484
25
  • Victoria 2: A House Divided
  • Victoria 2: Heart of Darkness
  • Rome: Vae Victis
  • Europa Universalis III
  • Heir to the Throne
  • Divine Wind
  • Europa Universalis III: Chronicles
  • Crusader Kings II
  • Crusader Kings II: Sword of Islam
  • Crusader Kings II: Legacy of Rome
  • Crusader Kings II: Reapers Due
  • Stellaris: Leviathans Story Pack
  • Hearts of Iron IV: Field Marshal
  • Hearts of Iron IV: Colonel
  • Hearts of Iron IV: Cadet
  • Stellaris Sign-up
  • Stellaris
  • Prison Architect
  • Crusader Kings II: Conclave
  • Europa Universalis IV: Rights of Man
  • Stellaris: Digital Anniversary Edition
  • Europa Universalis IV: El Dorado
  • Crusader Kings II: Monks and Mystics
  • Stellaris: Distant Stars
  • Surviving Mars
  • Hearts of Iron IV: Death or Dishonor
  • Stellaris: Apocalypse
  • Age of Wonders III
  • Europa Universalis IV: Cradle of Civilization
  • Europa Universalis IV: Rule Britannia
  • Hearts of Iron IV: Expansion Pass
  • Europa Universalis IV: Golden Century
  • Age of Wonders: Planetfall
  • Stellaris: Federations
  • Stellaris: Lithoids
  • Europa Universalis 4: Emperor
  • Hearts of Iron IV: La Resistance
  • Crusader Kings II: Sunset Invasion
  • Europa Universalis IV
  • Europa Universalis IV: Dharma
  • Hearts of Iron IV: Expansion Pass
  • Europa Universalis IV: Cossacks
  • Stellaris: Humanoids Species Pack
  • Surviving Mars: First Colony Edition
  • Victoria 2
  • War of the Roses
  • Cities: Skylines
  • Crusader Kings II: Way of Life
  • Pillars of Eternity
  • Europa Universalis IV: Common Sense
This has turned into a GRRM length novel

If you guys could give him a hand in optimising his performance issues, I'm sure a lot of folk would be mighty grateful!
 

Ridixo

Lt. General
On Probation
39 Badges
May 25, 2018
1.385
1.164
  • Stellaris: Galaxy Edition
  • Stellaris: Synthetic Dawn
  • Stellaris - Path to Destruction bundle
  • Stellaris: Apocalypse
  • Stellaris: Leviathans Story Pack
  • Stellaris: Distant Stars
  • Stellaris: Ancient Relics
  • Stellaris: Megacorp
  • Stellaris: Humanoids Species Pack
  • Stellaris: Lithoids
  • Stellaris: Digital Anniversary Edition
  • Age of Wonders: Planetfall Premium edition
  • Age of Wonders: Planetfall - Revelations
  • Age of Wonders: Planetfall Season pass
  • Age of Wonders III
  • Crusader Kings II
  • Crusader Kings II: The Old Gods
  • Crusader Kings II: Sons of Abraham
  • Crusader Kings II: Sword of Islam
  • Crusader Kings II: Horse Lords
  • Tyranny: Archon Edition
  • Tyranny - Tales from the Tiers
  • Tyranny - Bastards Wound
  • BATTLETECH - Digital Deluxe Edition
  • BATTLETECH: Heavy Metal
  • BATTLETECH: Flashpoint
  • BATTLETECH: Season pass
  • Pillars of Eternity
  • Warlock: Master of the Arcane
  • Warlock 2: The Exiled
All of this looks great, i really hope for it to works as you say. My computer is not exactly state of the art, so any performance improvement is welcome.

Thanks for addressing this issues :)

We don’t think this will affect many people, but there you have it.

It will affect more people than you think.
 

Jamor

Imperator: Rome Producer
28 Badges
Mar 7, 2017
627
1.784
  • Crusader Kings II: Charlemagne
  • Stellaris: Galaxy Edition
  • Europa Universalis IV: Res Publica
  • Europa Universalis IV: Call to arms event
  • Europa Universalis IV: Wealth of Nations
  • Europa Universalis IV: Conquest of Paradise
  • Crusader Kings II
  • Crusader Kings II: Sword of Islam
  • Crusader Kings II: Sunset Invasion
  • Crusader Kings II: Sons of Abraham
  • Crusader Kings II: The Republic
  • Crusader Kings II: Rajas of India
  • Crusader Kings II: The Old Gods
  • Crusader Kings II: Legacy of Rome
  • Shadowrun: Dragonfall
  • Shadowrun Returns
  • Stellaris: Humanoids Species Pack
  • Stellaris: Synthetic Dawn
  • Stellaris - Path to Destruction bundle
  • Shadowrun: Hong Kong
  • Stellaris: Leviathans Story Pack
  • Stellaris Sign-up
  • Stellaris: Galaxy Edition
  • Stellaris: Galaxy Edition
  • Stellaris
  • Pillars of Eternity
  • Crusader Kings II: Way of Life
  • Europa Universalis IV
It will affect more people than you think.

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.
 

Spaceception

Lt. General
11 Badges
Jan 25, 2018
1.442
821
  • Stellaris
  • Stellaris: Leviathans Story Pack
  • Stellaris - Path to Destruction bundle
  • Stellaris: Synthetic Dawn
  • Stellaris: Apocalypse
  • Stellaris: Distant Stars
  • Stellaris: Megacorp
  • Stellaris: Ancient Relics
  • Stellaris: Lithoids
  • Stellaris: Federations
  • Stellaris: Necroids
Looking good, I guess there was gonna be a performance DD!
I usually play on medium galaxies, so this looks like it'll be a nice improvement for me. :)
Can't wait for next week!!
 

Caged Light

Recruit
39 Badges
Aug 31, 2018
3
7
  • Stellaris: Synthetic Dawn
  • Europa Universalis IV
  • Stellaris: Megacorp
  • Age of Wonders III
  • Stellaris: Humanoids Species Pack
  • Stellaris: Apocalypse
  • Surviving Mars: Digital Deluxe Edition
  • Stellaris: Distant Stars
  • Surviving Mars: First Colony Edition
  • Surviving Mars
  • Imperator: Rome Deluxe Edition
  • Imperator: Rome
  • Prison Architect
  • Surviving Mars: First Colony Edition
  • Stellaris: Lithoids
  • Stellaris: Federations
  • Stellaris: Necroids
  • Europa Universalis IV: Mandate of Heaven
  • Stellaris: Digital Anniversary Edition
  • Europa Universalis IV: Rights of Man
  • Hearts of Iron IV: Cadet
  • Europa Universalis IV: Mare Nostrum
  • Europa Universalis IV: Common Sense
  • Europa Universalis IV: El Dorado
  • Cities: Skylines
  • Europa Universalis IV: Art of War
  • Europa Universalis IV: Conquest of Paradise
  • Cities: Skylines - Snowfall
  • Europa Universalis IV: Res Publica
  • Europa Universalis IV: Wealth of Nations
  • Europa Universalis IV: Pre-order
  • Cities: Skylines - After Dark
  • Stellaris: Ancient Relics
It will affect more people than you think.

The last 32-bit CPU was 17 years ago. Can those computers even run Stellaris? And there's literally no reason for anyone with a newer CPU to have a 32-bit OS. In short, anyone who's affected by this kinda deserves it.
 

reaperman427

The sober Scot
26 Badges
Mar 28, 2014
1
0
  • Crusader Kings II: Legacy of Rome
  • Victoria 2: Heart of Darkness
  • Victoria 2: A House Divided
  • Semper Fi
  • Victoria: Revolutions
  • Hearts of Iron III Collection
  • Hearts of Iron III: Their Finest Hour
  • Hearts of Iron III
  • Europa Universalis IV
  • Crusader Kings II: Sword of Islam
  • Crusader Kings II: Sunset Invasion
  • Crusader Kings II: Sons of Abraham
  • Crusader Kings II: The Republic
  • For the Motherland
  • Crusader Kings II: The Old Gods
  • Crusader Kings II
  • Cities: Skylines - Parklife
  • Cities: Skylines - Parklife Pre-Order
  • Age of Wonders III
  • Crusader Kings II: Monks and Mystics
  • Hearts of Iron IV: Cadet
  • Stellaris
  • Europa Universalis IV: El Dorado
  • Cities: Skylines
  • Victoria 2
  • Stellaris - Path to Destruction bundle
I'm glad that optimisation is a primary focus of this patch, It'll be nice to run the game on more than 4gb of memory
 

VilhelmF

Sergeant
15 Badges
Mar 21, 2019
50
11
  • Crusader Kings II
  • Stellaris: Synthetic Dawn
  • Stellaris - Path to Destruction bundle
  • Pillars of Eternity
  • Stellaris
  • Hearts of Iron IV: Cadet
  • Stellaris: Digital Anniversary Edition
  • Stellaris: Leviathans Story Pack
  • Stellaris: Humanoids Species Pack
  • Stellaris: Apocalypse
  • Stellaris: Distant Stars
  • Shadowrun Returns
  • Stellaris: Megacorp
  • Stellaris: Ancient Relics
  • Crusader Kings III
Art team works on relics and adventures, tech team works on performance and some copy/paste from Glavius

Really solid, looking forward to coming back to the game in 2.3!
 

HandicapdHippo

General
59 Badges
Jul 26, 2012
1.934
1.283
  • Crusader Kings II: Charlemagne
  • Victoria 2: Heart of Darkness
  • Victoria 2: A House Divided
  • Sword of the Stars II
  • Heir to the Throne
  • Divine Wind
  • Europa Universalis III Complete
  • Crusader Kings II: Sword of Islam
  • Crusader Kings II: Sons of Abraham
  • Crusader Kings II: The Republic
  • Crusader Kings II: Sunset Invasion
  • Crusader Kings II
  • Crusader Kings II: Rajas of India
  • Crusader Kings II: Legacy of Rome
  • Crusader Kings II: The Old Gods
  • Stellaris: Digital Anniversary Edition
  • Crusader Kings II: Horse Lords
  • Crusader Kings II: Conclave
  • Stellaris
  • Stellaris: Galaxy Edition
  • Stellaris: Galaxy Edition
  • Crusader Kings II: Holy Fury
  • Stellaris Sign-up
  • Crusader Kings II: Reapers Due
  • Stellaris: Lithoids
  • Stellaris: Leviathans Story Pack
  • Crusader Kings II: Monks and Mystics
  • Stellaris - Path to Destruction bundle
  • Stellaris: Megacorp
  • Crusader Kings II: Jade Dragon
  • Stellaris: Humanoids Species Pack
  • Stellaris: Apocalypse
  • Stellaris: Distant Stars
  • Stellaris: Necroids
  • Imperator: Rome Sign Up
  • Europa Universalis IV
  • Stellaris: Ancient Relics
  • Prison Architect
  • Stellaris: Federations
  • Europa Universalis III Complete
  • Europa Universalis IV: Common Sense
  • Europa Universalis III Complete
  • Victoria 2
  • 500k Club
  • Europa Universalis IV: El Dorado
  • Mount & Blade: Warband
  • Mount & Blade: With Fire and Sword
  • Crusader Kings II: Way of Life
  • Europa Universalis IV: Res Publica
  • Europa Universalis IV: Wealth of Nations
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.
Thank god! I just had to abandon a heavily modding game in the 2400's because of this exact issue! Game crashed trying to save because of the memory limit.
 

Inny

Sergeant
51 Badges
Mar 31, 2013
71
64
  • Crusader Kings II
  • Stellaris: Synthetic Dawn
  • Tyranny - Tales from the Tiers
  • Sword of the Stars II
  • Majesty 2 Collection
  • Magicka
  • Leviathan: Warships
  • Knights of Pen and Paper +1 Edition
  • King Arthur II
  • Europa Universalis IV: Conquest of Paradise
  • A Game of Dwarves
  • Europa Universalis III
  • Dungeonland
  • Stellaris: Necroids
  • Age of Wonders
  • Stellaris: Humanoids Species Pack
  • Stellaris: Apocalypse
  • Surviving Mars: Digital Deluxe Edition
  • Shadowrun Returns
  • Shadowrun: Dragonfall
  • Shadowrun: Hong Kong
  • Surviving Mars: First Colony Edition
  • Stellaris: Megacorp
  • Surviving Mars: First Colony Edition
  • Age of Wonders: Planetfall
  • Age of Wonders: Planetfall Deluxe edition
  • Age of Wonders: Planetfall Premium edition
  • Age of Wonders: Planetfall Season pass
  • Stellaris: Lithoids
  • Stellaris: Federations
  • Stellaris: Galaxy Edition
  • Europa Universalis IV
  • The Showdown Effect
  • Warlock: Master of the Arcane
  • War of the Roses
  • Pillars of Eternity
  • Knights of Pen and Paper 2
  • Stellaris
  • Stellaris: Galaxy Edition
  • Age of Wonders III
  • Tyranny: Archon Edition
  • Tyranny: Archon Edition
  • Stellaris: Digital Anniversary Edition
  • Stellaris: Leviathans Story Pack
  • Stellaris - Path to Destruction bundle
  • Crusader Kings Complete
  • Surviving Mars
  • Tyranny - Bastards Wound
  • Stellaris: Ancient Relics
  • Stellaris: Distant Stars
The move to 64 bits is the occasion to get rid of many overflow bugs that plague the game. Either by using bigger variables, or by setting caps to prevent the values to overflow and become negative.
Examples:
Weapons range overflow prevents whole fleets from firing.
Research points overflow prevents your empire from building anything.
etc.
 

TheFunMachine

First Lieutenant
18 Badges
May 10, 2016
256
282
  • Stellaris: Synthetic Dawn
  • Stellaris: Apocalypse
  • Stellaris: Necroids
  • Stellaris: Federations
  • Stellaris: Lithoids
  • Age of Wonders: Planetfall Sign Up
  • Stellaris: Ancient Relics
  • Stellaris: Megacorp
  • Stellaris: Distant Stars
  • Pillars of Eternity
  • Stellaris: Humanoids Species Pack
  • Stellaris - Path to Destruction bundle
  • Stellaris: Leviathans Story Pack
  • Stellaris: Digital Anniversary Edition
  • Stellaris: Galaxy Edition
  • Stellaris: Galaxy Edition
  • Stellaris
  • Stellaris: Distant Stars Pre-Order
This is an excellent DD, thank you very much for putting it together and giving the community a technical update.
 

Shirasik

Decentralized Hive Mind
19 Badges
Jun 28, 2016
1.036
226
  • Stellaris: Galaxy Edition
  • Warlock: Master of the Arcane
  • Stellaris
  • Stellaris: Galaxy Edition
  • Stellaris: Digital Anniversary Edition
  • Stellaris: Leviathans Story Pack
  • Stellaris - Path to Destruction bundle
  • Stellaris: Apocalypse
  • Stellaris: Distant Stars
  • Shadowrun Returns
  • Shadowrun: Dragonfall
  • Shadowrun: Hong Kong
  • Stellaris: Megacorp
  • Stellaris: Ancient Relics