How is the vicky economy modelled? What are the formulas and underlying assumptions?

  • 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.
Well, there's more problems with the economy than just d=!d, as outlined above, but it's equally all fixable - especially with the freedom of action available to the devs. I regard the PDM economy as essentially in a finished state; that's why I've taken to adding in decisions to give the player more to aim toward - I feel paradox kinda missed a trick by shipping the game with almost no decisions per country.

And let's keep to things that are actually achievable within the confines of the game, rather than looking for ideas like 'utility' which would require a total rewrite from design stage, shall we? The devs are not likely to change the fundamentals of the economic system, and nor should they.

Which is a shame... a stable and simple system would have been very easy to make. Aggregate demand should simply equate with aggregate supply. You can do this with functions as simple as you like. The producers will have slightly differing cost functions due to techs and that's it. From what I've read here so far the system is flawed and near impossible to get into a decent working order without imposing extreme limitations on it.
 
Which is a shame... a stable and simple system would have been very easy to make. Aggregate demand should simply equate with aggregate supply. You can do this with functions as simple as you like. The producers will have slightly differing cost functions due to techs and that's it. From what I've read here so far the system is flawed and near impossible to get into a decent working order without imposing extreme limitations on it.

None of the solutions implemented by PDM or AoC add "extreme limitations". Fixing d=!d for luxury goods just requires a slight reordering of the pop demands and fixing d=!d for build costs just requires build costs to be based on RGO goods not factory goods. The decimal rounding problem just requires a lowering of good cost, a raising of output, and a raising of consumption. Even without fixing the decimal rounding problem it only makes things difficult for small pops, which don't make up a significant portion of the population, to fulfill their needs for a select few goods. Naselus has taken this all a step further and added in more RGO and factory goods, but that doesn't mean he's added "extreme limitations".
 
Okay so a factory has a few interesting values in the savegame files. This is from a level 3 lumber mill in state 604 (I think Basel).

It has a stockpile, which is likely the same one you can see on ingame tooltips:
timber=237.15692 (unit price .909 )
cement=1.48221 ( 15.83984)
machine_parts=0.02966 ( 20.05896)

Just to give a rough idea of inputs, total cost is ~239.613. If all of these inputs were used, this should result (for v1.2) in ~237 lumber at 100% efficiency. This is an old savegame, so I don't know if the country in question had any input efficiencies. I'm not even sure how many clerks are working.​

Then there is a list of the various component provinces and pops that contribute to the factory.

employment=
{
state_province_id=269
employees=
{

{
province_pop_id=
{
province_id=269
index=0
type=7
}
count=4203

ETC ETC ETC.




Then there are these values:
money=240038.14697
last_spending=239620.57495
last_income=431450.50049

For reference, the sale all 237 lumber at a unit price of 1.01001 would result in about 239.5 in cash for this savegame, but I have no idea if all the lumber is selling or if there are input efficiencies at play. It looks like these values have some degree of floating point as both "money" and "last_spending" are coincidentally close to the stockpile price, but off by a factor of 1000. In fact, last_spending is so close to the price of the stockpile, it's a fair bet that's what it represents.

Some factories also have a line that says "subsidised=yes" below "last_income." Obviously this lumber mill is not subsidised. For every factory I looked at money was greater or equal to last_spending. Factories under construction have a value for money, but 0's for everything else.


Of course, God (or Naselus) only knows if you can alter these values through a mod, let alone alter the factory behavior somehow. Investigating...
 
Last edited:
There is really no way for us to affect these values directly as there are only four scopes available for scripting, country, state, province, and pop; there is no factory scope.
 
Yes, we can't adjust factory spending behaviour directly. We can lower inputs etc, but the way it handles money is entirely controlled by the efficiency factors; it won't save money afterwards.

The factory is not an actor, like a realworld corporation. The factory instead is purely the means of production, with a financial presence limited purely to affording its inputs, wages and + maintainence costs. All surplus money is then filtered out to be divided between the workers and the capitalists.

It'd be quite handy to know the profit sharing ratios, if we can find them. They're hardcoded, so it'd probably require an in-game observation test with no minimum wages enabled.

I DO know that wages are taken prior to determining surplus, which is why 'good' wages in vanilla tank the economy. I'd bet they're drummed out at about the same time as goods are purchased, during the 'expenses' stage - that's when the factory spends it's money, prior to determining profit.
 
I hate to dredge the thread up again, but I have some questions about the d=!d luxury needs bug Naselus. Moving goods to everyday needs category immediately eliminates the problem, but I've noticed you can still have some of the need in the luxury needs category and still have actual bought equal demand perfectly. Do you know what is going on here?
 
Two basic possibilities on this.

1) the need is low enough in price that it can be purchased in full by the relatively few POPs earning enough to buy luxury needs.

2) the need is in small enough quantities that total lux goods can be bought by the few POPs earning enough to buy lux needs.

Basically, 90% of the time this crops up, it's because the majority of POPs are getting <99% everyday needs, and are not activating luxury demand at all, and the other 10% of the time it appears they're getting ALL luxury needs - possibly due to rounding errors in income etc.

There's also the great unknown factor in this, which is how overbuying functions. We have no idea if OVERBOUGHT lux needs suffer d=!d or not. It's frustratingly hard to figure out a valid observation experiment for this, too, as overboughts don't appear in a needs fulfillment slot on the interface - you only find out anything about them from their impact on CON/MIL, and the rest are bundled into the 'regular' luxury needs space in the individual POP detail screen. If you can think of a way to observe these, don't be shy to tell me :)
 
