[posila] [0.17.25] Alt-info layered icon scaling issues

We are aware of them, but they have low priority. We have more important things to do. They go here in order not to take space in the main bug thread list.
User avatar
Deadlock989
Smart Inserter
Smart Inserter
Posts: 2528
Joined: Fri Nov 06, 2015 7:41 pm

[posila] [0.17.25] Alt-info layered icon scaling issues

Post by Deadlock989 »

Possibly related to this similar issue with technology tree icons:

viewtopic.php?f=7&t=67210

And maybe a regression back to these days:

viewtopic.php?f=11&t=54373&p=319783&hil ... on#p319783

Having great issues using 64x64 layered icons where the layers have different scales. To get them looking right, the base layer[1] has to have scale 1 - that has been the case for some time. But I don't know if this is a change with 0.17 or something older, but such icons will not look right when they are rendered as alt-info icons on assembling machines etc.:

Image

Layered icons which only use 32x32 are not affected (e.g. barrelling). Single layer (icon, not icons[]) icons are also fine at 64x64. It's only when there are layers and when any of the layers have scale < 1.

The code within the recipe prototype that produces this kind of result:

Code: Select all

  icon_size = 64,
  icons = {
    {
      icon = "__DeadlockIndustry__/graphics/icons/misc/blank-64.png",
      icon_size = 64,
      scale = 1
    },
    {
      icon = "__DeadlockIndustry__/graphics/icons/rendered/gold-gravel-64.png",
      icon_size = 64,
      scale = 0.5,
      shift = {
        8,
        8
      }
    },
    {
      icon = "__DeadlockIndustry__/graphics/icons/rendered/dirty-water-64.png",
      icon_size = 64,
      scale = 0.5,
      shift = {
        -8,
        -8
      }
    },
    {
      icon = "__DeadlockIndustry__/graphics/icons/rendered/copper-chunk-64.png",
      icon_size = 64,
      scale = 1,
      shift = {
        0,
        0
      }
    }
  },
  
Image

tehfreek
Filter Inserter
Filter Inserter
Posts: 391
Joined: Thu Mar 17, 2016 7:34 am
Contact:

Re: [0.17.25] Alt-info layered icon scaling issues

Post by tehfreek »


User avatar
Deadlock989
Smart Inserter
Smart Inserter
Posts: 2528
Joined: Fri Nov 06, 2015 7:41 pm

Re: [0.17.25] Alt-info layered icon scaling issues

Post by Deadlock989 »

I found / remembered the workaround for this - it's not pretty.

To make layered icons with a variety of non-32x32 sizes and scales work correctly, you have to put a completely blank 32x32 icon layer first (i.e. the bottom layer). Then, multiply the desired scales of any other layers by (32/iconsize). For example if you have a 64x64 icon on a middle layer which you want to be half the size, you actually set its scale to 0.25 (0.5 * (32/64)) - if you want it full size, you actually halve it. The icons then appear correctly in all the game menus I can find and also as alt-info icons on assemblers etc.

Meanwhile shift values always seem to refer to the equivalent in 32x32 pixels no matter what the size of the icon, so if you want a 64x64 icon shifted by 4 of its pixels, you actually shift by 2.

It seems like there is still some assumption in the code somewhere that icons are 32x32 despite being able to specify they're not. Hopefully will be made more logical during the GUI refresh?

Cheers.
Image

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

Re: [posila] [0.17.25] Alt-info layered icon scaling issues

Post by posila »

Which mod is that? I thought it's your Deadlock's Industrial Revolution, but I can't find anywhere to download it.

User avatar
Deadlock989
Smart Inserter
Smart Inserter
Posts: 2528
Joined: Fri Nov 06, 2015 7:41 pm

Re: [posila] [0.17.25] Alt-info layered icon scaling issues

Post by Deadlock989 »

posila wrote:
Wed May 15, 2019 9:40 am
Which mod is that? I thought it's your Deadlock's Industrial Revolution, but I can't find anywhere to download it.
It's not finished and not available yet.

