Allow setting render layer or secondary draw order for transport belt endings

Place to ask discuss and request the modding support of Factorio. Don't request mods here.
Post Reply
User avatar
Smart Inserter
Smart Inserter
Posts: 2393
Joined: Fri Nov 06, 2015 7:41 pm

Allow setting render layer or secondary draw order for transport belt endings

Post by Deadlock989 »

Currently transport belts are hardcoded to use render layer "transport-belt-endings" for just the end segments of belts, while start and middle segments all use "transport-belt" which is lower in the render order. I am guessing this is so that endings work around the usual top-to-bottom then left-to-right draw order that entities on the same render layer would usually have, so that side-loading belts look right. (It means that by default rows 14, 16, 18 and 20 in the belt sprite sheet are treated differently which took a while to figure out.)

I have a use case where I would like to swap those orders so that endings are sometimes under everything else:

belts1.jpg (391.99 KiB) Viewed 284 times

You can see that there is a visual glitch in the top row of parallel belts when the belt ends earlier then the belt below. Because the belt ending is on a higher render layer, it is also drawn above any belts in the tile below if the entity's sprite intrudes into that tile (and since belts went pseudo-3D and break tile boundaries that is much harder to avoid).

How does vanilla solve this? It doesn't, it has the same problem - it's just that the belt geometry isn't as wide and the colours aren't as contrasting so you have to zoom in very close to spot it:

belt.gif (347.59 KiB) Viewed 284 times

For the dark belt design above, it would probably look better if endings were always below the body instead of always above - except that it would break the case where you are sideloading from the south, which would look wrong.

So I am wondering if there is any easy way to fix this. My understanding of secondary draw orders (e.g. as used in pipe connections) is that they are tweaks to the render layer after the north-south-east-west order is applied. Is there any way of exposing per-direction control of secondary draw orders for different belt segments? Would it even help?
"If Stalin had a good writeup on programming, would linking that be dangerous?"

Post Reply

Return to “Modding interface requests”