I ran a little experiment on paper in my VRRP China game. For middle class pops, paper is desired several times more as a luxury need than as an everyday need.

To test this, I went from max middle class taxes to no tax, and went to -100% on the tariffs (e.g. max subsidies). Thus, the buying power for my middle class pops jumped up abruptly.

The demand for paper jumped from ~650 to over 1000. Demand was exactly equal to actual_bought throughout (weird in general). My middle class pops, about 10M strong, jumped from ~0% to 35% receiving some luxury needs.

Some small evidence that you can disable d=!d by adding luxury goods to the everyday pile.

... and a single data point suggesting that you only need to have a nominal amount in the everyday pile.
 
Last edited:
Lemme ask this then,

Can anyone truly explain how good price is determined? ... a nice "price(supply, demand, actual_bought, baseprice)= " maybe?

I noticed that many goods don't simply rise and fall based on whether or not supply is bigger than demand. Specifically, many goods prices are stable if there's a stable gap in supply and demand.

It seems like the ratio of supply to demand creates a deviation from a good's base price (at least in VRRP, dunno if it's moddable). If or where actual_bought fits in is a mystery to me.
 
actual bought doesn't effect price - it didn't even exist as a separate figure til 1.2.

In the experiment you did with paper, what were the needs fulfillments of middle class POPs? d=!d should only occur when lux needs demand is between 1% and 100%.

However, another interesting anomaly on this: I currently have a d=!d on shoes in PDM, even though no-one uses them as a lux need. Or a stockpile need either, unless the AI has decided to randomly buy them. Every game.

Hmm, here's a thought - what is AI stockpiling behaviour? does it just use the automated trade AI, or not?

The price appears to have margins for error in it - it's possible for there to be 2 or 3 different stable prices for goods at equal levels of supply and demand, depending on what the prices have done recently. This implies a range, determined by (supply/demand)*baseprice. But prices can only move by a limited amount per day - the price won't jump £5, it'll slowly climb there.
 
As I mentioned, prior to the tax changes, almost none of my middle class pops were getting any luxury needs. After the tax change 35% were getting at least some luxuries. Thus, there was a broad increase in luxury demand.

Even if luxury needs were only a small part of the 50% jump in demand for paper, one would expect d=!d to cause at least a small gap between demand and actual_bought. Strangely, those values for paper were equal before and after the tax changes, and stayed equal for months (I stopped watching after a while). ...and like you've noticed, even many non-luxury goods have a small gap.

AI stockpiling may well have a role. But WTF is the AI doing stockpiling freaking telephones?

