[1.1.41] Spidertron legs don't collide with tiles using custom collision layers

This subforum contains all the issues which we already resolved.
Post Reply
Xorimuth
Filter Inserter
Filter Inserter
Posts: 624
Joined: Sat Mar 02, 2019 9:39 pm
Contact:

[1.1.41] Spidertron legs don't collide with tiles using custom collision layers

Post by Xorimuth »

Dev version of SWS attached (Note - not the same as the 1.2.4 from this bug report.

You can see in the screenshot that the water tile and spidertron leg's share the "layer-13" collision mask, so the spidertron leg should not be able to land on the water, but it does.

If I add water-tile or player-layer to the spidertron leg collision mask then it correctly stops the leg from landing on the water. You can adjust the spidertron leg collision mask in data-final-fixes.lua:26.

I've had no problems with entity collisions, it is just tiles.
Screenshot 2021-09-29 at 19.39.25.png
Screenshot 2021-09-29 at 19.39.25.png (2.69 MiB) Viewed 2535 times
Attachments
Collision mask tests bug report.zip
(572.61 KiB) Downloaded 178 times
SpidertronWeaponSwitcher_1.2.4.zip
(41.3 KiB) Downloaded 160 times
My mods
Content: Freight Forwarding | Spidertron Patrols | Spidertron Enhancements | Power Overload
QoL: Factory Search | Remote Configuration | Module Inserter Simplified | Wire Shortcuts X | Ghost Warnings

posila
Factorio Staff
Factorio Staff
Posts: 5201
Joined: Thu Jun 11, 2015 1:35 pm
Contact:

Re: [1.1.41] Spidertron legs don't collide with tiles using custom collision layers

Post by posila »

In 1.1, entity collision mask contain at least one of "water-tile", "ground-tile", "resource-layer", "player-layer", "item-layer", "doodad-layer" in order to be considered for tile collision check.
I think it should be changed, but I am not brave enough to change it in 1.1

User avatar
boskid
Factorio Staff
Factorio Staff
Posts: 2242
Joined: Thu Dec 14, 2017 6:56 pm
Contact:

Re: [1.1.41] Spidertron legs don't collide with tiles using custom collision layers

Post by boskid »

As posila mentioned, tile collisions were not checked when none of those 6 layers were in the collision mask.

Fix for this is to have an aggregate value computed from all the tile prototypes so whenever a collision layer is used in one of the tile's collision mask, every entity that also has that layer will now start checking collisions with tiles.
This fix has a huge chance of breaking some mods that depend on this broken behavior, even a base game offshore-pump was kind of abusing this logic to be placeable on water-shallow. I still believe it is better to have this bug fixed than keeping the bug for the mod compatibility reasons so the fix is complete and will be included in 1.1.42.

Post Reply

Return to “Resolved Problems and Bugs”