I've been thinking about transport costs and how they could be modelled in Vic3 given what we know of the game. I don't read every thread here so maybe it was already discussed (and solved), please link it if this is the case. I saw this post https://forum.paradoxplaza.com/foru...and-economic-geography.1483618/#post-27691666 which basically outlines the same principle I was thinking about.
I worked with the following assumptions from my understanding of the Dev Diaries:
I agree with 1. as a reasonable approximation to make the game run smoothly and intuitively. I'm a bit bothered by 2. because with this simplification we lose a core aspect of the economics of the time. So I've tried to come up with a calculation of transport cost that is reasonably realistic, simple enough, scalable and takes into account that units of goods are not explicitly tracked.
In a nutshell: the local price of a good is not only given by the market price but also by it's transport cost. The transport cost calculation takes the distance between two states d and multiplies it by a transport cost factor w. The distance is measured by the length of the trade route between the two states (also an interesting exercise but not the point here). The weight factor is a monetary weight unique for each country and good. It represents the cost of transporting a unit of good over a unit of distance. For example perishable, bulky or dangerous goods would have high weight because it is more expensive to transport them. Since goods are not explicitly tracked I base my calculation only on the capacity of a distant state to satisfy local consumption. Developers hinted to a similar logic where states that can satisfy their own consumption would get bonuses.
The below (pseudo-) code explains the calculation. Hopefully it should be readable to the few non-IT folks here
Let's take and example for calculating the local price of wheat in Bohemia (Austrian market):
In my opinion, this system could generate interesting and realistic gameplay situations such as:
What do you think? I've had this in my head for a week now, feels good to get in "on paper"
PS: if you are concerned about computational complexity, the algorithm can be scaled down by pooling demands and capacities of states into larger regions, sort of trade nodes. All states inside a node would be considered local and would not pay extra for transport. Imports from further away would be calculated on a node-to-node basis. I could also imagine a layered approach where inside the trade node the distances are calculated between individual states, but the node-to-node calculation is applied when the good cannot be supplied by the local node.
I worked with the following assumptions from my understanding of the Dev Diaries:
- Goods are not tracked as they travel through the market. The game does not model where a tank of oil is produced and where it is consumed. The disparities between supply and demand influence the good's price but producing more than need will not stockpile and producing less will not prevent consumption (unless the yet-unexplained Shortage mechanics kicks in).
- Assuming a state has full infrastructure, the local prices of goods match the market prices. The state can buy and sell with every other state in the market without penalty.
I agree with 1. as a reasonable approximation to make the game run smoothly and intuitively. I'm a bit bothered by 2. because with this simplification we lose a core aspect of the economics of the time. So I've tried to come up with a calculation of transport cost that is reasonably realistic, simple enough, scalable and takes into account that units of goods are not explicitly tracked.
In a nutshell: the local price of a good is not only given by the market price but also by it's transport cost. The transport cost calculation takes the distance between two states d and multiplies it by a transport cost factor w. The distance is measured by the length of the trade route between the two states (also an interesting exercise but not the point here). The weight factor is a monetary weight unique for each country and good. It represents the cost of transporting a unit of good over a unit of distance. For example perishable, bulky or dangerous goods would have high weight because it is more expensive to transport them. Since goods are not explicitly tracked I base my calculation only on the capacity of a distant state to satisfy local consumption. Developers hinted to a similar logic where states that can satisfy their own consumption would get bonuses.
The below (pseudo-) code explains the calculation. Hopefully it should be readable to the few non-IT folks here
Python:
stateCurrent # state chosen for below calculation
goodCurrent # good chosen for below calculation
w # transport cost weight of goodCurrent
demand # demand for goodCurrent in the stateCurrent (in units of good)
statesOrdered # list of all states ordered by their distance to the stateCurrent
d # distances from stateCurrent to states in statesOrdered
remaining = demand # yet to be satisfied demand for goodCurrent
transportCost_total = 0 # initialization of the total transport cost
for State s in statesOrdered # iterate through list of states beginning with the closest (stateCurrent always first with d=0)
capacity_s = s.production(goodCurrent) # production capacity of state s
contribution_s = min(capacity_s - remaining, capacity_s) # contribution of state s towards consumption in stateCurrent, if remaining is low, the state does not contribute with its full capacity
transportCost_s = contribution_s * d_s * w # cost of transporting contribution_s from s to stateCurrent over distance d_s
transportCost_total = transportCost_total + transportCost_s # increment total transport cost
remaining = remaining - contribution_s # decrement remaining demand for good
if remaining == 0
exit loop # demand for goodCurrent in stateCurrent has been satisfied
price_transport = transportCost_total / demand # divide the total transport cost by the demand to calculate average transport price per unit of goodCurrent
price_local = price_market + price_transport # final local price of goodCurrent in stateCurrent
Let's take and example for calculating the local price of wheat in Bohemia (Austrian market):
- Wheat has a market price price_market=10 and a transport cost factor of w=1
- Bohemia has a demand for 100 units of wheat
- Bohemia has the capacity to produce only 70 wheat
- Since 70 wheat is produced locally, it bears no additional transport cost
- First iteration of the loop does not increase transportCost_total since d=0
- Now we search in the states closest to Bohemia for the remaining 30 wheat
- Moravia is at a distance of d=2 from Bohemia and produces 20 wheat
- The cost of transporting the 20 wheat is contribution_s * d * w = 20 * 2 * 1 = 40
- Lower Austria is at a distance of d=5 from Bohemia and produces 120 wheat
- Since currently remaining=10, we consider only 10 wheat is provided by Lower Austria to Bohemia
- The cost of transporting the 10 wheat is contribution_s * d * w = 10 * 5 * 1 = 50
- The entire demand for Wheat in Bohemia can be satisfied by these three states at a transport cost of transportCost_total = 0+40+50 = 90
- The average per-unit price of transport is price_transport = transportCost_total / demand = 90/100 = 0.9
- We can now calculate Bohemia's local price of wheat price_local = price_market + price_transport = 10+0.9 = 10.9
In my opinion, this system could generate interesting and realistic gameplay situations such as:
- Major shortcuts, e.g. the Suez canal, could drastically decrease the distance between the core states and the colonies, thus decrease prices of exotic goods.
- Players will be incentivised to reduce the transport cost factor by researching new inventions (say refrigerated trains). This would give more interesting options and flavour to the technological gameplay. Unsure how Infrastructure production methods could factor into this...
- Low-tech industries could still be competitive in remote locations. Colonial farms with less advanced production methods would still be able to supply the local population (or not, depending on how remote it is). Also technologically less advanced nations could, under certain circumstances, profitably supply major powers' colonies with staple goods.
- There could be an interesting trade-off between production methods, especially in the food industries. High-efficiency production of raw food would supply the local population, less efficient but more durable processed food would supply the industrial hinterland. For example, raw fish would be reasonably affordable only in coastal states. However, building canneries (with easily imported steel), would produce canned food with a much lower transport cost factor.
- Coal is the driving fuel of industrialization. States near a large deposit would have more profitable factories since they all would consume cheap local coal.
What do you think? I've had this in my head for a week now, feels good to get in "on paper"
PS: if you are concerned about computational complexity, the algorithm can be scaled down by pooling demands and capacities of states into larger regions, sort of trade nodes. All states inside a node would be considered local and would not pay extra for transport. Imports from further away would be calculated on a node-to-node basis. I could also imagine a layered approach where inside the trade node the distances are calculated between individual states, but the node-to-node calculation is applied when the good cannot be supplied by the local node.
- 15
- 4
- 3
- 2