Cost per Unit Calculation Bug

Discussion about Production and Resources

Moderators: Balthagor, Legend, Moderators

Eric Larsen
Colonel
Posts: 350
Joined: Oct 25 2005
Location: Salinas, CA

Cost per Unit Calculation Bug

Post by Eric Larsen »

I have found a bug in how the "cost per unit" is calculated. I've been wondering how players have been able to downsize their industries, jack up their efficiencies, buy a bunch from the WM at higher prices and yet turn a profit. :o

In my game as Southern California in the US-California scenario my region has zero production for ore, coal, and uranium. It's also way short on water and timber production. The scenario starts 5/1/2010 and my data is from 4/20/2011, almost a whole year into the scenario. After almost a year of buying from the WM all of my ore, coal and uranium and a huge percentage of my timber and water I found my cost per units in complete error.

Description____Ore______Coal____Uranium____Timber_____Water____
cost per unit.....187.75......33.82......16.21...........20.66...........268.81.....
WM price..........268.70......67.89......23.88...........35.27...........385.89.....

The cost per unit is the 4/20/11 cost per unit as calculated by the game. The WM price is the price I'd been paying for all but the first 3 weeks as prices fluctuated, especially coal. I managed to find the sweet spot of buying about 22,500 units each day at that constant price of 67.89, the others I had to buy a bunch one day at my price and then wait until the WM price came back down before buying more at the same price, month after month for 11 months for the other 4 products.

Since I have no production for ore, coal, and uranium my cost per unit should be the cost I have been buying the stuff at. My inventory consists wholly of bought product and should reflect that price. My inventory of timber and water consists wholly of bought product and that higher price I paid for it is not being factored into my production costs. The stock being used is being calculated at my cost per unit for what I do manufacture and is not adding in that extra cost of the imports. Therefore profit margin is overstated, taxes get overstated, and a whole bunch of other related things get that benefit of false overstatement.

Just for grins I decided to further test cost per unit to see how buying a large quantity of ore would affect my c.p.u.. On 4/20/11 I had 284,000 units of ore at $187.75 and I offered to buy 531,000 units of ore at $269.47. I got about 338,000 units at that price. I didn't get any the next day as I forgot to jack up the price but on 4/23 I got about 10,000 around $291.00 and on the 3rd I got another 10,000 at 309.63. So I round that last 20,000 at 300.00.

start.........284k times $187.75 equals $53,321k.................................
bought.....338k times $269.47 equals $91,081k................................
bought.......20k times $300.00 equals $ 6,000k.................................
totals.......642k times $234.27 equals $150,402k...............................

On 4/24/11 when the dust settled from my little experiment I had 608,000 units which means I used about 34,000 units over the 4 days.

4/20/11 cost per unit .......... $187.75
4/24/11 cost per unit .......... $187.76 ???

My 4/24/11 cost per unit should have been $234.27, give or take a few pennies. That it only raised a penny when I more than doubled my inventory from 284,000 units to 608,000 units my cost per unit should have soared $46.52 since I have no production of ore in the first place! That's moving average inventory costing and it's the only way to value inventory on hand.

The problem is that inventory gets valued at cost per unit, which in the case of items that must be imported completely or in large part will lead to false results as I have so clearly demonstrated. No wonder players are downsizing industries, jacking up efficiency and research and buying high, selling low and turning a profit.

The solution is to value inventory properly, seperately with movjng average costing. That way the proper production cost can be calculated for profit margin in the domestic sales/expense calculation. The proper cost per unit of production plus the cost per unit of the properly and seperately valued inventory that gets used should yield the proper budgeted annual production cost for domestic sales profit/loss calculation. Right now it is grossly understated for using up imported goods bought at higher prices over and above what is being produced. Players who build more facilities get hammered with more maintenance costs and end up getting screwed incorrectly for building up facilities for products they are short on.

Instead of Bill Estimate on my import screen I should see cost per unit for my inventory. I don't get a Bill Estimate for my exports so I don't need it for my imports. More importantly I need to see a proper cost per unit for my inventory. Even more importantly the game needs a proper cost per unit for inventory so it calculates a proper production cost to include the actual cost per unit for high-priced imports.

