Page 1 of 2

[0.15.6] Sprite rectangle outside the actual sprite

Posted: Sun Apr 30, 2017 9:34 am
by DevilXD
This error message appeared to me today after updating some of my mods: http://imgur.com/07HDCOr

Mods folder: https://www.dropbox.com/s/w7yy5jy9ta6g4ik/mods.rar?dl=1

Is this mod related ?

Re: [0.15.4] Sprite rectangle outside the actual sprite

Posted: Sun Apr 30, 2017 9:52 am
by Klonan
Thanks for the report,

This is most probably sprite related,
Are you sure you are running version 0.15?

Can you provide your factorio log file?

Re: [0.15.5] Sprite rectangle outside the actual sprite

Posted: Sun Apr 30, 2017 11:41 am
by DevilXD
Klonan wrote:Are you sure you are running version 0.15?

Can you provide your factorio log file?
Yes, I'm running the latest 0.15.4 experimental.

Here's the log file: https://pastebin.com/Zzbim1Dv

EDIT: I've just updated to the 0.15.5 experimental - the game loaded just fine and everything works now. I don't know what that was about, maybe some sprites didn't crop correctly after mod updating ¯\_(ツ)_/¯

Here's the 0.15.5 log: https://pastebin.com/j7znGa6c

EDIT2: After a restart it came back, even in 0.15.5 =/ Here's the current log: https://pastebin.com/wcRnLBrq

Re: [0.15.4] Sprite rectangle outside the actual sprite

Posted: Sun Apr 30, 2017 12:33 pm
by Loewchen

Code: Select all

   0.004 2017-04-30 13:55:14; Factorio 0.15.5 (build 29304, win64, steam)
   0.004 Operating system: Windows 7 Service Pack 1
   0.005 Program arguments: "D:\Gry\Steam\steamapps\common\Factorio\bin\x64\Factorio.exe" 
   0.005 Read data path: D:/Gry/Steam/steamapps/common/Factorio/data
   0.005 Write data path: C:/Users/DevilXD/AppData/Roaming/Factorio
   0.005 Binaries path: D:/Gry/Steam/steamapps/common/Factorio/bin
   0.019 System info: [CPU:         Intel(R) Core(TM) i3-2120 CPU @ 3.30GHz, 4 cores, RAM: 4039MB]
   0.020 Display options: [FullScreen: 1] [VSync: 1] [UIScale: 100%] [MultiSampling: OFF] [Screen: 255]
   0.020 Available display adapters: 1
   0.021  [0]: \\.\DISPLAY1 - NVIDIA GeForce GT 630 {0x05, [0,0], 1920x1080, 32bit, 60Hz}
   0.021 Create display on adapter 0. Size 1280x720 at position [310, 162].
   0.158 Initialised Direct3D:[0] NVIDIA GeForce GT 630; driver: nvd3dumx.dll 21.21.13.7653
   0.166     Video memory size (dedicated video/dedicated system/shared system/available): 978/0/1763/2734 MB
   0.237 DSound: Starting _dsound_update thread
   0.237 DSound: Enter _dsound_update; tid=1648
   0.237 Device reset internal.
   0.240 Desktop composition is active.
   0.240 WARNING: You have vsync and desktop composition enabled on Direct3d. Consider disabling vsync to increase performance on some confirgurations.
   0.240 Graphics settings preset: medium
   0.242 Graphics options: [Graphics quality: normal] [Video memory usage: high] [Light scale: 80.2419%] [DXT: false]
   0.387 Loading mod core 0.0.0 (data.lua)
   0.402 Loading mod base 0.15.5 (data.lua)
   0.579 Loading mod Compact_Factory 1.5.0 (data.lua)
   0.730 Loading mod Concrete-Walls 1.0.0 (data.lua)
   0.880 Loading mod craftfaster 0.0.3 (data.lua)
   1.016 Loading mod Power_Armor_MK3 1.0.2 (data.lua)
   1.151 Loading mod textplates 0.2.1 (data.lua)
   1.334 Loading mod base 0.15.5 (data-updates.lua)
   1.526 Loading mod DefaultRequestAmount 1.0.0 (data-updates.lua)
   1.774 Checksum for core: 2926038370
   1.774 Checksum of base: 2698305660
   1.774 Checksum of Compact_Factory: 238138037
   1.774 Checksum of Concrete-Walls: 4054545514
   1.774 Checksum of craftfaster: 4194817031
   1.774 Checksum of DefaultRequestAmount: 1759619994
   1.774 Checksum of Power_Armor_MK3: 641129692
   1.774 Checksum of searching-flashlight: 0
   1.774 Checksum of textplates: 1623549897
   2.031 Info PlayerData.cpp:55: Local player-data.json available, timestamp 1493553258
   2.031 Info PlayerData.cpp:60: Cloud player-data.json available, timestamp 1493544404
   2.165 Loaded shader file D:/Gry/Steam/steamapps/common/Factorio/data/core/graphics/shaders/game.cso
   2.167 Loaded shader file D:/Gry/Steam/steamapps/common/Factorio/data/core/graphics/shaders/zoom-to-world.cso
   2.182 Initial atlas bitmap size is 16384
   2.187 Created atlas bitmap 16384x8852
   2.737 Created atlas bitmap 4096x3640
  16.677 Error AtlasSystem.cpp:939: Loading sprites failed: The given sprite rectangle (left_top=0x0, right_bottom=128x128) is outside the actual sprite size (left_top=0x0, right_bottom=32x32).
