AuthorTopic: Sprite size question  (Read 3740 times)

Offline Ackernym

  • 0001
  • *
  • Posts: 13
  • Karma: +0/-0
    • View Profile

Sprite size question

on: December 03, 2018, 09:33:20 pm
Hello Everyone!

I have a question about sprite sizes and animations that's been bugging me for quite a while now, and I can never seem to find a solid answer no matter how hard I look. I was wondering if when a game console, like the SNES, specifies that sprites must be 32x32 or whatever dimension, does it mean that the sprite needs to be exactly 32 pixels high by 32 pixels wide, or does it only mean that the sprite needs to fit in a 32x32 box, but it can be smaller? Similarly, how would a sprite animation work then? Is it also constrained by the sprite sizes, or can it be bigger?

Offline eishiya

  • 0100
  • ***
  • Posts: 1266
  • Karma: +2/-0
    • http://pixeljoint.com/p/28889.htm
    • View Profile
    • Website

Re: Sprite size question

Reply #1 on: December 03, 2018, 10:21:16 pm
It means the sprite must fit within that box, but it can be smaller (or rather, it should probably be that size, but unused pixels can be transparent).
Animates sprites are just sequences of different sprites displayed over time, so all the individual frames must fit the rules, but things can change between frames (such as position, palette, etc). This can mean that the entire animation as seen by the player can appear to be larger than the sprite size limit, although each frame is still within the limits.

In practice, a character can actually consist of multiple hardware sprites, and thus appear larger. For example, the NES used 8x8 hardware sprites, but most characters on the system were larger - this was done by building each character out of multiple sprites. These sprites didn't even have to be arranged in a grid, they could overlap, and clever designers used this to seemingly break the NES's limitations, such as by giving Mega Man more colours than is normally allowed:

(Source: http://www.dustmop.io/blog/2015/06/08/nes-graphics-part-2/ )
Note how the face overlaps some of the other sprites' boundaries, and how the overall shape of the sprite isn't a rectangle.

On most modern platforms, this hardware sprite trickery no longer happens, because modern hardware deals with vector planes and textures, "sprites" are just flat planes with a texture on them, and the size limitations are very large (and constrained by RAM and VRAM rather than by pixel size). When people give a sprite size limit in the context of these platforms, it's more of a stylistic thing, it tells the artist what the maximum size should be.

Offline Ackernym

  • 0001
  • *
  • Posts: 13
  • Karma: +0/-0
    • View Profile

Re: Sprite size question

Reply #2 on: December 03, 2018, 11:30:37 pm
Thank you so much for your detailed response! You've answered probably one of the biggest questions I've had about sprinting!

Offline yrizoud

  • 0010
  • *
  • Posts: 330
  • Karma: +0/-0
    • View Profile

Re: Sprite size question

Reply #3 on: December 04, 2018, 04:24:12 pm
This is also why early games sometimes made mistakes in choosing a good size : When a character was already tightly fitting in (for example) a 8x16 box, it was quite awkward to draw an animation frame where he punches/kicks and STILL fit in the 8x16 box. The artist would provide a sprite where the character punches like 2 pixels in front of him, the gameplay/hitbox would be made according to it, and this is how you get horrible action games.

Offline Ackernym

  • 0001
  • *
  • Posts: 13
  • Karma: +0/-0
    • View Profile

Re: Sprite size question

Reply #4 on: December 06, 2018, 04:43:36 am
ah, I didn't know that either. Thanks for the additional info!