I feel like I (and others) posted about this before but can't locate it.
When an entity has a layered structure, the layers seem (in most cases) to get drawn in this order, from the "bottom" up:
- Terrain / tiles
- Belts or belt-like things
- Shadows (draw_as_shadow = true)
- Everything else, from left to right and then top to bottom
The problem is with undergrounds and loaders, for any sprite structure defined in the direction_in and direction_out components. These seem to be drawn over the shadows but under everything else, as if they were higher priority than shadows and belts but lower priority than most other entities. This means that ugly shenanigans occur when underneathies and loaders are positioned immediately to the south of any entity which goes outside of tile bounds:
You can see it here with furnace entities:
And with other vanilla entities that go outside tile boundaries too, like refineries:
Another oddity / inconsistency between loaders and underneathies. With underneathies, non-belt sprite structure is drawn behind belts in front of it, as it should be. With loaders, though, the sprite structure is drawn on top of belts in front of it ...
Best case: could we have some control over where sprite structure is rendered? A "render order" parameter?
Failing that, could the direction_in and direction_out components of both underneathies and loaders be adjusted within the base game data, so that they are not drawn with the same priority as the flat belt part but with the same priority as other tall structures? Could loaders also be tweaked so that they are drawn in exactly the same way as underneathies?