• 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 #120 - New Economy System

Hello and welcome back to the Stellaris dev diaries! Today we're going to start talking about the next major update, which we have dubbed 2.2 'Le Guin' after Ursula K. Le Guin. Right now we're not ready to reveal anything about the precise nature of the update or whether it is accompanied by any DLC, other than to say that the Le Guin will have focus on trade and the economy, and that its release date is far away. Today's dev diary is going to be a bit on the foundational side, going over the new economic back-end we've implemented for 2.2.

New Economy System
The original economy system for Stellaris has always been something of a limitation for us. It's a sort of hybrid system, with resources being both scripted (and thus accessible to modders) and hard-coded (and thus inaccessible) in about equal measures. For example, under the old system ships would always cost minerals, as the code was set up for them to always cost minerals, and the only thing you could change was the amount of minerals they cost. Similarly, most things in the game that had an upkeep were hard-coded to use energy for upkeep, and again, only the amounts were able to be changed. A few things (such as for example Resettlement or the precise resources produced by a building) were more open than this, but generally the system made it quite hard to introduce new resources or change the way a particular empire might use a particular resource. The old system was also quite performance-intensive.

When we decided that we wanted to make the next major update be about the economy, the first thing we knew that we needed to do was to rewrite this system entirely. For the new system, we set out a number of goals:
1: The new system should make it easy to add new resources and swap the way resources are used
2: The new system should be as open to modding as we possibly could make it
3: The new system should improve performance

From this, we've created a new system that we call Economic Templates. Where previously there would be a jumble of different systems for how cost, production and maintenance of the different features in the game would work, there is now one unified system. Any single object in the game that can be owned by an empire and have an impact on the economy is called an Economic Unit. In the database files, an Economic Unit looks like this:

Code:
resources = {
    category = armies
 
    # Normal empires pay for armies with minerals
    cost = {
        trigger = {
            owner = { is_hive_empire = no }
        } 
        minerals = 100
    }
 
    # Hive Minds pay for armies partially with food
    cost = {
        trigger = {
            owner = { is_hive_empire = yes }
        }     
        minerals = 50
        food = 50
    }     

    # If Barbaric Despoilers, produce Energy while on enemy planets
    produces = {
        trigger = {
            owner = { has_valid_civic = civic_barbaric_despoilers }
            planet = { owner = { is_at_war_with = root.owner } }
        }
        energy = 3
    }     
 
    # Normal empires pay army upkeep with energy
    upkeep = {
        trigger = {
            owner = { is_hive_empire = no }
        }     
        energy = 1
    }
 
    # Hive Minds pay army upkeep with food
    upkeep = {
        trigger = {
            owner = { is_hive_empire = yes }
        }     
        food = 1
    }     
}

For those who cannot read our scripting language, this is an example I just created of how the new system can be used. It's for a regular assault army, which normally costs 100 minerals to build and has an upkeep of 1 energy, just as before. However, if your empire is a Hive Mind, the army will instead cost 50 minerals and 50 food, and costs 1 food in upkeep instead of 1 energy. Additionally, if you have the Barbaric Despoilers civic, armies that are located on enemy planets will produce 3 energy/month, paying for themselves and then some through wide-scale looting. This isn't an actual example from the internal build, but something I just created while writing this dev diary to show the possibilities that the new economic system opens up for for both us and modders - we could have fully biological empires that use food instead of minerals to build infrastructure, ships that produce research while in certain systems, leaders that give Unity... the possibilities are endless.
2018_08_09_1.png


Advanced Resources
With this system in place, we've been able to add several new 'advanced' resources to the game. They are as follows: Alloys, Rare Crystals, Volatile Motes and Exotic Gases. These resources are either manufactured from basic resources or found in rare planetary deposits (or both!) and are used to construct more advanced things in the game, such as ship components, megastructures, certain buildings and so on. There is also still a number of strategic resources such as Dark Matter and Living Metal that provide unique benefits, though precisely how many of these we will keep and how they are used is something we're still in the process of figuring out.

