informa
/
18 MIN READ
Developer Insights

Deep Dive: Modeling the global economy in Victoria 3

"When we set out to make the next installment in the series, we knew we had to nail the economy aspect, making it both believable as a real-world historical model and compelling as a game mechanic."

Game Developer Deep Dives are an ongoing series with the goal of shedding light on specific design, art, or technical features within a video game in order to show how seemingly simple, fundamental design decisions aren’t really that simple at all.

Earlier installments cover topics such as how art director Olivier Latouche reimagined the art direction of Foundation, how the creator of the RPG Roadwarden designed its narrative for impact and variance, and how the papercraft-based aesthetic of Paper Cut Mansion came together with the developer calls the Reverse UV method.

In this edition, Mikael Andersson, lead designer on Victoria 3, reveals how his team approached modeling the game's economy, addressing some of the issues that arise with similarly complex strategy games. 

I'm Mikael, lead designer for Victoria 3 from Paradox Development Studios in Stockholm, Sweden. The Victoria series of grand strategy games are about guiding a country through the economic and political upheaval of the Victorian era, spanning one century from 1836 to 1936. While all grand strategy games in Paradox's catalog have intricate game economies, in Victoria 3, we're modeling the actual economy, and everything else in the game—including your population demographics, political sentiment, and international relations—is affected by that.

When we set out to make the next installment in the series, we knew we had to nail the economy aspect, making it both believable as a real-world historical model and compelling as a game mechanic. Our goal was to model every aspect of the global economy: production and exchange; infrastructure and bureaucracy; international trade and tariffs; wages and taxes; and most importantly, the consumption needs of the global population, broken up into more than 700 geographic regions with up to 100,000 individual population groups to account for.

We had the benefit of hindsight—knowing what worked and what didn't in the previous games—and also enjoyed the privilege of not being forced into repeating those mechanics to meet audience expectations, seeing how Victoria II was already six years old when we started prototyping for Victoria 3. We needed to find a good formula for a new and reimagined Victoria game for a new decade and gave ourselves carte blanche to redesign and question everything down to core assumptions, so long as we captured the essence of the series. We made many such revisions, from politics to trade to military, but the most fundamental was arguably the transition from a closed to an open economic model.

In most games that revolve around the production of resources and management of supply chains, including previous Victoria games, production facilities are constructed by the player to create goods from nothing or labor alone (resource industry) or from (labor +) one or several input goods (manufacturing industry).

These goods are then stockpiled and eventually distributed to consuming agents. Your ability to provide the goods the consumers need at the time they need it measures how successful you are in constructing and optimizing your economic engine. If we apply the well-known tap-sink analogy to this, we can say that resource industries are taps (a.k.a. faucets), manufacturing industries are converters, and consumers are sinks (a.k.a. drains). In many management games, if the consumers are not provided the goods they demand at the right time, they will impose a penalty somewhere else in the system, leading to a spiral of inefficiency the player must strive to optimize away before it overtakes them.

Goods-based economy flow in a typical management game, e.g. a colony builder
Goods-based economy flow in a typical management game, e.g. a colony builder

In Victoria II, unlike most similar management games, economic agents transact with one another to acquire the goods they convert or consume. This is accomplished via a global market mechanic that sets the sale price of goods based on the balance of supply and demand over time. As a result, if Clothes are in low supply, consumers have to pay more than usual for them while producers earn a hefty profit by selling them.

The global money supply is limited, expanded primarily through gold mining (the tap), and shrunk primarily by interest payments on national loans (the sink). In practice, this means two factors determine if a consumer can purchase a unit of Clothes: the availability of that unit in the national stockpile, and whether the consumer has enough money to afford that unit of Clothes. If the consumer does not have enough money, they will not generate demand, and as a result, the Clothes remaining in the stockpile will decrease in price.

Eventually, the price might dip low enough that the consumer will be able to afford it, restoring demand. If the consumer cannot acquire the goods they desire, either due to low supply or insufficient funds, they may demote to a lower-grade consumer with reduced abilities and needs.

Economy flow in Victoria II, goods with money transactions
Economy flow in Victoria II, goods with money transactions

This system is not entirely closed or circular, but it is substantially more so than what you'd find in most models of game economies. The taps are limited to actual labor-conversion operations (goods) and gold mines (money), the sinks are actual consumption or inefficiencies, and the semi-fixed money supply circulates between the agents within this system to indicate wealth distribution between them.

So why abandon it? Because there are at least three difficult-to-solve design problems inherent to simulating circular economies:

