Game Development Community

Sound update (refactoring)

by Marcelo Oliveira · in Torque Game Engine · 04/24/2004 (1:58 pm) · 43 replies

Hello everyone,

Seems that many people there are a bit complained about the sound issues of the engine, while the graphics area is constantly being updated, the sound is a bit forgotten, so I've decided to do some upgrades into it.

Analizing the audio sources files, seems that there's a lot of duplicated code, for example, there are funcions and classes for looping and for streaming sounds, the non looping sounds are stored in global statics, etc.

So I've remade all the code, always following the OpenAL specification, as an example, the audio.cc source gone from 2466 lines to 938, and it's seems blazing fast and stable in my tests.

I've also decided to control the sound falloff entirely in torque, disabling any falloff and manually controlling it by using AL_GAIN, this way I can detect sound and cull the sounds with great precision.

So, here's a list of implemented features:

- Precise sound falloff and culling: controlled by TGE only, providing a great control of the sounds distance, as seen is this graphic:

raintree.hpg.com.br/oal_graph1.gifreferenceDistance = 100
maxDistance = 1000
The red line is the usual Inverse Distance (used in DS and OpenAL), the black line is the sound falloff when the MuteAtMaxDistance flag is enabled, providing an smooth but precise falloff.

- Code cleanup: Reuse of common code, instead of creating classes and arrays for looping, other for streaming, other for normal sounds, etc.

- Volume priority: Only the 16 (configurable amount) highest volume sounds are processed. The others are set to an culled state, but go back to playing state soon as an slot is avaiable or reaches great priority than other playing sound.

- Doppler:Enable the doppler effects on sources (using the already posted resource).

- Other bug fixes:
-AudioDatablocks missing links (when you reference a description in the profile it may be not created yet)

Here's the implementation plans:
- Enable EAX and environment stuff.
- Refactoring of AudioEmmiter (code cleanup).
- Implementation of visual feedback of AudioEmmiter (posted resource).


Well, what I need from you:
- Send lists of bug to be fixed.
- And wanted improvements.
- On finished, help testing on different platforms and machines (I've only have windows)

After the code is finished I'll submit it as a patch to garagegames (and also setup a resource).

Thanks
Page«First 1 2 3 Next»
#41
12/14/2004 (3:36 am)
Wooo thats great news Marcelo
well done !
#42
12/14/2004 (11:08 pm)
You did? Wow, nice work Marcelo! Lemme go approve that sucker! ;)
#43
12/15/2004 (8:46 am)
To whom is may concern, the resource is approved (thanks ben).

http://www.garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=6863

* Note that this is the old version, a new multi-api is being developed.
Page«First 1 2 3 Next»