How many sprites?

If you have questions about any aspect of QBasic programming, or would like to help fellow programmers solve their problems, check out this board!

Moderators: Pete, Mods

Post Reply
o_O

How many sprites?

Post by o_O »

I am trying to make a game, I am using sprites which are 10x32. I was wondering how many of them could i use without running out of memory.
I have 7 different pics for moving left, 7 for moving right, 5 for up and 5 for down, that is all without masks. Is there enough emory for me to create the masks or will i have to cut down on the number of sprites. So far that is all for one character.
barok_unlogged

Post by barok_unlogged »

i'm guessing thousands. you have 64k of memory to use. in my rpg engine i have a double buffer, 4 maps, up to 10 sprite sets, 4 tilesets, all without running out of space, so i think you will have enough space.

truth be told, we don't know how much. use the command:

fre(-1) to find out how much free space you have.
Anonymous

Post by Anonymous »

Look, a 10x32 sprite takes up 10*32+4=324 bytes of memory, considered that 1 byte is one pixel (256 colormode).

Now, you have 65536 bytes to spend according to barok, so you can make 65536 / 324 = very much (around 200), before your memory is full. ;)
Z!re
Veteran
Posts: 887
Joined: Wed Aug 04, 2004 11:15 am

Post by Z!re »

There are ways around that...


I'm using a 32MB world map, and over 2200 tiles, all of which are 64x64...

Not counting the sprites, which range from 32x32 to 128x128...


Only loading the needed psrites into memory is the trick.


Like... you don't need the LAVA tile, when you're in the smiths house, do you? (Unless there's lava in there, which i doubt)
Anonymous

Post by Anonymous »

We were talking about sprites in conv. mem. ;)

I use EMS (or XMS) too for storing sprites, and I'm also storing thousands of them in it easily ;)
Z!re wrote:Like... you don't need the LAVA tile, when you're in the smiths house, do you? (Unless there's lava in there, which i doubt)
lol :lol: I have lava in my house... (huh? do I? ;))
But, you're right. I only don't use it often for my games, I usually load tiles separately each level. Each level file contains a 'tileset' flag which indicates which tile packets to load. ;)
Post Reply