Page 1 of 1

[Twinsen][0.17.66] Storage tank entities ignore pipe_picture in their fluid boxes

Posted: Fri Aug 23, 2019 2:49 pm
by Deadlock989
I'm trying to make a custom storage tank using left-over bits and pieces from other sprites. The originating model was a furnace type entity with fluid boxes including both pipe_picture and pipe_covers. On the furnace, pipe_picture is drawn correctly when a pipe connects to that pipe connection. With the storage tank, pipe_picture seems to be completely ignored:

Untitled.png
Untitled.png (350.67 KiB) Viewed 2404 times
I guess the vanilla tank doesn't need pipe_picture defined in its fluid box because it's all baked into the base sprite. But I expected that a fluid box is a fluid box is a fluid box.

The storage tank fluid_box definition:

Code: Select all

fluid_box = {
	base_area = 20,
	pipe_connections = {
		{ position = {0,-1} },
		{ position = {1,0} },
		{ position = {0,1} },
		{ position = {-1,0} },
	},
	pipe_covers = pipecoverspictures(),
	pipe_picture = {
		north = get_layer("machines/flare-stack-pipe-pictures", nil, nil, false, nil, nil, 46, 6, 41, 18, 128, 128, {0,1}),
		east = get_layer("machines/flare-stack-pipe-pictures", nil, nil, false, nil, nil, 2, 50, 94, 36, 128, 128, {-1,0}),
		south = get_layer("machines/flare-stack-pipe-pictures", nil, nil, false, nil, nil, 50, 26, 39, 70, 128, 128, {0,-1}), 
		west = get_layer("machines/flare-stack-pipe-pictures", nil, nil, false, nil, nil, 2, 50, 32, 36, 128, 128, {1,0}),
	},
	secondary_draw_orders = { north = -1 }
},
(The get_layer function fetches bits of the same overlay sprite that was used successfully on the furnace entity, the definition is identical).

Re: [Twinsen][0.17.66] Storage tank entities ignore pipe_picture in their fluid boxes

Posted: Mon Aug 26, 2019 1:52 pm
by Twinsen
Indeed the storage tank was not drawing them since we never used it.

Should be fixed in Version: 0.17.67.
I only did some limited testing so let me know if it works as expected.

Re: [Twinsen][0.17.66] Storage tank entities ignore pipe_picture in their fluid boxes

Posted: Tue Sep 03, 2019 1:19 pm
by Deadlock989
The behaviour of the pipe_pictures is much improved in .67, i.e. now works as expected - thanks for that.

There is something off with layers / render order, though. The pipe_pictures and pipe_covers interact poorly, being rendered on top of each other in a different order depending on location, entity orientation and zoom level:

Zoom level 2
Untitled1.png
Untitled1.png (105.5 KiB) Viewed 2242 times
Some other zoom level
Untitled2.png
Untitled2.png (50.28 KiB) Viewed 2242 times
If the stars align in the right way then every affected machine on the screen flickers back and forth when you highlight any one of them:

flicker.gif
flicker.gif (87.95 KiB) Viewed 2242 times
It makes me think of z-fighting. I have seen something like this before in Factorio but I can't put my finger on the bug report. In that case it was some odd interaction between pipes, base layers and working_animations, due to them being on the same render layers, and I think the fix was just to move one of them to a higher layer. If I find it I'll post the link.

Re: [Twinsen][0.17.66] Storage tank entities ignore pipe_picture in their fluid boxes

Posted: Tue Sep 03, 2019 1:53 pm
by Klonan
Deadlock989 wrote:
Tue Sep 03, 2019 1:19 pm
The behaviour of the pipe_pictures is much improved in .67, i.e. now works as expected - thanks for that.

There is something off with layers / render order, though. The pipe_pictures and pipe_covers interact poorly, being rendered on top of each other in a different order depending on location, entity orientation and zoom level:
Can you make this as a new bug report