I would move this to pending maybe. I have worked around the problems for the time being. Part of the problem is having to work with both 32x32 and 64x64 icons at the same time, which causes a lot of confusion (I have been making all my icons at 3 different resolutions so it's ready for the future GUI update, but when a recipe is combined with a vanilla item, I'm currently forced to mix in a 32x32 icon as well). After the high res icons drop I will test it out again and see if the same sorts of issues crop up.

More pressing is this one, it can't be worked around: viewtopic.php?f=182&t=67210
Image

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

Re: [posila] [0.17.25] Alt-info layered icon scaling issues

Post by posila »

So I have fixed 67210 which also fixes 67458, and it makes sense of the issue you reported, but it might break your icon definitions (I hope it doesn't, though)

It is true the game has some internal "expected icon size" values for different kinds of icons, and if you don't define scale, the game will calculate it so that the icon is scaled to the expected size.
If you do define the scale the game assumes you know what you are doing and lets you do whatever, but when rendering icons in GUI, it rescales them to fit the slot. The issue 67210 is that the shift is not scaled with icon, only with UI scale when drawing the icon to GUI. Which means you must have defined shift prescaled for the GUI slot, instead of in coordinate space of your 64x64 icon. When the icon was rendered in-game, it was not scaled down to fit the slot and shifting were too small.

After the fix, you'll have to define shifts based on your icon_size not based on 32x32 slot size, so the behavior will be more reasonable (and alt-mode won't be inconsistent with the GUI).

However, there is still problem that you need to know what the game considers to be "expected size" of icons, so that your icons have consistent scale with vanilla ones in alt-mode. Solution that comes to my mind would be to add relative_scale. If scale was not set, the game would calculate it and multiply it with relative scale. That way you don't need to know that "expected size" is 32, so you should set scale for your 64 icon to 0.5 in order for it to have consistent size in alt-mode; and you wouldn't need blank bottom layer (even though this might be little bit tricky for the scale-to-fit in GUI). I am still trying to think how shift should be defined with relative_scale, though.

EDIT: I think the shift should be relative to of the original icon size (as it is now). I played with an idea of "relative_offset" which would be from range of -1 to 1, where 0 would be center of the icon, -1 left/top edge, 1 right/bottom edge; but it should work alright with normal shift, I think, so there is no need to introduce more special concepts.

EDIT2: After looking at it more ... each layer is treated independently calculating scale-to-fit 32x32 value, which makes the relative_scale idea little bit more complicated as each layer would be scaled relatively to different values.

User avatar
Deadlock989
Smart Inserter
Smart Inserter
Posts: 2528
Joined: Fri Nov 06, 2015 7:41 pm

Re: [posila] [0.17.25] Alt-info layered icon scaling issues

Post by Deadlock989 »

posila wrote:
Wed May 15, 2019 1:40 pm
So I have fixed 67210 which also fixes 67458, and it makes sense of the issue you reported, but it might break your icon definitions (I hope it doesn't, though)
Great. If it does break something, all of my layered icons are generated procedurally, so I would only have to fix a line or two.
After the fix, you'll have to define shifts based on your icon_size not based on 32x32 slot size, so the behavior will be more reasonable (and alt-mode won't be inconsistent with the GUI).
Makes sense. Thanks for looking at this.
However, there is still problem that you need to know what the game considers to be "expected size" of icons, so that your icons have consistent scale with vanilla ones in alt-mode. Solution that comes to my mind would be to add relative_scale. If scale was not set, the game would calculate it and multiply it with relative scale. That way you don't need to know that "expected size" is 32, so you should set scale for your 64 icon to 0.5 in order for it to have consistent size in alt-mode; and you wouldn't need blank bottom layer (even though this might be little bit tricky for the scale-to-fit in GUI). I am still trying to think how shift should be defined with relative_scale, though.

