Page 1 of 1

[1.1.81] Icon dump fails for some icons

Posted: Mon May 01, 2023 4:07 pm
by ilbJanissary
1. Attempting to use the --dump-icon-sprites command with the mod "Space Exploration" (space-exploration) and its required dependencies, to get icons from this mod for use in FactorioLab.
2. Several icons are output as blank png images. This includes many icons in the "item", "recipe", and "technology" folders, such as "item/se-capsule-behemoth-biter.png", "recipe/electronic-circuit.png", and "technology/se-space-simulation-ab.png"
3. The icons for these items / recipes / technologies appear to be OK in the data set, and appear OK inside the actual game, so I would expect the icons output by the --dump-icon-sprites command to match.
4. As far as I can tell, this always occurs for the icons in question, but does not occur for other mods I have tested including 248K, Pyanodons, and some others.
5. To reproduce, install and enable space-exploration, and run factorio.exe --dump-icon-sprites, then check the output.

I will attempt to determine what is unique about these icons and add more information, but at a glance they seem to be fairly normal icons. The other tool I use to dump data, the mod factoriolab-export, is able to dump these icons from within a running game without any trouble.

Re: [1.1.81] Icon dump fails for some icons

Posted: Mon May 01, 2023 4:15 pm
by ilbJanissary
Upon further investigation, it seems that what the failing icons have in common is that the first icon in the icons table contains a "shift" field.

EDIT: Moving on to other data sets, I also see this in some other mods, yet again where the first icon contains a shift field, e.g. "gas-compressed-air" from "angelsrefining".

Re: [1.1.81] Icon dump fails for some icons

Posted: Tue May 02, 2023 5:50 pm
by lyvgbfh
Are these perhaps icons where shift takes the contents partially or wholly outside of the canvas? I know with some values you can have techs drawing outside of their "box" in the tech tree, for example.

Re: [1.1.81] Icon dump fails for some icons

Posted: Tue May 02, 2023 7:35 pm
by ilbJanissary
Probably; that is not all that uncommon in modded data sets.
An example of the data from the SE small biter capsule, which fails:

Code: Select all

      "icons": 
      [
        {
          "icon": "__space-exploration-graphics__/graphics/icons/vatling.png",
          "icon_size": 64,
          "shift": 
          [
            -8,
            0
          ]
        },
        
        {
          "icon": "__base__/graphics/icons/small-biter.png",
          "icon_size": 64,
          "shift": 
          [
            2,
            0
          ]
        }
      ],

Re: [1.1.81] Icon dump fails for some icons

Posted: Tue May 02, 2023 8:26 pm
by Rseding91
Thanks for the report. This is now fixed for the next release.

Re: [1.1.81] Icon dump fails for some icons

Posted: Tue May 02, 2023 11:53 pm
by ilbJanissary
You're amazing, thank you.
This was the only real blocking issue preventing me from finishing the new mod data scripts for FactorioLab. I've already run it for all the supported data sets and everything seems good, except for these few missing icons.