Page 1 of 1

[0.16.22]Changing recipe does not give back all items

Posted: Sat Feb 03, 2018 2:30 pm
by Bilka
When you mine an entity that is currently crafting something, the items that are currently being used for crafting (already removed from the input inventory) are returned to the player, same if the player resets the recipe. This is not the case if the player instead sets the recipe to another one for example by copying a different one from another assembling machine, or by using LuaEntity::set_recipe().

I tested this by setting an assembler 1 to craft accumulators and inserting one stack of batteries and iron plate each and letting it start crafting. Within 10 seconds, mining and resetting recipe returns the full stacks of items, while setting the recipe to another one using copy paste or LuaEntity::set_recipe() does not, it returns 195 batteries and 98 iron plate. I expect the latter methods to also return the items currently being used for crafting, so the full stacks in this case.

Re: [0.16.22]Changing recipe does not give back all items

Posted: Sat Feb 03, 2018 5:26 pm
by Rseding91
Thanks for the report. It's now fixed for the next version of 0.16.

Re: [0.16.22]Changing recipe does not give back all items

Posted: Wed Feb 07, 2018 10:39 pm
by FasterJump
I was going to make a bug report since the bug is in the game since some time now. Then check "fixed bugs" thread, and I see this. Good job :)

Re: [0.16.22]Changing recipe does not give back all items

Posted: Sat Feb 10, 2018 5:48 am
by kovarex
It should work the other way. It shouldn't return the items ever.

Re: [0.16.22]Changing recipe does not give back all items

Posted: Sat Feb 10, 2018 6:59 am
by Bilka
kovarex wrote:It should work the other way. It shouldn't return the items ever.
Why do you want to punish the player for changing a recipe/aborting crafting? You also get back the items when you cancel handcrafting, and automation should always be better than handcrafting.

Re: [0.16.22]Changing recipe does not give back all items

Posted: Sat Feb 10, 2018 7:05 am
by kovarex
Bilka wrote:
kovarex wrote:It should work the other way. It shouldn't return the items ever.
Why do you want to punish the player for changing a recipe/aborting crafting? You also get back the items when you cancel handcrafting, and automation should always be better than handcrafting.
Because of productivity bonus. It was decided long time ago, that once crafting machine starts crafting, the items used as ingredients are lost forever.

Re: [0.16.22]Changing recipe does not give back all items

Posted: Sat Feb 10, 2018 8:09 am
by Rseding91
To punish every single player that plays the game that decides to move an in-progress because someone *might* abuse it slightly to get a few extra circuits through an extremely tedious process sounds like an incredibly bad idea to me.

It has worked this way for over 2 years and not one person has complained. The game doesn't punish players for re-designing or changing their mind.

If you're really that concerned with it we could change productivity to only apply after the normal recipe cycle finishes but it's going to add extra memory usage and save size per crafting machine in the game.

Re: [0.16.22]Changing recipe does not give back all items

Posted: Sat Feb 10, 2018 12:43 pm
by kitcat
So I wanted to make a banana milkshake, peeled and cut a banana and stuffed it into a mixed together with milk but didn’t turn on the mixer. Then I decided I didn’t want a milkshake after all, so I turned the mixer over and dumped the contents on the table. Suddenly, the milk was back inside the carton and the banana in one piece inside the peel.
Getting back ingredients that are already being processed into something else doesn’t make any sense.

Re: [0.16.22]Changing recipe does not give back all items

Posted: Sat Feb 10, 2018 3:01 pm
by Bilka
kovarex wrote:
Bilka wrote:
kovarex wrote:It should work the other way. It shouldn't return the items ever.
Why do you want to punish the player for changing a recipe/aborting crafting? You also get back the items when you cancel handcrafting, and automation should always be better than handcrafting.
Because of productivity bonus. It was decided long time ago, that once crafting machine starts crafting, the items used as ingredients are lost forever.
The productivity bonus exploit is not something anybody will ever exploit in a normal game, it is simply too tedious. The item overcompression on belt rotation is almost exactly the same situation. Would be a nice exploit, but nobody uses it because it has to be done by hand, just like resetting the recipe just after getting products from productivity.

It is completely against the spirit of factorio to punish the player for rebuilding, especially for moving machines. So, just like the belt overcompression, the possible but never used exploit should be ignored in favor of playability.

Re: [0.16.22]Changing recipe does not give back all items

Posted: Sat Feb 10, 2018 11:22 pm
by DaveMcW
Can someone explain the productivity exploit? I thought the productivity bar is reset when the recipe is changed.

Re: [0.16.22]Changing recipe does not give back all items

Posted: Sat Feb 10, 2018 11:34 pm
by BenSeidel
Rseding91 wrote:If you're really that concerned with it we could change productivity to only apply after the normal recipe cycle finishes but it's going to add extra memory usage and save size per crafting machine in the game.
This sounds like the solution to me. If you are worried about the memory & save size, maybe this will work:
If you allow the productivity% to go over 100% (internally that is) so that when a craft completes it checks if Current_Prod% > 100%, if so, spit out two crafts & subtract 100%.
The UI then displays Current_Prod% mod 100 in the bar.
You could even add a +[Bonus Craft] somewhere on the machine for when you have a productivity bonus > 100%, like on drills etc showing you the number of extra items the machine will spit out next craft.


Edit:
DaveMcW wrote:Can someone explain the productivity exploit? I thought the productivity bar is reset when the recipe is changed.
That is when you have a productivity > 100%. The productivity bar will then fill up faster than the normal crafting bar allowing you to get the "free" item before the first item is crafted. If you cancel the craft at the right stage you get the ingredients back & get the free craft.

It also works for lesser productivity bonuses, but this example is the easiest to understand.

Re: [0.16.22]Changing recipe does not give back all items

Posted: Sun Feb 11, 2018 12:49 am
by DaveMcW
Ok, I see how that would require extra memory usage to fix.

A compromise would be to allow refunds of recipes only if they can't use productivity.

Re: [0.16.22]Changing recipe does not give back all items

Posted: Tue Feb 13, 2018 2:33 am
by Jap2.0
It isn't even possible to get > 100% productivity in vanilla, is it?

Re: [0.16.22]Changing recipe does not give back all items

Posted: Wed Jul 31, 2019 7:41 am
by BlueTemplar
kovarex wrote: Sat Feb 10, 2018 5:48 am It should work the other way. It shouldn't return the items ever.
So, should the (un)"official" Factorio Reddit change their "Words of Wisdom" ?
/u/talrich wrote: Namaste. You seek balance. Here is my wisdom. Your mistakes have no cost but time, and the deconstruction planner even reduces that cost. Most games punish you for building, demolishing and rebuilding. Not Factorio. Let your anxiety wash away as you perceive that every belt placed can be moved. Every assembler is but a visitor to where it resides. The only significance is life, which leads to the further wisdom. Look both ways before you cross the tracks.

Re: [0.16.22]Changing recipe does not give back all items

Posted: Sat Aug 24, 2019 9:10 pm
by Loewchen
If you want to discuss this topic further do it in the FFF or open a Idea suggestion topic, this is a closed bug report.