[1.1.25] Disconnected rolling stock treated differently by signals

Bugs that are actually features.
Post Reply
Costin32121311
Burner Inserter
Burner Inserter
Posts: 5
Joined: Sat Feb 20, 2021 4:20 pm
Contact:

[1.1.25] Disconnected rolling stock treated differently by signals

Post by Costin32121311 »

Disconnected rolling stock seems to be treated differently by signals, which turn red in certain situations, as if the disconnected rolling stock brought to a station by a locomotive does not occupy the same space as rolling stock that is placed directly by hand which does not turn signals red in those same situations.

Image

This behaviour can be seen in the attached blueprint or map, in which I only created the blueprint to make sure this was not the fault of any mod. To reproduce it turn the combinator on the upper right corner of the screen on and off to send all trains to the left-most station, on the bottom track detach the locomotive next to the wagons from them, delete the locomotive, or get it out of the way by some other mean, you will see that the last signal that points towards the wagons (the one with two lamps tied to it) will stay red, it will stay red, indicating that part of the wagon enters the block, even if you destroy the last wagon and then place it back attached to the other wagons, however if you copy this setup in it’s current state to a blueprint and paste it, the signal on the pasted version will be green and will stay green even if you replace that wagon, it will also be green if you paste that blueprint without trains and then place the rolling stock by hand.

The stations are placed the way they are, four and six tiles apart from each other alternatively, so that, combined with both of the tiles a station takes up, the space deliniated by them is 6 and 8 tiles, this averages out at 7 tiles which seems to be the space needed to house a wagon that is attached to to other wagons, 4 tiles for the wagon and 3 tiles between wagons. The other tracks do not have this problem, presumably because they have more space per wagon, from stations with gaps of 6 tiles between them, so this error does not push the wagon far enough to reach into other blocks.

Placing stations this way makes it possible to park wagons at certain stations and have the blocks, defined by signals placed right next to the station, be considered empty so that trains can go back to the station and keep interacting with those wagons by attaching/detaching wagons, I use this, in conjunction with some mods that let me automatically set schedules for trains and attach and detach rolling stock, to work with wagons individually, much in the same way a real train station would operate, so this bug makes it very hard to store and take wagons from a track but I’m aware that this is a hyper-specific use-case.

Attachments
factorio-current.log
(14.65 KiB) Downloaded 72 times
Disconnected wagons train signal bug.zip
(4.44 MiB) Downloaded 76 times
Disconnected wagons train signal bug.txt
(3.2 KiB) Downloaded 59 times
Wagon bug.PNG
Wagon bug.PNG (3.5 MiB) Viewed 1687 times

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

Re: [1.1.25] Disconnected rolling stock treated differently by signals

Post by boskid »

Thanks for the report, however this is not a bug. Last rolling stock's rail join is at the position that is exactly on the transition between 2 rail blocks because of the rail signal that after the train stop on the same side, so depending on numerical accuracy and direction from which train arrived, it may happen to end on the block before or after that rail signal. If it ends before that signal then the block covering the train stop will be closed, if it lands on the block after that signal, block covering the train stop will be open. Both outcomes are acceptable, one (when closed) because visually train did not yet passed that signal, second (when open) because technically last rail joint passed that signal.
96333-joints.png
96333-joints.png (402.04 KiB) Viewed 1668 times

Costin32121311
Burner Inserter
Burner Inserter
Posts: 5
Joined: Sat Feb 20, 2021 4:20 pm
Contact:

Re: [1.1.25] Disconnected rolling stock treated differently by signals

Post by Costin32121311 »

I see, thank you for looking at it. If anyone else has encountered this behaviour and is looking for a way to bypass it, this made me realise that making a wagon slightly smaller so that the error does not affect it and making the space between wagons slightly bigger to compensate should work and connection_distance and joint_distance are available for modding in the prototype so this should be possible.

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

Re: [1.1.25] Disconnected rolling stock treated differently by signals

Post by boskid »

Costin32121311 wrote:
Sat Feb 20, 2021 8:11 pm
connection_distance and joint_distance are available for modding in the prototype so this should be possible.
Keep in mind that by changing joint_distance from default of 4 into something slightly higher, train will still travel to have front joint of front rolling stock to arrive at distance of 2 to train stop, but if first rolling stock will have larger joint_distance, center position of rolling stock will be shifted. When train does not align, pumps will not connect to fluid wagons. If you do not care about graphics, you can increase pump's `fluid_wagon_connector_alignment_tolerance` to be way larger than default of 0.0625

Costin32121311
Burner Inserter
Burner Inserter
Posts: 5
Joined: Sat Feb 20, 2021 4:20 pm
Contact:

Re: [1.1.25] Disconnected rolling stock treated differently by signals

Post by Costin32121311 »

Wagons not being centered is something that I did not think about, thank you for telling me. I was actually thinking of making the joint distance slightly smaller, not larger, so that I "pull" the wagons closer to the inside of the gap between stations, though that will have the same effects, I believe this will also affect the graphics of the wheels because they are placed based on the joint position.
Do you happen to know how big the error that causes this behaviour would be? It might be posible that with the precision of a double variable, which I believe is 15 digits, but I don't really know much about this sort of thing, I can adjust these values in such a way that I keep the joint far enough from the limit between blocks that the error does not move it into the next block while still keeping the center position close enough to the original that I do not have to modify that tolerance value or deal with unaligned graphics on pumps or bogies.
image

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

Re: [1.1.25] Disconnected rolling stock treated differently by signals

Post by boskid »

I do not have any solid numbers related to those margins. Some time ago i was doing trains movement changes where distance between joints is computed along rails (not as a straight line distance) so the margins most likely are small. There are some threshold values, like when a rail joint is within 0.0001 length to the exit it travels to it is considered at the end of rail, there is also another threshold where if the joint has less than 0.00000001 distance remaining to travel it will not move to the next rail. If i would be forced to guesstimate then i would choose a 0.05 margin (reducing joint distance and increasing connection distance by that) as enough in most cases, and would increase the pump's tolerance by the same value just to be sure. Its on the edge of supported behavior and if it would happen that even with those margins it would be possible for the trailing joint to not always pass that rail transition i would consider it to be most likely a minor issue, unless it would give so bad joints movement that would prevent vanilla train on only straight rails from aligning properly to pumps, which i would consider to be a bug.

Post Reply

Return to “Not a bug”