Open wvpm opened 3 days ago
I confirm that 5x base price is the absolute maximum price. This was tested by setting oil base price to 0.5, setting Sikkim's RGO to oil and buying 2000 oil. The price would rise by 0.01 until it reached 2.5.
The absolute minimum could be 0.22x base price. In my test, the lowest price I could get (by selling 500 oil daily) is 0.118. This is 0.236x base price. I suspect the price didn't go lower as decreasing it by 0.01 would result in 0.108, which is below 0.22x base price.
In repeated the selling test with a new game and the price would not drop below 0.12. So the minimum might be 0.24x or the code prevents it from hitting 0.11 (perhaps due to rounding errors).
Problem
In Victoria 2 each good has a price. These prices change depending on supply, demand and a base price. The base price is defined in common/goods.txt.
According to the wiki prices increase when demand > supply and decrease when demand < supply. It states that prices change with £ 0.01 per day. It also states that the minimum price is 0.22x the base price and the maximum is 5x the base price.
According to Reddit under "The prices of goods", price changes towards base price * square root(demand / supply).
I also did my own testing and confirmed prices changes by £ 0.01 per day. In a test where there is a good with base price 1, I repeatedly sold 30000 units per day on the market (using cheats). The price dropped to 0.58. The market screen claimed a supply of 32275.021and a demand of 8353.598. See Discord.
The price would not drop below 0.58. The square root(demand/supply) would be 0.5087. So the price does not even hit the square root as claimed by Reddit.
OpenVic needs to faithfully recreate this behaviour. The exact mechanic remains hidden and need to be discovered and documented.
Solution
Run Victoria 2 and record prices with the demand, supply and base price. Feel free to use cheats or mods to push prices to their extremes.
Work out the mechanics of price changes using the recorded data.
Document your findings in OpenVic/docs/simulation/calculations.yaml.
For questions, just ask me on Discord.