[2.0.18] Straight rails incompatible

Bugs that are actually features.
Theikkru
Filter Inserter
Filter Inserter
Posts: 417
Joined: Wed Mar 27, 2019 2:18 pm
Contact:

[2.0.18] Straight rails incompatible

Post by Theikkru »

Consider the following blueprint:
rails.png
rails.png (355.66 KiB) Viewed 639 times
If you try to place the top rail over the bottom rail (or vice versa), instead of getting the blue overlap indication, you get the red blocked indication.
I understand that curves changed in 2.0, but straight rails incompatible too? This is especially bizarre for me, since I thought I'd "fixed" my 1.0 rail blueprints by redoing all the curves, and everything connects just fine if I force-place it anyways.
Rseding91
Factorio Staff
Factorio Staff
Posts: 15587
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: [2.0.18] Straight rails incompatible

Post by Rseding91 »

Thanks for the report, yes straight rails changed too.
If you want to get ahold of me I'm almost always on Discord.
Theikkru
Filter Inserter
Filter Inserter
Posts: 417
Joined: Wed Mar 27, 2019 2:18 pm
Contact:

Re: [2.0.18] Straight rails incompatible

Post by Theikkru »

But why are they incompatible? Why doesn't it just treat the two versions as identical (except for minor visual differences)? As far as I can tell, there are no functional differences between the two versions of straight rails, except for this weird inability to overwrite them.
User avatar
boskid
Factorio Staff
Factorio Staff
Posts: 3899
Joined: Thu Dec 14, 2017 6:56 pm
Contact:

Re: [2.0.18] Straight rails incompatible

Post by boskid »

Legacy straight rail supports straights because of compatibility requirements as the legacy straight rail handles 6 directions (horizontal, vertical and 4 diagonal triangles) while new straight rail supports straights so it is possible to build them even after a planned removal of legacy rails in the future. New straight rail supports 4 directions (horizontal and vertical and 2 diagonals) in order to be able to manually build first rail from cursor just by rotating. This is why both of the rail pieces contain straights. As for why they report as incompatible, there is a generic rule i had to add to the logic about incompatible rails which says 2 rails cannot be built on top if they are different rail pieces but share one of the connection points with the same turning. This was required because if you would place legacy curved rail and new curved rail in a way that places straight parts of both of them at the same position, a rail extension would need to bind to both rails and by doing so would become inconsistent due to inability to connect to both rails at the same time. Since legacy straight rails and new straight rails are different pieces, when placed have matching connection point position with matching turning they are declared incompatible because if they would both be placed one on top of another that would be a consistency issue and game would crash. I am not sure we allow for having entities be ignorable on build due to other entity type being at the build position so i am not willing to bend the rules because i am afraid of consistency consequences as migrations for rails are really annoying and i am not willing to write ones to fix people's save files if they would find a way to force such overlapping rails set.
11-15-2024, 10-54-15.png
11-15-2024, 10-54-15.png (123.65 KiB) Viewed 592 times
Theikkru
Filter Inserter
Filter Inserter
Posts: 417
Joined: Wed Mar 27, 2019 2:18 pm
Contact:

Re: [2.0.18] Straight rails incompatible

Post by Theikkru »

boskid wrote: Fri Nov 15, 2024 9:52 am [...]I am not sure we allow for having entities be ignorable on build due to other entity type being at the build position so i am not willing to bend the rules because i am afraid of consistency consequences[...]
If it's not practical to fix at blueprint runtime due to differing entities, what about during blueprint creation? You could write a rule to always copy or blueprint straight (vertical/horizontal) rails as the new rail version.

I ran into this problem because I edited one of my old blueprints by pasting it into the world, modifying it, and then re-casting it to a blueprint, not realizing that it was even possible for vertical and horizontal rails to be old versions; presumably, those old rails would vanish in some future version, unpredictably breaking blueprints. If, instead, the game automatically updated on copy, editing a blueprint (e.g. to fix the curves) would also silently update all the straights as well.
Post Reply

Return to “Not a bug”