• 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!
 
I like all of this. My only problem with the new system and it’s presentation is that I currently like being able to tell at a glance how I fare on each research values. I don’t think you should merge those values. If it’s moveable in game, thought, it might just be an adjustment I could make at each beginning of the game...

For the rest, I really like how thins are looking. I just hope it won’t become too complex for some players.
 
@Wiz If we have a big screen and more UI real estate will we be able to fill up the top bar with single resources?

I really can't stand hiding things behind tool tips when my version of stellaris has two more whole resource bars worth of blank space to fill.
 
Improved economy and trade was very very high on my wishlist for Stellaris. So glad to see it's going to happen!
@Wiz, when you say far away, is it somewhere in 2018 or early 2019 or even later then that?
 
Hey @Wiz, while we're revamping economy and modding, there's an issue I've noticed for quite a while. Empires value your resources differently than they value their own resources. Typically this is okay because the vanilla Stellaris settings have all empires being curmudgeons when it comes to trade. However, if you want to try and tweak trade so that empires are more generous you can get in wonky situations where they will value your minerals more than they value their own minerals, your credits more than they value their credits, etc. This means you can sell them your minerals and then buy back even more minerals, which makes no sense! Basically trade breaks if an empire values a resource too much. An empire should value a resource the same regardless of if it is selling or buying.
 
Last edited:
The most promising thing about the trade and economy rework is that it opens possiblities;

  1. The resources located in your empire may influence tech development. Such like in famous sci fi stories, alien race A may favor shields and lasers, while race B will favor armor and rockets or one empire has better sensors, while another have better shields.. I hope this is the case, as it makes each empire special and distinctive.
  2. Special resource - whether found or manufactured - now there is a reason to go to war. Need special metals for your warship, you don't have it and your neighbour does? WAR! Different kind of war - Economy war - Would you be able to withhold resource or have a monopoly of it, means that opponents may not easly build battleship or have lasers and you influence the galactic economy. Alternative market - Would there be black market or smuggling?
  3. Mod created or dev created new races - Now we can have bioships, energy beings, silicon life forms
  4. Unique empire - Create an empire that build and sells robots. Or one that sells slaves. Strata in society; One that is ruled by peacocks, adminstrated by parrots, hawks are soldiers and admirals, while the non birds are slaves.
 
This is beautiful. Probably the way Stellaris should have been designed from the beginning.

I am starting to understand why they call him Wiz. Can't wait to see Martin design his own game from beginning to end some day.
 
Special resource - whether found or manufactured - now there is a reason to go to war. Need special metals for your warship, you don't have it and your neighbour does? WAR!

I don't think this really makes sense. After all, if I have to defeat the guy who has the special metal in order to get it, I don't really need the special metal, do I?
 
I don't think this really makes sense. After all, if I have to defeat the guy who has the special metal in order to get it, I don't really need the special metal, do I?

It is not about having it, it is about having not enough of it.

Think of it as oil. Oil is a critical resource. Due to not enough of it, countries go to war.

The same with resources in Stellaris. You may have some of it. If you have none of it, you buy it from the market. Since it will be cheaper if you get it from your neighbour, you go to war for it.
 
Tiles are dead. Not fixed. But dead.

Wich would be a really good point, if there was anything about Tiles in this DD.

In reality the only mention of the word "tile" was in "Volatile Motes".
 
I like it. Just reading this makes it hard to dive into the current version, which is a good sign. I'd argue that the game needs a more fleshed out diplomacy system before an economy overhaul, but that's just me. :)

Also, I wonder, since there's no mention of the "rolling beta" you guys were doing after Apocalypse, is that done then? Can we expect another 2.1 update before LeGuin hits?