Page 1 of 1

[Lou][2.0.63] tile_buildability_rules behaving differently than expected

Posted: Wed Aug 06, 2025 4:46 pm
by Quezler

Code: Select all

local prototype = data.raw["assembling-machine"]["assembling-machine-1"]
prototype.tile_buildability_rules = prototype.tile_buildability_rules or {}
table.insert(prototype.tile_buildability_rules, {
  area = prototype.collision_box,
  colliding_tiles = {layers = {lava_tile = true}},
})
expected behavior: that rule only collides with lava tiles. (assembling machine already unplacable on it, but that is irrelevant)
observed behavior: the assembling machine cannot be placed anywhere anymore.

When you comment out the colliding_tiles part you get the "At least one of 'required_tiles' or 'colliding_tiles' must be set." message which suggests that you can use colliding_tiles without required_tiles, so i believe this is a bug.

Re: [2.0.63] tile_buildability_rules behaving differently than expected

Posted: Fri Aug 08, 2025 11:02 pm
by Osmo
Have you also modified the collision mask of the assembler?
If not, it will require the area to collide with lava, while also colliding with lava itself, preventing its placement anywhere. Collision masks functions independently of the tile buildability rules.

Re: [2.0.63] tile_buildability_rules behaving differently than expected

Posted: Sat Aug 09, 2025 8:00 pm
by Quezler
im not quite sure sure how that is relevant to this bug.

the problem is that the optional required tiles default to collisionmask::none, which when the tile buildability rules check it always returns false.

instead it should default to colliding with every layer or just skip the check entirely.

like the temporary fix i used in the space exploration codebase is just to iterate all the collision layer prototypes and just shove that in the required table so that essentially never fails so only the colliding tiles actually matters.