1. Distribution modeling

2. Substitution modeling

3. Iterative imbalancing

If there's an insufficient amount of a resource, how do you decide the distribution of this limited quantity between demanding agents? There are many solutions to this, but all involve substantial micromanagement on part of the player.

In factory-building games, the player must typically construct and direct every length of conveyor belt and carefully tune their distributor mechanisms to place a suitable ratio on each belt. In games where distribution is more automated, resources are usually distributed on a first-come-first-serve basis, which can result in blockages where one agent sits around waiting for resources most of the time while the others run perfectly, forcing the player to solve the problem by ensuring the output is precisely tuned to the input requirements. Victoria's economy is far too large for the first approach to be scalable, and fine-tuning production to create perfect autarkies is also not what we want the player to spend their time on.

To solve this, our predecessor Victoria II uses the concept of a global market, where all goods inside a national market that go unused end up. Any unmet national demand can then be reconciled on the same global market. If supply is insufficient to serve all consumers, the order by which they are allowed to access the supply is determined by their country's Prestige, so agents in more prestigious countries get to purchase all the goods they need off the global market before the next country on the ladder gets a chance to purchase any.

Conversely, all domestic production is used to fulfill domestic demand before trading with the global market occurs. This means that if a country has a monopoly on the production of a good and also demands it in greater quantities than they produce it, none of these goods make it onto the global market and other countries are entirely incapable of getting access to them. More commonly, when goods are in high demand by high-Prestige countries, lower-Prestige countries have no way to access these without producing them domestically.

Victoria 3 budget

In reality, this is where price competition should kick in; if a less prestigious country desperately needs some small amount of a key resource and is willing to pay a premium for it, they should not be locked out of acquiring it. But this would require a design solution for a very hard three-body-type problem, where the equilibrium depends on supply, demand, and price, with the value of each variable in some way dependent on one or both of the others.

So we had to conceive of a system where available goods were distributed between interested consumers based on their capacity to pay, preferably without melting the player's CPU. We also didn't want to make a "perfectly fair" trade system by forcing countries to "buy local" over imports such that trade only smooths out imbalances. Trade policies often had severe political and diplomatic repercussions in the 19th century, ranging from the Corn Laws to the Opium Wars (just to name a few), and it'd be a mischaracterization to portray trade as objectively good for all involved parties. The player's trade priorities should have an impact both on different parts of their own population and industries, as well as the population and industries they're trading with.

Another problem we had to tackle for Victoria 3 was goods substitution. In Victoria II, a province's resource production might consist exclusively of Fruit, while the people who live there might be starving to death because they don't have enough Grain. This doesn't seem too difficult to solve on the surface—just specify an exchange rate between compatible goods and choose to buy the one that's available.

But you very quickly run into a similar issue as the distribution modeling: if there isn't enough Grain but Fruit is plentiful, who should get to buy what amount of Grain? If Grain and Fruit are close enough in price, and you need several of each, how many should you buy? If all agents follow the same purchase pattern, how do you prevent flip-flop effects from day to day, where everyone favors Grain one day and Fruit the next due to price and availability? We wanted a robust substitution system for Victoria 3, where populations would be able to gradually substitute not just food items but also things like Telephones in place of Transportation, reflecting the reduced need to travel long distances in person to conduct business or talk to friends and family.

Finally, by iterative imbalancing, I mean the tendency for patterns in a circular economy to lead to extreme effects over time. Very small surpluses or shortages, when resolved against stockpiles on a frequently recurring basis, will eventually lead to enormous imbalances that don't feel logical and can lead to huge problems for the game economy.

When these result from some sort of dysfunction, like an illogical distribution issue, they can be game-destroying. For example, let's say that a small, poor nation produces mostly Fruit. It produces much more than it consumes on its own, thereby ending up exporting most of it to the global market, leading to an influx of cash. If it's not possible to substitute Fruit for Grain, the local population will demand Grain it cannot import due to low Prestige combined with low global supply. This means it might not be able to put that cash back into global circulation, and even if the effect is too small to notice in a single transaction, over thousands of iterations, the country will start sucking liquidity out of the global economy. This could, in turn, lead to global economic collapse for reasons the player has little insight into and even less control over.

While most such occurrences could likely be labeled bugs, whether in fundamental economy logic or just AI behavior, these kinds of phenomena can be both hard to track down and campaign-breaking. Victoria II's endgame experienced such issues with some frequency, whether due to distribution problems, discrepancies between money being drained through the sink and gold being injected through taps, or small quirks of economic dependencies that built up over the century. This was our biggest concern for the economic model we chose for Victoria 3—we needed it to be resilient to economic patterns imposing subtle imbalances over time, especially since it can take a lot of time to debug something that only manifests as an obvious bug after 100,000 iterations.

