"Sprite too large"?

Place to get help with not working mods / modding interface.
Post Reply
User avatar
Reika
Filter Inserter
Filter Inserter
Posts: 582
Joined: Tue May 19, 2015 1:56 am
Contact:

"Sprite too large"?

Post 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?
Image

Veden
Filter Inserter
Filter Inserter
Posts: 294
Joined: Wed Jul 13, 2016 3:54 pm
Contact:

Re: "Sprite too large"?

Post 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}
}

User avatar
Reika
Filter Inserter
Filter Inserter
Posts: 582
Joined: Tue May 19, 2015 1:56 am
Contact:

Re: "Sprite too large"?

Post 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?
Image

User avatar
Mooncat
Smart Inserter
Smart Inserter
Posts: 1190
Joined: Wed May 18, 2016 4:55 pm
Contact:

Re: "Sprite too large"?

Post 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. ;)

User avatar
Reika
Filter Inserter
Filter Inserter
Posts: 582
Joined: Tue May 19, 2015 1:56 am
Contact:

Re: "Sprite too large"?

Post 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.
Image

User avatar
Reika
Filter Inserter
Filter Inserter
Posts: 582
Joined: Tue May 19, 2015 1:56 am
Contact:

Re: "Sprite too large"?

Post by Reika »

Also, the error is being thrown for images much less than 2048 pixels on a side.
Image

User avatar
Mooncat
Smart Inserter
Smart Inserter
Posts: 1190
Joined: Wed May 18, 2016 4:55 pm
Contact:

Re: "Sprite too large"?

Post 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.

User avatar
Reika
Filter Inserter
Filter Inserter
Posts: 582
Joined: Tue May 19, 2015 1:56 am
Contact:

Re: "Sprite too large"?

Post 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?
Image

User avatar
Mooncat
Smart Inserter
Smart Inserter
Posts: 1190
Joined: Wed May 18, 2016 4:55 pm
Contact:

Re: "Sprite too large"?

Post 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".

User avatar
Reika
Filter Inserter
Filter Inserter
Posts: 582
Joined: Tue May 19, 2015 1:56 am
Contact:

Re: "Sprite too large"?

Post 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.
Image

User avatar
Mooncat
Smart Inserter
Smart Inserter
Posts: 1190
Joined: Wed May 18, 2016 4:55 pm
Contact:

Re: "Sprite too large"?

Post 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.

Post Reply

Return to “Modding help”