As part of these changes we're also in the process of reworking the top bar. Since we will now have rather too many resources to show them all, the top bar will now only show individual entries for resources that are important for your empire to always keep track of, with the rest shown as a consolidated entry that can be tooltiped for greater detail. Science is also consolidated into a total output of all 3 sciences, with tooltip showing the individual production of each. We're going to ensure that only relevant resources are shown individually, so most Machine Empires wouldn't have Food appear as an individual entry in the top bar, for example. We're also considering letting the player manually override this and decide which precise resources they want to keep track of within the available topbar space.

(Please note that the new topbar is nowhere near final and will have some ugly graphical issues. This is not how it will look on release)
2018_08_09_2.png


That's all for today! I know this dev diary was rather technical and perhaps primarily of interest to modders, but I felt it was important to explain the fundamental changes that have taken place in the game's back-end, both in relation to the changes coming in 2.2, and the possibilities that this opens up in the future for having empire types with radically different approaches to resource production and consumption. Next week we're going to finally start talking about the new Planetary Management system. See you then!
 

Hapchazzard

Captain
2 Badges
May 4, 2015
355
1.130
  • Stellaris Sign-up
  • Imperator: Rome Sign Up
Very nice! Just to be clear - will barbaric despoiler looting be an actual thing? You said that it's not in the internal build, but IMO it would actually be pretty cool if it were.
 

LeSingeAffame

Loyal ally to Durcorach the Black Drake
73 Badges
Sep 16, 2012
3.603
2.395
  • Crusader Kings II
  • Europa Universalis IV
  • Victoria 3 Sign Up
  • Europa Universalis 4: Emperor
  • Crusader Kings III
  • Crusader Kings II: Sword of Islam
  • Crusader Kings II: Sunset Invasion
  • Crusader Kings II: The Republic
  • Crusader Kings II: Legacy of Rome
  • Crusader Kings II: The Old Gods
  • Crusader Kings II: Sons of Abraham
  • Crusader Kings II: Horse Lords
  • Crusader Kings II: Rajas of India
  • Crusader Kings II: Conclave
  • Crusader Kings II: Charlemagne
  • Crusader Kings II: Way of Life
  • Crusader Kings II: Reapers Due
  • Crusader Kings II: Jade Dragon
  • Crusader Kings II: Monks and Mystics
  • Crusader Kings II: Holy Fury
  • Stellaris
  • Stellaris: Galaxy Edition
  • Stellaris: Galaxy Edition
  • Stellaris: Synthetic Dawn
  • Stellaris: Leviathans Story Pack
  • Stellaris - Path to Destruction bundle
  • Stellaris: Digital Anniversary Edition
  • Stellaris: Distant Stars
  • Stellaris: Humanoids Species Pack
  • Stellaris: Apocalypse
  • Stellaris: Megacorp
  • Hearts of Iron IV: Expansion Pass
  • Imperator: Rome
  • Imperator: Rome Deluxe Edition
  • Imperator: Rome Sign Up
  • Imperator: Rome - Magna Graecia
Code:
resources = {
    category = armies
 
    # Normal empires pay for armies with minerals
    cost = {
        trigger = {
            owner = { is_hive_empire = no }
        }
        minerals = 100
    }
 
    # Hive Minds pay for armies partially with food
    cost = {
        trigger = {
            owner = { is_hive_empire = yes }
        }   
        minerals = 50
        food = 50
    }   

    # If Barbaric Despoilers, produce Energy while on enemy planets
    produces = {
        trigger = {
            owner = { has_valid_civic = civic_barbaric_despoilers }
            planet = { owner = { is_at_war_with = root.owner } }
        }
        energy = 3
    }   
 
    # Normal empires pay army upkeep with energy
    upkeep = {
        trigger = {
            owner = { is_hive_empire = no }
        }   
        energy = 1
    }
 
    # Hive Minds pay army upkeep with food
    upkeep = {
        trigger = {
            owner = { is_hive_empire = yes }
        }   
        food = 1
    }   
}

