Hardcoded\Weird processing of 'normal' quality

Place to get help with not working mods / modding interface.
iMoonlight
Manual Inserter
Manual Inserter
Posts: 1
Joined: Wed Apr 23, 2025 2:20 pm
Contact:

Hardcoded\Weird processing of 'normal' quality

Post by iMoonlight »

I was tinkering with qualities and found that some items (inserters, drills, pumpjacks) processing their stat changes for 'normal' ('unknown' too?) quality in weird way.

Simple code to update all qualities with stats from 'legendary' quality
data-updates.lua

Code: Select all

local qualities_to_override = {"quality-unknown", "normal", "uncommon", "rare", "epic"}

local legendary = data.raw.quality["legendary"]
for _, qn in pairs(qualities_to_override) do
	local quality_copy = table.deepcopy(data.raw.quality[qn])

	quality_copy.level = legendary.level

	quality_copy.beacon_power_usage_multiplier = legendary.beacon_power_usage_multiplier
	quality_copy.science_pack_drain_multiplier = legendary.science_pack_drain_multiplier
	quality_copy.mining_drill_resource_drain_multiplier = legendary.mining_drill_resource_drain_multiplier

	data:extend {quality_copy}
end

Code: Select all

"dependencies": ["base >= 2.0", "quality >= 2.0"]
Loaded mods

Code: Select all

   0.679 Loading mod core 0.0.0 (data.lua)
   0.694 Loading mod base 2.0.43 (data.lua)
   0.838 Loading mod elevated-rails 2.0.43 (data.lua)
   0.864 Loading mod quality 2.0.43 (data.lua)
   0.880 Loading mod space-age 2.0.43 (data.lua)
   1.210 Loading mod base 2.0.43 (data-updates.lua)
   1.224 Loading mod quality 2.0.43 (data-updates.lua)
   1.243 Loading mod LegendaryQualityForAll 0.1.2 (data-updates.lua) - my mod
   1.251 Loading mod space-age 2.0.43 (data-updates.lua)
It works great for all qualities including 'normal' for most items
04-23-2025, 17-28-47.png
04-23-2025, 17-28-47.png (145.4 KiB) Viewed 404 times
04-23-2025, 17-29-25.png
04-23-2025, 17-29-25.png (104.47 KiB) Viewed 404 times
But for inserters it ignores quality level in calculations of rotation speed and consumption (health scaling works fine)
04-23-2025, 17-32-15.png
04-23-2025, 17-32-15.png (73.62 KiB) Viewed 404 times
04-23-2025, 17-32-32.png
04-23-2025, 17-32-32.png (54.71 KiB) Viewed 404 times
Also it do not show bonuses (and seems to do not apply them) for regular drills (pumpjacks too) in tooltip but shows them in factoropedia (big drills works fine)
04-23-2025, 17-36-23.png
04-23-2025, 17-36-23.png (145.01 KiB) Viewed 404 times
04-23-2025, 17-36-56.png
04-23-2025, 17-36-56.png (95.65 KiB) Viewed 404 times
User avatar
Omnifarious
Filter Inserter
Filter Inserter
Posts: 286
Joined: Wed Jul 26, 2017 3:24 pm
Contact:

Re: Hardcoded\Weird processing of 'normal' quality

Post by Omnifarious »

The way quality scaling in general is handled is weird. All the mods I've looked at that try to make quality scaling work differently for an existing item end up creating special case versions of the item for every quality level and then performing a little switcheroo every time it's built. I don't know that they update the item descriptions at all with their new data, The change may just mysteriously appear at build time.

I've been looking into making a mod that changes accumulator quality scaling so that the maximum input and output flow rates scale the same as the storage.

I suspect the turn rates for inserters are just hard-coded and not based on anything. I would be curious what happened with those if you added an extra quality level that was another two steps higher than "legendary". I suspect it wouldn't add new turn rates for inserters.

Also, your code leaves "epic" and "rare" untouched, but the tooltip shows them as having been modified. Was it modified, or is that another weird artifact? If the code you show doesn't reflect the code you ran, I would suggest changing that, and also suggest leaving it "rare" and "epic" untouched as a control.
Osmo
Long Handed Inserter
Long Handed Inserter
Posts: 70
Joined: Wed Oct 23, 2024 12:08 pm
Contact:

Re: Hardcoded\Weird processing of 'normal' quality

Post by Osmo »

Some of these have since been fixed (inserters), but if this still happens you should report every occurence of this as a bug
Post Reply

Return to “Modding help”