BUG: "Oil Industry production costs" are wrongly calculated.

Place bug reports / questions here.

Moderators: Balthagor, Legend, Moderators

Post Reply

For players, what you are thinking about this post:

Yes, it should be good to have it implemented as described above.
9
75%
No, economy is perfect, as it is (I have not read whole post).
0
No votes
No, economy is perfect, as it is (I have read whole post).
2
17%
I am not sure (I have not read whole post).
1
8%
I am not sure (I have read whole post).
0
No votes
 
Total votes: 12
rbilka
Warrant Officer
Posts: 28
Joined: Jun 12 2012
Human: Yes

BUG: "Oil Industry production costs" are wrongly calculated.

Post by rbilka »

I have spended here all day, to explain and investigate this problem.
So please, before you reply here anything, take your time and read whole post, and AFTER THEN make your own opinion/replay/post.
I consider this as main crucial base point of game economy, so if you don't have anything relevant to say or you are not sure, how it is working, just wait till someone from "programmers" explain us those things.
English is not my born language, than sorry if you don't understand me completly, I am doing best what I can.
Thank you (to everyone) for understanding.


Following problem is present for all "Industry production costs", not just OIL.

1) The game does not take into account the real price, for which the state acquired that raw materials in their inventories (stocks). Simple, raw materials prices are taken from "world market".

How it should be:
For every kind of "raw materials" or "products" in stocks, game already have stocks "amount" value.
We need additional one, "average aquisition price" for that "amount" in stocks. We will call it later/bellow as StockAcquisitionPricePerUnit value.

How to calculate "StockAcquisitionPricePerUnit" value:

Code: Select all

Everything here would be about OIL.

Time 0:
// Starting state:
StockAmount = 0l;
StockAcquisitionPricePerUnit = 0$/l;
WorldMarketPricePerUnit = 1$/l;
StockCurrentMarketValue = StockAmount * WorldMarketPricePerUnit = 0$;

Time 1:
// Event: State buys 1000 liters of OIL for 1000$ (=1$ per liter). // adding to stock:
AcquiredVolume = 1000l;
AcquiredPrice = 1000$;
StockAcquisitionPricePerUnit = ((StockAmount * StockAcquisitionPricePerUnit) + AcquiredPrice) / (StockAmount + AcquiredVolume);
StockAmount = StockAmount + AcquiredVolume;
// New state/results:
StockAmount = 1000l;
StockAcquisitionPricePerUnit = 1$/l;
WorldMarketPricePerUnit = 1$/l;
StockCurrentMarketValue = StockAmount * WorldMarketPricePerUnit = 1000$;

Time 2:
// Event: we do nothing, just world market price for oil increases from 1$/l to 10$/l
// New state/results:
StockAmount = 1000l;
StockAcquisitionPricePerUnit = 1$/l;
WorldMarketPricePerUnit = 10$/l;
StockCurrentMarketValue = StockAmount * WorldMarketPricePerUnit = 10000$;

Time 3:
// Event: State buys 100 liters of OIL for 1000$ (=10$ per liter). // adding to stock:
AcquiredVolume = 100l;
AcquiredPrice = 1000$;
StockAcquisitionPricePerUnit = ((StockAmount * StockAcquisitionPricePerUnit) + AcquiredPrice) / (StockAmount + AcquiredVolume);
StockAmount = StockAmount + AcquiredVolume;
// New state/results:
StockAmount = 1100l;
StockAcquisitionPricePerUnit = 1.82$/l;
WorldMarketPricePerUnit = 10$/l;
StockCurrentMarketValue = StockAmount * WorldMarketPricePerUnit = 11000$;

Time 4:
// Event: we do nothing, just world market price for oil decreases back from 10$/l to 1$/l
// New state/results:
StockAmount = 1100l;
StockAcquisitionPricePerUnit = 1.82$/l;
WorldMarketPricePerUnit = 1$/l;
StockCurrentMarketValue = StockAmount * WorldMarketPricePerUnit = 1100$;