Our solution, instead of a slow trickle from the tap and a steady drain in the sinks with the game currencies of the economy circulating heavily between the agents in the interim, was this: turn the taps on full blast, letting all resources trickle through the system in an instant, using these quantities to assign prices, and converting all goods to money in accordance with those prices.

We then adjust each agent's value inventory by the net amount of money, positive or negative. This value inventory can be measured in currency or, more abstractly, as a measurement of "wealth" between 1-99. We then wipe the slate clean and start all over again with no memory of the previous iteration except the adjusted value inventories. In this way, the entire world economy with all its producing, consuming, transacting agents could be said to have a certain "potential" or "state" at any given time, and any changes made to one agent simply adjust that agent's position in the economy, thereby affecting potentially every other agent in the process.

Economy flow in Victoria 3: goods with independent value transfer between agents
  1. A Wheat Farm consumes some Tools and uses population labor to produce some Grain.
  2. The number of buy orders for Tools and sell orders for Grain that end up on the national market as a result depends on the infrastructure rating in the farm's location.
  3. Meanwhile, without regard for how much Grain or Tools are on the market, Food Industries turn Grain into Groceries, and Tooling Workshops turn Wood and Iron into Tools, using population labor in the process. As with the Wheat Farm, infrastructure determines how much of this ends up on the market as buy and sell orders.
  4. Now that we have determined how much the nation's industries produce and consume, the population consumes an assortment of goods of types and quantities depending on their Wealth level, their culture, and what substitutable goods are in best supply in their location. This consumption also turns into buy orders on the market in relation to infrastructure. For example, if Food Industries have produced a lot of Groceries, using Grain as an input, they may opt to purchase the former over the latter, thereby ensuring the profitability of the Food Industries which ensure the profitability of the Wheat Farms.
  5. As we are now able to determine the total supply and demand on the market in terms of buy and sell orders, we can compute a preliminary market price. This market price, in conjunction with domestic buy and sell orders, is used to determine how many units of goods to move across all established inter-market trade routes worldwide, which also generates buy and sell orders. In the process, profit is generated for the part of the population that works in trade, from which the imports and export tariffs for each trading country are subtracted and deposited into the countries' treasuries.
  6. With the final post-trade market balance now available, we can set market prices for all goods and compute the price for each unit produced and consumed across the country. This is also moderated by infrastructure, such that poorly connected parts of the country are more reliant on goods generated by local industry. Every agent that has purchased or sold any goods on the market now converts that to a value in £, positive or negative, which it resolves against its internal value store (cash reserves for industries, treasury for government buildings). If we have produced plenty of Grain, this is good for the Food Industries; if we have produced plenty of Tools, this is good for the Wheat Farms; if the demand for Grain is very high, this is good for the Wheat Farms, but bad for the population, unless they can substitute it for something else.
  7. All labor performed by the population is now compensated with a wage from industries (or government buildings) at a rate depending on their profession and a wage level metric each building calibrates over time depending on its profitability, labor need, and cash reserves balance.
  8. Tax is deducted from the population in accordance with the nation's laws, based on e.g. how much income taxes, dividends, or interest they earn, the goods they have purchased, what profession they are, etc. The money is resolved against the country's treasury, which can run a positive balance (gold reserves) or negative balance (domestic loans leveraged against the country's total cash reserves).
  9. Every part of the population now looks at how much money they have left (or are missing) after wages, potential government support, taxes, and goods purchases, then adjust their Wealth accordingly, resulting in purchasing a slightly different basket of goods in the next economy tick and a number of other behavioral changes.
  10. The entire slate is wiped clean, effectively draining all economic data out of the system except what has been converted into £ and stored in buildings, treasuries, or population.

Since each agent produces and consumes independently of both the supply of goods and the availability of currency, we don't have a distribution problem. Even when it comes to trade between markets, we can simply compute how much is being supplied and demanded to/from the markets in question and create a sufficient amount of Buy and Sell orders on each market to adjust the price accordingly.

Victoria 3 rural folk

The supply and demand of goods are still very important as they determine prices, which determine wealth distribution between members of your population and the quantity of trade between markets. This means more quantities of a good can be bought than are actually sold on the market every tick, but since there are no stockpiles, this can be thought of as an abstraction. We do accommodate for when a good that is used in manufacturing is in very short supply compared to demand, which will limit the potential output of that industry (or military proficiency for buildings whose inputs are armaments, bureaucracy output for administrative buildings, etc.) but this is the exception; in most situations, being undersupplied simply means decreased profitability, which in turn limit capacity to pay salaries, which will result in the loss of workers and reduce efficiency.

For goods consumed by the population, having to pay through the nose to meet your needs without an increase in salary means a deficit that reduces wealth over time, which reduces the demand for goods (and causes dissatisfaction and radicalism in the population, leading to demand for political change, crime and turmoil, and emigration).

Substitution can be managed quite readily with this system as well, since, if the production/availability of goods can be computed anytime independently of demand, we can simply use this value directly to influence which goods should be substituted for others and in which ratios. In Victoria 3, we use this to model both the substitution of Fruit vs. Grain, where poorer members of the population may substitute one for the other freely to meet their basic needs while more well-to-do members demand some minimum proportions of each, and Tea vs. Coffee, where the British might demand Tea while the Swedes are mostly about the (other) black gold. Introduce plentiful Opium to a market hungry for Liquor, and many will switch their vice of choice to what's most readily available.

Finally, with this model, there is no fear of eventual market collapse due to key resources or liquidity being removed from the economy's circulatory system through isolation in some forgotten stockpile. Means of production + labor creates goods supply, which generates revenue that can be spent on input goods and wages, which creates goods demand, which determines prices. Gradual changes to the economy are reflected in weekly changes in storage pools of value: building cash reserves, national treasuries, and population wealth.

Another major benefit we derive from being able to take a "snapshot" of a dynamic economy like this is that we can predict the impact of changes to it before they have transpired, and execute the changes to the price dynamics as soon as the change has been made, even while paused.

Victoria 3 diplomatic play

If the player considers constructing another Textile Mill, it is possible to predict—simply by adding some values to a temporary object encapsulating the price setting logic—what the impact of this new industry's increased production and consumption will have on the price in the market and therefore on the profitability of that industry.

Obviously, we cannot predict what this will mean to the wealth development of the population in the state and, therefore, the increased demand on Clothes over time, which will also have an impact on profitability; nor on the wages of the people working the Textile Mill, which might depend on what professions the local population are qualified to perform and the rate of immigration to the state as a result of the new job openings; nor how this will affect trade volume of Fabric or Dye and therefore the tariff revenues of your rival. But these are the effects you as a player learn from over time, whereas being able to gauge whether a new factory will be profitable before you invest money and time into building it is more urgently needed information.

That is not to say this model is not without its drawbacks. As a designer with a borderline pathological obsession with simulation, it hurts my heart a bit when I consider the absence of goods stockpiling in Victoria 3 (though that raises the question, what about shelf life? Seasonal harvests? Item quality? Leveraging your inventory as assets in exchange for credit?).

Also, since demand is not directly determined by the ability to pay, our model does not support a complete separation of price and value, or for that matter, separate buy and sell prices—meaning we cannot currently pull tricks like letting planned economies set fixed prices for goods without introducing enormous exploits. Nevertheless, the benefits this open economy offers, in terms of the level of complex interactions we can model before hitting performance limits, easily outweigh those quibbles, and in practice, these abstractions are more intuitively comprehensible to players. And at the end of the day, that's what matters: can we model the economic interactions we want in a way that is understandable and feels empowering to play with?

For a more practical rundown of how this system works in-game from a player's perspective, I encourage you to watch the short Victoria 3 tutorial series on YouTube or one of the many, many Let's Plays.

You can find the game itself on Steam. Thank you for reading!

    Latest Jobs

    Cryptic Studios

    Remote
    1.19.23
    Senior Producer

    Anne Arundel Community College

    Arnold, MD, USA
    1.30.23
    Instructor/Assistant Professor, Game Art

    Night School Studio

    Los Angeles, CA, USA
    1.09.23
    Level Designer / Scripter, Games Studio
    More Jobs   

    CONNECT WITH US

    Explore the
    Subscribe to
    Follow us

    Game Developer Job Board

    Game Developer Newsletter

    @gamedevdotcom

    Explore the

    Game Developer Job Board

    Browse open positions across the game industry or recruit new talent for your studio

    Browse
    Subscribe to

    Game Developer Newsletter

    Get daily Game Developer top stories every morning straight into your inbox

    Subscribe
    Follow us

    @gamedevdotcom

    Follow us @gamedevdotcom to stay up-to-date with the latest news & insider information about events & more