The price appears to have margins for error in it - it's possible for there to be 2 or 3 different stable prices for goods at equal levels of supply and demand, depending on what the prices have done recently. This implies a range, determined by (supply/demand)*baseprice. But prices can only move by a limited amount per day - the price won't jump £5, it'll slowly climb there.

That would make the most sense. Grain, for instance, has had demand outpace supply by roughly 20% for years in my latest game. The price hasn't changed much beyond .8 (nominal value of .75) the entire time. The thing is, many goods show very rapid, but very small, random price fluctuations if you watch them closely.



Weirder and weirder.
 
I suspect the AI may actually stockpile goods that are being manufactured in it's country, in order to stabilize the price - possibly as a quick-and-dirty means of redistributing wealth and supporting Artisans or something. Rizz has already po8inted out the observable effect of d=!d from stockpiles, plus it would explain a weird country-specific mass bankruptcy bug I noticed in PDM - plus it would also explain the sizable differences in supply/demand levels depending on which country you play as... but I haven't got any proof.

There's also the possibility that the AI is operating with 'allow population to purchase from stockpile' active. Can we get some save game analysis on this and see if that tells us anything?
 
There's also the possibility that the AI is operating with 'allow population to purchase from stockpile' active. Can we get some save game analysis on this and see if that tells us anything?

Hmm, that would be interesting. But if the AI really was buying up stockpile, wouldn't actual_bought be fairly high if countries were buying it up?

On a related note, I've been playing with barrels and prices. In this game, my country is the only buyer and seller of barrels. I was buying up my stockpile (I'm not sure why), which kept the price up pretty high, nearly &100 per unit. Once the stockpile topped off, my daily purchase was reduced to 66.95 units, which is exactly one less than the demand and actual_bought values of 67.95. Presumably a nominal value of 1.0 is added to both of those values even when there is some actual business taking place.

