PSA: Make sure you are setting correct icon_size
PSA: Make sure you are setting correct icon_size
Soon, we will merge and release the first batch of the new icons, which will have base size 64x64 px and mipmaps.
If you are adding new prototypes by copying a base prototype and changing some values on it (for example by using table.deepcopy; which is probably the best way to add a new prototype if you don't want to make completely custom graphics), make sure you also set icon_size to size of your icon (don't rely on your icon_size being already set in the base mod), otherwise your mod won't load anymore after we change our icon sizes.
Ideally, you should clear all possible icon definitions on the copy (icon = nil, icon_size = nil, icons = nil) and define your own icon from scratch
So far we have ran into PowerCubes not being loadable with the first batch of the new icons (charger-station is not overwriting icon_size)
If you are adding new prototypes by copying a base prototype and changing some values on it (for example by using table.deepcopy; which is probably the best way to add a new prototype if you don't want to make completely custom graphics), make sure you also set icon_size to size of your icon (don't rely on your icon_size being already set in the base mod), otherwise your mod won't load anymore after we change our icon sizes.
Ideally, you should clear all possible icon definitions on the copy (icon = nil, icon_size = nil, icons = nil) and define your own icon from scratch
So far we have ran into PowerCubes not being loadable with the first batch of the new icons (charger-station is not overwriting icon_size)
- eradicator
- Smart Inserter
- Posts: 5211
- Joined: Tue Jul 12, 2016 9:03 am
- Contact:
Re: PSA: Make sure you are setting correct icon_size
Is there any relevant performance penalty to just using icons= everywhere it's supported, even for single-layered icons?
Author of: Belt Planner, Hand Crank Generator, Screenshot Maker, /sudo and more.
Mod support languages: 日本語, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.
Mod support languages: 日本語, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.
Re: PSA: Make sure you are setting correct icon_size
Runtime-wise, there is no difference between the definitions for single-layered icons. Multi-layered ones, can be heavy on rendering (including render prepare, which is serial with update) ... if used for items that are shown on belts or in alt-mode in large quatities. E.g. making ores multilayered should raise some eyebrows.eradicator wrote: ↑Wed Jun 05, 2019 11:30 am Is there any relevant performance penalty to just using icons= everywhere it's supported, even for single-layered icons?
I don't know what would be performance difference between parsing plain icon definition and layered icon definition in Lua. (probably not much)
I thought about making mipmaps available only for the layered icon definition and converting all base icons to it, but that would break even mods that correctly overwrite both icon and icon_size, but don't think of clearing icons to nil.
- eradicator
- Smart Inserter
- Posts: 5211
- Joined: Tue Jul 12, 2016 9:03 am
- Contact:
Re: PSA: Make sure you are setting correct icon_size
That is very reassuring to know, thanks :).
Couldn't that be solved by pre-composing the final icon on startup? Icons aren't that large so the VRAM would be bearable? Would be great for using a mask to make every ore-variation a slightly different color shade, or similar ore-graphics generation.
Author of: Belt Planner, Hand Crank Generator, Screenshot Maker, /sudo and more.
Mod support languages: 日本語, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.
Mod support languages: 日本語, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.
Re: PSA: Make sure you are setting correct icon_size
It could, but better it could be an external tool that we don't have to bugfix and otherwise maintain. Like an image editor. I think it is bad as it is that we have content pipeline embedded in the game and keep building sprite atlases on player computers, essentially having to load everything into memory on the startup, so I am up for as little preprocessing steps as possible.eradicator wrote: ↑Wed Jun 05, 2019 12:25 pm Couldn't that be solved by pre-composing the final icon on startup? Icons aren't that large so the VRAM would be bearable? Would be great for using a mask to make every ore-variation a slightly different color shade, or similar ore-graphics generation.
- Deadlock989
- Smart Inserter
- Posts: 2529
- Joined: Fri Nov 06, 2015 7:41 pm
Re: PSA: Make sure you are setting correct icon_size
My body is ready
Last edited by Deadlock989 on Wed Jun 05, 2019 5:42 pm, edited 2 times in total.
- eradicator
- Smart Inserter
- Posts: 5211
- Joined: Tue Jul 12, 2016 9:03 am
- Contact:
Re: PSA: Make sure you are setting correct icon_size
I can totally understand your desire for wanting to keep the code-base clean. But from a modders perspective the layering is a really awesome feature for dynamicalls generating things based on other mods content that i know nothing about. Doing it in an image editor would be impossible. So i'm very greatful that it exists.posila wrote: ↑Wed Jun 05, 2019 2:01 pmIt could, but better it could be an external tool that we don't have to bugfix and otherwise maintain. Like an image editor. I think it is bad as it is that we have content pipeline embedded in the game and keep building sprite atlases on player computers, essentially having to load everything into memory on the startup, so I am up for as little preprocessing steps as possible.eradicator wrote: ↑Wed Jun 05, 2019 12:25 pm Couldn't that be solved by pre-composing the final icon on startup? Icons aren't that large so the VRAM would be bearable? Would be great for using a mask to make every ore-variation a slightly different color shade, or similar ore-graphics generation.
I also have belts with barrels on them ;).
Author of: Belt Planner, Hand Crank Generator, Screenshot Maker, /sudo and more.
Mod support languages: 日本語, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.
Mod support languages: 日本語, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.
Re: PSA: Make sure you are setting correct icon_size
+1eradicator wrote: ↑Wed Jun 05, 2019 3:58 pm I can totally understand your desire for wanting to keep the code-base clean. But from a modders perspective the layering is a really awesome feature for dynamicalls generating things based on other mods content that i know nothing about. Doing it in an image editor would be impossible. So i'm very greatful that it exists.
I want GLSL shaders for my graphics. I said before in a thread that it was for prototype stage, but I've changed by mind. I want it for prototype and runtime. Real-time ray marching displays inside Factorio? Real-time animated icons? Turn Factorio into 3D? Why not?
Posila, do you accept bribes to change your mind?
My mods: Capsule Ammo | HandyHands - Automatic handcrafting | ChunkyChunks - Configurable Gridlines
Some other creations: Combinassembly Language GitHub w instructions and link to run it in your browser | 0~drain Laser
Some other creations: Combinassembly Language GitHub w instructions and link to run it in your browser | 0~drain Laser
Re: PSA: Make sure you are setting correct icon_size
Back to topic (to other things, I might respond in the hue thread)... in the end, we'll release just new ore icons + new ore item pictures with variations; so the change is not so dramatic and hopefully won't break any mods.
- Deadlock989
- Smart Inserter
- Posts: 2529
- Joined: Fri Nov 06, 2015 7:41 pm
Re: PSA: Make sure you are setting correct icon_size
The icon mipmap definition will be in the engine, but will be used just for the ores in the base game. Mods will be able to start using it.
- Deadlock989
- Smart Inserter
- Posts: 2529
- Joined: Fri Nov 06, 2015 7:41 pm
Re: PSA: Make sure you are setting correct icon_size
Nice one. Good times.
Re: PSA: Make sure you are setting correct icon_size
Another "minor" change related to icons.
I was visited by a prophet who gave me vision of a future, so in hopes to save my soul, I decided to limit number of picture variations that will be loaded from item prototype to number of 16.
I was visited by a prophet who gave me vision of a future, so in hopes to save my soul, I decided to limit number of picture variations that will be loaded from item prototype to number of 16.
- Deadlock989
- Smart Inserter
- Posts: 2529
- Joined: Fri Nov 06, 2015 7:41 pm
Re: PSA: Make sure you are setting correct icon_size
Bang go my plans to have 720 variations of pebble in 0.5 degree rotations on belts.
Re: PSA: Make sure you are setting correct icon_size
You mean 1280 variations, all with 720 rotations each, right?
My mods: Capsule Ammo | HandyHands - Automatic handcrafting | ChunkyChunks - Configurable Gridlines
Some other creations: Combinassembly Language GitHub w instructions and link to run it in your browser | 0~drain Laser
Some other creations: Combinassembly Language GitHub w instructions and link to run it in your browser | 0~drain Laser