Does icon_size really have any affect?

Place to post guides, observations, things related to modding that are not mods themselves.
Post Reply
Zomis
Inserter
Inserter
Posts: 31
Joined: Fri Apr 21, 2017 7:01 pm
Contact:

Does icon_size really have any affect?

Post by Zomis »

The icon_size property was introduced not so long ago, but does it really have any effect at the moment? What happens if I enter the wrong value?

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

Re: Does icon_size really have any affect?

Post by posila »

Your mod will either cause an error on startup or the icon won't be properly sized in game.

User avatar
darkfrei
Smart Inserter
Smart Inserter
Posts: 2903
Joined: Thu Nov 20, 2014 11:11 pm
Contact:

Re: Does icon_size really have any affect?

Post by darkfrei »

posila wrote:Your mod will either cause an error on startup or the icon won't be properly sized in game.
Why we haven't default value? If not specified, then 32.

Bilka
Factorio Staff
Factorio Staff
Posts: 3129
Joined: Sat Aug 13, 2016 9:20 am
Contact:

Re: Does icon_size really have any affect?

Post by Bilka »

darkfrei wrote:Why we haven't default value? If not specified, then 32.
Because that's not the right size for like half of the icons? It's better to define it everywhere than to use a default that might/will change in the future.
I'm an admin over at https://wiki.factorio.com. Feel free to contact me if there's anything wrong (or right) with it.

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

Re: Does icon_size really have any affect?

Post by bobingabout »

Zomis wrote:The icon_size property was introduced not so long ago, but does it really have any effect at the moment? What happens if I enter the wrong value?
The original question (topic). Yes. It has an effect. Currently all item icons are 32, but others like Technology are 128, and categories (tabs at the top when you open the crafting menu) are 64.

Those USED TO BE hard values, except technology, that was 128 if it was base game, and 64 for mods, unless you specified an icon_size tag.
This was strange, and meant you needed to add icon_size to all technology to make it work as expected. Which is the reason the default value was removed, forcing you to add the tag to all icons in 0.16.

Back in earlier versions (0.12 and earlier, etc), icon sizes for technology were automatic, just give it a file, and it scaled to fit. it was late 0.12 when they changed the research GUI that they introduced the icon_size fiasco, because the rules were all over the place (128 for the newly introduced base game icons, but 64 for mods, and if your mod was using a 32 size icon, it wouldn't be resized, just centred.)

To get back to the quoted question, if you for example have an icon you want to use for a technology, and a tab, and an item... you can use the same graphic in say, 64x64, and specify icon_size = 64 in all cases. Technology graphics will scale up, item graphics will scale down.
darkfrei wrote:Why we haven't default value? If not specified, then 32.
As specified above, it used to be. I'm not entirely sure why they decided to remove the default of 32 from items, recipes and entities, or the default of 64 from categories, but... they did. Even a default of 128 for technology would have been fine instead of doing what they did in 0.12 to 0.15, the issue is that it was inconsistent, and changing the defaults around over time was causing mods that didn't change the icon size caused loading errors.
Bilka wrote:Because that's not the right size for like half of the icons? It's better to define it everywhere than to use a default that might/will change in the future.
That's where you have different defaults for different things, 32 for items, recipes and entities, 64 for categories, and 128 for technology. The default should be whatever is appropriate for the situation.


In any case, it doesn't really matter, we do have an icon_size tag now, and those who have only just started modding will not know it was never there, while those of us who have been modding for a long time... well... if you've been modding as long as me, you'll just shrug and get on with it, just another change in a long list of changes, some more pointless, and some very revolutionary. This one is just "Meh" *Shrug* to me... A pain in the backside going through and adding it to everything, but at the end of the day, it does make sense, and doesn't add or remove anything from the game.
Creator of Bob's mods. Expanding your gameplay since version 0.9.8.
I also have a Patreon.

Supercheese
Filter Inserter
Filter Inserter
Posts: 841
Joined: Mon Sep 14, 2015 7:40 am
Contact:

Re: Does icon_size really have any affect?

Post by Supercheese »

Well, you can now use high-resolution icons, so they won't be badly pixelated when zoomed in!

Post Reply

Return to “Modding discussion”