2
\$\begingroup\$

Lets say you have a game like Phoenix Wright: Ace Attorney, where characters appear on screen and do things like:

  • change their stance/pose depending on the situation and mood (looking happy, looking sad, looking at the camera, looking to the side, etc.)
  • move their mouths while their text is printing out
  • randomly blink
  • do other stuff (getting pecked by a bird for example)

I'm not sure how I should go about saving all those different "sub animations" in my spritesheets. Should everything related to one character be saved in one huge spritesheet? Or should all those sub animations have their own separate spritesheet? Should I save ALL blinking related sprites in one spritesheet or should I keep them separate from each other (one spritesheet for the blinking sprites of the happy pose, one file for the sad pose, etc)?

I would like to know what the preferred approach would be from a technical and "artistic" standpoint:

  • What's the best way to save up on space and make sure the game handles the sprites well?
  • What "format" would be preferred for the guy actually creating those sprites? I don't mean format as in file format or even a tool specific for the creation of spritesheets, but more HOW the sprites are arranged on the spritesheet(s).
\$\endgroup\$
  • \$\begingroup\$ Since the main advantage of having sheets is to able to load multiple the sprites at the same time, and not have to switch textures to use them. The pragmatic criteria is how will you load them. So, try to keep things together (as much as file and texture size allows) in this order: all the sprite of an animation of a character, all the sprites for animations around the same pose of a character, all the sprites of a character. Choosing format is broader, my advice is to see what formats are common for your engine / platform and choose among those the easier to use for you that will work. \$\endgroup\$ – Theraot May 3 '17 at 8:46
  • \$\begingroup\$ @Theraot Sorry, I should've been more clear with what I mean with format: not talking about file format actually, more like how the sprites should be arranged in the spritesheets. Edited my question for clarity. \$\endgroup\$ – noClue May 3 '17 at 8:51
0
\$\begingroup\$

Format and layout doesn't really matter for the artist because you can process and pack the sprites to take up less room.

You can tell the artist to save each sprite in a separate file and make everything that is not part of the sprite fully transparent.

Then you use a tool to go over every sprite and find some tight enough enclosing geometry and then go and pack several of them into a single sheet. while making sure there are no overlaps. Prefer packing sprites that you need together into a single file. For example all the frames of a sobbing animation would go into the same file.

You save the layout of each sheet so you can index them by the original file name (or whatever you use as sprite identifier) so you can create the geometry to display it at runtime. Make sure to discard the pixels that are fully transparent.

This allows you to add hot-loading of new sprites easily. Your engine can then monitor a directory of raw files with 1 sprite each and each time a file is updated in it you and then loading the updated file and letting it override any previously loaded sprite with the same ID.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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