EDIT: I think the shift should be relative to of the original icon size (as it is now). I played with an idea of "relative_offset" which would be from range of -1 to 1, where 0 would be center of the icon, -1 left/top edge, 1 right/bottom edge; but it should work alright with normal shift, I think, so there is no need to introduce more special concepts.

EDIT2: After looking at it more ... each layer is treated independently calculating scale-to-fit 32x32 value, which makes the relative_scale idea little bit more complicated as each layer would be scaled relatively to different values.
You've lost me a little here but I kind of follow it.

It's true that all of this is a bit of a dark art. I don't know how I know that inventory icons are 32, inventory tabs are 64 and technologies are 128 - I just seem to have absorbed that knowledge from somewhere. Another thing that trips me up occasionally is that the units that shift uses means one thing for icons, where it's "1.0 = 1 equivalent pixel if your icon were 32x32, even when it isn't", and in entity sprites, where it's "1.0 = 1 tile width at low resolution which you need to know is 32 pixels/tile". I've absent-mindedly got them muddled and wondered why my icons aren't being shifted - they are, but an invisible fraction of a pixel - or why my entity sprite has disappeared - it hasn't, it's just being placed offscreen somewhere because I shifted it by 16 tiles.

Did I read it right, that "original icon size" is changing to 64x64 in the future GUI update? Because a lot of these issues just evaporate if your mod has a consistent icon size for items/recipes across the board, instead of trying to mix stuff up. In a way I don't care what resolution that is, although it has to be said that 64x64 icons are much nicer, especially when rendered on belts.
Image

Qon
Smart Inserter
Smart Inserter
Posts: 2119
Joined: Thu Mar 17, 2016 6:27 am
Contact:

Re: [posila] [0.17.25] Alt-info layered icon scaling issues

Post by Qon »

Some test code:

Code: Select all

    piece.icons = {{
        icon = '__'..mod_name..'__/graphics/0.png',
        icon_size = 1,
        scale = 1, -- scale is bugged, so we need a blank scale 1 image first
        -- https://forums.factorio.com/viewtopic.php?f=7&t=71480&p=433700&hilit=scale#p433700
    }}
    local pn = function() return (math.random() < 0.5 and 1 or -1) end
    for i = 1, 6 do
        local size = item.icon_size or (item.icons and item.icons[1] and item.icons[1].icon_size) or nil
        local scale = math.random()*0.3 + 0.65
        table.insert(piece.icons, {
            icon = item.icon or (item.icons and item.icons[1] and item.icons[1].icon) or nil,
            icon_size = size,
            scale = scale / size, -- since the blank image is 1x1 everything else is scaled up by 32 for some reason?
            shift = mult({((1 - 0.3*math.random()) * (1 - scale)) * pn(), ((1 - 0.3*math.random()) * (1 - scale)) * pn()}, 0.5),
            dark_background_icon = item.dark_background_icon or (item.icons and item.icons[1] and item.icons[1].dark_background_icon) or nil,
        })
    end
I start with a blank 1x1 image since scale is bugged for the first icon in the list.
Then for the real icons I need to set scale = scale / size because otherwise the icons are scaled up by 32 for some reason. Is that another bug or is it a part of the first bug?

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

Re: [posila] [0.17.25] Alt-info layered icon scaling issues

Post by posila »

The problem is essentially this: "icons" definition is not "icon composition", it is "icon with overlays"
The first layer is expected to be 'base icon', rest are expected to be overlays on top of it. But the definition doesn't communicate it well (or at all), allows you to shoot yourself into a foot and it is beyond simple bugfix to make it so it is not that. I don't know if that's what it was intended to be initially, but it is what it ended up being.

GUI, which doesn't care about layers in sprites at all, but happens to render them, stretches a base icon to fill a slot. So if you define it as 1x1 px image with scale 1, and the slot is 32x32 pixels, it'll scale the whole thing by factor 32. If you hadn't specified scale at all, the game would infer the scale to be 32 (not 1) and it would have worked. Except, not quite. Because you would have to know what is the expected size for this icon, so you can define your other layers with correct scale and shift. For that reason it is better to be explicit with scale of the base icon. And you can even use 1x1 image with scale 1 as a base, then you just have to operate in range <0, 1> in layers (just divide your values by 32). Except you can't actually do that, because in the alt mode the icon would have size of just 1/32th of a tile. So you still need to know what is expected size of the base icon.