Sprite name: __base__/graphics/icons/repair-pack.png.
If this is being used as an icon you may need to define the icon_size property.
  16.677 Error Util.cpp:58: The given sprite rectangle (left_top=0x0, right_bottom=128x128) is outside the actual sprite size (left_top=0x0, right_bottom=32x32).
Sprite name: __base__/graphics/icons/repair-pack.png.
If this is being used as an icon you may need to define the icon_size property.
  22.150 DSound: Stopping voice
  22.150 DSound: Joining thread
  22.152 DSound: Exit _dsound_update; tid=1648
  22.152 DSound: Waiting for voice to stop ... signaled
  22.152 DSound: Joined thread
  22.152 DSound: Destroying thread
  22.152 DSound: Thread destroyed
  22.152 DSound: Releasing buffer
  22.153 DSound: Voice stopped
  22.153 DSound: Deallocating voice
  22.153 DSound: Deallocated voice
  22.235 Steam API shutdown.
  22.239 Goodbye

Re: [0.15.5] Sprite rectangle outside the actual sprite

Posted: Tue May 02, 2017 12:48 pm
by Toch
Same bug here, Mods Nixie tubes and waterfill (water fill not fully updated for 0.15, just rewrited it for 0.15) does this for me if i delete crop-cache.dat it works again, so basicly i delete this file before every launch. Error itself looks like this Image

edit mine log:
https://pastebin.com/STGC9hMm

Re: [0.15.6] Sprite rectangle outside the actual sprite

Posted: Tue May 02, 2017 2:29 pm
by DevilXD
Newest log from 0.15.6, still the same happens ¯\_(ツ)_/¯

Code: Select all

   0.006 2017-05-02 16:26:19; Factorio 0.15.6 (build 29362, win64, steam)
   0.006 Operating system: Windows 7 Service Pack 1
   0.006 Program arguments: "D:\Gry\Steam\steamapps\common\Factorio\bin\x64\Factorio.exe" "--wait-to-close" "6912" 
   0.006 Read data path: D:/Gry/Steam/steamapps/common/Factorio/data
   0.006 Write data path: C:/Users/DevilXD/AppData/Roaming/Factorio
   0.006 Binaries path: D:/Gry/Steam/steamapps/common/Factorio/bin
   0.226 System info: [CPU:         Intel(R) Core(TM) i3-2120 CPU @ 3.30GHz, 4 cores, RAM: 4039MB]
   0.226 Display options: [FullScreen: 1] [VSync: 1] [UIScale: 100%] [MultiSampling: OFF] [Screen: 255]
   0.227 Available display adapters: 1
   0.227  [0]: \\.\DISPLAY1 - NVIDIA GeForce GT 630 {0x05, [0,0], 1920x1080, 32bit, 60Hz}
   0.228 Create display on adapter 0. Size 1280x720 at position [310, 162].
   0.751 Initialised Direct3D:[0] NVIDIA GeForce GT 630; driver: nvd3dumx.dll 21.21.13.7653
   0.916     Video memory size (dedicated video/dedicated system/shared system/available): 978/0/1763/2734 MB
   1.268 DSound: Starting _dsound_update thread
   1.268 DSound: Enter _dsound_update; tid=3184
   1.268 Device reset internal.
   1.272 Desktop composition is active.
   1.272 WARNING: You have vsync and desktop composition enabled on Direct3d. Consider disabling vsync to increase performance on some confirgurations.
   1.272 Graphics settings preset: medium
   1.273 Graphics options: [Graphics quality: normal] [Video memory usage: high] [Light scale: 80.2419%] [DXT: false]
   2.160 Loading mod core 0.0.0 (data.lua)
   2.653 Loading mod base 0.15.6 (data.lua)
   5.613 Loading mod Compact_Factory 1.5.0 (data.lua)
   5.734 Loading mod Concrete-Walls 1.0.0 (data.lua)
   5.849 Loading mod craftfaster 0.0.3 (data.lua)
   5.968 Loading mod Power_Armor_MK3 1.0.2 (data.lua)
   6.080 Loading mod textplates 0.2.2 (data.lua)
   6.283 Loading mod base 0.15.6 (data-updates.lua)
   6.477 Loading mod DefaultRequestAmount 1.0.0 (data-updates.lua)
   6.695 Checksum for core: 3409166051
   6.695 Checksum of base: 2213884006
   6.695 Checksum of Compact_Factory: 238138037
   6.695 Checksum of Concrete-Walls: 4054545514
   6.695 Checksum of craftfaster: 4194817031
   6.695 Checksum of DefaultRequestAmount: 1759619994
   6.695 Checksum of Power_Armor_MK3: 641129692
   6.695 Checksum of searching-flashlight: 0
   6.695 Checksum of textplates: 2686553149
   7.015 Info PlayerData.cpp:55: Local player-data.json available, timestamp 1493735177
   7.015 Info PlayerData.cpp:60: Cloud player-data.json available, timestamp 1493544404
   7.737 Loaded shader file D:/Gry/Steam/steamapps/common/Factorio/data/core/graphics/shaders/game.cso
   7.893 Loaded shader file D:/Gry/Steam/steamapps/common/Factorio/data/core/graphics/shaders/zoom-to-world.cso
   7.906 Crop bitmaps.
   8.190 Initial atlas bitmap size is 16384
   8.195 Created atlas bitmap 16384x8851
   9.737 Created atlas bitmap 4096x3640
  24.507 Error AtlasSystem.cpp:939: Loading sprites failed: The given sprite rectangle (left_top=0x0, right_bottom=128x128) is outside the actual sprite size (left_top=0x0, right_bottom=32x32).
