What is the maximum size for 2D sprites?

Godot Version

4.2

Question

A few days ago I rendered some images in Blender to create a 2D animated sprite in Godot. Since I’m a badass, I rendered them in 1080p. It was about 84 “photos” that I put into an AnimatedSprite2D (I scaled them to 0.06 D:! ). My godot threw errors everywhere. It was closing.
I thought it was just a bug in my code, but when testing in other projects it always happened when loading the images.

That’s why my specific question. What is the maximum size, or the recommended size for the images that will be part of Animatesprite2D?

Please share the errors it threw, that would probably help

1 Like

Generally the Godot was closed directly.
After much insistence I was able to get it to run. Godot consumed 22GB of ram on my PC. And there were errors in all the lines of the code and other errors that I don’t know about. But attached in the image:

When I deleted this scene I only had the animatesprite2D with the 84 images added. It did not generate any errors and everything returned to normal.

Those errors should probably be fixed, something is wrong in your scene setup

2 Likes

So it’s not because of the problem of using high resolution images?

Well I don’t know, you should fix the things that have obvious errors first or try to fix them, the errors are helpful when you listen to them.

You can also try putting the image in a separate scene, if it doesn’t break then you can be quite sure it’s unrelated

1 Like

Yes, I will continue testing.

To clarify, these errors do not exist without the animatesprite2D node. The errors seen refer to signals between nodes. But if I let the game run for a while (I closed it because it consumes 22GB of ram) errors occur in almost all lines, even in lines such as variable declarations.

They’re not errors of signals but of nodes being missing, try just removing the texture and keep the nodes

if they are missing node errors. But as I clarify again. These errors are throughout the code. For example, the first error in red refers to the “mundo” scene.
The following lines in red refer to the UI scene.
Then a bug occurs in the “cuartel” scene where the progress bar supposedly no longer exists.

etc etc

Finally no node works in the game…

All these lines do not generate an error when I just delete the animatesprited2d that has all these textures.

Here I leave an image of the game running once the AnimateSprite2D node has been deleted. As you can see no red.

Well do you have a script on the animated node? The errors aren’t likely to be caused by the size of the sprite but the code, try replacing the image with a smaller one

1 Like

My plan is to render all the images again at a much smaller size. That’s why I wanted to know what size would be recommended? if it exists.

As for the animation code. Simply declaration and ready function:

var animatesprite_2d=$AnimateSprite2D
func _ready():
animatesprite_2d.play(“anim”)

after finishing rendering I was so eager to see what it would look like in the game </3

Well there isn’t a limitation here beyond the texture limitations of your graphics card, so again this is probably not the cause

So I ask again: does the nose that seems to cause the problem have any script? If so please show it

Render the images to the relevant screen size. If your characters should take 40x60 pixels then make a 40x60 render. Use the ruler tool to find out exactly. Godot will decompress images into RAM so unlike the files on disk any extra pixel added will directly increase RAM usage.

2 Likes

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.