resource_autoplace_all_patches noise-expressions with identical regular_patch_set_index influence each other?
Posted: Sat Sep 13, 2025 1:04 pm
My initial goal was to have a small resource patch in the center(-ish) of another resource patch. I figured I could make them use the same location by ensuring that their spot_noise expressions use the same skip_offset parameter. While trying/debugging this approach I noticed the following:
With this code in a data.lua (no other code anywhere else, no other mods. Game version 2.0.66):
And starting a new game, I would expect iron patches to be the same size as usual, with small copper patches in the middle (or very little/no copper, if the RNG got unlucky, I guess). Instead I see the following:
It looks like both the iron and copper have been shrunk. A normal iron patch should have like 4 times that radius (and be less regular and all that).
So it looks like changing the index in the copper noise expression somehow influenced the iron noise expression or something? No idea if that's a bug, missing documentation, or just me misunderstanding something big time.
I would love some ideas on how to debug this, or just... any solution really.
With this code in a data.lua (no other code anywhere else, no other mods. Game version 2.0.66):
Code: Select all
local copper = data.raw["noise-expression"]["default-copper-ore-patches"]
copper.expression = copper.expression
:gsub("regular_rq_factor = 0.11", "regular_rq_factor = 0.03")
:gsub("regular_patch_set_index = 1", "regular_patch_set_index = 0")
It looks like both the iron and copper have been shrunk. A normal iron patch should have like 4 times that radius (and be less regular and all that).
So it looks like changing the index in the copper noise expression somehow influenced the iron noise expression or something? No idea if that's a bug, missing documentation, or just me misunderstanding something big time.
I would love some ideas on how to debug this, or just... any solution really.