Page 1 of 1
"Sprite too large"?
Posted: Sun Aug 13, 2017 7:25 pm
by Reika
Some people - notably those playing on lower graphics settings - are getting this error with my mods. I can have low-resolution fallbacks as necessary, or an hr-version (though I do not think most entity types support that explicitly). However, how can I check that the sprite would be too large, or check the settings that determine that? Can I see a user's graphical settings during the data load phase?
Re: "Sprite too large"?
Posted: Sun Aug 13, 2017 7:42 pm
by Veden
you can test the low resolution stuff by switching your graphics settings for Sprite resolution from high to low or if you have the Atlas size at 2048 or less.
I don't know how to check for graphics settings but I was able to solve it by defining an hr_version
Code: Select all
local radarOverlay = util.table.deepcopy(radar)
radarOverlay.name = "item-collector-base-overlay-rampant"
radarOverlay.pictures.filename = "__Rampant__/graphics/entities/chest/itemCollectorOverlay2.png"
radarOverlay.pictures.width = 2048
radarOverlay.pictures.height = 2048
radarOverlay.pictures.direction_count = 1
radarOverlay.pictures.line_length = 1
radarOverlay.pictures.shift[2] = 0.07
radarOverlay.pictures.hr_version = {
filename = "__Rampant__/graphics/entities/chest/itemCollectorOverlay2.5.png",
priority = "low",
width = 3200,
height = 3200,
apply_projection = false,
direction_count = 1,
line_length = 1,
shift = {0.1875, -0.24}
}
Re: "Sprite too large"?
Posted: Mon Aug 14, 2017 2:30 am
by Reika
Veden wrote:you can test the low resolution stuff by switching your graphics settings for Sprite resolution from high to low or if you have the Atlas size at 2048 or less.
I don't know how to check for graphics settings but I was able to solve it by defining an hr_version
Code: Select all
local radarOverlay = util.table.deepcopy(radar)
radarOverlay.name = "item-collector-base-overlay-rampant"
radarOverlay.pictures.filename = "__Rampant__/graphics/entities/chest/itemCollectorOverlay2.png"
radarOverlay.pictures.width = 2048
radarOverlay.pictures.height = 2048
radarOverlay.pictures.direction_count = 1
radarOverlay.pictures.line_length = 1
radarOverlay.pictures.shift[2] = 0.07
radarOverlay.pictures.hr_version = {
filename = "__Rampant__/graphics/entities/chest/itemCollectorOverlay2.5.png",
priority = "low",
width = 3200,
height = 3200,
apply_projection = false,
direction_count = 1,
line_length = 1,
shift = {0.1875, -0.24}
}
Not all entities support hr versions.
Again, is it possible to fetch user graphics settings?
Re: "Sprite too large"?
Posted: Mon Aug 14, 2017 8:56 am
by Mooncat
Normal resolution supports images up to 2048 x 2048 px.
High resolution supports images up to 4096 x 4096 px.
It is not about users. It is Factorio's limit.

Re: "Sprite too large"?
Posted: Mon Aug 14, 2017 9:29 pm
by Reika
Mooncat wrote:Normal resolution supports images up to 2048 x 2048 px.
High resolution supports images up to 4096 x 4096 px.
It is not about users. It is Factorio's limit.

Yes, but how can I know which the user has selected? I do not get the errors, and others have resolved them by simply raising their graphics settings.
Re: "Sprite too large"?
Posted: Tue Aug 15, 2017 12:22 am
by Reika
Also, the error is being thrown for images much less than 2048 pixels on a side.
Re: "Sprite too large"?
Posted: Tue Aug 15, 2017 2:18 am
by Mooncat
Ah, I should correct the statements. The limits are applied on any side of the image.
"Normal resolution supports images up to 2048px on any side.
High resolution supports images up to 4096px on any side."
In the entities that support HR images, there should be something like
Code: Select all
filename = "__mod__/graphics/a.png",
hr_version =
{
filename = "__mod__/graphics/b.png",
...
}
Outside hr_version, you should use normal resolution images. So, in this case, a.png is NR, b.png is HR.
Only a.png is loaded when the user uses "normal" or lower graphic quality, and only b.png is loaded when user uses "high" graphic quality.
Re: "Sprite too large"?
Posted: Tue Aug 15, 2017 5:29 pm
by Reika
Mooncat wrote:Ah, I should correct the statements. The limits are applied on any side of the image.
"Normal resolution supports images up to 2048px on any side.
High resolution supports images up to 4096px on any side."
In the entities that support HR images, there should be something like
Code: Select all
filename = "__mod__/graphics/a.png",
hr_version =
{
filename = "__mod__/graphics/b.png",
...
}
Outside hr_version, you should use normal resolution images. So, in this case, a.png is NR, b.png is HR.
Only a.png is loaded when the user uses "normal" or lower graphic quality, and only b.png is loaded when user uses "high" graphic quality.
Again, the users are getting the error with images that are like 1600x700. And what do I do for entities that do not support hr, such as smoke - which as it happens,
all my problem entities are?
Re: "Sprite too large"?
Posted: Tue Aug 15, 2017 6:24 pm
by Mooncat
Reika wrote:Again, the users are getting the error with images that are like 1600x700.
Have no idea what's going on there. Probably need to ask a dev. Log file will help.
Reika wrote:And what do I do for entities that do not support hr, such as smoke - which as it happens, all my problem entities are?
Simply don't supply HR images. The hr_version attribute is an option for the users who can load HR images. But for those who can't, maybe due to graphic card limitation, the hr_version attribute will be ignored, and the image outside hr_version will be loaded instead. So you should only provide NR images there. If hr_version is not supported, treat it as "this object doesn't have HR images".
Re: "Sprite too large"?
Posted: Wed Aug 16, 2017 11:31 pm
by Reika
Mooncat wrote:Reika wrote:
Simply don't supply HR images. The hr_version attribute is an option for the users who can load HR images. But for those who can't, maybe due to graphic card limitation, the hr_version attribute will be ignored, and the image outside hr_version will be loaded instead. So you should only provide NR images there. If hr_version is not supported, treat it as "this object doesn't have HR images".
I am not willing to have a sprite whose frames are like 100x200 when the object it is for is 40 tiles wide.
Re: "Sprite too large"?
Posted: Thu Aug 17, 2017 9:20 am
by Mooncat
Reika wrote:Mooncat wrote:Reika wrote:
Simply don't supply HR images. The hr_version attribute is an option for the users who can load HR images. But for those who can't, maybe due to graphic card limitation, the hr_version attribute will be ignored, and the image outside hr_version will be loaded instead. So you should only provide NR images there. If hr_version is not supported, treat it as "this object doesn't have HR images".
I am not willing to have a sprite whose frames are like 100x200 when the object it is for is 40 tiles wide.
There is no other way to overcome this limit AFAIK. You should make a request for supporting separated spritesheets.
Currently, there is "stripes" for entities that have directions, e.g. robots, turrets, units, car, tank, and even spawners. But it didn't work on non-directional entities.
Good luck.