Removing the resource cache after canceling a recipe

Works as intended Production & Recipes UI & UX
kwj_nekko_6320 [discord] · 11 months ago

When I cancel a recipe from a machine, I am given a button to remove the input resource cache, but it seems broken.

The description tells me that the removed resource will be given back to the available storage (or dock if not), but when I actually press the button, the resource seems to be gone.

eryk500 [discord] · 11 months ago

Note: Not all resources can be stored in the dock & those will just end-up getting voided.

Any ther ones will (or at least should) get moved there, even if there isn't enough space
to fit within the storage capacity of the dock.

eryk500 [discord] · 11 months ago

Ok, what is not being stored?

I'm curious, because that is how it used to work &
there was no reason for that to change.

If it's an actual bug, then I'll be glad to aggre with you,
but I'm just not so sure that it actually voided resources that it shouldn't have.

kwj_nekko_6320 [discord] · 11 months ago

Just anything. Most recently, hydrogen gas.

From Boiler(gas), I removed option to burn Hydrogen gas.

When I tried to retrieve the already input hydrogen, it just gone forever.

eryk500 [discord] · 11 months ago

Can you actually store Hydrogen gas in the shipyard though 🤔
(and sorry I just realised that I sed dock, but I actually meant
the shipyard that your main ship is / can dock at)?

eryk500 [discord] · 11 months ago

kwj_nekko_6320 [discord] wrote:

From Boiler(gas), I removed option to burn Hydrogen gas.

Becaue I'm pretty sure that most gasses can't be stored there.
I might be wrong / out-of-date though, I'm not going to lie about that.

kwj_nekko_6320 [discord] · 11 months ago

Well I actually had a hydrogen gas storage (with plenty of empty space) at the moment, so dock is not relevant.

And this symptom was repeated every possible times (with flat, loose, fluid storages)

eryk500 [discord] · 11 months ago

Ok, I just checked the code & Hydrogen has canBeDiscarded set to true;
in comparison Seawater is the same, but Diesel is not (has canBeDiscarded
set to false instead), so it wouldn't have been stored there anyways.

In fact any resource prototypes with canBeDiscarded set to true
don't even get a buffer to get stored in, in the Shipyard.
It makes sense of course, but it just solidifies that the Shipyard can't store them.

RealisticOptimist · 11 months ago

kwj_nekko_6320 [discord] wrote:

And this symptom was repeated every possible times (with flat, loose, fluid storages)

With solid goods I never observed losing any. However, if the recipe was running, the items in use seem lost. Only the stored ones get recovered.
If you think you have it reproducible, please provide a save, with instruction what recipe at what assembly, boiler, plant ... you cancel.

kwj_nekko_6320 [discord] · 11 months ago

"if the recipe was running, the items in use seem lost"
This. But how is it justified? If recipe was running but not finished, either the original source material should come back or the resultant material should spawn.

RealisticOptimist · 11 months ago

Well, it's rare for COI to lose materials. I am aware of only 3 occasions:

  • The one @eryk500 [discord] pointed out. Gases and e.g. water are not returned. They are also lost from transports, when you empty or delete them.
  • Removing a material from an ore sorter loses the unsorted input of that material. That I actually consider a flaw. The already sorted amount is returned for free (can be used for cheating).
  • Cancelling running recipes.

Cancelling running recipes actually has a real world counterpart. You can't cleanly recover input materials from a machine in the middle of processing. Be glad you do not impose downtime for cleaning the machine and having to dispose of the semi processed now waste.

Usually this is a early game issue (my first assemblers I put several recipes at once, e.g. CP1 and electronics 1). So, once I have enough dedicated assemblers, I ensure the recipe to be removed is not running. Either another recipe is active. Or I enforce by stopping input or output and wait until production is blocked.

eryk500 [discord] · 11 months ago

RealisticOptimist wrote:

With solid goods I never observed losing any. However, if the recipe was running, the items in use seem lost. Only the stored ones get recovered.

🤔 ok, I've looked at that (in the code) & it seems that you're correct.

If a recipe is started then the machine takes stuff from the input buffer to craft with &
then when it finishes that recipe, the crafted stuff get's added to the output buffer;
but when you unassign a recipe, then that recipe get's immediately removed
from the active recipe list & then "recipes get rebuilt", which includes resetting buffers,
removing any empty & no longer necessary ones, but neither method handles
any resource returns from ongoing recipes (including the unassigned one),
so it seems to "destroy resources" that way.

Closed as ☑️ Works as intended

9 Showing 1–14 of 14