Sprite name: __base__/graphics/icons/repair-pack.png.
If this is being used as an icon you may need to define the icon_size property.
  24.522 Error Util.cpp:58: The given sprite rectangle (left_top=0x0, right_bottom=128x128) is outside the actual sprite size (left_top=0x0, right_bottom=32x32).
Sprite name: __base__/graphics/icons/repair-pack.png.
If this is being used as an icon you may need to define the icon_size property.
  34.893 DSound: Stopping voice
  34.893 DSound: Joining thread
  34.895 DSound: Exit _dsound_update; tid=3184
  34.895 DSound: Waiting for voice to stop ... signaled
  34.896 DSound: Joined thread
  34.896 DSound: Destroying thread
  34.896 DSound: Thread destroyed
  34.896 DSound: Releasing buffer
  34.896 DSound: Voice stopped
  34.896 DSound: Deallocating voice
  34.896 DSound: Deallocated voice
  35.056 Steam API shutdown.
  35.059 Goodbye

Re: [0.15.6] Sprite rectangle outside the actual sprite

Posted: Tue May 02, 2017 2:38 pm
by Klonan
Seems like a mod error

Re: [0.15.6] Sprite rectangle outside the actual sprite

Posted: Tue May 02, 2017 3:47 pm
by apriori
The same bug but for __base__ sprite. Just updated and tried to launch.
log

Re: [0.15.6] Sprite rectangle outside the actual sprite

Posted: Tue May 02, 2017 4:34 pm
by IG2
I gote the same Error as apriori just postet. Even the sime sprite (oil refinery).

EDIT: Removeing all Mods and reinstalling them from inside the game fixed the Bug for me.

Re: [0.15.6] Sprite rectangle outside the actual sprite

Posted: Tue May 02, 2017 4:39 pm
by credomane
This bug report is a duplicate of 45573. Since the devs are in this thread can I get a dev/moderator move 45573 to dups, please.

Cross linking posts to help pool information together for those keeping an eye on this.

Re: [0.15.6] Sprite rectangle outside the actual sprite

Posted: Tue May 02, 2017 4:52 pm
by credomane
Think I tracked it down to where research-queue is causing this error.

Here is a snippet from research-queue gui.lua

Code: Select all

function get_size(tech)
	if tech.icon_size then return tech.icon_size
	elseif string.find(tech.icon,"__base__") then return 128
	else return 64 end
end

