TNT Basic Forums > Programming Q&A
Optimising graphic and sound loading
< Last Thread     Next Thread >
Thread        Post A Reply

02-02-2003 21:31

Posted by:

Click Here to Email Machi   Find more posts by Machi

Because I have a number of large sprites and, probably, quite a few sounds that I need to load at the beginning of a program, the loading is currently taking around 40 seconds. I would like to reduce this time as much as possible without significant modification to the contents. I am already structuring the program to perform as much loading as possible in the "cracks" - when the main menu is displayed etc -ie times when the user is probably not reacting faster than the computer, but I need to do better.

1) Any tricks or tips that might expedite this loading ?
2) Is it faster to place a large number of sprites in a single image bank or to distribute them across a large number of small banks ?
3) Are there any critical thresholds that I should be aware of in terms of sprite size, sound size etc ?
4) Are jpegs faster, slower or no different to other formats given the same size file ?
5) Likewise, is there any difference in the performance of the different sound file formats that are supported ?
6) How does the number and size of variables - especially arrays - impact the startup and performance ?
7) Are there any significant differences, given that I am simply using graphics mode and not input mode throughout, between OS 9 and OS X performance ? (I haven't seen any significant differences in systems with no other applications running, but I thought I'd ask)

02-02-2003 23:04

Posted by:
Mark Tully

TNT HQ, England

Click Here to Email Mark Tully   Find more posts by Mark Tully

To address the questions that I can:

1/2) You graphics can be speeded up by making sure that they are as small as possible. Don't have 24 bit images in your game if it runs in software mode, as they'll only be converted by TNT Basic to 16 bit as they're loaded - but the file size will be larger.
Some compressed file formats might take fractionally longer to load due to decompression taking time, but this isn't likely to be a big factor.

It doesn't matter whether you load many small banks or one big bank, it's the amount of data to be loaded that matters. So if you load fewer images then it will take less time. You could for example only load the sprites you need for the title screen at first, then the first level, then the second etc.

3) Your entire project must be less than 16Mb. For more information read threads:

We're going to remove this limit soon.

4) JPEGS are compressed so might take slightly longer to be loaded initially - but the smaller file size might counteract this.... You'll just have to experiment I'm afraid!

5) They should be decompressed on the fly, so the more compressed they are the faster they'll load. But the more CPU hit you'll get when you play them.

6) The number and size of variables/arrays doesn't affect load time.

7) OS 9 tends to get better performance for given hardware, due to the fact TNT Basic gets complete control of the Mac. On OS X, it has to play nice or OS X will take away all it's CPU time and make your game go all slow. Generally, the performance is pretty close though, as long as you're not running a LightWave render in the background on OS X or something...

Anyone else got any experiences to contribute?


02-03-2003 00:37

Posted by:

Venice, ITALY!

Click Here to Email matteo   Find more posts by matteo

Not me. Hohoho!

All times are GMT        Post A Reply

Forum Jump:
< Last Thread     Next Thread >

< Contact Us - TNT Basic >

Powered by: vBulletin Lite Version 1.0.1 Lite
Copyright © Jelsoft Enterprises Limited 2000.