More interesting is how the price responded once my order dropped to 66.95. It dropped by a fixed value (&0.5005) everyday (I didn't watch the first few days) until levelling off at &41.0

Summary of values after reduced sales order:
Typical supply:~100units/day
demand/bought:~67.95 units/day (~ 66% of supply)
daily price drop:~&.5005/day (~ 1% of base price of &50)
stable price:&41.0 (~ 82% of base price)
 
I tried to be sneaky and drive the price of barrels down in my country by setting buy<0 for barrels. Sure enough the price dropped, all the way to 50% of base price (&25).

I then allowed automated trade to keep my supply up, but woe unto me, it took the industry a while to resume production (realistic, actually), leaving price where it was before.

Damn Military-Industrial complex!
 
Naselus, could you expand on the issue of wages a bit, or give me a general idea of where to look/read if you've gone over this at length before?

From what I have read here, it seems that a given RGO/Factory does not treat wages as an expense in the sense that workers are paid before 'profit' is determined. Rather, 'wages' are taken as form of profit sharing, the amount determined as seemingly hard-coded percentage of the difference between the income generated by the factory/RGO and the cost of its inputs. Correct?

Are legislated 'minimum wages' a separate entity, mathematically speaking, from 'basic' wages? Or do they simply directly adjust the profit distribution function? It could be that minimum wages are first extracted directly from the 'profits' before applying the distribution function, or they could be taken directly from the Capi/Aristo share after the primary distribution.

I see in your mod that you changed the minimum wage reform by scaling the minimum wage vaules (so as to work with the rest of the PDM scaling, I presume) and then changed "no minimum wage" to a nominal value. Playing a game with the latest version of PDM. Will see if I can do some experimenting with this when I get to the point where I can enact a minimum wage reform.
 
wages:

OK, 'basic' wages are essentially a profit share - craftsmen receive a portion of the profit of the factories they work in. This appears to be roughly the same portion that RGO workers get paid, which is roughly 20% ish for poor POPs. The exact figure is unknown and open to debate. I suspect it breaks down as something like 15% -35%-50% for poor/mid/rich, but that's complte conjecture. I'll see if I can devise an observation experiment.

Rizz has noted a very small income going to craftsmen in unprofitable factories, but once again, this has not been confirmed. As Craftsman POPs can and will split their labour betwen multiple factories, it's hard to get an exact figure unless you limit the factory and craftsman numbers to match exactly.

Minimum wages, on the other hand, act as an expense and the money for them is paid out to the recipient at the purchasing stage of the factory's production process. This is why a 'good' minimum wage in vanilla is economic suicide - you start paying the money out before profit margins are figured out, which results in factories being incapable of proift This can be alleviated somewhat by halving vanilla values. Minimum wages are an absolute value, as near as I can tell; so a minimum wage of 0.01 means £1, rather than 1%.

This is about as much as we know on the subject for the limited testing that has been done thus far. More data woukld be much appreciated.
 
Some handy information I've dug up regarding precious metals:

There are 4 stats related to precious metals.

Gold-to-cash rate, in defines.lua, is money paid directly to the government for every unit of gold produced. It is totally unrealted to the value of gold defined in goods.txt. So if a mine produces 5 precious metal, and gold-to-cash rate is 1, then the government will receive £5 every day. No other factors effect this, and the money generated is NOT shown in the province RGO profit output.

Gold-to-worker rate, in defines.lua. This determines how much money workers receive from every unit of precious metal. It IS effected by the cash value of gold; so if a mine produces 5 gold, and the price of gold is 5, and gold-to-pay rate is 3, then the mine will produce 5*5*3 = £75 to be split between the workers. This IS shown in the province RGO profit screen.

Precious metal value, in goods.txt. This is used to multiply worker pay rate to determine profit. This value never changes from the number in goods.txt.

Precious metal output, in production_types.txt. This determines how much gold is produced by the mine, and is effected by mine and RGO output and throughput multipliers.

Now, this allows us to work with the cash supply much more effectively, as follows:

If we set gold-to-worker pay rate at 1, then it can be ignored, as it will do nothing. This appears to be the approach paradox used. As gold-to-worker rate never does anything except multiply the POPs income, the same effect can be achieved by changing precious_metal price, which also has no other effect.

Gold-to-cash rate, as it is not effeected by gold value but is effected by the RGO's throughput and output, should probably also be set to 1 to become safely ignored, with all state gold income being increased through the precious metal production setting in production_types.txt. Tweaking this value should only be used if you want gold for the state to change without effecting workers.

Gold price can be used exclusively to determine how much the RGO workers make. This should be seen as the primary variable when attempting to adjust cash rate.

Gold production will effect both country income and worker income, and so should probably be set at an easy to use integer, like 1, 5 or 10. Bear in mind that if we have set gold-to-cash rate at 1, then every gold unit produced will give the state £1 - and the state shall also tax the workers.
 
If we go back to price determination, I believe it was explained as price rises if the goods wanted are greater than the goods supplied. The flaw here is that goods wanted are the inelastic demand per individual. Each pops wants X amount of good Y regardless of price. This is true to an extent and not a problem if done correctly. The game allows no substitution of goods so therefore the price mechanism can only affect Qd through income. The problem is the game does not take into account income only that pop X wants Y numbers of goods. The system can work but it must take into account that at certain prices pops will be priced out. This is the fatal flaw of the system that fact that income plays no role. The two viable modding perspectives are limiting demand and playing with price floors and caps or injecting money and playing with price caps.

Either works to fix the flaw because money allows pops not to be out priced and limiting demand brings demand into income. What would be optimal is for Paradox to fix this in a patch. Since the pricing out problem does not seem to happen with life needs, pops never seem to run prices up so high they can't afford any, then paradox would have to rewrite the code to check how many of the wanted goods can be bought. Essentially with all perfectly inelastic goods, those whose quantity demanded do not respond to price until someone is priced out, that is how demand works. Only income and number of buyers would shift the curve and even income only shifts at certain ranges. Market demand in these cases is how much people can buy at each price. This is not necessarily the case for inelastic or elastic goods.

The downside is processing time it would require dry runs before trades are made.

The downside is processing time. It would require dry runs before trades are made.

The fix that can not be modded would be something like this and only be a small change to the current model.
Check amount people will buy versus the quantity supplied. If Qd > Qs prices increases until Qd=Qs. It would require several runs until the game found a price to where all the Qs could be sold. Note Qd = Quantity demand the correct term (demand is often used incorrectly for this term in these threads) and Qs = quantity supplied. The game would check and see how much would be bought (Qd) if > Qs, how much is available to be sold, then price increases which causes Qd to fall as people are priced. When Qd=Qs adjustment ends. If Qs>Qd then price falls until Qd=Qs or Qd does not change. As price falls more people could afford the good unless the market is saturated at which point the excess goes into the sea or is stockpiled.

So the decision is fairly simple in plain english,

If how much people will buy > amount available price rises until amount people will buy = amount available. The amount people will buy drops as people are priced out of the market. If the amount available is > amount people will buy price falls until amount people will buy does not change or the amount people will buy rises enough to meet amount available. In this case Qs>Qd would lead to less profits as prices fall and maybe still goods are not sold. I think if you do this you can completely remove price floors and caps. However, only paradox can do this. I think it is hard coded. Unless you could write daily events to do this?
 
Using events to do it would destroy the game speed. Anything which makes the game fire a decision or event every day results in a massive slowdown. Only the devs can fix d=!d in that way :)
 