I also noticed another bug with the efficiency sliders for the three products that I had no production capability in. As I increased my efficiency and infrastructure investments in other products those sliders would rise, up to 87% at my zenith. Then as I wound down my investments in efficiency and infrastructure those sliders dropped as well, down to 79%. Then I started reinvesting in efficiency and infrastructure and it started to rise again to 80% but I only had restarted that last rise for a few weeks and slowly. The sliders were showing correctly that $0 dollars were being invested in those three items no matter the rise or fall of the slider percentage. I have no doubt that my cost per unit was fluctuating in tune to that rise and fall in infrastructure investment.

It looks like my infrastructure investment was having an effect on cost per unit for industries where I had no production capability at all. Ofcourse infrastructure investment should have zero effect upon industries with zero production capability. Hopefully this too will get fixed.

The problem with rewarding players with downsizing industries and then allowing them to jack up efficiency investment to makeup the shortfall in production is it does not take into account the Law of Diminishing Returns! The more players pump into efficiency the less they should get back in return for their investment as efficiency rises. There are only so many people any particular, singular farm, mine, factory or plant can employ and product it can produce. Investing in new farms, mines, factories or plants do employ far more people and can produce far more product than investing in old because at the beginning you don't have that problem of diminishing returns.

Certainly players should be penalized for overbuilding industries where they produce far more than they use or import, but players should not be penalized so unfairly for investing in new facilities for products they are short on. As long as there's demand a player should get rewarded for fulfilling it himself. Please give production it's just due for creating jobs, fulfilling demand and making the proper profit it can. Heck if the WM can sell lower than a player can produce then by all means it should reward a player for importing when he should and creating employment elsewheres. However if the player can create jobs and make a product cheaper than the WM price he should be rewarded properly as well, as long as he doesn't get carried away. That darned Law of Diminishing Returns! :D
Thanks,

Eric Larsen
BigStone
General
Posts: 1390
Joined: Dec 22 2004
Location: Holland

Post by BigStone »

With all respect Eric ... but i'm afraid you're now diving to deep into
this stuff....
I believe it was IlDuce said a few times - don't worry be happy-

And please remeber.... it's a (war)game... :wink:
NO MORE NOISY FISH [unless they are green & furiously]
I HAVE STILL A FISH IN MY EAR
Eric Larsen
Colonel
Posts: 350
Joined: Oct 25 2005
Location: Salinas, CA

It's all about Economics

Post by Eric Larsen »

BigStone wrote:With all respect Eric ... but i'm afraid you're now diving to deep into
this stuff....
I believe it was IlDuce said a few times - don't worry be happy-

And please remeber.... it's a (war)game... :wink:
BigStone,
All I'm hoping to do is make the economic model more realistic and to get gimmick cheats taken out of the game. Don't forget what Clauswitz said about war and economics. Making the economic/commerce module more realistic can only help make the game better and more enjoyable.

It's really a pity that nowadays people are more interested in instant gratification and cheats than in hard work and honesty. Are you so enamored of gimmick cheats in games that you are afraid for someone to try to bring some honest reality to them? Not only did I expose a very serious problem, I actually provided the solution as to how to fix it. I'd say that's a rather nice thing I did, spending hours trying to figure out a problem, testing it, documenting it, and then writing it up.

Don't worry, be happy that someone like me actually takes the time and care to try to improve the game for everyone. Well everyone except for cheaters. I actually enjoy this wargame even though I've yet to get into the war aspect.
Thanks,

Eric Larsen
User avatar
tkobo
Supreme Ruler
Posts: 12397
Joined: Jun 04 2002
Location: In a vast zionist plot ...RIGHT BEHIND YOU ! Oh Noes !

Post by tkobo »

PRODUCTION cost = the mount of money it takes to MAKE a unit,NOT buy the unit.


IMPORT cost is the amount of money it takes to purchase a unit,NOT to make a unit.


BOTH costs are shown independatly AND differentiated between in the pop -ups.
Last edited by tkobo on Dec 22 2005, edited 1 time in total.
This post approved by Tkobo:Official Rabble Rouser of the United Yahoos
Chuckle TM
BigStone
General
Posts: 1390
Joined: Dec 22 2004
Location: Holland

Post by BigStone »

I don't think it will add much to the gameplay if you wanna implement a full economy model to the game....
NO MORE NOISY FISH [unless they are green & furiously]
I HAVE STILL A FISH IN MY EAR
Il Duce
Brigadier Gen.
Posts: 577
Joined: Aug 10 2005
Location: Venice - the Doge's palace on the Pacific.

