[0.17.3] Crash using 1x1 empty.png

We are aware of them, but they have low priority. We have more important things to do. They go here in order not to take space in the main bug thread list.
User avatar
Optera
Smart Inserter
Smart Inserter
Posts: 2920
Joined: Sat Jun 11, 2016 6:41 am
Contact:

[0.17.3] Crash using 1x1 empty.png

Post by Optera »

I stumbled into the weirdest hard to reproduce error.

For Deep Mine I'm generating a module to add mining productivity to assembler type mines:

Code: Select all

  {
    type = "module",
    name = "deep-mine-prod-module",
    icon = "__core__/graphics/empty.png",
    icon_size = 1,
    flags = { "hidden" },
    subgroup = "module",
    category = "productivity",
    tier = 0,
    stack_size = 1,
    effect = { productivity = {bonus = 0.02}} -- productivity step size is 2% we use as many as actual force mining-bonus requires
  },
This works fine until I load Dectorio alongside it, suddenly Factorio throws an error:

Code: Select all

AtlasSystem.cpp:1204: The given sprite rectangle (left_top=0x0, right_bottom=32x32) is outside the actual sprite size (left_top=0x0, right_bottom=1x1).
Sprite name: __core__/graphics/empty.png.: __core__/graphics/empty.png
However this is not Dectorio messing with my prototype, but the Atlas system getting confused as you can see in the serpent.block made in the attached logfile the icon_size is still set to 1.

Setting the icon to any 32x32 icon, even leaving the size at 1 it loads without problem.
Attachments
factorio-current.log
(27.95 KiB) Downloaded 110 times

orzelek
Smart Inserter
Smart Inserter
Posts: 3922
Joined: Fri Apr 03, 2015 10:20 am
Contact:

Re: [0.17.3] Crash using 1x1 empty.png

Post by orzelek »

Are you sure that Dectorio did not take icon that uses empty.png from one of other mods and changed it by giving it icon_size while creating it's own icon or something?
I've seen a discussion about similar issue in mod forum I think.

User avatar
Optera
Smart Inserter
Smart Inserter
Posts: 2920
Joined: Sat Jun 11, 2016 6:41 am
Contact:

Re: [0.17.3] Crash using 1x1 empty.png

Post by Optera »

Mods shouldn't be able to write to /core/graphics/
But just to make sure I created my own empty.png inside DeepMine and it produced the same error.
In fact I created uniquely named copies for each use, which is how i figured it was the icon for the module and not the entity sprite.

orzelek
Smart Inserter
Smart Inserter
Posts: 3922
Joined: Fri Apr 03, 2015 10:20 am
Contact:

Re: [0.17.3] Crash using 1x1 empty.png

Post by orzelek »

Optera wrote:
Fri Mar 01, 2019 9:46 pm
Mods shouldn't be able to write to /core/graphics/
But just to make sure I created my own empty.png inside DeepMine and it produced the same error.
In fact I created uniquely named copies for each use, which is how i figured it was the icon for the module and not the entity sprite.
The case I'm talking about was not messing with your prototype. It was creating new prototype in mod and reusing icon from other mod without looking at size. It doesn't matter what png it has then - it matters that it's 1x1 and otheh mod ignores that.
Discussion is here:
viewtopic.php?f=190&t=54343&p=402048&hi ... ng#p402048

Maybe Dectorio does something similar?

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

Re: [0.17.3] Crash using 1x1 empty.png

Post by posila »

Tracking which mod creates which sprite definitions is not perfect, but it is better then nothig. It essentially lists all mods that reference the image, despite just one of them caused the invalid sprite definition. Sometime I'll see if I can make it better without big performance impact on mod loading.

User avatar
PantherX
Long Handed Inserter
Long Handed Inserter
Posts: 53
Joined: Sat Sep 03, 2016 6:26 am
Contact:

Re: [0.17.3] Crash using 1x1 empty.png

Post by PantherX »

I was able to reproduce this and it was an issue in Dectorio. I've released an update that mitigates the issue. Try again with Dectorio v0.9.2.

User avatar
Optera
Smart Inserter
Smart Inserter
Posts: 2920
Joined: Sat Jun 11, 2016 6:41 am
Contact:

Re: [0.17.3] Crash using 1x1 empty.png

Post by Optera »

Dectorio 0.9.2 seems to have fixed the issue.

Post Reply

Return to “Minor issues”