basisproject / tracker

A meta repo that tracks bugs, features, discussions, and progress in a centralized location for the entire Basis project.
14 stars 1 forks source link

Inception (as opposed to consumption) based cost tracking #120

Closed orthecreedence closed 4 years ago

orthecreedence commented 4 years ago

Ok, I've been kicking this can down the road for a while, time to give this some serious thought.

I build a widget. It comes out to 5₡. All of a sudden, there is an iron shortage and the resource cost of iron quadruples. Suddenly, I'm stuck with a widget that nobody wants to buy, and if I sell it for 1/4 the cost, it dings my performance.

The problem here is that we value resources and currency at the point of consumption, not at the point of inception. However, resource and currency costs are variable, and it would make for a very unstable economy to have these values shifting out from under us all the time based on the whims of the global currency system or resource shortages.

I believe it makes sense to aggregate and store resource/currency costs as an aggregate value inside the Costs object, and this aggregate value would be set at the moment the costs are created.

This makes things work a lot closer to how money does, and allows shifting the underlying resource/currency costs without putting too much strain on existing flows.

A nice piece of this is that cost/value conversion only needs to happen at the point of inception: we no longer need to worry about converting resource/currency cost values into credit values whenever we need to check a company's max costs, and a company's max costs is no longer variable depending on the shifts of the overall resource plan or banking snafus. This allows us to get rid of the CreditConverter and instead record the cost directly into the Costs object.

Implementation deets: