How much does a recipe with catalyst and probability produce?

Place to get help with not working mods / modding interface.
Post Reply
mrvn
Smart Inserter
Smart Inserter
Posts: 5709
Joined: Mon Sep 05, 2016 9:10 am
Contact:

How much does a recipe with catalyst and probability produce?

Post by mrvn »

Say I have a recipe that produces this:

Code: Select all

      products = {
        {
          amount = 10,
          catalyst_amount = 4,
          name = "thing",
          probability = 0.7,
          type = "item"
        }
      }
How many things would that produce on average per cycles with 20% productivity bonus?

The productivity bonus of the assembler only affects anything in excess over the catalyst. So 4 + 6 * 120% for the productivity.

But do the 0.7 probability apply to the whole amount or just the excess over the catalyst? So is it 0.7 * 10 = 7 or 4 + 0.7 * 6 = 8.2 on average?

Actually how doe the productivity work? My understanding is that every cycle the productivity progress in the assembler increases by 20%. When it reaches 100% the assembler produces an extra cycle of the recipe except with catalyst amounts removed. Is the probability applied before or after the catalyst amount is removed from the equation? I figure it can't be before because what if the amount without catalyst becomes negative?

In total I think the formula would be (assuming thing isn't also an ingredient): 4 + 0.7 * 6 * 120% = 9.04.

Now if thing is also an ingredient, say 7 (catalyst = 4) then it would be 4 + 0.7 * 6 * 120% - 7 = 2.04.

PS: Why do ingredients have a catalyst_amount value? How does that figure into anything?

FuryoftheStars
Smart Inserter
Smart Inserter
Posts: 2551
Joined: Tue Apr 25, 2017 2:01 pm
Contact:

Re: How much does a recipe with catalyst and probability produce?

Post by FuryoftheStars »

I don't know the affect of probability on the catalyst, so my guess would be one of these two formulas, but further testing would be required:
  1. probability * (catalyst + (result - catalyst) * (1 + productivity))
  2. catalyst + probability * (result - catalyst) * (1 + productivity)
As to the point behind catalyst, maybe see FFF-256?

Edit: I think something to be aware of from that FFF is that it seems if you don't specify catalyst_amount, then it will automatically use your input ingredient amounts for this if your result contains the same items. As such, you don't even need to specify it unless you want the catalyst_amount to be different.
My Mods: Classic Factorio Basic Oil Processing | Sulfur Production from Oils | Wood to Oil Processing | Infinite Resources - Normal Yield | Tree Saplings (Redux) | Alien Biomes Tweaked | Restrictions on Artificial Tiles

Post Reply

Return to “Modding help”