Developer Diary 16

This developer diary was first posted in the M&T forum here, and team members answered some questions in the thread. It was further posted on the M&T subreddit here, and team members also commented there.

Dev Diary #16 - Economy 2.0
Hello and and welcome to another M.E.I.O.U. and Taxes Dev Diary.

Today we are going to talk about the economy, one of the crown jewels of 3.0.

The credits for the economy and trade mechanics go, first and foremost, to @wogudwkd12, the lead designer of economy and creator of the entire concept who has spent the last two years working on it, but also to @FireKahuna, and @VineFynn.

First, we want to mention a brand new concept in 3.0: Economy simulations. The economy and trade systems in 3.0 are very complex and dynamic. One of our greatest challenges was making sure that the world state in 1356 is both stable and balanced. To solve that, the trio mentioned above created an economic simulation system inside the game.

When we run a Sim, the game goes through all economy and trade calculations for X amount of years (usually around 1000) in the very first day, without changing outside factors, like politics or technology. Whenever we change something in those systems’ code, be it a minor trade balance tweak or an entirely new trade good, we run new simulations again and again, until we get a result that we are comfortable with. This single day simulation is fifty times faster than running observer games with AIs active and such, so it speeds up the balancing process greatly. A 1000-year sim takes only about five hours to fully calculate.

After a sim is done running, we save the file and run a python script to extract the data and use those values to load the 1356 game start. The Sim sets the entire world’s values for production, population, estates, commerce, etc. for each province and country. All this data is put into an event that happens when you click “play”.

Of course, this python script will be in the game files for any submodders (and economics students), along with explanations for how to use it and the various other fancy 3.0 modding tidbits.

Now, let’s move onto Economy 2.0.

We have already written an entire dev diary on the economy much earlier, and touched on  many improvements with Path to Modernity v2, but that touch was rather shallow. So here’s the full story:

Infrastructure:

All industries correspond to specific categories called Infrastructures. There are two major categories of infrastructure, Resources (rural) and Districts (urban), containing seven specific infrastructure types, Farmlands, Fisheries, Forestries, Mines, Industrial, Academic, and Commercial.



Each infrastructure has a size (yellow), a maximum size (orange), and how much money they are earning or losing per year. Their earnings are directly taken from what the industry slots in the province pay for their infrastructure types’ maintenance, and these earnings are spent on goods and labor to carry out the maintenance. For an infrastructure to be profitable, the industry slots that depend on that infrastructure need to pay more for maintenance than actually required to maintain it.



The first four are categorized as natural resources, and can be considered “rural” infrastructure types. Their connected industries mainly require rural labor. Each resource infrastructure has a maximum natural capacity given by the province’s natural features. The current Infrastructure size is set by the total combined size of all Industries that belong to that type.

Districts, or “urban” infrastructure types, have no size limit. They mainly require urban labor. Without a size limit, any province could theoretically grow into a large and prosperous urban center, given enough time and investment.

Provincial elites and the state own shares of infrastructure.



Here, for example, you can see that for this province, the state owns 16.2% of all farmland in the province. The owners need to pay their corresponding share of infrastructure maintenance every year. If they either can’t or don’t want to pay for it, their infrastructure will slowly shrink in size as it is not being maintained.

The profitability of infrastructure depends on the total profitability of the industries that belong to that specific Infrastructure. If farmland industries are losing money because of a bad year or they couldn’t trade their goods, they will lose money, which means the State will lose some money as well from their percent share of farmland Infrastructure.

This means that owning infrastructure isn’t purely beneficial. There is a risk and a responsibility that comes with it. Bad investments could end up costing the state treasury dearly. Then again, maybe your goal is to quickly build up a province’s industry, in which case that short-term loss may turn out to be quite beneficial in the long term.

The state can increase their share of infrastructure types by investing ducats, using our new and shiny investment buttons. (Yes, actual buttons! The fact that they are located in the building menu is purely coincidental).



Through the building interface, you can invest into provinces for each type of Infrastructure. This value is directly subtracted from your treasury. Investing efficiency depends on local state reach and corruption within the province, and investing in places where corruption is high may lead to the elites bringing some of that newly built infrastructure into their possession.

