1
\$\begingroup\$

I've been making a game that features 2 traditionally animated playable characters, hd backgrounds, props, and extra special effect animations. Things have gone well so far, but I have a few questions regarding HD animated sprites and the use of texture atlasing.

The first: What are some best practices to determine the total texture budget of a modern 2d game? So far, I have considered the following: The characters on their own take up roughly 256 x 256px worth of screen space, but of course that size will vary depending on the intended size of the character. I expect each character to have more than 10 - 12 unique animated sequences. The frames per animation will obviously vary as well depending on the animation length and level of detail. Assuming each animation has about 15 frames, that would mean that a single character's texture atlas could be something around the lines of 3072 x 3072px (or rounding up to the nearest power of two). Two characters would obviously require double the texture size in memory.

Basically, how do I determine if a budget is "acceptable" for modern hardware? How can I tell if it's ok that, at worst, two characters require 6144x6144px worth of memory space?

Secondly: Is it better to load all of our sprite's resources on one huge atlas texture? Or separate textures for each animation? For example, instead of one big "character.tga" file with every animation, you could have "character_idle" and "character_attack" and "character_win" which could be loaded as separate resources. On one hand, it would probably both be slower to load and harder to manage if every animation was a separate texture resource. On the other hand, if you only needed to have a characters "idle" animation, you could choose to only load that animation.

\$\endgroup\$

closed as primarily opinion-based by Kromster, MichaelHouse Dec 1 '14 at 16:04

Many good questions generate some degree of opinion based on expert experience, but answers to this question will tend to be almost entirely based on opinions, rather than facts, references, or specific expertise. If this question can be reworded to fit the rules in the help center, please edit the question.

  • 1
    \$\begingroup\$ #1 is opinion-based. #2 is too broad. #3 is was answered here before, search plz. #4 is too broad. \$\endgroup\$ – Kromster Dec 1 '14 at 8:59
  • 1
    \$\begingroup\$ How is "how do I determine if a budget is "acceptable" for modern hardware?" too broad? I understand that memory can vary between clients, but there must be a logical way in which games like Destiny, Dota 2 or any game determines its budget. I have a general idea of what requirements my game has, how do I determine if those statistics are realistic for modern PCs. Similarly, #3's closest answer is this: gamedev.stackexchange.com/questions/69539/… which doesn't actually tackle the issue in regards to animation, which is \$\endgroup\$ – TheYokai Dec 1 '14 at 10:12
  • 1
    \$\begingroup\$ a more specific use case \$\endgroup\$ – TheYokai Dec 1 '14 at 10:13
  • \$\begingroup\$ What is a modern hardware - PC, PS4, XBOX-One? You did not even specified that. \$\endgroup\$ – Kromster Dec 1 '14 at 10:35
  • \$\begingroup\$ "characteristic of present and recent time; contemporary; not antiquated or obsolete" - Defintion of modern courtesy of Dictionary.com \$\endgroup\$ – TheYokai Dec 1 '14 at 10:38
1
\$\begingroup\$

What are some best practices to determine the total texture budget of a modern 2d game?

This likely depends on the size of your target platforms RAM/VRAM, and how much you'll need to have loaded at one time. It's probably something that you have to fine-tune. Another thing to consider is non-volatile storage (media/disk space, etc.).

How can I tell if it's ok that, at worst, two characters require 6144x6144px worth of memory space?

Texture budget will depend on what hardware you're targeting, as each device will have a different maximum texture size. Look at the range of devices that you plan on supporting (mobile devices, consoles, PC hardware, etc.) and try to find out the lowest common denominator. If you have two characters, you probably don't want to have their sprites on the same atlas due to the fact that only one of them might be needed at a time.

Is it better to load all of our sprite's resources on one huge atlas texture? Or separate textures for each animation?

It's a trade off. Switching UV indices within a single texture is a lot faster than binding a different texture. However, having textures that are too big or being forced to load more than you need at any given time is also not ideal and can bog down performance. It could be that the time to bind a different texture is relatively minimal, in which case multiple texture atlases might be the way to go. But if your character switches animations very frequently, and each animation is only a few frames, then you might find it works better to pack as many frames into your atlas as you can until you reach your decided max texture size.

Good luck.

\$\endgroup\$

Not the answer you're looking for? Browse other questions tagged or ask your own question.