[1.1.34] Modding: graphics errors with layered recipe icons.

Bugs that are actually features.
everything-narrative
Burner Inserter
Burner Inserter
Posts: 13
Joined: Fri Aug 16, 2019 5:31 pm
Contact:

[1.1.34] Modding: graphics errors with layered recipe icons.

Post by everything-narrative »

Description
The bug manifests as a strange rendering of recipe icon generated using the

Code: Select all

icons
property for layered icons.

First, when rendering on an assembler in alt-mode, the top layer isn't properly shadowed:
crush-brick-icon-error.png
crush-brick-icon-error.png (119.12 KiB) Viewed 2213 times
Second, when rendering in the crafting menu, the icon spills out of bounds:
crush-brick-icon-error-2.png
crush-brick-icon-error-2.png (180.02 KiB) Viewed 2213 times
How to replicate
A mod with the following `data.lua` file was used to generate this error

Code: Select all

data:extend{
  {
    type='recipe',
    name='crush-brick',
    enabled='true',
    ingredients = { { 'stone-brick', 1 } },
    result = 'stone',
    energy_required = 0.5,
    category = 'advanced-crafting',
    icon_size = 64,
    icon_mipmaps = 4,
    icons = {
      {
        icon = '__base__/graphics/icons/stone-brick.png',
        icon_size = 64,
        icon_mipmaps = 4,
        scale = 0.3,
        shift = {-7, -7},
      },
      {
        icon = '__base__/graphics/icons/stone.png',
        icon_size = 64,
        icon_mipmaps = 4,
        scale = 0.3,
        shift = {7, 7},
      },
    },
  }
}
Expected behavior
The alt-mode recipe graphic should be properly outlined in shadow to maximize legibility.

Additionally, the recipe icon should at the very least be clipped to fit within the recipe "button."
Further complaints
The documentation for the `Types/IconData` is ambiguous on the exact behavior of the `scale` and `shift` properties.
Attachments
crush-brick-icon-error.log
(7.56 KiB) Downloaded 97 times
posila
Factorio Staff
Factorio Staff
Posts: 5406
Joined: Thu Jun 11, 2015 1:35 pm
Contact:

Re: [1.1.34] Modding: graphics errors with layered recipe icons.

Post by posila »

Thanks for the report.
None of this is a bug. Icon layers are borderline unusable except for the case in vanilla for which they were added (barrel recipes) but that's not a bug.

viewtopic.php?p=434010#p434010

I am considering redesigning icon layer definitions for the expansion, though.
everything-narrative
Burner Inserter
Burner Inserter
Posts: 13
Joined: Fri Aug 16, 2019 5:31 pm
Contact:

Re: [1.1.34] Modding: graphics errors with layered recipe icons.

Post by everything-narrative »

posila wrote: Sun Jun 06, 2021 7:07 pm Thanks for the report.
None of this is a bug. Icon layers are borderline unusable except for the case in vanilla for which they were added (barrel recipes) but that's not a bug.

viewtopic.php?p=434010#p434010

I am considering redesigning icon layer definitions for the expansion, though.
Could this note be added to the documentation?
Icon layering was designed for barrel recipes, and are not feature-rich enough to create general icon graphics. It is recommended to use image editing software for the creation of new icons.
User avatar
Stringweasel
Filter Inserter
Filter Inserter
Posts: 419
Joined: Thu Apr 27, 2017 8:22 pm
Contact:

Re: [1.1.34] Modding: graphics errors with layered recipe icons.

Post by Stringweasel »

Another limitation seems to be when layers icons need to fade. I saw two cases:
  • Alerts flashing
  • The "filtered" slots in an assembler that's faded.
Each layer is faded individually, meaning where they overlap is a brighter spot. Looks kinda odd.

Image

I just took a few hours to untangle my 8 icons into a modular and easy-to-use system. Guess I need to change it back :roll: :mrgreen:
Alt-F4 Author | Factorio Modder
My Mods: Hall of Fame | Better Victory Screen | Fluidic Power | Biter Power | Space Spidertron | Spidertron Dock | Weasel's Demolition Derby
Official Contributor to Space Exploration
Post Reply

Return to “Not a bug”