2d game / sprite (a lot)

Godot Version



Hello everybody,

I have for a project to make a little 2d game rogue like / rpg with a friend.

I have pick up some assets (sprites) for players/enemies.

Players and enemies will be compose by superposed animated sprites (bodies, weapons, wearings, helmets, shieds, etc, …with for each walk animation, idle animation, fighting animation, etc…

My problem is how to implement animation of characters with all these sprites (may be 1000 sprites in all, i think)

  • My first question is in a true game, 1000 sprites is big or not ? Is it the good way make this kind of game ?

  • May i load all sprites at the begining of game, or only when i use them?

Thanks for your answers,
A gamer :wink:

Those are loaded questions, to be honest. :sweat_smile:

A quick answer is that regardless of how many animated sprites you have, and unless you have thousands of animated assets on the screen at the same time, it shouldn’t be a problem.

Mainly the reason is that you will have a limited number of assets in a level (scene) loaded at the same time. Let say 10 NPCs each with 16 sprites. It’s still “only” 160 sprites. When I say that I have Octopath Traveller in mind as an example. Then you might have trees/foliage which might be 4 each… All I’m saying is, it’s a non-issue. And again, problems might arise when you have a a buttload of assets in a single scene.

Now, the logic behind all this might become a problem. Like, large scripts that might coordinate things. Bloat might become a problem.

The number of sprites shouldn’t be a problem as those not used in a scene are simply files in the res:// pack. What matters is those loaded in a scene. Although, the thing you have to keep in mind is that assets files will make your distribution file bigger. So, keep what is used, remove what’s unnecessary.

Hopefully that might answer some of the questions.

Thanks for your answer,

I have noticed two point:

  • Take care to the script to manage sprites
  • Clean ressources unused in the asset pack

As you work on your project, once in a while do an export and verify that it works as intended and keep an eye on the export files, check the size, etc.

If possible have other people you trust run it, or better yet, if you have another machine (or a virtual machine) run it there and see what happens.

It’s all part of a process. But honestly, code. Just code and see what happens. Don’t put hurdles and fences around yourself before you start.