Deterministic Recycler


Adds a new Recycler that takes in more ingredients to get rid of random chance. While keeping ratios. Inserter stack size 4 is recommended.

Tweaks
a month ago
2.0 - 2.1
540
Manufacturing

g Compatibility with Cerys

a month ago

Deterministic Recycler has some conflict with the Cerys mod:

Failed to load mods: deterministic-recycling/prototypes/recycling.lua:235: attempt to perform arithmetic on local 'factor' (a nil value)
stack traceback:
deterministic-recycling/prototypes/recycling.lua:235: in function 'adjust_recipe_amount'
deterministic-recycling/prototypes/recycling.lua:309: in function 'finish_deterministic_recycling_recipe'
deterministic-recycling/prototypes/recycling.lua:361: in function 'generate_determinstic_recipe'
deterministic-recycling/prototypes/recycling.lua:366: in function 'generate_determinstic_recipes'
deterministic-recycling/data-final-fixes.lua:3: in main chunk

a month ago

With how Cerys set the value for the U235 in the nuclear scrap recycling it was impossible to find a factor that works for all products.
Added a fail safe so it shouldn't crash for that reason again.
And set it to use a factor of 10000 for nuclear scrap recycling. This allows all other products to be deterministic and gives 8 U235 compared to the expected 8.01... from normal recycling.

a month ago

Does it even makes sense to make such recipes deterministic? I would say keep recipes derived from crafting as taking 4x the ingredients, as for self recycling or things like scrap recycling - either don't support at all or don't try to make the ratio deterministic. It's not something you would be upcycling anyway.

a month ago

Unless you explicitly opt in you don't overwrite the regular recycling recipes. So there is no point in not supporting it, as you lose nothing.

a month ago

Thanks for the quick fix, it now loads correctly.

Without having looked at the code yet, I assume you are searching for common factors. You could introduce an error margin (for example m=0.01) and when all output ratios are within that margin just round it if you really want to support anything.

But GReen_boyY is probably right: It's probably better to not touch such recipes.

New response