[0.18.x] Strange pump interaction Non-standard size fluid wagon

Place to ask discuss and request the modding support of Factorio. Don't request mods here.
Post Reply
User avatar
bobingabout
Smart Inserter
Smart Inserter
Posts: 7352
Joined: Fri May 09, 2014 1:01 pm
Contact:

[0.18.x] Strange pump interaction Non-standard size fluid wagon

Post by bobingabout »

This one I'm saying is definitely a bug.

First, I resized the fluid wagon down to a 2 length wagon, and tried to connect pipes to it to see what would happen. (This is something I actually plan to do, but haven't done graphics yet, code testing first)
This is basically accomplished by changing the following tags to the specified values:

Code: Select all

    collision_box = {{-0.6, -0.6}, {0.6, 0.6}},
    selection_box = {{-1, -0.703125}, {1, 1.296875}},
    joint_distance = 0,
Now, look at the screenshots:
https://www.dropbox.com/s/tcswcswi7318r ... 6.png?dl=0
https://www.dropbox.com/s/0m6r06vyo1smq ... 9.png?dl=0
https://www.dropbox.com/s/2gi68hcjokwfl ... 1.png?dl=0
https://www.dropbox.com/s/2io32k3uy5j8s ... 3.png?dl=0

as you can see, the ones placed outside of the collission box correctly do not try to connect.
Also, as expected, only one pump tries to connect.
However, 2 of the 4 possible pump locations results in an odd connection attempt.


Moving on. This one I'm not sure if it's a bug, or a request, however, I tried tried to make a 10 length wagon. Here is the code changes.

Code: Select all

    collision_box = {{-0.6, -4.6}, {0.6, 4.6}},
    selection_box = {{-1, -2.703125}, {1, 5.296875}},
    joint_distance = 8,
This is the result:
https://www.dropbox.com/s/jgbfhboz2c8tb ... 6.png?dl=0

As you can see, only 3 of the 5 pumps try to connect. It's not entirely unexpected, but not the desired behaviour, when placing the pump, the ground does highlight a yellow square around what would be the two far end tanks, they just don't actually connect.
Creator of Bob's mods. Expanding your gameplay since version 0.9.8.
I also have a Patreon.

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

Re: [0.18.x] Strange pump interaction Non-standard size fluid wagon

Post by boskid »

Issue with joint_distance of 0 is that it has to be unsupported. When rolling stocks are moving, joints are the primary thing which position is being traced. Rolling stock position is overriden by a middle point between map positions of both joints ("map position" here means conversion from double precision down to 1/256 precision), and the rolling stock orientation is taken as orientation of vector going from backJoint to the frontJoint. Simply saying: increase joint_distance to at least 0.01 (smaller values may throw soon). To prevent next rolling stocks from misalignment, you may reduce connection_distance from 3 by a small value from joint_distance. This also appears to fix graphics for me. With joint_distance of 0 you will get rolling stocks that do not rotate at all.

Issue with long fluid wagon is that.. pump to fluid wagon logic is hardcoded as for 3 tanks, that is: there are exactly 6 slots for connector graphics per each pump direction. There are also other places where amount of 3 tanks is hardcoded. This hardcoded number was not observed in the fluid wagon with joint_distance of 0 since there is also rail check and pumps that were not connecting were simply not seeing fluid wagons on their rail entities. If you fix junction distance so orientation is properly computed and make a train "locomotive(normal) - cargo wagon(normal) - fluid wagon(short)" you will see there are 8 pumps that wants to connect to the fluid wagon because now it is on 2 rails and is being detected by 8 pumps. They will connect to all 3 hardcoded fluid wagon connectors. Outer 4 pumps (that graphicaly will appear as able to connect using base gfx) will not connect since they will fail to find fluid wagon on their rail.

I am not sure if this can be even considered bug report right now, it was never supported so it is more like modding request.

User avatar
bobingabout
Smart Inserter
Smart Inserter
Posts: 7352
Joined: Fri May 09, 2014 1:01 pm
Contact:

Re: [0.18.x] Strange pump interaction Non-standard size fluid wagon

Post by bobingabout »

boskid wrote:
Fri May 15, 2020 4:38 am
Issue with joint_distance of 0 is that it has to be unsupported. When rolling stocks are moving, joints are the primary thing which position is being traced. Rolling stock position is overriden by a middle point between map positions of both joints ("map position" here means conversion from double precision down to 1/256 precision), and the rolling stock orientation is taken as orientation of vector going from backJoint to the frontJoint. Simply saying: increase joint_distance to at least 0.01 (smaller values may throw soon). To prevent next rolling stocks from misalignment, you may reduce connection_distance from 3 by a small value from joint_distance. This also appears to fix graphics for me. With joint_distance of 0 you will get rolling stocks that do not rotate at all.
I didn't actually try to move the wagon, but if it doesn't rotate at all, that would be a big problem. Setting it to 0 was done on purpose to put both bogies on top of each other, to make it look like a single fixed wheel set.
If you're saying setting it to... 0.015625 (half a pixel) would work, and fix the issue, I'll give it a try.
boskid wrote:
Fri May 15, 2020 4:38 am
Issue with long fluid wagon is that.. pump to fluid wagon logic is hardcoded as for 3 tanks, that is: there are exactly 6 slots for connector graphics per each pump direction. There are also other places where amount of 3 tanks is hardcoded. This hardcoded number was not observed in the fluid wagon with joint_distance of 0 since there is also rail check and pumps that were not connecting were simply not seeing fluid wagons on their rail entities. If you fix junction distance so orientation is properly computed and make a train "locomotive(normal) - cargo wagon(normal) - fluid wagon(short)" you will see there are 8 pumps that wants to connect to the fluid wagon because now it is on 2 rails and is being detected by 8 pumps. They will connect to all 3 hardcoded fluid wagon connectors. Outer 4 pumps (that graphicaly will appear as able to connect using base gfx) will not connect since they will fail to find fluid wagon on their rail.

I am not sure if this can be even considered bug report right now, it was never supported so it is more like modding request.
I'm going to presume the "I'm not sure this can even be considered a bug" part is more for the second half... but, yeah, I did start the second part with "This one I'm not sure if it's a bug, or a request", so I'd be happy to move it to requests. It's not entirely a mod breaking thing if only 3 pumps can connect to a larger wagon, but it would be better if all 5 could.

Ideally, instead of the 3 positions being hard-coded, it would be better if the modder can specify how many, and maybe even their positions (EG: instead of 3 where the middle one is centered, perhaps only 2 where they connect... a tile away from the center either side... or a non-symmetrical wagon where only the end connection connects)

(Again, this is something I'd try and program myself if I still had source access, I actually had a growing list of things I wanted to work on after the "Don't submit PRs while we're trying to get the game stable" phase)
Creator of Bob's mods. Expanding your gameplay since version 0.9.8.
I also have a Patreon.

Rseding91
Factorio Staff
Factorio Staff
Posts: 13209
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: [0.18.x] Strange pump interaction Non-standard size fluid wagon

Post by Rseding91 »

I'm going to move this to modding interface requests but I doubt it will ever happen. The pump <> fluid wagon connection logic was a mistake of our past that i'm not looking to spend more time on.
If you want to get ahold of me I'm almost always on Discord.

Post Reply

Return to “Modding interface requests”