Odd warnings in log about icon scales?

Place to get help with not working mods / modding interface.
User avatar
Deadlock989
Smart Inserter
Smart Inserter
Posts: 2529
Joined: Fri Nov 06, 2015 7:41 pm

Odd warnings in log about icon scales?

Post by Deadlock989 »

I feel like this kind of thing has come up before but can't put my finger on it ... This has started appearing since 1.1.0.

Code: Select all

   6.208 Warning AtlasSystem.cpp:155: Image "__base__/graphics/icons/accumulator.png" was used for an icon multiple times with different scale. Icon background might not be consistent with other icons.
   6.208 Warning AtlasSystem.cpp:155: Image "__IndustrialRevolution__/graphics/icons/64/empty-barrel.png" was used for an icon multiple times with different scale. Icon background might not be consistent with other icons.
   6.208 Warning AtlasSystem.cpp:155: Image "__IndustrialRevolution__/graphics/icons/64/empty-barrel.png" was used for an icon multiple times with different scale. Icon background might not be consistent with other icons.
   6.208 Warning AtlasSystem.cpp:155: Image "__IndustrialRevolution__/graphics/icons/64/empty-barrel.png" was used for an icon multiple times with different scale. Icon background might not be consistent with other icons.
   6.208 Warning AtlasSystem.cpp:155: Image "__IndustrialRevolution__/graphics/icons/64/empty-barrel.png" was used for an icon multiple times with different scale. Icon background might not be consistent with other icons.
   6.208 Warning AtlasSystem.cpp:155: Image "__IndustrialRevolution__/graphics/icons/64/empty-barrel.png" was used for an icon multiple times with different scale. Icon background might not be consistent with other icons.
   6.208 Warning AtlasSystem.cpp:155: Image "__IndustrialRevolution__/graphics/icons/64/empty-barrel.png" was used for an icon multiple times with different scale. Icon background might not be consistent with other icons.
   6.208 Warning AtlasSystem.cpp:155: Image "__IndustrialRevolution__/graphics/icons/64/empty-barrel.png" was used for an icon multiple times with different scale. Icon background might not be consistent with other icons.
   6.208 Warning AtlasSystem.cpp:155: Image "__IndustrialRevolution__/graphics/icons/64/empty-barrel.png" was used for an icon multiple times with different scale. Icon background might not be consistent with other icons.
The above is appearing in my log. "empty-barrel.png" is my replacement for the empty barrel item and is also the bottom layer of filled barrels. The filled barrel item prototypes comes out like this, I don't feel like there's anything amiss:

Code: Select all

{
  icons = {
    {
      icon = "__IndustrialRevolution__/graphics/icons/64/empty-barrel.png",
      icon_mipmaps = 4,
      icon_size = 64
    },
    {
      icon = "__IndustrialRevolution__/graphics/icons/64/barrel-mask.png",
      icon_mipmaps = 4,
      icon_size = 64,
      tint = {
        a = 1,
        b = 1,
        g = 0.66250000000000018,
        r = 0.25
      }
    }
  },
  localised_name = {
    "item-name.filled-barrel",
    {
      "fluid-name.water"
    }
  },
  name = "water-barrel",
  order = "b[water-barrel]",
  stack_size = 10,
  subgroup = "barrel",
  type = "item"
}
What's really odd though is the same warning appearing for the base mod's accumulator.png. I don't touch the accumulator item (I've triple checked). I do touch the entity but I don't change its icon. Yet if I remove my mod (and all the barrel changes), the warning about the accumulator icon goes away. I also checked by removing every other mod except mine.

The only thing that accumulators and empty barrels have in common is in both cases, the icon file is used for multiple items, one of which has a single icon definition and the other(s) use layered icons. In the accumulator's case it's used for the default Electric Energy Interface item as well, but with the single icon in an icons definition. Scale isn't set explicitly in any of the definitions though so I'm not sure why the warning about different scales. I know that there are various shenanigans involving scale and layers but in all cases these icons are 64x64 with 4 mipmap levels and those properties are set explicitly by both my mod and the base mod - scale is never set.

If I comment out my barrel changes then I still get the accumulator.png warning. Yet I'm 100% certain that I don't go anywhere near either the accumulator or the EEI item.

So, uh. Um?
Last edited by Deadlock989 on Wed Nov 25, 2020 8:21 pm, edited 1 time in total.
User avatar
Deadlock989
Smart Inserter
Smart Inserter
Posts: 2529
Joined: Fri Nov 06, 2015 7:41 pm