Investing increases infrastructure size (up to the maximum for resource infrastructure), as well as increasing your infrastructure share accordingly. An infrastructure size increase means that the industries belonging to that Infrastructure will see their size increase as well, and the increase in labor demand will lead to increased wages for the population.

Industries and Labor:



There are a number of requirements for opening industries in specific locations, such as having a certain natural resource, a certain climate, a minimum urban population amount or a minimum amount of urban development, but you’ll have to wait to see a full list as this is still subject to changes.

Every industry has inputs and outputs. Input goods are bought from the market to fill the industry’s capacity of production, consumed to produce outputs, then the outputs are sold on the market again. Industries also use labor, paying wages to the population for it. In a remarkably elegant and straightforward manner, industry profitability is determined by the output price minus the input price, wage cost and infrastructure maintenance. Input and output price depend on the trading opportunities that the province can provide. An isolated province will see their industries not thrive to the same degree as a province that is surrounded by others in the same trade sector, or connected to other sectors via the trade network.

We’ll talk more about trade in another Dev Diary, but for now let’s keep going here.

Now, what does a thriving industry mean? Industries expand or shrink naturally. They have a complex heuristic logic where they can choose the former or the latter depending on what is the most profitable choice. If an Industry is experiencing losses, it will choose to shrink, while if it thinks size expansion will lead to a gain in profitability, it tries to expand.

What happens when an industry expands? Well, besides the obvious gain in size, meaning it produces more outputs and consumes more inputs, wages will also rise temporarily. This is because an expanding industry suddenly demands more labor and needs it asap. Wages will be higher until the labor demand is fulfilled to the same relative level as it was before.



When an Industry is lacking labor, it will see its throughput decrease, limiting its productive capability. This means less input and less output, while the upkeep for infrastructure stays the same, therefore resulting in decreased profitability. If a player suddenly decides to invest a large amount into an infrastructure, they will more than likely experience immediate losses, until the labor demand is met and the wages go down. Huge investments are typically a bad idea unless the province is already well developed or they can easily afford the labor.



Skill for now does not do anything noteworthy, but rest assured that we have plans for it.

Remember the Soil Quality and Agriculture DD?



Soil quality limits and determines the production capacity of different types of agricultural industries. A province where the land isn’t capable of growing potatoes won’t be able to produce them. At the same time, the more a location is suitable for a crop type, the greater the food output of that crop type will be, resulting in better profitability and lower food prices.

The labor capacity of a province is calculated from the population itself, with different classes providing different types of labor. Peasants, for example, provide rural labor, which is mainly used in resource industries.



Creating work opportunities by increasing labor demand from industry slots will increase wages, which directly affect the willingness of people to migrate to that province looking for jobs. This is how we tied economic expansion to population growth and development. Neat, isn’t it?

​

Summary:

The 3.0 economy is a living thing of its own. A vicious war or horrible disease will lead to a decrease in population. Less population results in a lack of labour. Throughput goes down, and industries in that region will produce less and start to shrink, while wages rise.

A country that depends on goods from that region, for example the Ottomans buying food from Egypt, may start to depend on other places for their needs, or even start producing these goods themselves. This can lead to a formerly mediocre region suddenly thriving and becoming prosperous and rich, greatly benefiting the owner. Population will increase there, meaning more manpower capacity, more money, and more ability to wage wars; A new power is born. What happens on one continent affects another.

The same concept can be applied universally. China can be devastated by a disease, a war, or a certain guy with a limp. Countries that depended on China for their necessities will have to start buying from someone else, creating a temporary or permanent shift in the world's economy.

That’s it for now! I know everyone is going to have lots of questions, and all these things may sound complicated at first, but the whole purpose of the Dev Diaries is to introduce new concepts. Rest assured that when we release 3.0, we are going to have a detailed wiki ready to go, explaining how everything works and how to interact with it.

Remenber that we are also present in https://discord.gg/kDJn3d, our official discord.