For those who cannot read our scripting language, this is an example I just created of how the new system can be used. It's for a regular assault army, which normally costs 100 minerals to build and has an upkeep of 1 energy, just as before. However, if your empire is a Hive Mind, the army will instead cost 50 minerals and 50 food, and costs 1 food in upkeep instead of 1 energy. Additionally, if you have the Barbaric Despoilers civic, armies that are located on enemy planets will produce 3 energy/month, paying for themselves and then some through wide-scale looting. This isn't an actual example from the internal build, but something I just created while writing this dev diary to show the possibilities that the new economic system opens up for for both us and modders - we could have fully biological empires that use food instead of minerals to build infrastructure, ships that produce research while in certain systems, leaders that give Unity... the possibilities are endless.
View attachment 395968
You really want to make me fall in love with the game again, right?!

Really excited for the update and future dev diaries, the Twitter teasers really make me want to know more.
For what we have seen, this seems to be a very good direction for the game!

Question time!

Are all land armies now the same, since we only have one 'armies' bloc?
Can we still have multiple types of land units? If so, can we still modify what resources they need to build?
 

Milten

General
78 Badges
Sep 20, 2011
1.944
4.995
  • Europa Universalis IV
  • Crusader Kings II
  • Stellaris
  • Victoria 2
  • Hearts of Iron IV: Colonel
  • Hearts of Iron III Collection
  • Magicka
  • King Arthur II
  • Impire
  • Sword of the Stars II
  • Tyranny: Archon Edition
  • Crusader Kings III
  • Age of Wonders: Planetfall
  • 500k Club
  • Pillars of Eternity
  • Cities: Skylines
There is also still a number of strategic resources such as Dark Matter and Living Metal that provide unique benefits, though precisely how many of these we will keep and how they are used is something we're still in the process of figuring out.
So these still function like current strategic resources? I.e. no stockpiling?
 

Ezumiyr

Field Marshal
73 Badges
Jul 21, 2012
3.966
6.864
  • Crusader Kings II
  • Stellaris: Galaxy Edition
  • Crusader Kings II: Reapers Due
  • Europa Universalis IV: Mare Nostrum
  • Magicka 2
  • Stellaris - Path to Destruction bundle
  • Europa Universalis IV: Pre-order
  • Europa Universalis IV: Third Rome
  • Cities: Skylines Deluxe Edition
  • Crusader Kings II: Jade Dragon
  • Stellaris: Synthetic Dawn
  • Victoria 2: Heart of Darkness
  • Victoria 2: A House Divided
  • Europa Universalis IV: Res Publica
  • Europa Universalis IV: Wealth of Nations
  • Crusader Kings II: Legacy of Rome
  • Crusader Kings II: The Old Gods
  • Crusader Kings II: Rajas of India
  • Crusader Kings II: Charlemagne
  • Crusader Kings II: The Republic
  • Crusader Kings II: Sons of Abraham
  • Crusader Kings II: Sunset Invasion
  • Crusader Kings II: Sword of Islam
  • Cities in Motion
  • Europa Universalis IV: Art of War
  • Europa Universalis IV: Conquest of Paradise
  • Magicka
  • Europa Universalis IV: Cradle of Civilization
  • Europa Universalis IV: Rights of Man
  • Hearts of Iron IV: Cadet
  • Tyranny: Archon Edition
  • Stellaris: Digital Anniversary Edition
  • Stellaris: Leviathans Story Pack
  • Crusader Kings II: Monks and Mystics
  • Victoria 3 Sign Up
  • Surviving Mars
  • Age of Wonders III
  • Stellaris Sign-up
  • Stellaris: Galaxy Edition
  • Stellaris
  • Crusader Kings II: Conclave
  • Europa Universalis IV: Cossacks
  • Crusader Kings II: Horse Lords
  • Europa Universalis IV: Common Sense
  • Pillars of Eternity
  • Crusader Kings II: Way of Life
  • Europa Universalis IV: El Dorado
  • 500k Club
  • Warlock 2: The Exiled
  • Victoria 2
