• 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!
 
My only wish now is that they re-add "local" resources, similar to how food worked pre-1.5. That way it would be possible to add localized industry and go full Vic II.

I don't know... I still love the idea of being able to blockade a highly specialized economy. I feel like that would be a good balance. The production bonuses of specialization offset against greater vulnerability to blockades or losing individual planets.
 
Even if that doesn't get added, the new system can be used to mod it in anyway.

Would be nice if Paradox created a Distant Worlds-like private economy system themselves at some point (not necessarily in the next major patch).

My only wish now is that they re-add "local" resources, similar to how food worked pre-1.5. That way it would be possible to add localized industry and go full Vic II.

This.
 
My only wish now is that they re-add "local" resources, similar to how food worked pre-1.5. That way it would be possible to add localized industry and go full Vic II.
Well the existence of the Marketplace means your wish is already dead.
 
Looking good.
Any development on the economics will be appreciated. I found it simplistic
 
Last edited:
Looking good.
Any development on the economics will be apprciated. I found it to simplistic.

Not only simplistic, but also not supporting the core mechanics at all. If it was a Age of Wonders 3, that is mainly focused on tactical/strategic warfare and not diplomacy and politics, simplistic economy would be welcomed. The thing is, Stellaris wants to be mix of 4X and Grand Strategy Game, but the economics is bad synergized with diplomacy/politics (little better with expantion).
 
Not only simplistic, but also not supporting the core mechanics at all. If it was a Age of Wonders 3, that is mainly focused on tactical/strategic warfare and not diplomacy and politics, simplistic economy would be welcomed. The thing is, Stellaris wants to be mix of 4X and Grand Strategy Game, but the economics is bad synergized with diplomacy/politics (little better with expantion).
My opinion exactly
 
Hopefully LeGuin will make me play Stellaris as much as Ckii and EUIV. I love the concept and gameplay, but I haven't taken the full plunge with it yet.
 
Well the existence of the Marketplace means your wish is already dead.
Not necessarily. There already exists (script) support for features not used in the base game.
The main problem I found with implementing this is that I couldn't add additional incrementing resources and UI elements. It could all be done using custom variables if need be.
Locally consumed resources would make it easier though.
 
I don't know... I still love the idea of being able to blockade a highly specialized economy. I feel like that would be a good balance. The production bonuses of specialization offset against greater vulnerability to blockades or losing individual planets.
I don't like the game turning into Galciv 3 where every planet is specialized though. I hate that form of game design.

Victoria wasn't like this and I think it had the best economic model of any GSG with Distant Worlds Universe being a close 2nd.
 
You can't super specialize though. There's only so many raw resource tiles of a type on a world, and pure city-planets do sacrifice raw outputs.
 
You can't super specialize though. There's only so many raw resource tiles of a type on a world, and pure city-planets do sacrifice raw outputs.

You are probably going to be able to specialize on one or two resources per planet, somewhat depending on it's size as well. If I understand correctly smaller planets will usually have more deposits for its size even if larger planets have more deposits overall. This might mean that you could specialize on only one resource on some smaller planet while being able to build enough city districts on larger planets to specialize on two resources.

Space mines certainly increased in importance now since you rather extract resources from space rather than spend POP for it.
 
I love all the different possibilities this opens up. I'm curious as to whether or not there will be a way to tell what resources different empires depend on, as during wartime that would decide what attacks would cripple the enemy the most, both economically and militarily.
 
I feel like your understanding of game design is highly limited. First off there is nothing wrong with an "anything goes" sandbox game design, it just need proper design implementations, Witcher 3 is a perfect example of this executed perfectly for example. That aside the win conditions are useless and don't describe any game design objective, claiming it represents something is another lack of design sight in my opinion here. Game design isn't necessarily about giving the player an objective to complete, it can be, there are plenty of games that do this and you can achieve this, but this isn't always the case, Skyrim, CSGO, Garry's Mod, these games don't actually have a fundamental objective for the player to achieve, in the least that isn't principally why players play them and why they're popular. (as much as I hate Bethesda game design there is a point to be made that they do a good job isolating the player from the objective the game wants to give you) Instead just as many games rely on giving the player a wide amount of things to do and letting them choose what to do, this is why GTA is always so popular over other games with better focused systems. To be blinded in this manner of design is narrow and shallow, weak in design methodology and always will lead you to a very secluded view of games. Look at it this way, a game can have multiple gameplay loops and a game can be mechanically divergent and still serve a core principal of design. At the end of the day its purely about serving the player's sense of engagement, and if allowing the player to execute actions in the system how they want can serve that there is no reason that shouldn't be done. As a game designer, if I can manage to make multiple mechanics that can serve each other but yet serve multiple different gameplay loops I would execute them because it opens up the flexibility of my game to multiple players and playstyles and gives them a large degree of expression in the game. There are logical extremes this could be taken to but I'm gonna leave off my critique of this post here.

You forget one important thing, GTA and Witcher 3 quality have nothing to do with a genius design recipe. It's simply thanks to their budget and their very large workforce : Rockstar and CDProjekt are probably the biggest teams in the game industry who only focus on creating a single game. A thousand persons working on the game who are often exploited by being paid with low wages and given ton of responsability is the actual secret behind the quality of these games.
Sorry but I had to say it because I often see people unfairly comparing these games to others.

Paradox as far as I know have a relatively small budget and a small but talented team and it's impressive to see how dedicated they are to improve the game several years after its release.
 
You forget one important thing, GTA and Witcher 3 quality have nothing to do with a genius design recipe. It's simply thanks to their budget and their very large workforce : Rockstar and CDProjekt are probably the biggest teams in the game industry who only focus on creating a single game. A thousand persons working on the game who are often exploited by being paid with low wages and given ton of responsability is the actual secret behind the quality of these games.
Sorry but I had to say it because I often see people unfairly comparing these games to others.

Paradox as far as I know have a relatively small budget and a small but talented team and it's impressive to see how dedicated they are to improve the game several years after its release.
Final fantasy (who ever makes them) is also a big team only working on one game.