Page 1 of 1

[2.0.77] stacking entities and rendering

Posted: Fri Jun 19, 2026 10:31 pm
by hgschmie
So I have this hybrid entity, which is stacking a loader and an inserter on top of each other.

Generally it seems to work ok, except when it comes to wire connections. And at this point, I ran out of ideas.

This is what I see in the game:
Screenshot 2026-06-19 at 15.07.40.png
Screenshot 2026-06-19 at 15.07.40.png (165.6 KiB) Viewed 90 times
On the right, this is how it is visible in the game. In the middle, this is only the loader (the wire connection is on the inserter so when the inserter is removed, the wire goes away as well). On the left is the inserter only.

When I disable the 'structure' in the loader (so that it only uses the belt graphics), this is what I see:
Screenshot 2026-06-19 at 15.11.15.png
Screenshot 2026-06-19 at 15.11.15.png (176.97 KiB) Viewed 90 times
On the left is again only the inserter with the wire connection, in the middle only the loader (which only shows the belt graphics). On the right is how the entity is visible. Note that the loader seems to be drawn "over" the inserter. Where the structure from the loader is missing, the inserter is vislble, but the belt is "above" the inserter.

My assumption was that the entities would be "stacked" by render layer:

- lowest is "transport belt" (if I look at https://lua-api.factorio.com/latest/typ ... Layer.html and assume the order here is "bottom to top"), then "transport-belt" comes first.
- then the structure. The loader prototype offers "structure_render_layer" to control this
- the inserter, which should be rendered at "object" layer.
- finally the circuit connectors

but this is where it seems to go wrong. I have not managed to 'stack' the inserter and the structure correctly and the inserter gets drawn "under" the belt, which should not happen as 'transport-belt' is below 'object'.

Also, the mask that the loader applies to overlay the belt of anything "below" seems to hardcoded in the game / not visible to the modding API.

and to make this even more interesting/funny is that when I enable shadows for the circuit connectors, those get rendered correctly, but not the connectors themselves:
Screenshot 2026-06-19 at 15.28.13.png
Screenshot 2026-06-19 at 15.28.13.png (185.62 KiB) Viewed 90 times
At this point I have run out of ideas on how to solve this. Grateful for any tips.