Post by Il Duce »

...Please take this in the spirit that it is offered.

Good games are very rare.

A game with the level of developer support and user involvement in the development process [this forum] is one-of-a-kind.

I wouldn't exactly call calculation errors a gimmick or a cheat. There are cheats to the game, clearly documented, and all in all, relatively useless [IMO] for any other purpose but validating a tactic in a short period of time, as this game is very time-intensive. One simply works around the calc errors, and awaits the fix - see the previous paragraph. Think of them as 'random events' in the context of the game, if you will. All of us have our favorite calculation error, and most of us try not to exploit them overmuch. This would be like playing tennis without a net.

Many of the threads in this forum, some going back since inception, deal with the level of realism and complexity of the model, and the relative value that additional complexity would make to the playability and challenge of the game [the discussions of unit types and minute differences between them are a good case in point].

All in all, the developers have done an outstanding job in both creating an unusually good game-concept, and in being receptive to user input that sometimes takes them far afield from their original design goals [I imagine that it is something like watching your child get tattooed, pierced, and amputated].

If you check the history, it is a given that the AI regions are presently no match for the savvy and patient human player, but they are entertaining. Their deficiencies, as well as discrepencies in the various model aspects [econ, diplo, tactics, etc] all seem to be very actively in development, and the improvements in the three updates are substantial.

We all have our pet issues, and I am no exception. The goats read all of these postings - how they find the time is beyond me, and they don't always have time to respond individually, immediately, or with a promised fix, or with the precise fix that you are looking for. That's o.k. with me - I'm only right about 49% of the time.

You aren't the only one to identify an issue and provide a detailed discussion of how you'd like to see it addressed. In many cases, even if your solution is the absolutely perfect idea and the devs couldn't agree with you more, there may be limitations to the code as it exists today that would prevent that from being implemented. That's o.k. with me, too.

At some point the goats will have to either call the game complete, or charge a maintenance fee for the upgrades. I'm pretty sure they are also working on their next revenue producing project. All of this is o.k. with me too. That's the main reason that I tend to caution people to be very selective about what the priorities for updates will be, as I suspect we'll only get a few more before the devs have to address this very difficult decision.

Continue to not worry. Be as happy as you want.
Colorless green ideas sleep furiously [but otherwise, they do not worry and are happy].
User avatar
Balthagor
Supreme Ruler
Posts: 22082
Joined: Jun 04 2002
Human: Yes
Location: BattleGoat Studios

Post by Balthagor »

Il Duce wrote:...The goats read all of these postings - how they find the time is beyond me...
...I have a slow-time bubble in my basement ;)

You are correct that we read as many posts as we can and essentially do triage on what we should persue next. It is also worth mentioning that as we are gathering our resources for our next project, it will be in the same game genre. So many ideas posted here may never get integrated into SR2010 but may be incorporated into our next title. As such, even a long detailed posts that gets little to no response could become a key concept in a future title.

Thanks again to everyone for being so involved in the forums!
Chris Latour
BattleGoat Studios
chris@battlegoat.com
Eric Larsen
Colonel
Posts: 350
Joined: Oct 25 2005
Location: Salinas, CA

Post by Eric Larsen »

tkobo wrote:PRODUCTION cost = the mount of money it takes to MAKE a unit,NOT buy the unit.


IMPORT cost is the amount of money it takes to purchase a unit,NOT to make a unit.


BOTH costs are shown independatly AND differentiated between in the pop -ups.
tkobo,
Where are the production costs and import costs shown separately? If you mean that the cost per unit for production is calculated separately from the cost per unit of inventory then I sure would like to see it. If you mean that the import cost is separate for purposes of purchasing inventory then you are correct but you miss the point. There really needs to be a separate cost per unit for inventory that is the moving average of production and imports. As shown in my example inventory costs are very incorrect because imports are not factored properly into cost per unit for inventory on hand.
Eric
Eric Larsen
Colonel
Posts: 350
Joined: Oct 25 2005
Location: Salinas, CA

Correct is Better!

Post by Eric Larsen »

Balthagor wrote:You are correct that we read as many posts as we can and essentially do triage on what we should persue next. It is also worth mentioning that as we are gathering our resources for our next project, it will be in the same game genre. So many ideas posted here may never get integrated into SR2010 but may be incorporated into our next title. As such, even a long detailed posts that gets little to no response could become a key concept in a future title.

