Page 1 of 1

[2.1.11] Fully overlapping tile_buildability_rules are discarded

Posted: Mon Jul 20, 2026 3:21 am
by OhSnap
Scenario: Two mods add a tile_buildability rule. One for whitelisting and one for blacklisting. (In this specific case, Maraxsis and Rabbasca).

Observed behaviour:
If all tiles of the two rules overlap, the second rule is discarded.

Consider these two buildings:
07-20-2026, 04-56-54.png
07-20-2026, 04-56-54.png (86.58 KiB) Viewed 189 times
07-20-2026, 04-58-04.png
07-20-2026, 04-58-04.png (78.94 KiB) Viewed 189 times
collision masks of purple concrete is { harene = true }, grey rubble is { ground_tile = true }
AM3: top left part is not covered by maraxsis rule, but the harene rule still applies on the whole rule area (as expected).
flare stack: {0,0} apparently is part of the top-left tile, so both rules cover all tiles of the bounding_box. harene rule is completely ignored.
07-20-2026, 05-04-00.png
07-20-2026, 05-04-00.png (207.29 KiB) Viewed 189 times
If I modify the AM3 variant to have both rules have the full bounding_box area, it behaves like the flare stack as well, completely ignoring the harene rule, so this issue is not caused by some other difference in the buildings.

Expected behaviour: The rules should apply consistently, regardless of full tile overlap or not. In this case everything worked as intended for cases where the rules had partially overlapping bounding boxes (AM3 case), even in the overlapping parts.

Re: [2.1.11] Fully overlapping tile_buildability_rules are discarded

Posted: Mon Jul 20, 2026 9:15 am
by boskid
Please provide a save file that i could use to sync mods with and use to reproduce the failing behavior. I have read this bug report 4 times now and i am still not sure if i understand what it is exactly about and i am not willing to manually recreate the issue just to trace which logic is responsible of this behavior to know if its intended or not.

Re: [2.1.11] Fully overlapping tile_buildability_rules are discarded

Posted: Mon Jul 20, 2026 3:39 pm
by OhSnap
Sure, here is a very simple mod that explains the behaviour:
The point is that the second rule is meant to prevent the building from being placed on land, but AM3 can still be placed on land:

Code: Select all

-- data.lua
local am2 = data.raw["assembling-machine"]["assembling-machine-2"]
local am3 = data.raw["assembling-machine"]["assembling-machine-3"]

-- CANNOT be built on land, because second rule prohibits it (expected)
am2.tile_buildability_rules = {
    { area = {{0,0},        {1.5, 1.5}}, colliding_tiles = { layers = { out_of_map = true } } }, -- dummy rule, not all tiles of second rule covered
    { area = {{-1.5, -1.5}, {1.5, 1.5}}, required_tiles = { layers = { water_tile = true } }, remove_on_collision = true }
}

-- CAN be built on land, because second rule is ignored (NOT expected)
am3.tile_buildability_rules = {
    { area = {{-1.5, -1.5}, {1.5, 1.5}}, colliding_tiles = { layers = { out_of_map = true } } }, -- dummy rule, same tiles as second rule covered
    { area = {{-1.5, -1.5}, {1.5, 1.5}}, required_tiles = { layers = { water_tile = true } }, remove_on_collision = true }
}
Save and mod attached. I can also provide save with the real mods (rabbasca + maraxsis) if required, but I thought this might me much easier to follow.
(the save has AM2's in inventory. I can not place them anywhere as that is exactly the point of this bug report. AM3 should not be placeable on land as well with this setup)