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.

Newcomers DBPro Corner / breaking the 32 item limit

Author
Message
Jcoggins
18
Years of Service
User Offline
Joined: 6th May 2006
Location:
Posted: 30th Mar 2008 02:53
I would like to have see DBPro allow more then 32 sounds, 32 images, etc... I do not know why there is a 32 item limit but I think it would be great if this were changed.

Jason
Ed222
17
Years of Service
User Offline
Joined: 3rd Nov 2007
Location: Calgary
Posted: 30th Mar 2008 03:18 Edited at: 30th Mar 2008 03:19
where did you hear that? DBP has no image and sound limit
[edit]
of course I could be wrong so please correct me if I am

TDK
Retired Moderator
22
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 30th Mar 2008 03:38
From the help files:

Quote: "CLONE SOUND

This command will clone a sound into the specified Destination Sound Number. Cloning a sound will create a new sound that can be played like any other loaded sound, but uses the same WAV data of the original sound. The advantage of sound cloning is that one hundred sounds could be used with only a single instance of the sound data stored in memory. The Sound Number must be an integer value."


TDK_Man

TDK
Retired Moderator
22
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 30th Mar 2008 12:52
I only posted it because it contained the phrase "one hundred sounds could be used" - in the OP Jcoggins was under the impression that there was a limit of 32.

No other reason.

TDK_Man

Paul08
16
Years of Service
User Offline
Joined: 20th Feb 2008
Location: Oxford, UK
Posted: 30th Mar 2008 16:57
interesting. not trying to step on anyones toes or whatever but if i had this question i probably would of just written a quick prog to test how many i could load? to see if it would work or not i mean, or rather, cross the bridge when i came to it. (or swim accross in some peoples cases)

Paul
Rudolpho
18
Years of Service
User Offline
Joined: 28th Dec 2005
Location: Sweden
Posted: 30th Mar 2008 22:29 Edited at: 30th Mar 2008 22:30
What, there's no limit?
I thought most objects (that is not only 3D objects, but images, sounds, etc.) had a limit of 65535 instances... or was that in DBC?

(Not that you'd probably ever would use that many of anything).

"I kören hörs de brummande busarna Björnligan och Gondolen"
Jcoggins
18
Years of Service
User Offline
Joined: 6th May 2006
Location:
Posted: 31st Mar 2008 00:04
I got this information from the book "DarkBasic Pro Game Programming, Second Edition" published by Thomson Course Technology.

It specifies in several places, such as page 197 3rd paragraph when talking about creating bitmaps, that states "only 31 bitmaps may be loaded at a time" because image number 0 is assigned to the screen.

It also states on page 332 in the last paragraph "there can be a maximum of 32 songs loaded into memory at one time."

Has DBPro changed to make these parts of the book obsolete since the book was published in 2007?

If not, I hope the core language is updated to change this.

Jason
TDK
Retired Moderator
22
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 31st Mar 2008 00:30
Quote: "It specifies in several places, such as page 197 3rd paragraph when talking about creating bitmaps, that states "only 31 bitmaps may be loaded at a time" because image number 0 is assigned to the screen."


Yes that is correct. That's using Load BITMAP - not Load IMAGE - check the help files. In DB a bitmap is a screen - not an image.

Quote: "It also states on page 332 in the last paragraph "there can be a maximum of 32 songs loaded into memory at one time.""


In your opening post, you said "32 sounds" - not 32 songs. You have a Load Music command and a Load Sound command. The Load Music is primarily for MIDI files.

Load Sound can be a WAV or an MP3, but as has already been said, playing lots of MP3's at the same time will overload the codec - they are of course compressed files which have to be decompressed (usually on the fly).

WAVs on the other hand are not compressed so you can load and play many more of them at the same time before you start having problems.

More to the point, why would anyone want to play more than 32 sounds at the same time?

I suspect that you probably have more than 32 in total for the whole game, but wouldn't use more than 6-8 at any one time and probably less than 32 for a whole level.

There's nothing stopping you from simply re-using them - loading in sounds at the start of each level, replacing the ones previously loaded.

TDK_Man

Login to post a reply

Server time is: 2024-11-25 06:56:53
Your offset time is: 2024-11-25 06:56:53