Recycling to itself list

Don't know how to use a machine? Looking for efficient setups? Stuck in a mission?
IsaacOscar
Filter Inserter
Filter Inserter
Posts: 306
Joined: Sat Nov 09, 2024 2:36 pm
Contact:

Re: Recycling to itself list

Post by IsaacOscar »

BlueTemplar wrote: Wed Nov 27, 2024 12:51 pm Oh, I think I get it now : I got confused between 'empty barrel' as an item (which is actually just 'barrel') and 'empty barrel' as a category of recipe. I guess this was added to make sure the game doesn't get confused and gives you back filled barrels when you try to recycle an empty one ?
(Which makes me think : where exactly is the basic vs advanced recipe distinction is being made in the code ?)
I don't think it does, the way the code works is to first look at the recipes and convert them to "complex" recycling recipes. It skips alot of recipes, but if a mod adds two normal looking recipes that produce the same thing, I think the code will just generate two recycling recipes, and one will overwrite the other.

Then the code goes over every item, an if a recycling recipe for it wasn't generated in the first step, it makes a recycle-to-itself recipe.
User avatar
BlueTemplar
Smart Inserter
Smart Inserter
Posts: 3212
Joined: Fri Jun 08, 2018 2:16 pm
Contact:

Re: Recycling to itself list

Post by BlueTemplar »

Yeah, but how does Factoriopedia knows which recipes are «alternative» ?
BobDiggity (mod-scenario-pack)
IsaacOscar
Filter Inserter
Filter Inserter
Posts: 306
Joined: Sat Nov 09, 2024 2:36 pm
Contact:

Re: Recycling to itself list

Post by IsaacOscar »

BlueTemplar wrote: Wed Nov 27, 2024 1:05 pm Yeah, but how does Factoriopedia knows which recipes are «alternative» ?
Good question, I couldn't find anything in the documentation... Also, all the generated recycling recipes are listed as alternatives with my mod.
IsaacOscar
Filter Inserter
Filter Inserter
Posts: 306
Joined: Sat Nov 09, 2024 2:36 pm
Contact:

Re: Recycling to itself list

Post by IsaacOscar »

Thanks to my mod, I've discovered that pistol's have a complex recycling recipe, despite not being craftable in game:
Screenshot 2024-11-28 112240.png
Screenshot 2024-11-28 112240.png (94.11 KiB) Viewed 417 times
(i.e. it gives you 5/4 copper and 5/4 iron plates, and takes 5/16s to recycle)
User avatar
Khagan
Filter Inserter
Filter Inserter
Posts: 262
Joined: Mon Mar 25, 2019 9:40 pm
Contact:

Re: Recycling to itself list

Post by Khagan »

BlueTemplar wrote: Wed Nov 27, 2024 1:05 pm Yeah, but how does Factoriopedia knows which recipes are «alternative» ?
The basic (non-alternative) recipe is the one that has the same (internal) name as the item.
IsaacOscar
Filter Inserter
Filter Inserter
Posts: 306
Joined: Sat Nov 09, 2024 2:36 pm
Contact:

Re: Recycling to itself list

Post by IsaacOscar »

Khagan wrote: Thu Nov 28, 2024 1:55 am The basic (non-alternative) recipe is the one that has the same (internal) name as the item.
Ah, it's so simple! Thank you.
So I checked the code, and it doesn't care what the recipe's name is (other than to check against a few hardcoded names), i.e. the code is happy to make a recycling recipe from an "alternative" one. I'm not sure though if it ever does so in vanilla.
User avatar
BlueTemplar
Smart Inserter
Smart Inserter
Posts: 3212
Joined: Fri Jun 08, 2018 2:16 pm
Contact:

Re: Recycling to itself list

Post by BlueTemplar »

It's kind of weird that it doesn't check for that..?

----

Ah yeah, the pistol's recipe seems to be hidden in the game, and therefore, Factoriopedia ? I'll add it to the list.
(Are there any others ?)
I remember stumbling on it before 2.0 (without reading the files) by using recycling mods.
Last edited by BlueTemplar on Thu Nov 28, 2024 11:43 am, edited 3 times in total.
BobDiggity (mod-scenario-pack)
IsaacOscar
Filter Inserter
Filter Inserter
Posts: 306
Joined: Sat Nov 09, 2024 2:36 pm
Contact:

Re: Recycling to itself list

Post by IsaacOscar »

BlueTemplar wrote: Thu Nov 28, 2024 11:26 am It's kind of weird that it doesn't check for that, weren't alternative recipes introduced as a concept to deal with this specific issue ??

----

Ah yeah, the pistol's recipe seems to be hidden in the game, and therefore, Factoriopedia ? I'll add it to the list.
(Are there any others ?)
I remember stumbling on it before 2.0 (without reading the files) by using recycling mods.
I recall the pistol being craftable in older versions, but they just disabled the recipe instead of deleting it.
I guess I could write a lua script to find stuff with hidden recipes but non-simple recyclings...
User avatar
BlueTemplar
Smart Inserter
Smart Inserter
Posts: 3212
Joined: Fri Jun 08, 2018 2:16 pm
Contact:

Re: Recycling to itself list

Post by BlueTemplar »

Weren't alternative recipes introduced as a concept to deal with this recycling issue ??

Hmm, I might have misremembered between FFFs and modding discussions ??
https://factorio.com/blog/post/fff-387
If an item has alternative recipes, it's not clear which ingredients should be returned on recycling this item. This makes adding alternative recipes pretty much a no-no.
Yeah, this didn't work out as well as it could have I guess... (But would have been a bit too much of a restriction IMHO.)
I guess this predates the Factoriopædia ?
It's been mentioned above how alternative recipes are a problem in part due to recycling. This isn't the case for smelting and chemical processes, as the recycler returning ingredients of these transformative recipes just doesn't make any sense. So, recycling an iron plate will just return an iron plate, with 25% chance.
BobDiggity (mod-scenario-pack)
User avatar
Khagan
Filter Inserter
Filter Inserter
Posts: 262
Joined: Mon Mar 25, 2019 9:40 pm
Contact:

Re: Recycling to itself list

Post by Khagan »

BlueTemplar wrote: Thu Nov 28, 2024 11:42 am Weren't alternative recipes introduced as a concept to deal with this recycling issue ??
In 1.1 the obvious example of something with multiple recipes is sold fuel. But it doesn't have a 'default' (non-alternative) recipe, and the ingredients are fluid only, so not recyclable.
IsaacOscar
Filter Inserter
Filter Inserter
Posts: 306
Joined: Sat Nov 09, 2024 2:36 pm
Contact:

Re: Recycling to itself list

Post by IsaacOscar »

BlueTemplar wrote: Thu Nov 28, 2024 11:42 am Weren't alternative recipes introduced as a concept to deal with this recycling issue ??

Hmm, I might have misremembered between FFFs and modding discussions ??
https://factorio.com/blog/post/fff-387
If an item has alternative recipes, it's not clear which ingredients should be returned on recycling this item. This makes adding alternative recipes pretty much a no-no.
Yeah, this didn't work out as well as it could have I guess... (But would have been a bit too much of a restriction IMHO.)
I guess this predates the Factoriopædia ?
It's been mentioned above how alternative recipes are a problem in part due to recycling. This isn't the case for smelting and chemical processes, as the recycler returning ingredients of these transformative recipes just doesn't make any sense. So, recycling an iron plate will just return an iron plate, with 25% chance.
Yup, the FFF is out of date.
IsaacOscar
Filter Inserter
Filter Inserter
Posts: 306
Joined: Sat Nov 09, 2024 2:36 pm
Contact:

Re: Recycling to itself list

Post by IsaacOscar »

Ok, my LUA script returned the following list of recyclable hidden recipes:
  • pistol
  • loader
  • fast-loader
  • express-loader
  • infinity-chest
  • infinity-pipe
  • heat-interface
  • turbo-loader
However, all except the "pistol" are unobtainable in normal gameplay.
User avatar
BlueTemplar
Smart Inserter
Smart Inserter
Posts: 3212
Joined: Fri Jun 08, 2018 2:16 pm
Contact:

Re: Recycling to itself list

Post by BlueTemplar »

Thanks !

I did some renaming to minimize confusion :
basic recipe => main recipe
(confusion with simple recycling result)
EDIT : would 'default' be better ??

