Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check recycling recipes #242

Open
KiwiHawk opened this issue Nov 26, 2024 · 6 comments
Open

Check recycling recipes #242

KiwiHawk opened this issue Nov 26, 2024 · 6 comments
Labels
Factorio 2.0 Changes that depend on Factorio 2.0

Comments

@KiwiHawk
Copy link
Contributor

One interesting thing to note is that recycling does not prioritize the official recipe. It seems the recipe that is defined first will be the one that is used.

Related to this, the recycler's recipes do not take into account changes made to recipes after the data stage. If a recipe is changed in the data-updates or data-final-fixes stage, the recycling recipe will also need to be updated to match.

Originally posted by @Qatavin in #189 (comment)

@KiwiHawk KiwiHawk added the Factorio 2.0 Changes that depend on Factorio 2.0 label Nov 26, 2024
@KiwiHawk KiwiHawk added this to the Bob's mods 1.3.0 milestone Nov 26, 2024
@Qatavin
Copy link
Collaborator

Qatavin commented Nov 27, 2024

I am currently working on this problem.

@Qatavin
Copy link
Collaborator

Qatavin commented Nov 28, 2024

Okay, so, it seems my assessment from before was wrong. I activated the Add Conversion Recipes setting for converting furnace types into one another, and it made all the recycling recipes for furnaces go wonky. The game doesn't consistently pick the first or the last defined recipe when it decides which to use for recycling, nor does it use the one with the best matching name. It seems to have a preference for recipes that have fewer ingredients - regular furnaces and mixing furnaces want to recycle into each other on the stone, steel, and electric tiers, so there's clearly something going on there. But that's all I know. Fortunately, I can just apply the functions I've already written, and everything will be fixed.

Edit: Copying over some notes from #244. I've created a function that updates the outputs of existing recycling recipes if the original recipe they were based on has been changed, and tries to update the icon if an item of the same name as the original recipe exists (useful, for example, when assembling machines have their colors changed). Also updates energy_required. Can handle either single recipes or tables of multiple recipes.

We'll probably want to also add an additional function to take a specific recipe (such as a specific alternate recipe) to redo a recycling recipe with.

We might also need a function to force a recipe to be a self-recycling recipe, as they call it. Or maybe not. It would be simple enough to just do that manually. We'll see.

I'm also thinking about adding a function that makes recycling output a variable fraction of the original inputs (like, 50% or 80% instead of 25%). After all, if an item can't be made with productivity, strictly speaking there's no need for the output to be so small.

@KiwiHawk
Copy link
Contributor Author

I suggest disabling and hiding the conversion recipes/setting if Quality mod is enabled.

@Qatavin
Copy link
Collaborator

Qatavin commented Nov 28, 2024

I suggest disabling and hiding the conversion recipes/setting if Quality mod is enabled in all cases.

Fixed that for you.
In all seriousness, though, I did manage to solve the issue easily enough, so it's no big deal. It's just very strange.

@SGZ-Creations
Copy link

SGZ-Creations commented Jan 19, 2025

Not sure if it something to ask the devs of factorio about. Would it be possible for them to add a Api feature that was off by default. Tho if necessary under the type = "recipe", to have "force_disable_recycling"?
I added it in my example below to show what i meant. Tho i don't see any point in this having to be forced it should simply ignore the recipe containing mentioned feature.
In form of loading recipe the recipes containing the function would simply be skipped.

{
            type = "recipe",
            name = "name",
            enabled = false,
            energy_required = 10.0,
            category="crafting-with-fluid",
            hide_from_player_crafting = true,
            force_disable_recycling = true, 
             --(false would not make sense as that would be the same as simply removing the line like category="crafting-with-fluid",)
            ingredients = {
                {type="item", name="furnace-conversion", amount=1}
            },
            results = {{type="item", name="new-funrace", amount=1}},
        },

@Pezzawinkle
Copy link

Just a quick read of the vanilla code-base, suggests that a recipe property of
recipe.auto_recycle = false will stop the creation of a recycle recipe from being created at the data-updates initiation, meaning you can mix and match which recipe you wish to use, and can call the function later during the updates if you flip the tag before hand...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Factorio 2.0 Changes that depend on Factorio 2.0
Projects
None yet
Development

No branches or pull requests

4 participants