[0.17.42] Recipe with probability has other result as befor the update

Bugs that are actually features.
Post Reply
User avatar
AmatorPhasma
Fast Inserter
Fast Inserter
Posts: 126
Joined: Sat Aug 05, 2017 8:20 pm
Contact:

[0.17.42] Recipe with probability has other result as befor the update

Post by AmatorPhasma »

Hi,

I dont know if it is a bug or something related to my misunderstanding of the recipe definitions.
My recipes in my mod have an other result after updating to 0.17.42
looks related to:
[*]Fixed that products wouldn't allow amount_min of 0 for items. (71014)

My recipe definition:

Code: Select all

data:extend(
{
    {
        type = "recipe",
        name = "apm_crusher_drumms_used_repair",
        category = "crafting-with-fluid",
        icons = {
                    apm.power.icons.crusher_drumms_used,
                    apm.lib.utils.icon.dynamics.recycling,
                },
        icon_size = 32,
        group = "apm_power",
        subgroup = "apm_power_tools",
        order = 'ac_b',
        normal = {
            enabled = false,
            energy_required = 3,
            ingredients = {
                {type="fluid", name="water", amount=30},
                {type="item", name="apm_crusher_drumms_used", amount=5},
                {type="item", name="repair-pack", amount=1},
            },
            results = { 
                {type="item", name="apm_crusher_drumms", amount=4, catalyst_amount=4},
                {type="item", name="apm_crusher_drumms", amount_min=0, amount_max=1, probability=0.95, catalyst_amount=1},
                {type="item", name="repair-pack", amount_min=0, amount_max=1, probability=0.95, catalyst_amount=1},
                {type="fluid", name="apm_dirt_water", amount=30, catalyst_amount=30},
            },
            main_product = '',
            requester_paste_multiplier = 4,
            always_show_products = true,
            always_show_made_in = true,
            allow_decomposition = false,
            allow_as_intermediate = false,
            allow_intermediates = false,
        },
        expensive = {
            enabled = false,
            energy_required = 3,
            ingredients = {
                {type="fluid", name="water", amount=30},
                {type="item", name="apm_crusher_drumms_used", amount=5},
                {type="item", name="repair-pack", amount=1},
            },
            results = { 
                {type="item", name="apm_crusher_drumms", amount=4, catalyst_amount=4},
                {type="item", name="apm_crusher_drumms", amount_min=1, amount_max=1, probability=0.95, catalyst_amount=1},
                {type="item", name="repair-pack", amount_min=1, amount_max=1, probability=0.95, catalyst_amount=1},
                {type="fluid", name="apm_dirt_water", amount=30, catalyst_amount=30},
            },
            main_product = '',
            requester_paste_multiplier = 4,
            always_show_products = true,
            always_show_made_in = true,
            allow_decomposition = false,
            allow_as_intermediate = false,
            allow_intermediates = false,
        }
    },
})
In the attatchments two images:
- version 0.17.41 (also tested on version .40, .39 ... down to 0.32)
- version 0.17.42

The question is: bug or not bug? :)
Attachments
Version 0.17.41 and older
Version 0.17.41 and older
recipe_0_17_41.png (47.89 KiB) Viewed 1343 times
Version 0.17.42
Version 0.17.42
recipe_0_17_42.png (47.38 KiB) Viewed 1343 times

Rseding91
Factorio Staff
Factorio Staff
Posts: 13209
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: [0.17.42] Recipe with probability has other result as befor the update

Post by Rseding91 »

Thanks for the report. I would say the recipe is now correct after the update and was wrong before.

As you have the recipe defined you have: a 95% chance to get an item between 0 and 1.

So you have a 95% chance to get a 50% chance at an item which is a 47.5% chance at an item. Rounded up that's 48% which is what you see in the tooltip.
If you want to get ahold of me I'm almost always on Discord.

User avatar
Trblz
Long Handed Inserter
Long Handed Inserter
Posts: 63
Joined: Thu Sep 21, 2017 1:23 am
Contact:

Re: [0.17.42] Recipe with probability has other result as befor the update

Post by Trblz »

This thread is the closest i can find an answer to my question.

In latest beta:

Let's take Chemical Plant as example: ingredients: 5x steel-plate, 5x iron-gear-wheel, 5x electronic circuit, 5x pipe

Now i am looking for the following probability behavior:

Input: 5x steel-plate, 5x iron-gear-wheel, 5x electronic circuit, 5x pipe
Success-Output: 1x chemical-plant
Failure-Output : 5x steel-plate-scrap, 5x iron-gear-wheel-scrap, 5x electronic circuit-scrap, 5x pipe-scrap

Probability for Success-Output:Failure-Output = 80:20 % ; its either Success or Failure, so no 16% (0.8*0.2) chance of both outputs at the same time.

Is this possible with the current recipe structure definitions?
My Mod list: Necormant co-author

Rseding91
Factorio Staff
Factorio Staff
Posts: 13209
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: [0.17.42] Recipe with probability has other result as befor the update

Post by Rseding91 »

Trblz wrote:
Sat Sep 07, 2019 5:31 pm
Is this possible with the current recipe structure definitions?
Unfortunately no.
If you want to get ahold of me I'm almost always on Discord.

Post Reply

Return to “Not a bug”