From my point of view the main issue is that the base icon definition allows you to override scale and shift, and scale and shift of overlays are not defined in coordinate space of unscaled base icon.

(Side note, just for completeness: black outlines in alt-mode, and shadows around icons in some GUIs are also calculated just from the base icon)

Ref: 71480

User avatar
Deadlock989
Smart Inserter
Smart Inserter
Posts: 2528
Joined: Fri Nov 06, 2015 7:41 pm

Re: [posila] [0.17.25] Alt-info layered icon scaling issues

Post by Deadlock989 »

From my perspective, whatever change posila made on 15 May made everything a lot more consistent. I still have 99 problems but recipe icons being drawn radically differently in alt-mode and the inventory grid ain't one. If successive icon layers always taking their relative scale from the base layer is the price that has to be paid for consistency, I can totally live with it. I don't have any desire to rework icon compositing across three different mods, especially right now when all the base game stuff is still 32x32 but many modders are starting to gear up for 64x64 and mipmaps.
Image

User avatar
bobingabout
Smart Inserter
Smart Inserter
Posts: 7352
Joined: Fri May 09, 2014 1:01 pm
Contact:

Re: [posila] [0.17.25] Alt-info layered icon scaling issues

Post by bobingabout »

reference: viewtopic.php?f=7&t=71480#p433626
well, you know what my issue is.
I would expect that for a 32x32 pixel frame, the icon expects to be of size 32. and differing icon sizes should then need scaling to this size (size 64 requiring scale = 0.5, IE scale should be 32/icon_size)

This is basically how normal graphics in the game works. hr_version is usually set to double the resolution than is expected with scale = 0.5 set.
The problem then comes in with... what do you expect icons such as inventory category tabs that default to 64, and technology icons which default to 128 to be?
if the original icon is 128 and you have a second icon of size 64 shift by {64, 64} to put it in the bottom right quadrant, that would work for a technology icon as the frame defaults to 128, but if you then try and use the same icon for an item (Which I have done in the past) the frame is a different size and {64,64} would put it the secondary icon outside of the frame.

Still, an icon = and icon_size = pair on the item/entity/recipe itself should scale to fit the window automatically, otherwise you'd expect icon_scale = 0.5 for every icon_size = 64 icon that exists, this should be done automatically. should you really expect the first entry of an icons table to work differently?

So, after all this "thinking" my suggestion is as follows.
it doesn't matter what the original icon is, the "playing field" of that icons array should then be set to the icon_size of this first icon and therefore scale defaults to 1.
so if you use a size 32, 64 or 128 icon, it still just fits in whatever frame you're putting it in (frames of sizes: icon = 32, category = 64, or technology = 128), the default scale to make that icon of that size fit whatever frame is 1.
therefore setting a scale of 0.5 would mean it takes up 50% of the frame width and height.
by default it is placed in the center so you'd then need to shift it upto ((1- scale) /2) * icon_size to move it around within that frame.(that's a formula to work out how much it needs to shift by as a percentage, then multiply it by the icon size to convert it into pixels)
so, EG, to put a scale 0.5 size 32 icon in the top left corner, you'd need to shift it by {-(((1 -scale)/2) * size), -(((1 -scale)/2) * size)} = {-(0.25 * 32), -(0.25 * 32)} = {-8, -8}. See fill barrel icons generation in base game data-updates.lua for reference. it sets a fluid's icon scale to 0.5 and shifts by {-8, -4} to move the icon to the top, but only slightly over to the left. it now performs 16/icon_size to calculate the scale now to take into account icons of sizes that aren't 32.

