I made some experiments and using AnimatedSprite seams less memory intensive that Sprites (+AnimationPlayer).
Here is how I did:
- Create 4 sprites (500x500px PNG 16b color) and create an AnimatedSprite with it.
- Create a 2000x500px spritesheat to use my sprites in a Sprite and configure an Animation Player accordingly.
I instanciate either Sprites or Animated Sprites multiple times with a script and use the monitoring tools to benchmark them:
- Static memory for 100 Sprites: 24Mio (Animated Sprites) / 26Mio (Sprites)
- Static memory for 1000 Sprites: 25Mio (Animated Sprites) / 51Mio (Sprites)
- Static memory for 10000 Sprites: 43Mio (Animated Sprites) / 302Mio (Sprites, can only display at 50FPS)
- Static memory for 20000 Sprites: 62Mio (Animated Sprites, 50FPS) / 580Mio (Sprites 40FPS)
I tried to preload the texture in the script and assign it to every Sprite but it did not change the result.
If someone can explain why I may be interrested. Nevertheless because I like to use Blender to animate my 2D characters it's easier for me to use Animaed Sprites.
Version: Godot v3.2.2 (official)