[2.1.17] Quality roll does not occur if next quality is Normal

Bugs that are actually features.
User avatar
Shemp
Long Handed Inserter
Long Handed Inserter
Posts: 81
Joined: Mon Jan 19, 2026 6:51 pm
Contact:

[2.1.17] Quality roll does not occur if next quality is Normal

Post by Shemp »

I have defined an additional quality "Poor", whose next quality is Normal. Quality module 1 is changed to have +100% quality.

I suspect that qualities that come before Normal in the chain may be explicitly unsupported by the engine, but the docs aren't clear about this.

zzz-ShempDebug_0.2.1.zip
(1.69 KiB) Downloaded 8 times
Content:

Code: Select all

local color = { r = 0.0, g = 0.8, b = 0.8 }

data:extend{{
    type = "quality",
    name = "poor",
    next = "normal", -- This is the important part
    level = 0,
    localised_name = "Poor",
    order = "0a", -- Normal is always ordered before other qualities
    icons = {{
        icon = data.raw.quality.normal.icon,
        tint = color,
    }},
    color = color,
}}

data.raw.module["quality-module"].effect.quality = 1.0
Steps to reproduce:
  • Download the reproduction mod above, load it together with the Quality mod.
  • Enter a game world, place any assembling machine, set any recipe at Poor quality, and insert a Quality module 1 (guaranteed quality up).
  • Run the crafting recipe. (This also works with furnaces.)
Expected result:

Quality module 1 has +100% quality effect. Crafting should always cause quality to go up with this module in the machine.
machine-tooltip.png
machine-tooltip.png (196.8 KiB) Viewed 103 times

Actual result:

Crafting with Poor ingredients and the Quality module 1 causes the recipe products to always be Poor.
recipe-product.png
recipe-product.png (61.57 KiB) Viewed 103 times
But the Normal quality is unlocked by the force.
normal-unlocked.png
normal-unlocked.png (99.75 KiB) Viewed 103 times
If you set quality_change = 1 or higher on a recipe product, the result will be Normal or greater as expected.
User avatar
boskid
Factorio Staff
Factorio Staff
Posts: 4846
Joined: Thu Dec 14, 2017 6:56 pm
Contact:

Re: [2.1.17] Quality roll does not occur if next quality is Normal

Post by boskid »

Where is QualityPrototype::next_probability set? It defaults to 0 which has the outcome as observed.
Post Reply

Return to “Not a bug”