Questions about 2d sprites

Blitz3D Forums/Blitz3D Programming/Questions about 2d sprites

mv333(Posted 2009) [#1]
1) Are there any size/color/amount limits with 2d sprites, like there was on Amiga/C64?

2) Is there a certain pixel size you should stick to, when creating sprites? I think a while back i saw someone mention that you should stick with even numbers, or increase the number by 8?

3) Which format should i use for sprites? JPEG, PNG......

4) Why does Blitz use animstrips, instead of separate images, for animation?


Thanks.


Matty(Posted 2009) [#2]
A lot of this depends on whether you are referring to 2d mode or 3d mode.

1) - 32 bit color (8 bit per channel RGB and 8 bit alpha) or -16 bit color depending upon your call to 'graphics' command
1) - textures larger than 2048 in any dimension will be reduced to that size, images - as large as your video memory can handle
2) - images - dimensions don't matter, textures - size of each side power of 2 and preferably square although some cards can handle rectangular (but still power of 2 size) textures
if they are not power of 2 often blitz will resize them internally so that they are power of 2 in size
3) - jpg - good if you don't need to mask, png with alpha - although alpha irrelevant in 2d mode, tga with alpha, bmp, alpha only applicable with textures
4) if you're talking about animating in 2d not 3d then there's no advantage of using animstrips instead of single images except for load times and ease of use.


Ginger Tea(Posted 2009) [#3]
4) Why does Blitz use animstrips, instead of separate images, for animation?


if the images are small, eg they all fit in a single 640*480 bitmap, then thats one image and a few drive clusters and not god knows how many width by height sprites you would be using taking up many many many clusters

my usual analogy is take a bottle of jd or vodka or whatever and put a single shot in a pint glass and repeat till the bottle is empty
now what is more space saving (ie drive clusters) one bottle with 28 shots or 28 nigh on empty pint glasses?

or for example a card deck 52 individual faces + 1 or back's + 1 or 2 joker's as individual bitmaps or one bitmap going
A12345678910JQK***
A12345678910JQK***
A12345678910JQK***
A12345678910JQK***

*'s denote extra images (ive chosen to pad it out to 16) for card backs jokers etc

if you have many sprites that are retro low res (ie amiga/c64 sizes) you can get many many animstrips out of one bitmap, all you have to do is index it right
hero a walk left frames 1 2 3 4
hero a walk right frames 5 6 7 8
hero b walk left frames 9 10 11 12
etc