for k, tech in pairs(data.raw.technology) do
	if tech.icon then
		data.raw["gui-style"].default["rq-tech"..tech.name] = 
		{
			type = "frame_style", 
			width = 64, 
			height = 64, 
			scalable = false, 
			graphical_set = 
			{
				type = "monolith", 
				top_monolith_border = 0, 
				right_monolith_border = 0, 
				bottom_monolith_border = 0, 
				left_monolith_border = 0, 
				monolith_image = 
				{
					filename = tech.icon, 
					priority = "extra-high-no-scale", 
					width = get_size(tech),
					height = get_size(tech),
					x = 0, 
					y = 0
				}
			}, 
			align = "center", 
			top_padding = 0, 
			right_padding = 0, 
			bottom_padding = 0, 
			left_padding = 0, 
			flow_style = 
			{
				horizontal_spacing = 0, 
				vertical_spacing = 0
			}
		}
    end
end
From what I gather in this code if the technology that research-queue is attempting to generate an icon for does NOT define icon_size then research-queue guesses. It want a 64x64 button with a 64x64 image BUT a lot of icons in mods are actually 32x32 or some other size. This is causing research-queue to be wrong (and always has been) but it never caused a problem until 0.15. My guess is there was a change in utils.cpp that added a sanity check that is now throwing this error in mods. The error points to the image file in the error message but leaves out any mention of the mod that actually caused the error to be displayed. Misleading the real source of the error. In the cause of OP the error is "blaming" a Factorio image when the real problem looks to be the "craftfaster_0.0.3" mod when it uses the repair-pack image in the technology it creates.

Is there a mod api function to get the real size of an image if icon_size is NOT defined? If there isn't I think research-queue and any other mod that "reaches" into other mods to make icons dead in the water or highly error prone when their dependent mods update their icons.

[edit]
What has me confused is why you get exactly one startup without this error being thrown. After that you get this error message until you delete crop-cache.dat then you get one startup without the error again.

Re: [0.15.6] Sprite rectangle outside the actual sprite

Posted: Tue May 02, 2017 4:56 pm
by DevilXD
Klonan wrote:Seems like a mod error
Yes, but the error message mentions vanilla game files, not mod files ¯\_(ツ)_/¯

Re: [0.15.6] Sprite rectangle outside the actual sprite

Posted: Tue May 02, 2017 6:11 pm
by Loewchen

Re: [0.15.6] Sprite rectangle outside the actual sprite

Posted: Tue May 02, 2017 6:15 pm
by posila
Thanks for the report.
A mod is using 32x32px image for icon that is excepted to be 128x128px. The moc can specify icon_size property to change expected size. It is error the game loads the first time around (when generating crop-cache).
We didn't expect this error to be ever hit by a player (only by us, and mod developers) so it didn't go to minimal mode with option to disable broken mods.
We changed that for 0.15.7 too.

Re: [0.15.6] Sprite rectangle outside the actual sprite

Posted: Tue May 02, 2017 7:00 pm
by apriori
Removing cache dat doesn't affect the result for me. The same error.

EDIT: Even after reinstalling the game.

Re: [0.15.6] Sprite rectangle outside the actual sprite

Posted: Tue May 02, 2017 9:16 pm
by posila
apriori wrote:Removing cache dat doesn't affect the result for me. The same error.

EDIT: Even after reinstalling the game.
Some mod is referencing oil rafinery assets from vanilla, but those changed in the last update (we forgot to put it to changelog). This will also make the game start in minimal mode so you'll see list of mods that use the asset.

Re: [0.15.6] Sprite rectangle outside the actual sprite

Posted: Wed May 03, 2017 7:33 am
by apriori
posila wrote:
apriori wrote:Removing cache dat doesn't affect the result for me. The same error.

EDIT: Even after reinstalling the game.
Some mod is referencing oil rafinery assets from vanilla, but those changed in the last update (we forgot to put it to changelog). This will also make the game start in minimal mode so you'll see list of mods that use the asset.
Is there any way to find out which mod references to this asset? AFAIR I don't have any refinery-related mods installed (as we can see in my log file above).

Edit: specialized oil refinery has got its own asset.

Re: [0.15.6] Sprite rectangle outside the actual sprite

Posted: Wed May 03, 2017 7:57 am
by posila
I can see you use Total Commander, so you can do following:
total-cmd.png
total-cmd.png (14.54 KiB) Viewed 14460 times

Re: [0.15.6] Sprite rectangle outside the actual sprite

Posted: Thu May 04, 2017 6:22 am
by dragontuar
I have the same error and have looked at a few of the images for mods and they are 32x32 when the error says they aren't

Re: [0.15.6] Sprite rectangle outside the actual sprite

Posted: Thu May 04, 2017 7:01 am
by DevilXD
dragontuar wrote:I have the same error and have looked at a few of the images for mods and they are 32x32 when the error says they aren't
posila wrote:A mod is using 32x32px image for icon that is excepted to be 128x128px.
Just wait, it's fixed for the next release :)