Recipe Combinator


Special combinator to give information about items, fluids, receipes etc

Content
a month ago
2.0
552
Circuit network

g Productivity

2 months ago
(updated 2 months ago)

First off, huge thanks for making this for 2.0. I've enjoyed making build everything machines since literally 0.14 and the original Crafting Combinator mod https://forums.factorio.com/viewtopic.php?f=193&t=42964 And I was super bummed to see how much functionality was lost with the builtin assembler control features in 2.0.

I'm wondering if you have any thoughts on handling productivity for ingredient counting these days. My first thought was you could account for the 50% for recipes in the recipe combinator itself when using a foundry for example. But if the UI has both foundry and assembler selected as 'use recipes from these machines' that kind of doesn't work. Plus you have the modules themselves, as well as a lot of new research productivity now. And because they add up instead of multiply, it's kind of a mess to try to piece them together bit by bit in normal logic too. Though I think it WOULD be possible as there's some mods that let you see the research levels (https://mods.factorio.com/mod/research-control-tower) and some others that let you see what modules are in an assembler.

EDIT: On a related note, I see it adjusts crafting time by the speed of the machine already, so it does a similar adjustment there. But it can't take into account machine quality, and it has to round off to output a signal, so it sometimes is hard to correct the value the combinator puts out to the true speed of the machine. Perhaps a checkbox to always output the raw speed of the recipe (like 30 ticks for a 0.5s recipe, regardless of machine)?

2 months ago
(updated 2 months ago)

I guess to sum up my ramblings after examining a few other things, I had these possible feature requests that might be broadly applicable.

1) Allow me to feed the Recipe Combinator the expected productivity via a chosen non-item virtual signal. I can add up the modules and research technology and give you the exact productivity # the recipe will be crafted with. Whether you include the 50% for foundry/em/biochamber or I do is not a big concern. If the recipe doesn't allow productivity obviously this # would be ignored.
2a) Possibly give an option to ignore machine speed and output raw craft time, optionally multiplied by craft count as currently done.
-or-
2b) Like #1, allow me to feed you the true craft speed of the machine (multiplied by 100, because of fractions like 1.25 speed) that the recipe will be crafted with. There is already a virtual signal for speed, even. Or could be selectable as you do in your UI for the outputs.

Cheers!

2 months ago

Yeah, I'm definitely looking for a sane way to account for modules, especially productivity. It seems to have a lot of knobs though.

For things like machine speed, it's not too bad because you can postprocess it by multiplying the recipe combinator's time by a per-machine speed factor. It would be cleaner if that were built-in, but then again it would clutter the interface. It would be possible to output raw time instead, but I'm not sure that this would much simplify the circuit in practical deployments of machines, since they would have different sizes (affects beacon surround) and module counts.

For prod though, it's better to build into the recipe combinator, so that it can correctly calculate the number of recipes require. I'll have to see how it fits into the circuit at the current latency though ... currently the combinator is made out of many smaller hidden combinators, and ideally I'd like to keep that architecture so that there's no per-tick Lua code, and so that I can later make a button to export a vanilla blueprint of combinators that's equivalent to the recipe combinator. It might still be possible, or I might have to increase the latency by 1-2 ticks.

I think the calculation goes from ceil(required / recipe output) to ceil(ceil(required / recipe output) / (1 + prod bonus)), so it shouldn't be too hard to implement, but it might require some latency tricks. There are also a lot of corner cases involving recipes where some parts are marked as catalysts (eg Kovarex) — on a related note, it might be nice to have a "net input and/or output only" toggle.

2 months ago

Gotcha, I see where you're coming from with the challenges of the prod calculations, and not wanting to re-calculate constantly. I was looking through the code a bit and I think I have a better handle on how it works. It would still be nice if productivity % could be provided by a signal instead of only manually, but I understand you'd be regenerating the table every single time that signal changed, and that's hard to communicate through the UI. I also especially like the idea of the net products for things like kovarex.

I will say, for speed I think your stance is reasonable too, but you might need like a 10x multiplier or something for the integer representation. For example, making yellow belt in a foundry, the actual tick speed for a craft is 7.5, but it gets ceil() to 8, and then that propagates through any number of crafts, so 1000 crafts says 8000 ticks instead of 7500. The way the old crafting combinator handled it was I think all the speeds were multiplied by 100 or something. I think x10 would be plenty for 99% of items in the base game, though there are some serious odball craft times like constant combinator at 4.2s, Power Switch at 5.7s, or Artificial Soils at 9.5s. Even without handling speed module & quality boosts, just the integrated craft count multiplier for speed sadly still has to deal with some of that nonsense.

2 months ago

Oh yeah, hm, I'd forgotten that some items take fractional ticks to make. That could also be tricky.

I also need to make the GUI more modular at some point. Having it all on one screen is too much, especially as I try to add more features. So maybe eventually I can find a way to declutter it so that adding a speed multiplier field or whatever won't be a problem.

New response