[1.1.104] small yet fun "1 pixel" diff for tile-unknown icon

Bugs that are actually features.
KeepResearchinSpoons
Long Handed Inserter
Long Handed Inserter
Posts: 77
Joined: Tue Dec 01, 2020 6:57 pm
Contact:

[1.1.104] small yet fun "1 pixel" diff for tile-unknown icon

Post by KeepResearchinSpoons »

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
as easily seen by `find . | grep unknown` in icons dump, for example.

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:
no, I did not push hard on your screen to un-emboss it!
no, I did not push hard on your screen to un-emboss it!
a-b.diff.png (554 Bytes) Viewed 582 times
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 with

Code: Select all

data.raw["tile"]["tile-unknown"].icon = "__core__/graphics/icons/unknown.png"
data.raw["tile"]["tile-unknown"].icon_size = 64
fun fact; asset is defined in `__core__`, so you do not *have to* depend on the `__base__` actually...
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! :lol: :lol: :lol:
User avatar
boskid
Factorio Staff
Factorio Staff
Posts: 3063
Joined: Thu Dec 14, 2017 6:56 pm
Contact:

Re: [1.1.104] small yet fun "1 pixel" diff for tile-unknown icon

Post by boskid »

Thanks for the report. I am not considering this to be a bug. If they would be required to be equal then they would be all pointing at the same file.
Post Reply

Return to “Not a bug”