// Some details:
If you aquire something thru diplomacy, it would be added to stocks by the same rules above.
If you don't have enought stocks for your industry production, game should handle that it is is now. That means your production would be lowered, or some amount for some price would be aquired from world market and added to stocks (by same principse above).
This should be critical base value (StockAcquisitionPricePerUnit) for domestic economy and production costs calculation.
I will explain bellow why, but basicaly it realy allows to have "domestic production" and brings partialy stability for self-sustained domestic economy, regardles on actual market "crash/explosion".
It gives you real meaning to stockpile cheap raw materials or products, and sell / produce from them, when market prices rise up, because then your production costs stays +- at the same level (till you consume them from stocks), of course, new additions to your stocks would start increasing StockAcquisitionPricePerUnit of that materials in stocks, but you would be in control, from where + when + how "cheap" you aquire new raw materials.

2) Game takes, into calculatotion of "production costs", actual "world market price" of "raw materials" or products, and not the "real prices", at which that "raw materials" was acquired by the state to "domestic economy" (state stocks).

How it is in game:
Game calculate input prices (and productions costs) for every "raw material" from "current world market price" and not from real "aquisition price" (StockAcquisitionPricePerUnit) of that state stock supply.

How it should be:
As input price of "raw materials" for domestic "production costs" calculation, game should always use local=domestic "StockAcquisitionPricePerUnit" price.

Results of current implementation/model:
There is no point to make huge reserve of "cheap" "raw materials" for domestic industry.
You would be not able to produce cheaper products (from cheap raw materials in stocks) and sell it for higher market price (net income,revenue margin) later.
Because your production costs (raw input prices) will rise up with rest of the world prices, so net income in % would be still the same, no matter what.

Reasons, why we need above mentioned changes in economy models:

First reason (how it should work, but not currently not working):
If someone give you very big amount of OIL for 0$, and this amount is covering your entire 10 years consumption for whole domestic use (=domestic industry), you can STOP Oil production, and scrap all your Oil pumps.
Then if you are producing eletricity from that Oil (by petrol power plants), your production costs of eletricity should go rapidly down, because main component of input prices "production costs" of eletricity (Oil) you have for free = 0$.

Second reason (current faulty implementation):
One producer of critical resource (Eletricity or Oil) can very easy manipulate with everyones "all production costs", even if some states are "self-contained" = "closed domestic economy", of everything on whole world, by simple selling or (buying/not selling) that commodity, and that all in few DAYS (1-3days)!
Even when world resource supply helded by world is 1000x more, than was selled in those "manipulative sells".
This is main results, why everything is changing very rapidly (prices fluctuating too much), for example 10% (=+-5%) in matter of 10 days.

Example from game, how to test this (reproducable):

Code: Select all

// description
This is all about "OIL" production costs.
My production output (450 oil pumps) is not changing all time.
Number of emloyed workers on OIL pumps is not changing also.
Even GDP is almost not changing, so wages/salaries are the same.
Taxes are the same.
// Important to note!
I produce eletricity only from "uranium", not from the OIL or anything else, uranium is only from my own domestic production.
I am "changing" only "Bulk sales" price of eletricity, to maitain the same "world market price" of eletricity on the same $/unit price! So world market price of Oil will not have any impact on world market price of eletricity!

// test starts

Oil Current World Market Price is 10$/unit.
My Oil Domestic Production Cost is 9$/unit.
My profit = 10%.

I start selling too much OIL to the world market (for about 3 days +-) for 1$/unit:
Oil Current World Market Price decrease to 9$/unit.
My Oil Domestic Production Cost decrease to 8$/unit.
My Production/Sell Profit can be still +- = 10%.

Than I stop selling OIL for about 30 days +-:
Oil Current World Market Price increases to 35$/unit
My Oil Domestic Production Cost increase to 32.5$/unit
My Production/Sell Profit can be still +- = 10%.

Than I start selling OIL for about 15 days +- at price 1$/unit:
Oil Current World Market Price decrease to 9$/unit.
My Oil Domestic Production Cost decrease to 8$/unit.
My Production/Sell Profit can be still +- = 10%.
It is obvious, that only I (my self) am able to change production costs for OIL (but also production costs for everything else for anyone else in the world) in matter of days, just simple by selling to much OIL to the market for cheap or byt not seling at all. I can do that any time when I wish, so it is reproducable very easy.