"the possibilities are endless"

I like to see those words in a dev diary, but to be honest I've even more pleased by what I read about "advanced ressources". All this can help making each kind of empire feel unique by actually using the ressources it has - and not just by adding a modifier just because you happen to have that ressource within your borders.
 

Wizzington

Game Director (Victoria 3)
Paradox Staff
41 Badges
Nov 15, 2007
12.283
124.700
  • Hearts of Iron II: Armageddon
  • Rome: Vae Victis
  • Victoria 2: Heart of Darkness
  • Victoria 2: A House Divided
  • Sword of the Stars II
  • Sengoku
  • Europa Universalis: Rome
  • Victoria: Revolutions
  • Europa Universalis III Complete
  • March of the Eagles
  • Majesty 2
  • Magicka
  • Heir to the Throne
  • Arsenal of Democracy
  • Crusader Kings II
  • Darkest Hour
  • Europa Universalis III Complete
  • Deus Vult
  • East India Company
  • Europa Universalis III
  • Divine Wind
  • For The Glory
  • Hearts of Iron III: Their Finest Hour
  • Hearts of Iron III Collection
  • Prison Architect
  • Shadowrun: Hong Kong
  • Shadowrun: Dragonfall
  • Shadowrun Returns
  • Stellaris: Humanoids Species Pack
  • Stellaris: Synthetic Dawn
  • Stellaris - Path to Destruction bundle
  • Stellaris: Leviathans Story Pack
  • Stellaris Sign-up
  • Stellaris: Galaxy Edition
  • Stellaris: Galaxy Edition
  • Stellaris: Galaxy Edition
  • Mount & Blade: Warband
  • Magicka: Wizard Wars Founder Wizard
  • Crusader Kings II: Holy Knight (pre-order)
  • 500k Club
  • Victoria 2
Very nice! Just to be clear - will barbaric despoiler looting be an actual thing? You said that it's not in the internal build, but IMO it would actually be pretty cool if it were.

It's something we're considering doing, this particular case was just an example though.
 

Wizzington

Game Director (Victoria 3)
Paradox Staff
41 Badges
Nov 15, 2007
12.283
124.700
  • Hearts of Iron II: Armageddon
  • Rome: Vae Victis
  • Victoria 2: Heart of Darkness
  • Victoria 2: A House Divided
  • Sword of the Stars II
  • Sengoku
  • Europa Universalis: Rome
  • Victoria: Revolutions
  • Europa Universalis III Complete
  • March of the Eagles
  • Majesty 2
  • Magicka
  • Heir to the Throne
  • Arsenal of Democracy
  • Crusader Kings II
  • Darkest Hour
  • Europa Universalis III Complete
  • Deus Vult
  • East India Company
  • Europa Universalis III
  • Divine Wind
  • For The Glory
  • Hearts of Iron III: Their Finest Hour
  • Hearts of Iron III Collection
  • Prison Architect
  • Shadowrun: Hong Kong
  • Shadowrun: Dragonfall
  • Shadowrun Returns
  • Stellaris: Humanoids Species Pack
  • Stellaris: Synthetic Dawn
  • Stellaris - Path to Destruction bundle
  • Stellaris: Leviathans Story Pack
  • Stellaris Sign-up
  • Stellaris: Galaxy Edition
  • Stellaris: Galaxy Edition
  • Stellaris: Galaxy Edition
  • Mount & Blade: Warband
  • Magicka: Wizard Wars Founder Wizard
  • Crusader Kings II: Holy Knight (pre-order)
  • 500k Club
  • Victoria 2
So these still function like current strategic resources? I.e. no stockpiling?

As I said, we're still figuring out exactly how strategic resources will fit into the system, so more on this in a future DD.
 

Olterin

