Page 1 of 1
[2.0.28] IconData default size depends on other IconData objects in the array
Posted: Fri Dec 20, 2024 8:23 pm
by LuziferSenpai
Hey,
so Semenar and me did some testing to find the problem in my mod.
We found then out when the first icon inside a icons array has no icon_size set and then another icon in that array has a bigger icon_size then the default value, it will produce a error. But when I then set the icon_size to the default value it will work.
Code: Select all
2.498 Error ParallelSpriteLoader.cpp:67: Parallel sprite loading failed, falling back to normal sprite loading. The given sprite rectangle (left_top=0x0, right_bottom=256x256) is outside the actual sprite size (left_top=0x0, right_bottom=64x64).
2.501 Error AtlasBuilder.cpp:1266: The given sprite rectangle (left_top=0x0, right_bottom=256x256) is outside the actual sprite size (left_top=0x0, right_bottom=64x64).
If this is not a bug, then there needs to be a improvement to the documentation.
But with it beeing fixed, when setting a value it seems like a bug to me.
Mods used:
- Enemy Race Manager Libraries
- Enemy Race Manager
- Enemy Race Manager Asset Pack
- Enemy Race Manager - Post Process
- ERM - Terran HD Graphic Assets
- ERM - Terran Units for Players
- More Casting
Update: More Casting needs to be a version before 0.0.10. (I added a temp fix)
Greetz,
Luzifer
Re: [2.0.28] Parallel sprite loading failed / IconData default size depends on other IconData objects in the array
Posted: Fri Dec 20, 2024 9:04 pm
by Loewchen
Post the complete log please, see
3638.
Re: [2.0.28] Parallel sprite loading failed / IconData default size depends on other IconData objects in the array
Posted: Fri Dec 20, 2024 10:08 pm
by LuziferSenpai
Loewchen wrote: Fri Dec 20, 2024 9:04 pm
Post the complete log please, see
3638.
raiguard told me to post it and he was fine with the message above.
Re: [2.0.28] IconData default size depends on other IconData objects in the array
Posted: Sun Dec 22, 2024 8:56 pm
by raiguard
When posting to the forums, always post the full log. We have some tooling that allows us to sync mods from a log file.
Re: [2.0.28] IconData default size depends on other IconData objects in the array
Posted: Sun Dec 22, 2024 9:27 pm
by LuziferSenpai
raiguard wrote: Sun Dec 22, 2024 8:56 pm
When posting to the forums, always post the full log. We have some tooling that allows us to sync mods from a log file.
Ah I didnt know that.
Here you go.
Re: [2.0.28] IconData default size depends on other IconData objects in the array
Posted: Wed Feb 19, 2025 1:38 pm
by Rseding91
Looking into this, "defines.default_icon_size" is simply wrong and is not the default for all prototype types and as such isn't a viable value for all icon definitions. These prototypes use different defaults:
AchievementPrototype: 128
ShortcutPrototype: 32
ItemGroup: 128
TechnologyPrototype: 256
Re: [2.0.28] IconData default size depends on other IconData objects in the array
Posted: Wed Feb 19, 2025 2:22 pm
by Bilka
Rseding91 wrote: Wed Feb 19, 2025 1:38 pm
Looking into this, "defines.default_icon_size" is simply wrong and is not the default for all prototype types and as such isn't a viable value for all icon definitions. These prototypes use different defaults:
AchievementPrototype: 128
ShortcutPrototype: 32
ItemGroup: 128
TechnologyPrototype: 256
That is not correct. Those numbers are the
expected icon size. The expected size affects some things about icons (such as scale), but icon_size itself defaults to 64 even for those prototypes. This is documented here:
https://lua-api.factorio.com/latest/types/IconData.html
Re: [2.0.28] IconData default size depends on other IconData objects in the array
Posted: Wed Feb 19, 2025 2:33 pm
by Rseding91
Bilka wrote: Wed Feb 19, 2025 2:22 pm
That is not correct. Those numbers are the
expected icon size. The expected size affects some things about icons (such as scale), but icon_size itself defaults to 64 even for those prototypes. This is documented here:
https://lua-api.factorio.com/latest/types/IconData.html
Right, I missed that. But that makes this report even more confusing because the default is then fully always 64, so having it there (as 64) or not changes nothing on the engine side. That makes me lean even more towards this being a mod Lua definition error.
Is there some save I can sync mods with to reproduce this? Or some minimal mod that reproduces it so I can verify if it's a mod logic error or not?
Re: [2.0.28] IconData default size depends on other IconData objects in the array
Posted: Thu Feb 20, 2025 3:09 pm
by LuziferSenpai
Rseding91 wrote: Wed Feb 19, 2025 2:33 pm
Bilka wrote: Wed Feb 19, 2025 2:22 pm
That is not correct. Those numbers are the
expected icon size. The expected size affects some things about icons (such as scale), but icon_size itself defaults to 64 even for those prototypes. This is documented here:
https://lua-api.factorio.com/latest/types/IconData.html
Right, I missed that. But that makes this report even more confusing because the default is then fully always 64, so having it there (as 64) or not changes nothing on the engine side. That makes me lean even more towards this being a mod Lua definition error.
Is there some save I can sync mods with to reproduce this? Or some minimal mod that reproduces it so I can verify if it's a mod logic error or not?
These two mods together will break it.
Re: [2.0.28] IconData default size depends on other IconData objects in the array
Posted: Thu Feb 20, 2025 3:58 pm
by Rseding91
You're melding the existing icon definition of:
Code: Select all
icons =
{
{
icon = "__graphic_test_mod__/advisor256.png",
icon_size = 256,
}
}
With a new icon definition that starts as:
Code: Select all
icons = {
{
icon = modName .. "/graphics/64x64-empty.png"
}
}
Melding those two tables will result in:
Code: Select all
icons = {
{
icon = modName .. "/graphics/64x64-empty.png"
icon_size = 256,
}
}
Which will produce the exact error you're seeing. By specifying that the 64x64-empty.png icon_size is 64, meld uses the value from that and overwrites the 256 from the to-be-melded-into table.
Re: [2.0.28] IconData default size depends on other IconData objects in the array
Posted: Thu Feb 20, 2025 4:41 pm
by LuziferSenpai
Rseding91 wrote: Thu Feb 20, 2025 3:58 pm
You're melding the existing icon definition of:
Code: Select all
icons =
{
{
icon = "__graphic_test_mod__/advisor256.png",
icon_size = 256,
}
}
With a new icon definition that starts as:
Code: Select all
icons = {
{
icon = modName .. "/graphics/64x64-empty.png"
}
}
Melding those two tables will result in:
Code: Select all
icons = {
{
icon = modName .. "/graphics/64x64-empty.png"
icon_size = 256,
}
}
Which will produce the exact error you're seeing. By specifying that the 64x64-empty.png icon_size is 64, meld uses the value from that and overwrites the 256 from the to-be-melded-into table.
That doesnt make sense that it would meld the first icon with the icon_size of the second.
Re: [2.0.28] IconData default size depends on other IconData objects in the array
Posted: Thu Feb 20, 2025 4:47 pm
by LuziferSenpai
Okay, after boskid's comment I now understand I made a error myself.
Sry.
Re: [2.0.28] IconData default size depends on other IconData objects in the array
Posted: Thu Feb 20, 2025 4:47 pm
by Rseding91
LuziferSenpai wrote: Thu Feb 20, 2025 4:41 pm
That doesnt make sense that it would meld the first icon with the icon_size of the second.
That's what meld does.