[1.1.104] small yet fun "1 pixel" diff for tile-unknown icon
Posted: Fri Apr 12, 2024 2:55 am
pre
Factorio has a number of "fallback" icons;namely
- ./virtual-signal/signal-unknown.png
- ./tile/tile-unknown.png
- ./item/item-unknown.png
- ./fluid/fluid-unknown.png
- ./entity/entity-unknown.png
They all feature the black question-mark icon. Namely a `__core__/graphics/icons/unknown.png`.
which would suggest... that they are the same. But, ofc, it would be *strange* if they were. And they aren't.
Namely, all except the second one, the tile (spoiled it for ya!) are the same. And the tile one differs by this mask:
what
ofc, they are (all) defined at `__core__/prototypes/unknown.lua`and basically, the tile case specifically does NOT use icon; instead, it uses a "tile" graphics (aka 32x32 pix bitmap) which it gets by 0.5 scale of 64x64 icon.
Yet once dumped, the icons are full-size 64x64. Which, as you see, gets a little (em)bossy on the sidelines.
workaround
a data.lua withCode: Select all
data.raw["tile"]["tile-unknown"].icon = "__core__/graphics/icons/unknown.png"
data.raw["tile"]["tile-unknown"].icon_size = 64
reasonably enough, example above gets you same-hash same-pixels icons for all the 5 entries.
sidenotes
this is not the smallest-impact/smallest-size bug to date found with diff of cause. If you were to diff a base/demo-1.1.104, you shall meet some "npe" (aka new-player-experience) folders (and a few localization ones). Don't ask me how and why do I know that.Yet this alone gets the tinkership award. I mean, now they use the same hash bit-wise! hehe. Same data on the core level! Cows are happy, bugs are less so.
There was a neat point of nit-picking where we needed to stop (to keep the gtd efficiency rolling) and we have clearly passed it. But let's keep going and get this CORE fix into 2.0 or soon(er), kappa.
Tinker squad sends their regards.
...off to the land of predetermined subpixel precision we go!