Problem using multiple sounds simultaneously (Very pedagogical)
by Torbjorn Leksell · in Torque Game Engine · 01/18/2006 (5:35 am) · 1 replies
Scenario: The player fires an automatic weapon. Upon firing, the game plays a "firing" sound for each bullet fired. When the projectile hits a surface an explosion defined in the projectile datablock is used, this in turn plays an "explosion" sound.
Problem 1: This works fine with slower weapons but as soon as the fire rate reaches a certain point the sounds play only sporadically. It seems that the sounds are pilled up and some limit stops new sound from being played unless an old one expires. In my head this looks like this:

Problem 2: If the scenario is applied to two players in a multiplayer scenario, the time before the sounds are cut is halved, which seems to support my theory of a max limit.

Question: Does anyone know how to either increase this limit or allow the system to remove the oldest sounds in the list and replace it with a new? At least where to look or any other help? This is simply not a problem we can ignore and it's crucial for our game that this works.
(All this is also confirmed on an untouched version of the 1.4 release where the only change is made in the firing speed of the crossbow, if you want to replicate the problem just boost the fire speed and increase the amount of ammo to the crossbow in the standard 1.4 version)
Problem 1: This works fine with slower weapons but as soon as the fire rate reaches a certain point the sounds play only sporadically. It seems that the sounds are pilled up and some limit stops new sound from being played unless an old one expires. In my head this looks like this:

Problem 2: If the scenario is applied to two players in a multiplayer scenario, the time before the sounds are cut is halved, which seems to support my theory of a max limit.

Question: Does anyone know how to either increase this limit or allow the system to remove the oldest sounds in the list and replace it with a new? At least where to look or any other help? This is simply not a problem we can ignore and it's crucial for our game that this works.
(All this is also confirmed on an untouched version of the 1.4 release where the only change is made in the firing speed of the crossbow, if you want to replicate the problem just boost the fire speed and increase the amount of ammo to the crossbow in the standard 1.4 version)
About the author
A Torque user for seven years, been working with both 2D and 3D.
Torque Owner Adios, Man!
You are also restricted by the MAX_AUDIOSOURCES variable, which (in my 1.3 version at least) is set to 16. I'm sure that means that you can have up to 16 different audio handles playing at the same time, but as to how many instances of the same handle you can have (I think only one at a time), I'd need someone else to confirm for me.