Thanks again to everyone for being so involved in the forums!
Chris,
I know that this might be a big change and I do hope it gets incorporated into a future patch or release. BG has done a nice job at trying to make a realistic economic model and I hope you will be able to add a separate cost per unit for inventory on hand to make the economic model even more realistic. As you could see by my data inventory on hand is not being calculated properly and this allows players savvy to this shortcoming to exploit it. Poor players who aren't in the know on this will get trashed unfairly. :cry:
Thanks,

Eric Larsen
User avatar
tkobo
Supreme Ruler
Posts: 12397
Joined: Jun 04 2002
Location: In a vast zionist plot ...RIGHT BEHIND YOU ! Oh Noes !

Post by tkobo »

Why would we need a seperate "cost per unit in inventory" ?

We know how much the unit cost us to produce it domestically and we know how much the unit cost us to purchase it thru importing.

The only pro values your inventory have in game are the price you can sell them at to your public (domestic markup ),the price you can sell them at to other regions (export prices) and the price assigned them when used as components to produce a facility ,military unit,etc...
There really needs to be a separate cost per unit for inventory that is the moving average of production and imports
Why ?

And more importantly just how would the game keep track of the indiviual price of every single unit of billions ,keep track of which units at which price was used in which way,in which order, and how many of each unit at each price was still in inventory ?
Even if the inaccurate form of simply creating a new average price per unit in inventory was used, it would have to be done a minimium 12 times per day per region.
That could be over 100 added calculations per end day.



Weve already been told that simple histories of economic changes were not going to happen for the game.
What your asking for seems to me to be a history of individual costs of individual units (single peices/units of coal,oil,etc..).
Which is a much more severe "history".

I dont see what a feature like that adds.

It would be like adding in warehousing costs as a seperate cost to expenses for our stock piles/inventory.

Sure it would add more realism, but it wouldnt add anything of value (that i see ) to the game.
This post approved by Tkobo:Official Rabble Rouser of the United Yahoos
Chuckle TM
User avatar
Balthagor
Supreme Ruler
Posts: 22082
Joined: Jun 04 2002
Human: Yes
Location: BattleGoat Studios

Re: Correct is Better!

Post by Balthagor »

Eric Larsen wrote:...I hope you will be able to add a separate cost per unit for inventory on hand to make the economic model even more realistic. As you could see by my data inventory on hand is not being calculated properly and this allows players savvy to this shortcoming to exploit it...
To be honest, I have only skimmed the post, this is not a section of the forum that I moderate or claim to be an expert on. The military stuff is more my expertise. I will mention this thread around the rest of the team so we can investigate if a problem exists.
Chris Latour
BattleGoat Studios
chris@battlegoat.com
User avatar
Legend
General
Posts: 2531
Joined: Sep 08 2002
Human: Yes
Location: Ancaster, Ontario - BattleGoat Studios
Contact:

Post by Legend »

Perhaps I can shed some light on things here. By doing so may expose some areas of the game I would like to see added/improved but I will do so anyway.

The COST/UNIT as reported is what it costs you to produce something.
If your region does not produce any AND you see a number here then it represents what it will cost you IF you were to start producing that item.

For example if you import all of your agri and are thinking of producing some you can compare the (expected) COST/UNIT to what you are paying to import it.

An additional thing to consider is that while producing nothing of a particular product you are speding $zero on efficiency no matter where the slider in the third panel is set (Panel button tool tip is "Production")

No matter what you import the cost per unit reflects what you are producing (or what you could be producing).

____________

The next thing to consider if I am understanding things correctly is the cost/unit can be further reported.

We currently have COST/UNIT for production.
We could have COST/UNIT for what we have in our inventory... this would mean then any surplus would be added and then averaged into the price. This, to me, seems like it would be a lot of calculations. We'd have to track all inputs and outputs from the inventory even if we don't report it.
Shipment A - 12,000 units at $122/unit =$1,464,000
Shipment B - 24,000 units at $134/unit =$3,216,000
Shipment C - 4,000 units at $97/unit = $388,000

40,000 units @ $5,068,000
= $126.70 / unit

You may say, we could record 40,000 units @ $126.70/unit but what happens when we add 2,000 units at $102? We would have to record and keep track of each shipment to calculate a true cost per unit value.

