Game Development Community

Sprite Size

by Tim Saunders · in Torque Game Builder · 01/07/2008 (3:27 am) · 7 replies

I'm running my game in 800 by 600 resolution and I'm using sprites that are 32x32 size. If I don't specify a size for my sprites then they are scaled down considerably when the game is running. I thought the default size was their original size?

Also is there any performance benefit from using 32x32 size tiles instead of say 50x50? I'm considering making them a bit bigger you see...

#1
01/07/2008 (3:53 am)
The size of the sprite has no reference on how big it will appear in game. Each sceneObject has a 'size' parameter which determines that. The size of the sprite only effects how detailed it is.
Increaseing the size of sprites increases the amount of memory the game will need to load them. It's a balencing act between sprite quality and memory consumption.
#2
01/07/2008 (6:07 am)
Also most graphiccards handle images which have sizes by the power of 2 much faster than a 50x50 image for an example.
#3
01/07/2008 (6:15 am)
50x50 sprites will get padded to 64x64 when TGB loads them... unfortunately this has some nasty side effects. Without going into too much detail TGB will load your 50x50 sprite, and copy it into a NEW 64x64 one using up twice the memory. So, with TGB ALWAYS keep ALL your images power of 2.
#4
01/07/2008 (8:06 am)
Not only that, but most will do conversion work to get them to PoT, which takes up processing cycles and can add unwanted artifacting to your images.
#5
01/07/2008 (8:26 am)
Quote:
Without going into too much detail TGB will load your 50x50 sprite, and copy it into a NEW 64x64 one using up twice the memory. So, with TGB ALWAYS keep ALL your images power of 2.

Wow didn't know that! Thanks for the info. So if I leave my images as PoT then they aren't loaded twice?
#6
01/07/2008 (8:47 am)
They're technically not "loaded" twice, but they do take up twice the memory (and of course some extra processing power at load time, but this most likely isn't a concern)...
Torques memory manager is a bit peculiar at times, it doesn't really like letting go of memory.

So, yes. Keeping your images pow2 is definitely a good thing.
#7
01/07/2008 (11:21 am)
Thanks for the inside info.