[boskid][2.0.18] Rail signal wire connections break upon rotation sometimes

This subforum contains all the issues which we already resolved.
Theikkru
Filter Inserter
Filter Inserter
Posts: 416
Joined: Wed Mar 27, 2019 2:18 pm
Contact:

[boskid][2.0.18] Rail signal wire connections break upon rotation sometimes

Post by Theikkru »

Consider the following blueprint:
bp.png
bp.png (116.5 KiB) Viewed 435 times
If placed as pictured, the red wire connections to the rail signals work. If you rotate it, the connections break when you put the ghost down.
W H Y ?
User avatar
boskid
Factorio Staff
Factorio Staff
Posts: 3645
Joined: Thu Dec 14, 2017 6:56 pm
Contact:

Re: [boskid][2.0.18] Rail signal wire connections break upon rotation sometimes

Post by boskid »

That was a tough one, i tried at least 3 different approaches which were all way too complex so i decided on a 4th fix and so the issue is now fixed for 2.0.42.

Issue was that wire reach is performed as a distance between selection boxes, rail signals have rotated selections boxes and as it turns out, our code for measuring distances between boxes does not work correctly when boxes are rotated. Since the signal you have is slightly rotated, it falls into category of rotated boxes and regardless of the blueprint orientation, wire reach check was always seeing rail signal's box to be a vertical rectangle. Because of this when signal was above or below, the wire distance check was passing (with distance of 8.85) but when signal was on the sides of electric pole, the distance measured was 9.05 and the wire failed a reach check. For a fix i made the wire reach checks to use axis aligned bounding box of the selection box which fixes the issue while only slightly increasing the wire reach.
Post Reply

Return to “Resolved Problems and Bugs”