Add to this what happens when we use, through exports, internal use, domestic sales, producing other products etc... We would need to figure out what units are used... What I would think is we'd have to use an accounting principle such as FIFO - First In, First Out.

Further, in business actual inventory is usually not valued in the above manner as I have laid out but instead is calculated as a single item. Each item once entered into inventory can have a calculated average price. This price can be gathered by what it would take to replace it all of the inventory, or what it would take to sell it all. In the end adding a cost/unit to inventory would depend on how your government does it's books. And, we don't wan to go there with our wargame.

Other things that some players would find useful as a game improvement is what we are paying per unit. We can see the price items are being sold on the market if there were excess sales from yesterday, and usually the world market is selling something to use as the going price. We can see that we purchased $40M worth of a particular good but what actual price did we pay? What region did we buy it from? Did we buy it from multiple regions? Players may find this "wishlist reporting item" useful because if I import all of a particular product from one region, perhaps I wouldn't want to attack them. Or at least I should attack them after I have built of a good inventory of the product I need from them before I do attack that region. If I go to war and will see some boycotts, I may find "knowing is half the battle."
Eric Larsen
Colonel
Posts: 350
Joined: Oct 25 2005
Location: Salinas, CA

The only way

Post by Eric Larsen »

tkobo wrote:Why would we need a seperate "cost per unit in inventory" ?

We know how much the unit cost us to produce it domestically and we know how much the unit cost us to purchase it thru importing.
tkobo,
While the game keeps track of cost per unit of production the game does not compute the stock on hand correctly. Just look at my example to see how poorly the game computed cost per unit when there is no production of an item.

While the game shows us import prices from various sources that does not properly reflect our inventory cost even when we purchase 100% of our inventory. Consider that with products that do have production the game really screws up the cost per unit of what's on hand.

The only solution is a separate cost per unit for inventory and it's not rocket science but a few more simple calculations. The game needs a separate cost per unit for inventory and it's a simple matter of multiplying units of stock on hand from the day before times that day's cost per unit then adding in c.p.u. from production times units plus import c.p.u. times that day's import units. Total up the number of units and total cost and then divide total cost by total units and voila you have your new daily cost per unit of inventory that is correct!

The way the game miscalculates c.p.u. for inventory allows players to cheat the system by buying high, selling low and making a tidy profit to boot because the production c.p.u. is not the proper c.p.u. for inventory on hand. The way you whine about this improvement makes me believe you are too enarmored of this obvious cheat to want an honest cost per unit of inventory.
Thanks,

Eric Larsen
Eric Larsen
Colonel
Posts: 350
Joined: Oct 25 2005
Location: Salinas, CA

Watch Carefully

Post by Eric Larsen »

Legend wrote:An additional thing to consider is that while producing nothing of a particular product you are speding $zero on efficiency no matter where the slider in the third panel is set (Panel button tool tip is "Production")
Legend,
Next game you have a product with zero production watch the slider carefully. You will see it go up and down when it does indeed show zero efficiency investment. The infrastructure investment affects all efficiency sliders even when there is no production so if you vary infrastructure inventment up and down you'll see thoise zero production sliders go up and down in synch. For products with no production there should be no effect upon cost per unit of inventory when all of that comes from imports. That's why the game needs a separate cost per unit for inventory. That way the production slider can stay the same and the inventory c.p.u. slider would not be affected by infrastructure efficiency.
Thanks,

Eric Larsen
User avatar
tkobo
Supreme Ruler
Posts: 12397
Joined: Jun 04 2002
Location: In a vast zionist plot ...RIGHT BEHIND YOU ! Oh Noes !

Re: The only way

Post by tkobo »

Eric Larsen wrote:
The way the game miscalculates c.p.u. for inventory allows players to cheat the system by buying high, selling low and making a tidy profit to boot because the production c.p.u. is not the proper c.p.u. for inventory on hand. The way you whine about this improvement makes me believe you are too enarmored of this obvious cheat to want an honest cost per unit of inventory.
Thanks,

Eric Larsen
Sigh, so your saying i can spend $500 per unit on coal and sell that same unit for $ 300 and make a profit ?

And your an accountant ?

And please dont act badly by accusing others of cheating or whining.
This post approved by Tkobo:Official Rabble Rouser of the United Yahoos
Chuckle TM
Post Reply

Return to “Production - Commerce Department”