[0.18.34] Train Graphical Misalignment?

Bugs that are actually features.
XYZT
Inserter
Inserter
Posts: 31
Joined: Fri Jun 07, 2019 3:40 pm
Contact:

[0.18.34] Train Graphical Misalignment?

Post by XYZT »

While trying to set up a train station built over a curve, I noticed a weird graphical misalignment with trains.

Here is the station setup:
Annotation 2020-06-30 061019.png
Annotation 2020-06-30 061019.png (1.61 MiB) Viewed 2952 times
As you can see, the wagon outlines show that wagons should line up with the chests and inserters. But when I actually send a train to the station on "Automatic":
Annotation 2020-06-30 061111.png
Annotation 2020-06-30 061111.png (1.55 MiB) Viewed 2952 times
The wagons end up approximately one block offset from where they should be based on the wagon outlines from before. However, they still manage to interface with all six inserters based on the six white boxes around the inserters. Here's a close up:
Annotation 2020-06-30 061258.png
Annotation 2020-06-30 061258.png (680.43 KiB) Viewed 2952 times
This looks like a weird graphical glitch/misalignment.

Edit: Editing this post to add a blueprint:


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

Re: [0.18.34] Train Graphical Misalignment?

Post by boskid »

This is known feature due to some special "hackery" made for trains to look better. It shifts rolling stocks along rails by the value that depends on difference of given rolling stock orientation and head rolling stock orientation. This feature is called "vertical shift" (and is not required to happen in vertical direction). I will check how would trains look like without this shifting but in essence this is still not a bug.

XYZT
Inserter
Inserter
Posts: 31
Joined: Fri Jun 07, 2019 3:40 pm
Contact:

Re: [0.18.34] Train Graphical Misalignment?

Post by XYZT »

If this is not a bug and just a graphical fix, then it would be nice if it doesn't affect things like this:
Annotation 2020-06-30 070536.png
Annotation 2020-06-30 070536.png (1.34 MiB) Viewed 2936 times
Based on the "predicted wagon outlines" - all of these wagons should line up. While this is not a big deal for the inserters as all inserters can successfully interface with the wagons, it is a problem for fluid wagons where the pumps refuse to connect with the wagon unless perfectly aligned.

So, this is has gameplay effects beyond just aesthetics.

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

Re: [0.18.34] Train Graphical Misalignment?

Post by boskid »

Fluid wagons are not supported when part of train is on curved rails, but this is due to another thing: pumps need some precise alignment of 0.0625 ("fluid_wagon_connector_alignment_tolerance" in pump prototype). While diagonal rail has length of 1.41421356 and curved rail has a length of 7.84208122. Placing tight 90 degree bend (2 curved + 1 diagonal) will make fluid wagon after bend to be miss aligned by +0.098 and pumps do not connect. I would have to adjust this lengths a lot to make pumps to connect reliably but trains would be stretching or shrinking a lot when diagonal rail would have a length of 2 and curved a length of 8. I tested this once and amount of tests i would have to fix was enormous. best possible solution for this would be to change pump graphics to not have this overhanging arm for which a precise alignment is required to not look odd - in such case allowed alignment could be increased a lot. Mods should be able to do that (change gfx and increase alignment tolerance to 1 when pumps would always connect).

If you want to tinker with the vertical shifting, there is a "vertical_selection_shift" value in rolling stocks prototype, if you change it to 0 for locomotive, cargo, fluid and artillery, you will see trains without this "hackery".

-- edit:
If you combine both features with some extra details, you will be able to get misaligned pumps in game:
86455-pump-misaligned.png
86455-pump-misaligned.png (470.14 KiB) Viewed 2928 times
I would still not consider this to be a bug since part of train is on curved rail. Pumps connect because train is aligned but because head of train is deduced to be on the right, fluid wagon graphics is shifted even when pumps are connected.

XYZT
Inserter
Inserter
Posts: 31
Joined: Fri Jun 07, 2019 3:40 pm
Contact:

Re: [0.18.34] Train Graphical Misalignment?

Post by XYZT »

This still looks like a bug to me because the "expectation" (predicted wagon outline when hovering over a train stop) does not match reality (where the actual wagons end up).

However, since this was moves to "Not a Bug" - would it be appropriate to post it again as a suggestion/requested feature?

adam_bise
Filter Inserter
Filter Inserter
Posts: 419
Joined: Fri Jun 08, 2018 10:42 pm
Contact:

Re: [0.18.34] Train Graphical Misalignment?

Post by adam_bise »

boskid wrote:
Tue Jun 30, 2020 11:26 am
Mods should be able to do that (change gfx and increase alignment tolerance to 1 when pumps would always connect).
Just curious if anyone knows if such a mod exists? How hard would it be to create for someone with zero modding experience you think?

adam_bise
Filter Inserter
Filter Inserter
Posts: 419
Joined: Fri Jun 08, 2018 10:42 pm
Contact:

Re: [0.18.34] Train Graphical Misalignment?

Post by adam_bise »

boskid wrote:
Tue Jun 30, 2020 11:26 am
best possible solution for this would be to change pump graphics to not have this overhanging arm for which a precise alignment is required to not look odd - in such case allowed alignment could be increased a lot.
Couldn't the graphic itself be stretched to suit? It is supposed to be a hose anyway, correct?

Personally I would rather have working fluid wagons than a 0.0625 precision for the pump hose graphic.

Loewchen
Global Moderator
Global Moderator
Posts: 8964
Joined: Wed Jan 07, 2015 5:53 pm
Contact:

Re: [0.18.34] Train Graphical Misalignment?

Post by Loewchen »

Make a feature request.

Locked

Return to “Not a bug”