gbadev.org forum archive

This is a read-only mirror of the content originally found on forum.gbadev.org (now offline), salvaged from Wayback machine copies. A new forum can be found here.

Graphics > Regarding sprites, what are TALL and WIDE

#73659 - gs2phateon - Mon Feb 27, 2006 6:34 am

and how do you use them?

I am working on a game that I thought I might be able to use 64x64 sprites, until I realized how much space the actual bitmaps take up. But I was hoping that I could simply stretch the normally square 32x32 sprite to better take advantage of the space. Is this the right way to go about doing that?

#73660 - LOst? - Mon Feb 27, 2006 6:46 am

gs2phateon wrote:
and how do you use them?

I am working on a game that I thought I might be able to use 64x64 sprites, until I realized how much space the actual bitmaps take up. But I was hoping that I could simply stretch the normally square 32x32 sprite to better take advantage of the space. Is this the right way to go about doing that?


TALL and WIDE do not stretch the sprites graphics. They are states telling the shape of non squared sprites.
_________________
Exceptions are fun

#73662 - gs2phateon - Mon Feb 27, 2006 6:50 am

Ok, but what do you use them for?

#73669 - Fatnickc - Mon Feb 27, 2006 8:09 am

Well, if you had a 32x16 sprite, that could be called WIDE, as it is wider than a square (which is what is defaulted to, in effect). If, however, you had a 16x32 sprite, that would be called TALL.

#73680 - keldon - Mon Feb 27, 2006 11:26 am

gs2phateon wrote:
and how do you use them?

I am working on a game that I thought I might be able to use 64x64 sprites, until I realized how much space the actual bitmaps take up. But I was hoping that I could simply stretch the normally square 32x32 sprite to better take advantage of the space. Is this the right way to go about doing that?

http://user.chem.tue.nl/jakvijn/tonc/regobj.htm
Affine sprite in double size will do that.

#73693 - Cearn - Mon Feb 27, 2006 3:16 pm

Doubling the size of a sprite:
  • Set bits 8 and 9 in attribute 0 to make it an affine sprite with a double-size canvas
  • Select an object affine matrix for this sprite in attribute 1 (bits 8-12)
  • Fill that matrix with (pa,pb,pc,pd)= (0x80, 0, 0, 0x80). If you need to flip things, flip the signs.
Of course, the resultant sprites will be a little blocky.

How many 64x64 sprites do you intend to use? With only a 240x160 screen it can fill up pretty quickly so it can't be that many. If you're worried about the amount of animation frames, you don't have to load them up all at once; you can overwrite obj-VRAM at any time. Well not any time I guess, but you should be able to finish copying before the VBlank runs out if you use CpuFastSet or DMA.

#73705 - poslundc - Mon Feb 27, 2006 5:23 pm

It's important to bear in mind that (in addition to the 128 object limit) the GBA can only process so much sprite data on each scanline, and affine sprites consume more than three times the available cycles that normal sprites do.

If you use 32x32 scaled to 64x64, you will not be able to have more than 5 of them sharing a single scanline (including sprites that are partially or entirely obscured by other sprites) without having dropout occur.

Dan.

#73738 - tepples - Mon Feb 27, 2006 11:38 pm

If you make a mock-up of what the screen might look like, we might be able to help you pick display modes and the like.
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.

#74182 - gs2phateon - Fri Mar 03, 2006 7:00 am

My problem isn't what you guys are thinking it is.

When I said the sprites take up too much room, it's not in the RAM, but the actual bitmaps themselves.

I made 10 64x64 frames, and when I compiled them into the .gba file, the file size increased by 50-75 Kb. I can live with the 32x32 size, but I don't want to have to shell out 500-700 Kb for the animations of the main sprite alone. I have so many other things like the actual levels, coding, and enemy sprites, that I'd rather conserve space than find out halfway through the project that I'll end up way over my 4096 Kb goal.

EDIT:
One quick (hopefully not too stupid) question:
Am I right to assume that a 32x32 bitmap would take up 1/4 of the space a 64x64 bitmap would?

#74186 - gauauu - Fri Mar 03, 2006 8:50 am

So you are worried about the total size of your ROM?

First, you should decide if a smaller rom size will be worth uglier sprites -- remember what scaled sprites looked like on the SNES? Neat while they were scaling, but ugly if you caught them in a still frame.

Second, consider some sort of compression on your bitmaps. Even something simple like run-length encoding usually significantly shrinks down the size.

Third, if you aren't using 16-color sprites, switching to them will really cut the size of your graphics data in half.

#74206 - tepples - Fri Mar 03, 2006 2:35 pm

64*64*10 = 40960 bytes. Gauauu is right on both counts: If you use 16-color sprite cels, you can cut that in half. And yes, run-length compression of the transparent areas of the sprite cel is a big win.

But in a modern commercial-quality GBA game, it might be wise to devote 500 KB to a main character. You have 8192 KB available in the "64 Mbit" cart.
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.