recycling recipe/result => recycling output
ingredients => components
(confusion between recipe and recycling recipe)
BobDiggity (mod-scenario-pack)
User avatar
BlueTemplar
Smart Inserter
Smart Inserter
Posts: 3212
Joined: Fri Jun 08, 2018 2:16 pm
Contact:

Re: Recycling to itself list

Post by BlueTemplar »

Khagan wrote: Thu Nov 28, 2024 11:57 am
BlueTemplar wrote: Thu Nov 28, 2024 11:42 am Weren't alternative recipes introduced as a concept to deal with this recycling issue ??
In 1.1 the obvious example of something with multiple recipes is sold fuel. But it doesn't have a 'default' (non-alternative) recipe, and the ingredients are fluid only, so not recyclable.
Yeah, though the vanilla game didn't have neither a Factoriopedia, nor recycling, and 'alternative recipe' wasn't a word or a concept actually used anywhere in gameplay ?
BobDiggity (mod-scenario-pack)
IsaacOscar
Filter Inserter
Filter Inserter
Posts: 306
Joined: Sat Nov 09, 2024 2:36 pm
Contact:

Re: Recycling to itself list

Post by IsaacOscar »

BlueTemplar wrote: Thu Nov 28, 2024 12:00 pm Thanks !

I did some renaming to minimize confusion :
basic recipe => main recipe
(confusion with simple recycling result)
EDIT : would 'default' be better ??

recycling recipe/result => recycling output
ingredients => components
(confusion between recipe and recycling recipe)
The code uses the term "self recycling recipe". instead of "simple recycling". Also, I'd call "complex recycle" to be "proper recycling" or something, as it needs not be "complex" (it might only have 1 recycling output).
User avatar
BlueTemplar
Smart Inserter
Smart Inserter
Posts: 3212
Joined: Fri Jun 08, 2018 2:16 pm
Contact:

Re: Recycling to itself list

Post by BlueTemplar »

«Proper» is too vague IMHO.
I used 'simple' vs 'complex' to insist on the gameplay implications : making recycling factories for the complex ones is more complex (even with a single output), and you lose an opportunity for an extra step of module usage with the simple ones.
BobDiggity (mod-scenario-pack)
IsaacOscar
Filter Inserter
Filter Inserter
Posts: 306
Joined: Sat Nov 09, 2024 2:36 pm
Contact:

Re: Recycling to itself list

Post by IsaacOscar »

Oh, and I was curious and ran another lua script, and it seems the only "recyclable" recipe that is an "alternative" recipe is "Nutrients from spoilage" (i.e. recycling nutrients gives you spoilage, despite all recipes for "nutrients" being listed as "alternatives").
User avatar
BlueTemplar
Smart Inserter
Smart Inserter
Posts: 3212
Joined: Fri Jun 08, 2018 2:16 pm
Contact:

Re: Recycling to itself list

Post by BlueTemplar »

This sounds more like a coincidence of all (but not really??) biological (or is it spoilable ?? but that's not the case for fruits !!) items being turned into spoilage upon recycling ?
Last edited by BlueTemplar on Thu Nov 28, 2024 12:22 pm, edited 2 times in total.
BobDiggity (mod-scenario-pack)
IsaacOscar
Filter Inserter
Filter Inserter
Posts: 306
Joined: Sat Nov 09, 2024 2:36 pm
Contact:

Re: Recycling to itself list

Post by IsaacOscar »

BlueTemplar wrote: Thu Nov 28, 2024 12:18 pm This sounds more like a coincidence of all (but not really??) biological (or is it spoilable ?? but that's not the case for fruits !!) items being turned into spoilage upon recycling ?
Um no? The only things that recycle to spoilage are nutrients and spoilage itself (and agricultural towers, efficiency module 3s, overgrowth yumoko and jellynut soils).
If you're getting spoilage from something else, it's probably just spoiling before or after the recycler processes it.
User avatar
BlueTemplar
Smart Inserter
Smart Inserter
Posts: 3212
Joined: Fri Jun 08, 2018 2:16 pm
Contact:

Re: Recycling to itself list

Post by BlueTemplar »

(...which I guess is a 3rd recycling kind of output that I completely forgot about due to lack of testing...)

That's literally what the game tells you though :
Attachments
recycling_research.png
recycling_research.png (66.6 KiB) Viewed 259 times
BobDiggity (mod-scenario-pack)
Post Reply

Return to “Gameplay Help”