I do not necessarily agree with all of your views of economics (which is what economics is all about) and I think the game - somewhat unintentionally - models some things quite right.

First of all I think it wrng to present profit maximisation as axiom. That is theoretically sensible but it simply doesn't hold. There is quite a lot of papers on firms rather maximising revenue (of course to a reasonable point) or the ominous satisficing. V 2 unintentionally puts this (somewhat overdone) revenue maximisation in and, if the economy would work differently it would be very interesting as it kind of simulates everyone attempting to be a monopoly and thereby creating an oligopoly price war where, also in reality, everyone loses. This way however it does result in overproduction (which however mainly is to blame on the ridicolous abundancy of natural ressources coupled with, right techs provided, a ridicolous population and education growth all around the world (maybe some epidemics now and then would be reasonable))

I also disagree with the notion that the desire system is in principle bad. The game is modelling the 19th Century where prices were not fixed all around the world and strictly regulated and controlled. There was no forex, no EU commission and price discrimination was still common. You therefore have to see the world market as auction system, not as normal equilibrium market. Every consumer pays what he wants to pay (first degree price discrimination) and the consumers competing to buy goods therefore drive price up, even without buying anything. Again however the game overdoes it as practically everyone bids above ability.

I also think the shareholder system is not so bad. I mean, to a certain extent this makes sense as factories that earn more also generally pay higher wages (with 8.5 trillion speciality exceptions of course, as always in economics). The good thing about the shareholder system is that it is a cheap way of simulating wages with some realism without having to create a real labour market. That would be madness in the game in my opinion as the 100 trillion chinese craftsmen that emigrate ebverywhere endgame (again trhe ridicolous growth which probably would have made thomas malthus contemplate suicide) will reduce the worlds population into slavery.

That inflation is non-existent is somewhat an issue of necessity. Since inflation results mainly from increases in aggregate demand (at least according to friedman and friends (well its a bit more complicated but yeah its about it)) inflation in V2 in explode within 30 seconds due to aformentioned issues with disproportionate demand.

That money comes from gold is a bit simplistic but good enough for 19th century (see gold standard). Fractional reserve banking and fiat currency did exist, but far less than today and gold did still play a big role, as it still does now.

The world market I think is ok. You can speculate a bit too much (buy all of one good, especially oil as US/Russia or Rubber as UK, wait, congrats you own the world...) but especially with oil its not even so unrealistic. The problem again I think is mainly the fact that labour is basically the only variable factor of production in the game. One can therefore produce endless amounts of natural ressources provided one has enough population. That breaks every economy as it basically means aggregate supply (if we assume every human can produce more than it needs to survive) basically tends to infinity, collapsing prices and creating a socialist utopia with the sole problem that the currency doesnt collapse (as there is no deflation) so thereby creating a socialist utopia where people cant buy stuff (wehich of course is an excellent simulation of stalinist russia).