[2.0.43] Custom pipe-to-ground underground_collision_mask does not work for objects

Bugs that are actually features.
LazyManiac13
Burner Inserter
Burner Inserter
Posts: 8
Joined: Thu Apr 17, 2025 6:44 pm
Contact:

[2.0.43] Custom pipe-to-ground underground_collision_mask does not work for objects

Post by LazyManiac13 »

I started to develop my own pipe mod with not truly underground pipes, that I want to collide with other entities on build.
I found that underground_collision_mask for connecting pipes checks collisions with tiles only. I tried to add "object", "is_object", "is_lower_object" to collision layers. I also tried to force it by setting colliding_with_tiles_only = false but it does not work either.

Please, allow this check to work with all collision layers.

Code: Select all

  {
    type = "pipe-to-ground",
    name = "test-pipe",
    fluid_box =
    {
      pipe_connections =
      {
        { direction = defines.direction.north, connection_category = { "default", "test-pipe" }, position = {0, 0} },
        { direction = defines.direction.south, connection_category = "test-pipe", position = {0, 0} },
        {
          connection_type = "underground",
          direction = defines.direction.south,
          position = {0, 0},
          max_underground_distance = 10,
          underground_collision_mask =
          {
            colliding_with_tiles_only = false,
            layers = 
            {
              object = true,
              -- is_object = true,
              -- is_lower_object = true,
              water_tile = true,
              empty_space = true,
              lava_tile = true,
              -- ground_tile = false,
              -- floor = false,
              -- transport_belt = true,
            },
          },
        },
      },
      hide_connection_info = true
    },
Rseding91
Factorio Staff
Factorio Staff
Posts: 15432
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: [2.0.43] Custom pipe-to-ground underground_collision_mask does not work for objects

Post by Rseding91 »

Thanks for the report however that is intended. Its entire function is tile collision and does not interact with other entities.
If you want to get ahold of me I'm almost always on Discord.
robot256
Smart Inserter
Smart Inserter
Posts: 1155
Joined: Sun Mar 17, 2019 1:52 am
Contact:

Re: [2.0.43] Custom pipe-to-ground underground_collision_mask does not work for objects

Post by robot256 »

There are other collision layer names that have special purposes and don't actually cause collisions to happen, like elevated_rail_support. It would be nice if these special cases were documented somewhere.
Bilka
Factorio Staff
Factorio Staff
Posts: 3364
Joined: Sat Aug 13, 2016 9:20 am
Contact:

Re: [2.0.43] Custom pipe-to-ground underground_collision_mask does not work for objects

Post by Bilka »

robot256 wrote: Thu Apr 17, 2025 9:25 pm There are other collision layer names that have special purposes and don't actually cause collisions to happen, like elevated_rail_support. It would be nice if these special cases were documented somewhere.
https://lua-api.factorio.com/latest/typ ... ision_mask is already documented as only checking collision with tiles. The names of the collision layers are irrelevant in this case.

What do you mean by elevated_rail_support not causing collision?
I'm an admin over at https://wiki.factorio.com. Feel free to contact me if there's anything wrong (or right) with it.
LazyManiac13
Burner Inserter
Burner Inserter
Posts: 8
Joined: Thu Apr 17, 2025 6:44 pm
Contact:

Re: [2.0.43] Custom pipe-to-ground underground_collision_mask does not work for objects

Post by LazyManiac13 »

Rseding91 wrote: Thu Apr 17, 2025 9:18 pm Thanks for the report however that is intended. Its entire function is tile collision and does not interact with other entities.
Consider it modding feature request then. Let colliding_with_tiles_only be true by default in case of underground_collision_mask and allow to override it.
In rare case, if it is set to false by prototype, you can check all collision layers. Please.
robot256
Smart Inserter
Smart Inserter
Posts: 1155
Joined: Sun Mar 17, 2019 1:52 am
Contact:

Re: [2.0.43] Custom pipe-to-ground underground_collision_mask does not work for objects

Post by robot256 »

Bilka wrote: Thu Apr 17, 2025 9:44 pm
robot256 wrote: Thu Apr 17, 2025 9:25 pm There are other collision layer names that have special purposes and don't actually cause collisions to happen, like elevated_rail_support. It would be nice if these special cases were documented somewhere.
https://lua-api.factorio.com/latest/typ ... ision_mask is already documented as only checking collision with tiles. The names of the collision layers are irrelevant in this case.

What do you mean by elevated_rail_support not causing collision?
Sorry, I meant "rail_support". And now I feel crazy, because it works (causes collisions) in 2.0.43. I definitely made two different git commits of Cargo Ships to make boats collide with rail supports. First, I tried "rail_support", and then I switched to "is_object" because the first change didn't seem to work at the time. Either I was testing the wrong code or something changed between then and now. Probably it was my fault somehow.
Post Reply

Return to “Not a bug”