LuaRenderObject render layer depth

Place to ask discuss and request the modding support of Factorio. Don't request mods here.
jurgy
Inserter
Inserter
Posts: 36
Joined: Wed Feb 27, 2019 5:55 pm
Contact:

LuaRenderObject render layer depth

Post by jurgy »

When two entities with the same render layer are drawn, their y-coordinate determines which is drawn on top: Lower y is drawn over higher y.

With multiple modding projects I've encountered the limitation that you can't recreate this behavior in LuaRenderObjects. Render objects that are created later are always drawn on top of those that are rendered earlier. And render objects are always drawn on top of entities within the same layer.

The main reason I want this is that with rendered animations you have more control in when to start and stop the animation than with animations that are tied to the fixed purposes the entities are meant to.

I hope it's possible to implement this since it can lead to a lot more custom animation scripting.

I'll end this post with two examples of projects where I encounter this problem:
1) Animated trains
11-28-2025, 23-09-23.png
11-28-2025, 23-09-23.png (542.54 KiB) Viewed 147 times
I'm drawing animations on top of train entities, but as you can see, the tree in front of the train is drawn under the animation.

2) Assembler where the animation is tied to an event
11-28-2025, 23-12-17.png
11-28-2025, 23-12-17.png (1.23 MiB) Viewed 147 times
I've created this wharf that receives fish from boats. When a boat arrives I want to loop the animation just once. Doing that precisely by scripting the insertion of intermediate items in the input slots and setting crafting duration to exactly match one animation loop ended up being very brittle and often led to off-by-one (frame) errors that are impossible to correct for.
Handling this with LuaRenderObjects was far easier, but again, the entities are bellow the render object.
jurgy
Inserter
Inserter
Posts: 36
Joined: Wed Feb 27, 2019 5:55 pm
Contact:

Re: LuaRenderObject render layer depth

Post by jurgy »

As an addendum, I have made two other requests regarding the things we can do with animations:
1. Pausing/changing the speed of animations without jumping the frames
2. Exposing the animation prototype data in the runtime prototypes object

I'd be really happy if someone took the time to implement one or multiple of these requests!
Post Reply

Return to “Modding interface requests”