Personally, I would say that whatever the icon size is you use should be scale 1, so if the first is size 32, and the second is size 16, setting both to scale 1 should fill the frame, but currently everything is in relation to the first layer icon, so... I am also not opposed to the second icon of 16 when the first is 32 defaulting to half the frame (ie, would need to set scale = 2 to fill the frame), as this behaviour shouldn't break anything that already exists.


Conclusion (or TLDR): my opinion is that the first icon's SIZE sets the playing field and scale, changing the scale of that icon WILL change that icons size on the field, and any pixels (IE, scales and shifts) be based on that first icon's playing field size. This playing field (and therefore all icon layers) is then scaled to fit the icon window it is being drawn in, be it a 10x10 pixel item on the floor, or a massive scale 250% technology icon.

examples:
(if the first icon is size 32, a second icon of size 64 would need to be scale 0.5 to fit the frame, or size 16 would need to be scale 2 to fit. a shift of 32 would be needed to move an entire icon over)
(if the first icon is size 64, a second icon of size 128 would need to be scale 0.5 to fit the frame, or size 32 would need to be scale 2 to fit. a shift of 64 would be needed to move an entire icon over)
Last edited by bobingabout on Tue Jun 04, 2019 4:59 pm, edited 2 times in total.
Creator of Bob's mods. Expanding your gameplay since version 0.9.8.
I also have a Patreon.

User avatar
Deadlock989
Smart Inserter
Smart Inserter
Posts: 2528
Joined: Fri Nov 06, 2015 7:41 pm

Re: [posila] [0.17.25] Alt-info layered icon scaling issues

Post by Deadlock989 »

bobingabout wrote:
Tue Jun 04, 2019 3:59 pm
Conclusion (or TLDR): my opinion is that the first icon's SIZE sets the playing field and scale, changing the scale of that icon WILL change that icons size on the field, and any pixels (IE, scales and shifts) be based on that first icon's playing field size.
I'm completely opposed to this because it would cause me a lot of unwanted work and break a lot of stuff. Again. I don't see why we have to refactor our mods to suit you, just because you only recently discovered something that the rest of us dealt with and moved on from a year ago or more.

A mod doesn't know or care what size the frame for the icon is. Tech icons are sized at 128x128 by default, but I just got a new monitor and now the frame for selected technologies is being drawn at 256x256 and the 128x128 icon is scaled up automatically. In your scheme, nothing would actually work the way it's been for years and we'd have tiny icons floating in big spaces, or frames that aren't big enough for their icons, just because people might have a differently scaled monitor to the modder's.

If there's a fault, it's in the documentation. It could be more explicit the first indexed icon in the stack of icons{} is the base and it is expected to fill the frame. I don't think this is actually documented anywhere and to the novice user looking at the icons{} table definition it seems like all the icons have equal status. Once you know better, it's just a matter of dealing with it when you want different behaviour.
Image

User avatar
bobingabout
Smart Inserter
Smart Inserter
Posts: 7352
Joined: Fri May 09, 2014 1:01 pm
Contact:

Re: [posila] [0.17.25] Alt-info layered icon scaling issues

Post by bobingabout »

Deadlock989 wrote:
Tue Jun 04, 2019 4:25 pm
bobingabout wrote:
Tue Jun 04, 2019 3:59 pm
Conclusion (or TLDR): my opinion is that the first icon's SIZE sets the playing field and scale, changing the scale of that icon WILL change that icons size on the field, and any pixels (IE, scales and shifts) be based on that first icon's playing field size.
I'm completely opposed to this because it would cause me a lot of unwanted work and break a lot of stuff. Again. I don't see why we have to refactor our mods to suit you, just because you only recently discovered something that the rest of us dealt with and moved on from a year ago or more.

A mod doesn't know or care what size the frame for the icon is. Tech icons are sized at 128x128 by default, but I just got a new monitor and now the frame for selected technologies is being drawn at 256x256 and the 128x128 icon is scaled up automatically. In your scheme, nothing would actually work the way it's been for years and we'd have tiny icons floating in big spaces, or frames that aren't big enough for their icons, just because people might have a differently scaled monitor to the modder's.