Re: Odd warnings in log about icon scales?

Post by Deadlock989 »

Further investigations:

If I don't replace the non-layered empty barrel then I don't get any warnings about the filled barrels with multiple icon layers. But I do still get the accumulator icon warning.

A dump of the empty barrel item before I change it:

Code: Select all

{
  icon = "__base__/graphics/icons/fluid/barreling/empty-barrel.png",
  icon_mipmaps = 4,
  icon_size = 64,
  name = "empty-barrel",
  order = "i",
  stack_size = 10,
  subgroup = "intermediate-product",
  type = "item"
}
And after:

Code: Select all

{
  icon = "__IndustrialRevolution__/graphics/icons/64/empty-barrel.png",
  icon_mipmaps = 4,
  icon_size = 64,
  name = "empty-barrel",
  order = "i",
  stack_size = 10,
  subgroup = "intermediate-product",
  type = "item"
}
Bilka
Factorio Staff
Factorio Staff
Posts: 3433
Joined: Sat Aug 13, 2016 9:20 am
Contact:

Re: Odd warnings in log about icon scales?

Post by Bilka »

The empty barrel is used by base data-updates to generate the filled barrel items. Maybe something ends up wrong for those when combined with your own full barrel generation code.
I'm an admin over at https://wiki.factorio.com. Feel free to contact me if there's anything wrong (or right) with it.
User avatar
Deadlock989
Smart Inserter
Smart Inserter
Posts: 2529
Joined: Fri Nov 06, 2015 7:41 pm

Re: Odd warnings in log about icon scales?

Post by Deadlock989 »

Bilka wrote: Wed Nov 25, 2020 8:22 pm The empty barrel is used by base data-updates to generate the filled barrel items. Maybe something ends up wrong for those.
There's a dump of one of them in the first post above. I can't see anything amiss ... I'm overwriting them all in data-updates, after base mod's data-updates.

And it doesn't explain the weirdness of the accumulator. Is it just a coincidence that the accumulator is the very first entry in data.raw?
Bilka
Factorio Staff
Factorio Staff
Posts: 3433
Joined: Sat Aug 13, 2016 9:20 am
Contact:

Re: Odd warnings in log about icon scales?

Post by Bilka »

The only thing that is different there compared to vanilla is that you dont set the icon size + mipmap outside of icons (directly in the prototype). The icon size set there might affect the size/game-perceived scale of the lowest layer, though I'm pretty sure you know those mechanics better than me.

Accumulator is only the first entry in data.raw dumps because serpent.block sorts alphabetically by default. It's somewhere else in some irrelevant position in the "real" data.raw.
I'm an admin over at https://wiki.factorio.com. Feel free to contact me if there's anything wrong (or right) with it.
User avatar
Deadlock989
Smart Inserter
Smart Inserter
Posts: 2529
Joined: Fri Nov 06, 2015 7:41 pm

Re: Odd warnings in log about icon scales?

Post by Deadlock989 »

Tried setting size and mipmaps on the root and not in the icons table for the filled barrel items. So size and mipmaps were set outside for both the multiple icons filled barrels and the single icon empty barrel. Still got the warnings.

I then changed the empty barrel so that it also uses icons (just one table in the icons table), with size and mipmaps set outside, same on the filled barrels. All of the barrel warnings went away.

But the accumulator warning stayed. The accumulator is like the barrels, then, in that it is set in icon on one item and in icons in another. But when my mod isn't installed, there is no warning. But I'm 100% certain I don't touch the accumulator or EEI item icon definitions.

I think I'll watch Great British Bake Off for a bit.
User avatar
Deadlock989
Smart Inserter
Smart Inserter
Posts: 2529
Joined: Fri Nov 06, 2015 7:41 pm

Re: Odd warnings in log about icon scales?

Post by Deadlock989 »