Colonel
71 Badges
Jul 15, 2015
980
3.165
  • Crusader Kings II
  • Crusader Kings II: Charlemagne
  • Crusader Kings II: The Old Gods
  • Crusader Kings II: Legacy of Rome
  • Crusader Kings II: Rajas of India
  • Crusader Kings II: Sword of Islam
  • Europa Universalis IV: Mare Nostrum
  • Europa Universalis IV: Rule Britannia
  • Europa Universalis IV: Golden Century
  • Stellaris: Nemesis
  • Hearts of Iron IV: Cadet
  • Hearts of Iron IV: Colonel
  • Crusader Kings II: Reapers Due
  • Europa Universalis IV: Rights of Man
  • Stellaris: Digital Anniversary Edition
  • Stellaris: Leviathans Story Pack
  • Crusader Kings II: Monks and Mystics
  • Stellaris: Necroids
  • Cities: Skylines - Mass Transit
  • Europa Universalis IV: Mandate of Heaven
  • Stellaris: Lithoids
  • Surviving Mars
  • Cities: Skylines - Parklife
  • Age of Wonders III
  • Cities: Skylines - Green Cities
  • Stellaris: Megacorp
  • Stellaris: Humanoids Species Pack
  • Stellaris: Apocalypse
  • Crusader Kings II: Conclave
  • Europa Universalis IV
  • Crusader Kings II: Holy Fury
  • Surviving Mars: First Colony Edition
  • Stellaris: Distant Stars
  • Hearts of Iron III
  • Europa Universalis IV: Dharma
  • Victoria 2
  • Europa Universalis 4: Emperor
  • Crusader Kings III
  • Warlock: Master of the Arcane
  • Cities: Skylines
  • Europa Universalis IV: El Dorado
  • Shadowrun Returns
  • Magicka: Wizard Wars Founder Wizard
  • Crusader Kings II: Way of Life
  • Pillars of Eternity
  • Europa Universalis IV: Common Sense
  • Crusader Kings II: Horse Lords
  • Stellaris: Federations
  • Crusader Kings II: Sons of Abraham
  • Crusader Kings II: The Republic
This looks rather promising. Also, you horrible tease, Planetary Management next week :p

On a different note. How difficult will it be to introduce (via mods) new basic, advanced, and/or strategic systems into the game with the new backend?
 

pryr

Major
Mar 6, 2017
588
54
I have only one question - with all that changes that coming can we expect more differences in how different empires with different ethics build their economy and society?
 

Wizzington

Game Director (Victoria 3)
Paradox Staff
41 Badges
Nov 15, 2007
12.283
124.700
  • Hearts of Iron II: Armageddon
  • Rome: Vae Victis
  • Victoria 2: Heart of Darkness
  • Victoria 2: A House Divided
  • Sword of the Stars II
  • Sengoku
  • Europa Universalis: Rome
  • Victoria: Revolutions
  • Europa Universalis III Complete
  • March of the Eagles
  • Majesty 2
  • Magicka
  • Heir to the Throne
  • Arsenal of Democracy
  • Crusader Kings II
  • Darkest Hour
  • Europa Universalis III Complete
  • Deus Vult
  • East India Company
  • Europa Universalis III
  • Divine Wind
  • For The Glory
  • Hearts of Iron III: Their Finest Hour
  • Hearts of Iron III Collection
  • Prison Architect
  • Shadowrun: Hong Kong
  • Shadowrun: Dragonfall
  • Shadowrun Returns
  • Stellaris: Humanoids Species Pack
  • Stellaris: Synthetic Dawn
  • Stellaris - Path to Destruction bundle
  • Stellaris: Leviathans Story Pack
  • Stellaris Sign-up
  • Stellaris: Galaxy Edition
  • Stellaris: Galaxy Edition
  • Stellaris: Galaxy Edition
  • Mount & Blade: Warband
  • Magicka: Wizard Wars Founder Wizard
  • Crusader Kings II: Holy Knight (pre-order)
  • 500k Club
  • Victoria 2
You really want to make me fall in love with the game again, right?!

Really excited for the update and future dev diaries, the Twitter teasers really make me want to know more.
For what we have seen, this seems to be a very good direction for the game!

