Improved way to define non-standard recipes

Place to ask discuss and request the modding support of Factorio. Don't request mods here.
Post Reply
SWeini
Inserter
Inserter
Posts: 33
Joined: Mon Apr 04, 2022 6:43 am
Contact:

Improved way to define non-standard recipes

Post by SWeini »

I'm looking for better ways to define recipes that consume less than 1 item for a recipe cycle.

Like this recipe:
A + 10% Catalyzer -> B (There is a 10% chance that the catalyzer will break during operation.)

Current possibilities for mod authors:

Upscaling the recipe:
10 A + 1 Catalyzer -> 10 B
This can lead to very high numbers for strange or multiple fractional inputs. Having such high numbers (and also long recipe times) is sometimes unwanted.

Adding intermediaries:
1 Catalyzer -> 10 Catalyzer intermediary
A + 1 Catalyzer intermediary -> B
This adds unnecessary items. Also if you have multiple recipes with different fractions as input they need different intermediaries. Building a factory in this way will also be more complex.

This can also be done with fluids, but if the catalyzer is expensive losing fluid upon deconstruction is an issue.

Returning the catalyzer:
A + Catalyzer -> B + 90% Catalyzer
This complicates building the factory. It might be a nice puzzle the first time, but if this pattern repeats over and over again it will just be annoying to build.

Defining the catalyzer as fuel:
A -> B
Make the building's energy source a burner accepting the catalyzer. Balance numbers so that 1 Catalyzer is used up for every 10 recipe cycles. Unless the numbers and the catalyzer match coincidentally this requires a unique building for each recipe. It also doesn't play well with modules or additional fuel / electricity needs. This works great if using the catalyzer generates another item, like an empty catalyzer frame that you could use to craft a new catalyzer.

I'd like to open up a discussion for possible additions to the current way of defining recipes and start with the following proposals. What additional workaround are currently used, what use cases do you have and how could solutions look like?

Configure result to go back to ingredient inventory:
A + Catalyzer -> B + 90% Catalyzer (back to ingredients)
The machine output inventory wouldn't even allow catalyzers. After each crafting cycle the catalyzer instead would go directly to the input inventory. This would even work if the catalyzer was recovered at 100% without requiring extra loops around the machine.

Configure fractional/probabilistic ingredients:
A + 10% Catalyzer -> B
This would work exactly like the previous idea internally. It's configured differently, changing different rules about recipes. In contrast to the previous idea this would not work for catalyzers that are recovered at 100%.

Additional fuel item burners:
A + additional fuel of category "catalyzer" -> B
The machine would get additional fuel bars based on the recipe selected. The recipe defines allowed fuel categories and consumption rate. This not only enables fractional inputs, but also recipes with "any 1 of that group" ingredients. With fuel values defined per item there are some limitations on how the numbers can work out when multiple combinations are required, but in general this should provide quite a lot of flexibility.

Post Reply

Return to “Modding interface requests”