Bilka wrote: Wed Nov 25, 2020 8:28 pm The only thing that is different there compared to vanilla is that you dont set the icon size + mipmap outside of icons (directly in the prototype). The icon size set there might affect the size/game-perceived scale of the lowest layer, though I'm pretty sure you know those mechanics better than me.
From what I understood previously, internally the game engine still thinks icons are size 32. Technically the new "default" of 64 + mipmaps is scale 2. However the base layer of every icons specification defines a visual scale of 1 for itself and everything that follows. So if none of your icons have scale (a single icon can't, and every IconData inside icons should default to the same scale if no scale is specified) then it's all legit.

So I'm just going to ignore these warnings. As far as I can tell, these are all perfectly legal icon declarations - I'm using icon_size and icon_mipmaps inside every IconData entry in icons as required (specifyiing them in the root is "Mandatory if icon_size is not specified inside all instances of Types/IconData inside icons", my emphasis). It seems like the warning is overly sensitive to this if and only if there is also some other item that uses the same sprite in a standalone IconSpecification instead of a table of IconData. This is the case in vanilla for the accumulator icon. The only thing I can't explain is why the accumulator doesn't get warned about when there are no mods installed (I've quadruple checked and my code doesn't touch the accumulator or EEI items).
posila
Former Staff
Former Staff
Posts: 5448
Joined: Thu Jun 11, 2015 1:35 pm
Contact:

Re: Odd warnings in log about icon scales?

Post by posila »

I might just remove the warning as nobody complained about issue it is trying to warn about yet.
User avatar
Deadlock989
Smart Inserter
Smart Inserter
Posts: 2529
Joined: Fri Nov 06, 2015 7:41 pm

Re: Odd warnings in log about icon scales?

Post by Deadlock989 »

posila wrote: Thu Nov 26, 2020 1:34 pm I might just remove the warning as nobody complained about issue it is trying to warn about yet.
If you'll allow a slight hedging towards thinking about maybe actually complaining, if that helps tip you over ... I don't understand what the warning is warning about, what it is I'm doing wrong if anything. The warning is about different scales - I don't set any scales. It may be that there is some underlying representation of scale that is different between a single IconSpecification and a table of IconData but that's not my fault. The warning says backgrounds might look different - they don't look different. I feel like I'm following the letter of the specifications.
posila
Former Staff
Former Staff
Posts: 5448
Joined: Thu Jun 11, 2015 1:35 pm
Contact:

Re: Odd warnings in log about icon scales?

Post by posila »

Icon scale is usually inferred from icon_size and internally expected icon size, if not defined explicitly. But internally expected size is 32, except for achievement, item group and technology prototype, neither of which use icon background, so those should not trip the warning.

It is also possible that you used the sprites in sprite definitions somewhere with flag "icon" or "gui-icon" and generate_sdf = true and scale that is inconsistent with the inferred icon scale

What is it trying to warn about is following (there are 4 assembling machines on the image):
inconsisten_scale1.jpg
inconsisten_scale1.jpg (201.6 KiB) Viewed 1495 times
On bottom row, different icons are used with different scale, but their absolute outline width is the same, while on top row single icon is used with different scales and ends up with inconsistent outline width.

The top row might look like it is more correct, except I am lazy and the problem is usually inverse. Someone uses huge sprite as an icon and the game scales it down to match size of other icons. If outline would scale down too, the inconsistency would be immediatelly apparent.
User avatar
Deadlock989
Smart Inserter
Smart Inserter
Posts: 2529
Joined: Fri Nov 06, 2015 7:41 pm

Re: Odd warnings in log about icon scales?

Post by Deadlock989 »

posila wrote: Thu Nov 26, 2020 2:34 pm It is also possible that you used the sprites in sprite definitions somewhere with flag "icon" or "gui-icon" and generate_sdf = true and scale that is inconsistent with the inferred icon scale
Checked but no. Just for the empty barrel item icon and as the bottom layer in filled barrels. No flags are set in any of those prototypes. The resource itself (empty-barrel.png) is not being used in any sprites. Also I'm not going anywhere near accumulator icons.

I didn't realise the warning was about the in-world alt info item outline at all - where it says "icon background" I assumed it was talking about the glow/fuzz inside item slots or even the bottom layer of the icon definition itself. In fact I tone the alt-info outline right down with the item_outline_radius utility constant anyway.
posila
Former Staff
Former Staff
Posts: 5448
Joined: Thu Jun 11, 2015 1:35 pm
Contact:

Re: Odd warnings in log about icon scales?

Post by posila »

Deadlock989 wrote: Thu Nov 26, 2020 2:44 pmwhere it says "icon background" I assumed it was talking about the glow/fuzz inside item slots or even the bottom layer of the icon definition itself
Actually, it's about the glow/fuzz/drop shadow too.
Post Reply

Return to “Modding help”