If there's a fault, it's in the documentation. It could be more explicit the first indexed icon in the stack of icons{} is the base and it is expected to fill the frame. I don't think this is actually documented anywhere and to the novice user looking at the icons{} table definition it seems like all the icons have equal status. Once you know better, it's just a matter of dealing with it when you want different behaviour.
You misunderstand me, that's not what I'm suggesting.

As is current, an icons array's first entry, be it size 32 or 256, will have a playing field size of it's icon size, so all shifts are based on those numbers. IE, nothing changes. if your first icon is 32, then shifts are based on icon size being 32.
it doesn't matter if it's in a 32 pixel icon frame, or a 128 pixel technology frame, or if your GUI scale is set to 200% making those frames 256 pixels wide, the icon will always fit the frame it's supposed to be drawn in.

The only change I'm suggesting is that if you set scale = 0.5 on the first icon... instead of the icon still fitting the frame but all scales being fucked up, then the first icon would resize to half instead, meaning if that's what you intend, you don't need to set the blank size 32 icon like you do now. And even if you do have the blank size 32 icon first... well, everything is still in reference to that, so nothing breaks.


I was careful with my words when I said "Playing field size" not "Literal size on screen", playing field simply referring to the grid that the scale and shift are based against for ALL icons in all layers of the icons table.
That playing field is then scaled to fit the literal size on screen, be it a size 32 icon window, or your 200% technology window. Even the tiny 10x10 pixel items laying on the floor.

I'm going to add a little more to the end of my TLDR to make that more clear.
Creator of Bob's mods. Expanding your gameplay since version 0.9.8.
I also have a Patreon.

User avatar
Deadlock989
Smart Inserter
Smart Inserter
Posts: 2528
Joined: Fri Nov 06, 2015 7:41 pm

Re: [posila] [0.17.25] Alt-info layered icon scaling issues

Post by Deadlock989 »

You're still making the assumption that changes which suit you won't break other people's stuff. Successive icon scales are relative to the first icon's scale. You don't know what I'm setting as scales on any of my icons, first or last. You don't know how I've scaled successive icons relative to the first one. You have no idea how much or how little work it will be for other people to fix their mods, just because you want to do something with a prototype property that wasn't even intended behaviour in the first place.

If it ain't broke, don't fix it. This was a bug report about a different issue, I'm not sure how it drifted into being about relative scaling in icon overlays. The original bug report was about relative scales in one icons definition being rendered differently in the inventory tab and in alt-mode. posila fixed that, and there was much rejoicing. This bug report should be closed because the reported bug was fixed.
Image

Qon
Smart Inserter
Smart Inserter
Posts: 2119
Joined: Thu Mar 17, 2016 6:27 am
Contact:

Re: [posila] [0.17.25] Alt-info layered icon scaling issues

Post by Qon »

Deadlock989 wrote:
Tue Jun 04, 2019 5:06 pm
I'm not sure how it drifted into being about relative scaling in icon overlays.
posila wrote:
Mon Jun 03, 2019 11:05 pm
Ref: 71480

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

Re: [posila] [0.17.25] Alt-info layered icon scaling issues

Post by posila »

Deadlock989 wrote:
Tue Jun 04, 2019 5:06 pm
If it ain't broke, don't fix it. This was a bug report about a different issue, I'm not sure how it drifted into being about relative scaling in icon overlays. The original bug report was about relative scales in one icons definition being rendered differently in the inventory tab and in alt-mode. posila fixed that, and there was much rejoicing. This bug report should be closed because the reported bug was fixed.
It might have not been what you thought you were reporting; you reported alt-mode icon not rendering correctly, and it was not rendering correctly because your icons where rendered twice as big in alt-mode than they should be (but the layers were shifted by the correct amount). I fixed that shifting wasn't scaled proportionaly with layers in some cases, and in the meantime you found a workaround for the scaling issue. But the original issue of the icon being rendered twice as big as it should be still exists (with less-broken looking result). And my issue with the workarounds is that they require modders to know what the expected size of the icon is. One of the reason we made icon_size mandatory is that we wanted to be able to change "default icon sizes" without breaking everyones mods and suddenly we have a system that produces broken results if we do.

