[16.2] Circuit connectors drawn under entity sprite when modding

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

[16.2] Circuit connectors drawn under entity sprite when modding

Post by Atria » Sat Dec 16, 2017 11:37 am

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
1.png
image with middle part of chest
1.png (185.53 KiB) Viewed 1247 times
2.png
image without middle
2.png (147.26 KiB) Viewed 1247 times
WideChests_1.9.3.zip
mod
(222.51 KiB) Downloaded 28 times
merging.zip
save
(1.27 MiB) Downloaded 26 times

Atria
Inserter
Inserter
Posts: 49
Joined: Sat Jul 09, 2016 10:25 am
Contact:

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

Post by Atria » Sat Dec 16, 2017 2:41 pm

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: 3996
Joined: Thu Jun 11, 2015 1:35 pm
Contact:

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

Post by posila » Sat Dec 16, 2017 9:00 pm

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

Atria
Inserter
Inserter
Posts: 49
Joined: Sat Jul 09, 2016 10:25 am
Contact:

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

Post by Atria » Mon Dec 18, 2017 8:52 am

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
1.png
10th sprite is hiding circuit connector
1.png (619.65 KiB) Viewed 1099 times
2.png
circuit connector visible if steel chest is below it
2.png (738.18 KiB) Viewed 1099 times
merging.zip
new save
(1.96 MiB) Downloaded 21 times
WideChests_1.9.3.zip
new mod version
(24.88 KiB) Downloaded 25 times

Atria
Inserter
Inserter
Posts: 49
Joined: Sat Jul 09, 2016 10:25 am
Contact:

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

Post by Atria » Tue Dec 19, 2017 11:30 am

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: 3996
Joined: Thu Jun 11, 2015 1:35 pm
Contact:

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

Post by posila » Tue Dec 19, 2017 11:49 am

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
Inserter
Inserter
Posts: 49
Joined: Sat Jul 09, 2016 10:25 am
Contact:

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

Post by Atria » Tue Dec 19, 2017 1:22 pm

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”

Who is online

Users browsing this forum: LeonSkills