[16.2] Circuit connectors drawn under entity sprite when modding

This subforum contains all the issues which we already resolved.
Post Reply
Atria
Long Handed Inserter
Long Handed Inserter
Posts: 57
Joined: Sat Jul 09, 2016 10:25 am
Contact:

[16.2] Circuit connectors drawn under entity sprite when modding

Post by Atria »

I'm working on next relase of my mod and I've ran into a problem with sprite layers. I'm creating entity sprite as a lot of sprites in one layer. That is working great but problem is with circuit connectors.

Circuit connectors are drawn beneath entity sprite. See image 1. Not even entire circuit connector is drawn like that, led is shown.
If I don't add middle part of entity sprite (see image 2) the connector is shown, so it's definetly being drawn.

I tried to change entity sprite priorities, it seems to do nothing and result is always the same.

I'm attaching entire mod and save where I was testing it. In prototypes/entity.lua is line with HACK comment for hiding middle part of the chest.
Attachments
image with middle part of chest
image with middle part of chest
1.png (185.53 KiB) Viewed 4184 times
image without middle
image without middle
2.png (147.26 KiB) Viewed 4184 times
WideChests_1.9.3.zip
mod
(222.51 KiB) Downloaded 136 times
merging.zip
save
(1.27 MiB) Downloaded 140 times

Atria
Long Handed Inserter
Long Handed Inserter
Posts: 57
Joined: Sat Jul 09, 2016 10:25 am
Contact:

Re: [16.2] Circuit connectors drawn under entity sprite when modding

Post by Atria »

To clarify: It works if using single sprite as picture. Not working when using

Code: Select all

picture = { layer = { ...list of single picture sprites... } }

posila
Factorio Staff
Factorio Staff
Posts: 5201
Joined: Thu Jun 11, 2015 1:35 pm
Contact:

Re: [16.2] Circuit connectors drawn under entity sprite when modding

Post by posila »

Thanks for the report.
The connector will render as 10th layer in 0.16.5

Atria
Long Handed Inserter
Long Handed Inserter
Posts: 57
Joined: Sat Jul 09, 2016 10:25 am
Contact:

Re: [16.2] Circuit connectors drawn under entity sprite when modding

Post by Atria »

posila wrote:The connector will render as 10th layer in 0.16.5
This only moves the problem. If entity has more than 10 layers and 10th layer is at place of circuit connector it's still hidden. See image 1.

Or is there a way to put multiple sprites into one layer? Now i have:

Code: Select all

picture = {
    layers = {
        {
            filename = ...
            priority = ...
        },
        {
            filename = ...
            priority = ...
        },
        ...a lot of other individual sprites...
    }
}

I also just found another circuit connector sprite wierd behaviour. If I place normal steel chests below my entity at some point the circuit connector is drawn (see image 2). And when I pick those steel chests up the connector is not drawn again. The worst thing is that placing and picking up chests shows/hides the circuit connector randomly. Attaching new mod version and new save file.
Attachments
10th sprite is hiding circuit connector
10th sprite is hiding circuit connector
1.png (619.65 KiB) Viewed 4036 times
circuit connector visible if steel chest is below it
circuit connector visible if steel chest is below it
2.png (738.18 KiB) Viewed 4036 times
merging.zip
new save
(1.96 MiB) Downloaded 112 times
WideChests_1.9.3.zip
new mod version
(24.88 KiB) Downloaded 124 times

Atria
Long Handed Inserter
Long Handed Inserter
Posts: 57
Joined: Sat Jul 09, 2016 10:25 am
Contact:

Re: [16.2] Circuit connectors drawn under entity sprite when modding

Post by Atria »

It didn't occur to me that I can place those trouble making sprites in first 10 layers, so my problem is fixed but maybe that wierd glitch when placing entities near problematic entity is worthy of new bug report.

posila
Factorio Staff
Factorio Staff
Posts: 5201
Joined: Thu Jun 11, 2015 1:35 pm
Contact:

Re: [16.2] Circuit connectors drawn under entity sprite when modding

Post by posila »

I forgot to respond yesterday, I am sorry.
Yes, you can define layers that are supposed to be under the connector first.

I have mixed feeling about this - composing graphics from repeating smaller parts is great for not increasing already high VRAM requirements; but drawing lot of layers is not great for performance either.

As for connector being visible or not depending on entities around - it's just undefined order in which sprites with the same layer will draw.

Atria
Long Handed Inserter
Long Handed Inserter
Posts: 57
Joined: Sat Jul 09, 2016 10:25 am
Contact:

Re: [16.2] Circuit connectors drawn under entity sprite when modding

Post by Atria »

posila wrote:I have mixed feeling about this - composing graphics from repeating smaller parts is great for not increasing already high VRAM requirements; but drawing lot of layers is not great for performance either.
Well if it's under insane numbers it will probably be fine. I wirtten on mod portal that tha game probably wouldn't like entities 1000 tiles long. I will add that it can have effect on game performance when massive chest is placed down.
posila wrote:As for connector being visible or not depending on entities around - it's just undefined order in which sprites with the same layer will draw.
I don't need an answers, just wanting to be sure it really is not a bug:
Shouldn't then be random if connector is visible or not (exactly 50:50) since there is 2 sprites in 10th layer (connector and small entity sprite) and when it comes to draw 10th layer the game can pick them in random order? And shouldn't this happen to both of bottom chests in that screenshot (cause it didn't)?

Post Reply

Return to “Resolved Problems and Bugs”