Economy

Economy is dynamic. What makes it dynamic are 3 things. Dynamic supply, dynamic demand, and dynamic price. Their interaction with each other is the very core of economy.

Supply is dictated by industries. Industries have size, which is their throughput. Their size changes with a single goal of maximizing raw profit for its owners. They do that by predicting the expected value of their action through referencing their past record.

Industries maintain 2 record variables, where one records the summed value of its size changes while the other records the summed value of its profit changes. The system continuously updates those two variables such that they can be used to accurately predict the result of their action.

First, profit change record. In each given iteration, profit change record is updated in a following formula.

record := record * memory + profit 1 iteration before - profit 2 iterations before, where 0 <= memory < 1

Then, size change record is updated with this formula.

record := record * memory + action 1 iteration before

Once those two are updated, it's very easy to change industry size using those two records.

change = (profit change record / size change record) / (industry income + industry spending)

If both profit change record and size change record are positive, then that means that in the past the industry has in general increased its size which was met with increased raw profit. Therefore, it aligns with how profit change record / size change record > 0, because both are positive. If both profit change record and size change record are negative, then that means that in the past the industry has in general decreased its size which was met with decreased raw profit. Therefore, it aligns with how profit change record / size change record > 0, because both are negative. If profit change record is positive but size change record is negative, then that means that in the past the industry has in general decreased its size which was met with increased raw profit. Therefore, it aligns with how profit change record / size change record < 0, because one is positive and the other is negative. If profit change record is negative but size change record is positive, then that means that in the past the industry has in general increased its size which was met with decreased raw profit. Therefore, it aligns with how profit change record / size change record < 0, because one is positive and the other is negative.

Demand is dictated by price. There are 2 key sources of demand. Population and industries. Demand from both decreases when price is high, and increases when price is low. Let's start with how that works in population.

Population demand works by categorizing tradegoods into 3 categories of life, comfort, and luxury. Then they demand differing amount of different category of goods in a step by step manner.

First, population takes out a portion of its wealth and designate that as its maximum spending. They can spend less than that, but they will never spend more.

Then, population checks if it can afford 80% of its life needs. If it can't then it demands maximum spending * 80% / expected cost amount of life needs.

If it can, then population checks if it can afford additional 40% of its life needs and 60% of its comfort needs. If it can't it does the same thing as above just with 80% base life needs, 40% additional life needs, and 60% comfort needs.

If it can, then population checks if it can afford additional 40% of its life needs, 70% of its comfort needs and 100% of its luxury needs. If it can't, then it does the same thing as above just with different numbers.

If it can, then population checks if it can afford additional 40% of its life needs, 70% of its comfort needs and 100% of its luxury needs. If it can't then it does the same thing as above with same numbers. If it can, then set all demand to be 200% for all 3 categories of good and cease the algorithm.

Industry demand works by increase in input material cost decreasing the profit of the industry, putting a downward force on industry size and therefore on industry demand.

Price is dictated by supply and demand. Each iteration, all sectors calculate the total supply and demand for each of the tradegoods. Total supply of a given sector is given by following formula.

supply = sector production + max(import - export, 0)

Total demand of a given sector is given by following formula.

demand = sector consumption + max(export - import, 0)

Then, if supply > demand, sector's price belief for a given good is decreased. If supply < demand, price belief increases.

That's about it.

Economy is a set of systems which work together to simulate a dynamic market-oriented civil economy. It has two components, production and trade, where production handles production of goods while trade handles its distribution. Its main role is to generate income for the population, which in turn can then be taxed by the state for its income.

Starting with production, it is a system that describes how much of which good is produced in what province. It does so by organizing provincial industries into slots.

A slot is an empty place that can contain an industry. You can view it like a factory. A slot has its own treasury, income, spending, employees and rented lands.

An industry is a set of information that describes which trade good, land and labour a slot will produce and consume. A slot that contains a textile industry will consume fiber tradegood, urban low labour, urban high labour, urban industry land, while producing consumer product trade good.

Throughput of a slot is determined by its size. A slot whose size is 10 times bigger will consume 10 times the resources to produce 10 times the output. Size of a slot is determined by its wealth. More wealth it has, greater its size becomes, which reduces its profitability until income is equal to spending and profit is 0.

All slots have a rank. Higher the rank the better, because it reduces land and labour consumption while allowing production of more sophisticated trade good. A rank can be increased when a slot has at least 100 wealth, and satisfies the condition for promotion. When the condition is satisfied, 20% of wealth is deducted from slot treasury while its rank gets increased by one. Once increased, a rank does not decrease on its own.

Players can interact with production system by using local interactions. There are 2 things a player can do. A player can either open a new slot with an industry of its choosing, or endow wealth into preexisting slots, increasing the amount of wealth a slot contains.

Moving onto trade, it is a system which describes how the produced goods are distributed between provinces. For that, trade system is focused on two things, supply and demand. Those two are used to calculate price, fulfillment, and most importantly, import and export.

Price is simple. Every provinces have their own separate prices for each of the various trade goods. When supply is higher than demand, price drops below its base value. If demand is higher than supply, price will rise above its base value.

Using price differences, provinces that are connected to other provinces will do import and export calculation with that province. When the price difference is higher than the transportation cost, size of trade between provinces gets increased, until price differences slowly shrink till it is equal to the transportation cost. When it is lower, size of trade between provinces gets decreased.

Provinces can trade only with provinces it is connected with through a link. A link can be seen as a line that connects two dots. It can be formed only by trade centers with provinces that are within its range.

There are several conditions for how trade centers are formed. Most important conditions are, whether or not it is sufficiently close(in CE distance) to another trade center, whether or not a sufficient amount of commercial activity is occurring within a province, and how good the natural features of a province are for commercial activity.

Players can interact with trade system by either embargoing or waging a war against other country, or by subsidizing either internal or external trade. When a country is embargoed or when a country is at war, any trading activities between provinces owned by its belligerent will suffer heavily. When a trade is subsidized, a portion of the transportation cost will be subsidized, making a dent on state treasury while allowing greater amount of trade.

A player can also use a trade interaction on a province to see which provinces it is trading with.