Page 1 of 1

[Rseding91] [2.0.28] Quality % wrong when normal quality's level changes

Posted: Fri Jan 03, 2025 12:36 pm
by dominis

Code: Select all

local function rewrite_quality ()
  local order = { 'normal', 'uncommon', 'rare', 'epic', 'legendary' }
  local level = { 0, 1, 4, 16, 64 }
  for idx, rarity in ipairs(order) do
    if data.raw.quality[rarity] and not data.raw.quality[rarity].qml_ignore then
      data.raw.quality[rarity].level = 64 -- idx - 1
      data.raw.quality[rarity].next_probability = (0.4 - (idx - 1) / 100) ^ idx
    end
  end
end

local function rewrite_crafters ()
  local archetypes = { 'assembling-machine', 'furnace', 'mining-drill' }
  for _, archetype in ipairs(archetypes) do
    for _, entity in pairs(data.raw[archetype]) do
      if not entity.qml_ignore then
        if not entity['effect_receiver'] then
          entity['effect_receiver'] = {}
        end
        if not entity['effect_receiver']['base_effect'] then
          entity['effect_receiver']['base_effect'] = {}
        end
        if not entity['effect_receiver']['base_effect']['quality'] then
          entity['effect_receiver']['base_effect']['quality'] = 0
        end
        entity['effect_receiver']['base_effect']['quality'] = 0.2 -- math.max(entity['effect_receiver']['base_effect']['quality'], 0.01)
      end
    end
  end
end
It says it has ~61.44% quality but the observed effects are for ~61.44%/20.2 (removed level effects). All changes applied in data-final-fixes.lua. The yellow square symbol is all items at (n+1) quality or higher. Check mark is the total crafts. info symbol is quotient of check/square.

Also, shouldn't the docs say quality is multiplied by next_probability not divided by 10?

Re: [Rseding91] [2.0.28] Quality % wrong when normal quality's level changes

Posted: Wed Apr 16, 2025 3:49 pm
by Rseding91
Thanks for the report. The tooltip is now fixed for the next release.