Vagabond820 Posts: 21
9/26/2016
|
Can we get a field that works as such: "if X object is above Y value, load Z amount"?
Ie. If Basic Mineral is over 2,000 units, load 'max'. So if 5,000 units were present, it would load up to 3,000 if able.
This could also be extended to sell orders for buildings.
Ie. If stock of water is above 20,000 units, sell 5,000 per turn. Meaning once the stock reached 20,000 units it would sell any amount over up to 5,000 / turn.
In this way you could reserve stock for production each turn. Though I guess on that front, you could just have an option that says 'reserve necessary stock' that saves the amount necessary to produce with that building each turn in a special stockpile.
|
|
0
link
|
Doctor Dread Administrator Posts: 1478
9/26/2016
|
The problem is that there are 3 structures and 12 freighters coming in trying to sell or transfer the same product. Do they all have orders like this? What if one doesn't does he get to sell it down to nothing? That's been the problem I'm having designing the feature.
Instead of setting the units or structures to have a reserve amount, Maybe have the Product Stack itself have a reserve amount. "Don't let anything sell or transfer this stack below 2,000" that would make a lot more sense. Maybe instead of having to set a stack you can just declare it on the Assets page. "Reserve Product" option near where you set fleets which takes you to a page where you can declare a location and product or just pick an existing stack and have it set a reserve amount for that product at that location. It would be a list you can manage. That's the current idea on implementing this feature
|
|
0
link
|
Vulpex Posts: 390
9/27/2016
|
There is another option to implement this actually.
Rather than manage stacks with limits which is admittedly complicated - give storage space to tier 1 and 2 facilities (not to extraction facilitiies) the amount of storage space would scale up with the facility so that it could store say 10 or 20 turns of material needed for production.
You can then simply decide if the facility stores or does not store goods (single flag) if it does store goods it picks them up BEFORE any freighters or sale takes place during that turn.
Voila - and as a bonus you could make it so that materials stored in the facilities are protected (or partially protected based on facility damage) from raids.
|
|
0
link
|
Doctor Dread Administrator Posts: 1478
9/27/2016
|
Storing product as a separate record at the same location in game is complicated in the back end. The easiest way to make this not a problem is to have the factories burn there components early in the turn , before sells attacks or transfer orders happen. Right now Sells happen first and then transfer orders, attacks then production.
If I move production up in the turn it causes other problems. If I put it BEFORE selling then you could have the problem where you can't afford to run the factory until after you sell so you get stopped for a turn which causes you to not have money to run them the turn after and causes kind of a collapse. The draining of components might be the lesser of the evils.
|
|
0
link
|
Vulpex Posts: 390
9/27/2016
|
Hold on Dr. D - if storing product as a separate record in the same location is complicated in the back end - how is it handled when freighters or transports pick up goods? They sit there for as long as I don't ask them to move, quite happily I would add.
|
|
0
link
|
Doctor Dread Administrator Posts: 1478
9/27/2016
|
Vulpex wrote:
Hold on Dr. D - if storing product as a separate record in the same location is complicated in the back end - how is it handled when freighters or transports pick up goods? They sit there for as long as I don't ask them to move, quite happily I would add.
It's complicated =) You cannot have two separate records for the same product type on the same location Which are NOT cargo on another unit. CargoOnMilitaryID is column for every Product Record and is either NULL (on the ground) or is populated with the ID of the Military Unit carrying it
You also cannot have two separate records for the same product type that have the same CargoOnMilitaryiD.
Throughout the turn flip procedure I have to constantly check for whether product we're looking at is currently being carried on a unit or not. This is throughout Selling, buys, transfers, raiding. Every time you drop off product I have to make sure its adds to an already existing record for that product at that location THAT IS NOT CARGO (because there are 6 other ships of yours all carrying that product there) or make a new one there. Its very delicate because one wrong or missing check among 100 queries and joins that checks it causes some crazy Product bugs that are difficult to locate
If I were to add another form of storage I would have to spread another column and 100 modifications across everything in the system. It took months to shake out all the existing bugs concerning products. It would also display funny as it would be "Cargo" or "Storage" linked to a specific structure.
It would be easier if Structures and military units were the same table in the database then I can pretty much just have structures have "cargo" like units do but they aren't.
Either I make some kind of hold product table or perhaps take another look at making production be the first thing that happens in a turn. The problems with that may be lesser then the current one. For example You wouldn't be able to burn components in your factory the same turn your transports dropped them off if I moved it to the top. But that far more rare then the problem of components constantly being transferred out of the location.
With a list of product types at locations with a hold amount I only have to check in a couple of places. Selling and Transfer Pick up. There is already a mechanism for flagging attempts as failures in the code, this would just be a couple lines of code in a couple of places for another failure check which trips if the end quantity would be less then what you specified edited by DrDread on 9/27/2016
|
|
0
link
|