But why production costs of OIL is changing? Even price for eletricity is at the same level (I am selling eletricity, when OIL price on markets goes UP, to have stable price of eletricity).
How are domestic industry production costs calculated?
We don't know. Even programmers can not post here exact maths!
But we can at least try to elaborate what should be calculated as procuction cost (input).

Production costs for OIL need to be checked.

OIL pruduction costs should be calculated from:

1) Maintenance for OIL pumps, and that are right now in game "fully fixed expenses".
// Maybe game engine does not calculate "facility costs=maintenance" into "production costs" at all! Which would be very wrong. I think so, because is seems that all facilities maintenance are calculated separatly here: Finance >>> Expense Report >>> Treasuty >>> Facilities: $xxxM .

2) Wages/salaries for employes, amount of workers are fixed per facility, and when GDP/Taxes are stable, this expense item is also not changing.

3) Input raw materials price: for Oil pumps it is electricity. This shoud be only one main "variable" in production costs calculation.
As far as I can imagine, the are no other raw materials/resources consumed in Oil production process.
// Maybe very very little of "industry goods" and "consumer goods" as maintenance replacement (pipes, lighbulps, machinery, small repairs, and etc.).
But then question is, should be those calculated as "raw resource input" to "production costs"?
I guess YES, but than, what are "facility costs=maintenance" payments? Those should be than not calculated at all!
Maybe they are not, and that is reason, why "Industry" does not have "Anual Maintenance" displayed, just "-". This is question for developers?


For me it is clear and simple (to see, not to fixing it :) ).
All that can be fixed = solved by implementing two points/steps mentioned on beginning of this post, + some final checking, how are production costs of Oil (and other Industry) calculated.
georgios
Brigadier Gen.
Posts: 600
Joined: Aug 13 2012
Human: Yes

Re: BUG: "Oil Industry production costs" are wrongly calcula

Post by georgios »

perhaps you can remove from default.wmdata file the cost of row materials from the final price of goods. if you have it in your inventory it should not be buyed again.

good point! I will do it too!
User avatar
Anthropoid
Colonel
Posts: 416
Joined: Dec 10 2012
Human: Yes

Re: BUG: "Oil Industry production costs" are wrongly calcula

Post by Anthropoid »

Real life factors that figure into "production cost:"

1. Salaries and wages
2. Infrastructure & maintenance
3. Taxes and liability
4. Employee benefits
5. Research and development
6. Distribution
7. Raw materials
8. Manufacturing
9. Advertising, marketing and relations

That pretty much covers what any 'industry,' whether state-owned or private-owned, might have to pay for in producing its product.

As far as I can tell, very few of these are modelled in game. In fact, what we have in game is highly abstracted overall.

For example, "Petroleum" I think does not just represent merely crude oil, nor even only raw materials (natural gas, shale oil, whatever) but in fact evidently represents all petro-chemicals (including refined commodities such as diesel fuel, kerosene, gasoline, naptha, etc.) _as well as_ petroleum products (plastics used in 2nd and 3rd tier manufactured products represented under "Military Goods" and "Consumer Goods"). Likewise, "Agriculture" must also represent pharmaceuticals, plant crops, packaged food, live animals, etc., etc. Consumer Goods obviously represents a HUGE spectrum of things, ranging from calculators, to TVs, radios, clothing, vehicles, books, paper, paper clips, furniture, etc., etc.

In sum, for the sake of being playable, the game does not represent all the details, but instead clumps broad ranges of strategically-related raw materials and manufactured products under a few categories. This is a very common practice in strategy games going back decades and the main point is: it works to simulate the large-scale strategic decisions that a national regime would face: we don't have access to enough uranium, but we produce lots of food, and timber what do we do? Do we conquer our neighbor who has uranium in their borders, or do we befriend them and sell them stuff and buy their uranium?

This raises another crucial point: even in the most centralized and state-controlled economies ever (USSR, China pre-1990s, North Korea, etc) the degree of player control over these broad categories of commodities is somewhat unrealistic. It is exceptionally unrealistic for a laissez-faire economy such as post-WWII U.S. But then, making it more realistic very well might not make it more fun much less playable.

I agree that there seems to be a bit too much fluctuation in prices (meaning they go up and down too much in absolute values, and they go up and down too quickly) and that production costs jumping up as a result of giving stuff away is not a perfectly satisfactory dynamic. But I just expressed that sentiment in one long sentence and I didn't need to puzzle through all the background code or speculate about how things are running in the background to express that.

As far as I can tell, there is one or two main guys at BG that are the brains behind these algorithms, and the fact of the matter is: it is an amazing engine that works remarkably well. Since none of us are privy to their most inside knowledge of the engine, I have my doubts that anything beyond "there seems to be too much fluctuation . . ." is really going to prove to be that helpful in terms of improvements in future updates.

The detail you provide might well be quite useful to modders or to BG with respect to future releases; but given the train has already long-left the station (the game was released over a year ago?) I have my doubts that the sort of re-engineering to the entire engine that you suggest would be tenable.
rbilka
Warrant Officer
Posts: 28
Joined: Jun 12 2012
Human: Yes

Re: BUG: "Oil Industry production costs" are wrongly calcula

Post by rbilka »

The whole point was, why my production costs of OIL is rising, when everything else is stabilized (price of eletricity, taxes, gdp and etc). It should affect only market price based on demand/offer of OIL on market.
But it seems, that OIL production takes as input raw resource not only eletricity but also OIL!!! what is totaly wrong.
georgios
Brigadier Gen.
Posts: 600
Joined: Aug 13 2012
Human: Yes

Re: BUG: "Oil Industry production costs" are wrongly calcula

Post by georgios »

production cost of a good rises if the working places in this sector increase. If you bore more oil wells, there's a need of oil workers, and the difficulty to find them increases their salary and the whole cost of oil. Then you should halt the production and prefer buy cheaper oil from abroad. And your investment in new buildings goes lost.
User avatar
Balthagor
Supreme Ruler
Posts: 22082
Joined: Jun 04 2002
Human: Yes
Location: BattleGoat Studios

Re: BUG: "Oil Industry production costs" are wrongly calcula

Post by Balthagor »

rbilka wrote:The whole point was, why my production costs of OIL is rising, when everything else is stabilized (price of eletricity, taxes, gdp and etc). It should affect only market price based on demand/offer of OIL on market.
I have checked with George and confirmed that external factors affect region costs. This is as per design.
rbilka wrote:But it seems, that OIL production takes as input raw resource not only eletricity but also OIL!!! what is totaly wrong.
Oil is a raw material, there is not input raw resource.
Chris Latour
BattleGoat Studios
chris@battlegoat.com
georgios
Brigadier Gen.
Posts: 600
Joined: Aug 13 2012
Human: Yes

Re: BUG: "Oil Industry production costs" are wrongly calcula

Post by georgios »

where can we use this code?
georgios
Brigadier Gen.
Posts: 600
Joined: Aug 13 2012
Human: Yes

Re: BUG: "Oil Industry production costs" are wrongly calcula

Post by georgios »

natural gas is part of the oil production?
MertcanKs
Lt. Colonel
Posts: 207
Joined: Dec 11 2011
Human: Yes

Re: BUG: "Oil Industry production costs" are wrongly calcula

Post by MertcanKs »

Balt, this problem can be corrected in update 4? it would be perfect...
davidclaywood
Lieutenant
Posts: 90
Joined: Jun 18 2009
Human: Yes
Contact:

Re: BUG: "Oil Industry production costs" are wrongly calcula

Post by davidclaywood »

This suggestion is good but the calculation as explained is off technically.

What would be really nice is to have a detailed report calculated on demand and displayed in a way one could print it as a PDF for reference. This would isolate errors and prove accuracy.

Thanks for your serious consideration.
georgios
Brigadier Gen.
Posts: 600
Joined: Aug 13 2012
Human: Yes

Re: BUG: "Oil Industry production costs" are wrongly calcula

Post by georgios »

The most realistic it to find the oil extraction industry percentage on global gdp (3.6% *worldGDP) and divide it to global oil production in bbl. this shows the net production cost of a bbl of oil, not including other costs that are in it selling price. these costs are covered by the parameter "infrastructure" in social spending subdepartment.
Post Reply

Return to “Issues & Support”