Question time!

Are all land armies now the same, since we only have one 'armies' bloc?
Can we still have multiple types of land units? If so, can we still modify what resources they need to build?

All armies are not the same. The 'armies' tag in the resource unit tells the new economy system where it should apply costs, discounts, how it should organize the tooltip, etc. These tags can be dynamically scripted and will automatically generate modifiers, etc, so you can have modifiers that only apply to certain types of armies, for example.
 

Wizzington

Game Director (Victoria 3)
Paradox Staff
41 Badges
Nov 15, 2007
12.283
124.700
  • Hearts of Iron II: Armageddon
  • Rome: Vae Victis
  • Victoria 2: Heart of Darkness
  • Victoria 2: A House Divided
  • Sword of the Stars II
  • Sengoku
  • Europa Universalis: Rome
  • Victoria: Revolutions
  • Europa Universalis III Complete
  • March of the Eagles
  • Majesty 2
  • Magicka
  • Heir to the Throne
  • Arsenal of Democracy
  • Crusader Kings II
  • Darkest Hour
  • Europa Universalis III Complete
  • Deus Vult
  • East India Company
  • Europa Universalis III
  • Divine Wind
  • For The Glory
  • Hearts of Iron III: Their Finest Hour
  • Hearts of Iron III Collection
  • Prison Architect
  • Shadowrun: Hong Kong
  • Shadowrun: Dragonfall
  • Shadowrun Returns
  • Stellaris: Humanoids Species Pack
  • Stellaris: Synthetic Dawn
  • Stellaris - Path to Destruction bundle
  • Stellaris: Leviathans Story Pack
  • Stellaris Sign-up
  • Stellaris: Galaxy Edition
  • Stellaris: Galaxy Edition
  • Stellaris: Galaxy Edition
  • Mount & Blade: Warband
  • Magicka: Wizard Wars Founder Wizard
  • Crusader Kings II: Holy Knight (pre-order)
  • 500k Club
  • Victoria 2
I have only one question - with all that changes that coming can we expect more differences in how different empires with different ethics build their economy and society?

Yeah. More on this in future DDs.
 

Turelus

Corporal
34 Badges
May 9, 2017
29
23
  • Sword of the Stars II
  • Tyranny - Tales from the Tiers
  • Stellaris: Synthetic Dawn
  • Cities: Skylines Deluxe Edition
  • Warlock 2: The Exiled
  • Stellaris: Federations
  • Stellaris: Lithoids
  • Surviving Mars: First Colony Edition
  • Stellaris: Megacorp
  • Surviving Mars: First Colony Edition
  • Shadowrun: Hong Kong
  • Shadowrun: Dragonfall
  • Shadowrun Returns
  • Stellaris: Distant Stars
  • Surviving Mars: Digital Deluxe Edition
  • Stellaris: Apocalypse
  • Stellaris: Humanoids Species Pack
  • Tyranny - Bastards Wound
  • Stellaris: Necroids
  • Stellaris - Path to Destruction bundle
  • Stellaris: Leviathans Story Pack
  • Stellaris: Digital Anniversary Edition
  • Tyranny: Gold Edition
  • Tyranny: Archon Edition
  • Tyranny: Archon Edition
  • Stellaris: Galaxy Edition
  • Stellaris: Galaxy Edition
  • Stellaris
  • Cities: Skylines - After Dark
  • Pillars of Eternity
  • Cities: Skylines
  • Warlock: Master of the Arcane
  • Surviving Mars
  • Stellaris: Ancient Relics
Looks and sounding great, really excited for this update!

We're also considering letting the player manually override this and decide which precise resources they want to keep track of within the available topbar space.
Whilst this is being worked on, is there any chance you can also let us customise what quick buttons on the left we can choose? Running the game at 2560×1440 gives a lot of free space and I would love to have a quick button for leaders, edicts etc. without clicking into that "more" section.
If that's already someone in the game I missed it I will be very embarrassed by this request.