Page 1 of 1

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

Posted: Wed Sep 29, 2021 6:56 pm
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 2554 times

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

Posted: Wed Sep 29, 2021 7:46 pm
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

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

Posted: Mon Oct 04, 2021 12:52 pm
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.