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:
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":
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:
This looks like a weird graphical glitch/misalignment.
Edit: Editing this post to add a blueprint:
[0.18.34] Train Graphical Misalignment?
Re: [0.18.34] Train Graphical Misalignment?
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.
Re: [0.18.34] Train Graphical Misalignment?
If this is not a bug and just a graphical fix, then it would be nice if it doesn't affect things like this:
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.
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.
Re: [0.18.34] Train Graphical Misalignment?
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: 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.
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: 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.
Re: [0.18.34] Train Graphical Misalignment?
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?
However, since this was moves to "Not a Bug" - would it be appropriate to post it again as a suggestion/requested feature?
Re: [0.18.34] Train Graphical Misalignment?
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.
Re: [0.18.34] Train Graphical Misalignment?
Make a feature request.