[0.17.66] Potential issue with implementation of back_patch and front_patch to loader prototype?

This subforum contains all the issues which we already resolved.
User avatar
kirazy
Filter Inserter
Filter Inserter
Posts: 426
Joined: Tue Mar 06, 2018 12:18 am
Contact:

[0.17.66] Potential issue with implementation of back_patch and front_patch to loader prototype?

Post by kirazy »

In reference to this modding interface request, added in 0.17.65.

I have the following issue when trying to implement back_patch and front_patch in my mod Vanilla Loaders HD:
Image

I have the exact same images, exact same code as the vanilla Underground belt: https://imgur.com/a/DDtGCBv

Relevant code excerpt from Vanilla Loaders HD:

Code: Select all

-- Add back flange beneath items on the belt
loader.structure.back_patch =
{
	sheet =
	{
	filename = "__vanilla-loaders-hd__/graphics/entity/loader/loader-structure-back-patch.png",
	priority = "extra-high",
	width = 96,
	height = 96,
	hr_version =
	{
		filename = "__vanilla-loaders-hd__/graphics/entity/loader/hr-loader-structure-back-patch.png",
		priority = "extra-high",
		width = 192,
		height = 192,
		scale = 0.5
	}
	}
}

-- Little piece of texture that extends into territory occupied by items while on belt, but rendered beneath them.
loader.structure.front_patch =
{
	sheet =
	{
	filename = "__vanilla-loaders-hd__/graphics/entity/loader/loader-structure-front-patch.png",
	priority = "extra-high",
	width = 96,
	height = 96,
	hr_version =
	{
		filename = "__vanilla-loaders-hd__/graphics/entity/loader/hr-loader-structure-front-patch.png",
		priority = "extra-high",
		width = 192,
		height = 192,
		scale = 0.5
	}
	}
}
Code exerpt from base Factorio:

Code: Select all

back_patch =
{
  sheet =
  {
    filename = "__base__/graphics/entity/underground-belt/underground-belt-structure-back-patch.png",
    priority = "extra-high",
    width = 96,
    height = 96,
    hr_version =
    {
      filename = "__base__/graphics/entity/underground-belt/hr-underground-belt-structure-back-patch.png",
      priority = "extra-high",
      width = 192,
      height = 192,
      scale = 0.5
    }

  }
},
front_patch =
{
  sheet =
  {
    filename = "__base__/graphics/entity/underground-belt/underground-belt-structure-front-patch.png",
    priority = "extra-high",
    width = 96,
    height = 96,
    hr_version =
    {
      filename = "__base__/graphics/entity/underground-belt/hr-underground-belt-structure-front-patch.png",
      priority = "extra-high",
      width = 192,
      height = 192,
      scale = 0.5
    }

  }
}
If this is something that's fixable on my end that would be amazing, but I don't know what that could possibly be. Because it works 50% of the time.

Edit: I've attached the work-in-progress version of my mod, and the save file I use to test/troubleshoot. There are other associated mods but they can be grabbed from the mod portal, and technically speaking are not strictly necessary.
vanilla-loaders-hd_0.17.5.zip
(380.58 KiB) Downloaded 149 times
1 - Loader Hellscape.zip
(2.45 MiB) Downloaded 152 times
Staplergun
Long Handed Inserter
Long Handed Inserter
Posts: 96
Joined: Sun Mar 25, 2018 5:34 am
Contact:

Re: [0.17.66] Potential issue with implementation of back_patch and front_patch to loader prototype?

Post by Staplergun »

Make sure the sprite sheet sheets are correct, and make sure the layer being defined is the right one. I wrote this support, and I tested it by directly copying the `structure` property from the underground belt onto the loader.

Also make sure you set the structures render layer to transport belt. Front and back patch are based on rendering on the transport belt layer.

https://gfycat.com/idioticcarefreeflies
User avatar
kirazy
Filter Inserter
Filter Inserter
Posts: 426
Joined: Tue Mar 06, 2018 12:18 am
Contact:

Re: [0.17.66] Potential issue with implementation of back_patch and front_patch to loader prototype?

Post by kirazy »

In an early patch the option to change the default render layer for the loader was added, specifically because rendering on the transport-belt layer causes this issue:
Image

I had been rendering on the same level as underground belts, which I was told was transport-belt-circuit-connector.

Testing with just my mod and no others, and not specifying the render layer so that it uses the default, this is the following result:
Image

And with just my mod and specifying the render layer as transport-belt-circuit-connector:
Image

I'm reasonably confident that the sprite sheets are correct. They use the same layout as the ones for the underground belt, and match the in-game behavior of the loaders.

I'm not sure what else to check. I've included the sprite sheets in an album in the original post.

Edit: The code specifying the sprite sheets is identical to that used to specify the underground belt sprites, the visuals are slightly different to accomodate the 2x1 tile vs 1x1 tile sizes, and the in/out direction, but otherwise should be the same.

Edit 2: I will say that items on the belt perform fine, it's specifically the way the front/back interact with the transport belt piece.
https://gyazo.com/825129cfb9f11e11bc7a1789d740c0fb
posila
Factorio Staff
Factorio Staff
Posts: 5350
Joined: Thu Jun 11, 2015 1:35 pm
Contact:

Re: [0.17.66] Potential issue with implementation of back_patch and front_patch to loader prototype?

Post by posila »

Thanks for the report.
Fixed for the next release (0.17.67?)

I also changed default value of structure_render_layer to "transport-belt-circuit-connector"
Post Reply

Return to “Resolved Problems and Bugs”