Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Professional Discussion / Technical Question - How DBPro loads images

Author
Message
Kangaroo2
23
Years of Service
User Offline
Joined: 26th Sep 2002
Location: United Kingdom
Posted: 17th Aug 2003 04:00
Hi all, I'm back with another silly question for people in the know

I have a few games with large amounts of images used for sprites - thousands of images to load.

I have these images saved as Bitmaps (although obviously I compress them for downloading/installing ) but to save disk space and bandwidth I reduce their colour palettes, usually customised 16 colour or 256 colour. (Even great looking, large Street Fighter Alpha Sprites fit into 16 colours each usually perfectly and obviously the file size is tiny )

BUT I remember reading somewhere that when you load an image in dbpro, it automatically converts it to 32bit. Thats fair enough, but presumably it takes longer to load them if they are NOT 32bit in the first place, so considering I'm loading thousands of the blighters, am I wasting lots of time?

OR Is the speed difference un-noticable until millions of images are loaded?

OR Is there no speed difference, as even 32-bit images are "converted" to 32-bit as well?

Obviously I could run a large "for next" loop to thousands of identical images and test this but I have a feeling that would be far from accurate.

Also will different graphics cards do this at different speeds, or does the main CPU deal with it? And does loading all images in 32bit mode mean that any game running in 16bit mode (a necessity on many older pcs) will slow down, or does 16-bit mode render faster anyway?

Its a small niggly point I know, but its a thought that has been plaguing me, although personally I think quicker download times will probably prevail either way. (And please don't suggest other file types, I HAVE to use Bitmaps)

Thanks for any input, Sam / K2
Bunnies aren't just cute like everybody supposes, They got them hoppy legs & twitchy little noses,
And what's with all the carrots? What do they need such good eyesight for anyway?
IanM
Retired Moderator
23
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 17th Aug 2003 04:20
The conversion time to 16 or 32 bits is insignificant compared to the time it takes to get all the data from the disk.

Ideal file sizes would be below 4k, so that the OS gets the data in 1 block, but basically, the less data, the faster despite conversion ... for bitmaps at least.
Dreamora
23
Years of Service
User Offline
Joined: 20th Sep 2002
Location: Switzerland
Posted: 17th Aug 2003 05:30 Edited at: 17th Aug 2003 05:31
the most speed in your game you are gonna lose because of the amount of files as IanM said.

better try to get the amount of files down by moving them together in 1 file, this lowers the amount of disc operations and speeds up loading extremly.

every spriteorder (jump animation for example) in 1 pic or depending on the width-height of your sprites even more than 1 order in 1 pic.
as long as the file isnt larger than 1024x1024 (perhaps 2048x2048) everybody should be able to run it

and i think on a that large bitmap you will get quite a lot animation parts of a character.

Kangaroo2
23
Years of Service
User Offline
Joined: 26th Sep 2002
Location: United Kingdom
Posted: 17th Aug 2003 22:54
Thank you, both, that sets my mind at rest.

Yes I have considerred putting the sprites together into sprite sheets to speed up loading. There's a good, (but slightly pinickity ) reason why I haven't so far, but I may well change my mind soon

Bunnies aren't just cute like everybody supposes, They got them hoppy legs & twitchy little noses,
And what's with all the carrots? What do they need such good eyesight for anyway?

Login to post a reply

Server time is: 2026-07-22 18:53:47
Your offset time is: 2026-07-22 18:53:47