However, I am not going to do a change that would break existing mods.

@bobingabout: your expectations about shifting and scaling the first layer are not unreasonable, but that's not currently supported. The first layer is scaled to size that would fill the GUI slot, that's just how it works.

User avatar
bobingabout
Smart Inserter
Smart Inserter
Posts: 7352
Joined: Fri May 09, 2014 1:01 pm
Contact:

Re: [posila] [0.17.25] Alt-info layered icon scaling issues

Post by bobingabout »

Deadlock989 wrote:
Tue Jun 04, 2019 5:06 pm
This was a bug report about a different issue, I'm not sure how it drifted into being about relative scaling in icon overlays.
Because that's what my bug report was about, and Posila said to continue all discussions about it here, as a duplicate bug report.

Also, calm down, I'm voicing my opinion, just because I see it one way doesn't mean the devs will, and that doesn't mean that it will get changed to my image of how it should be.

at the end of the day, the important thing is that we know how things work, and how to use them. If what I want to do can be done, even if it doesn't work as you would expect, then that's fine.
posila wrote:
Tue Jun 04, 2019 6:08 pm
@bobingabout: your expectations about shifting and scaling the first layer are not unreasonable, but that's not currently supported. The first layer is scaled to size that would fill the GUI slot, that's just how it works.
A reasonable answer. Slightly disapointed, but then I guess the "blank icon of size 32 for the first layer" solution is just something I'll have to do if I don't want my first layer to fill the icon box.

Though, with all the new mipmap stuff coming, it does sort of make me wonder how mipmap with layered icons is going to work. or if "it just works".
Last edited by bobingabout on Tue Jun 04, 2019 6:24 pm, edited 1 time in total.
Creator of Bob's mods. Expanding your gameplay since version 0.9.8.
I also have a Patreon.

User avatar
Deadlock989
Smart Inserter
Smart Inserter
Posts: 2528
Joined: Fri Nov 06, 2015 7:41 pm

Re: [posila] [0.17.25] Alt-info layered icon scaling issues

Post by Deadlock989 »

posila wrote:
Tue Jun 04, 2019 6:08 pm
It might have not been what you thought you were reporting; you reported alt-mode icon not rendering correctly, and it was not rendering correctly because your icons where rendered twice as big in alt-mode than they should be (but the layers were shifted by the correct amount). I fixed that shifting wasn't scaled proportionaly with layers in some cases, and in the meantime you found a workaround for the scaling issue.
Well, re-discovered - I was doing that 18 months ago and then forgot about it temporarily when I took a break from modding. But the "workaround" is actually just using the property in the way it's expected to be used.
However, I am not going to do a change that would break existing mods.
Good to know. Thanks for investigating this.
Image

User avatar
Deadlock989
Smart Inserter
Smart Inserter
Posts: 2528
Joined: Fri Nov 06, 2015 7:41 pm

Re: [posila] [0.17.25] Alt-info layered icon scaling issues

Post by Deadlock989 »

bobingabout wrote:
Tue Jun 04, 2019 6:21 pm
Also, calm down
I'm perfectly calm. Just didn't fancy another weekend of cleaning up the mess after you move the goalposts.
Image

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

Re: [posila] [0.17.25] Alt-info layered icon scaling issues

Post by posila »

So, after thinking about it more, I decided to declare the current system as good enough.

There is no real reason for us to ever change internally expected sizes, we will just change icon_size in lua as everyone else, so having to know that the icon will be rescaled so that the first layer is 32x32px is not as big of a deal as I thought.

Post Reply

Return to “Minor issues”