Sign in to follow this  
EnochDagor

Need help with DirectSound RTS

Recommended Posts

Okay, using DirectSound... Assume thousands of units... each unit that is moving or working or building or whatever may generate an ambient sound. For example, a factory that is building something would create a low hum. Obviously, I wouldn't want to generate the sounds for all of the objects and play them at a constant rate as the CPU would ultimately clutch its heart, scream in agony and die. So... doing some sort of camera to object calculation is best... but what would be the best method for doing this? Furthermore, let's say several factories are located near each other. Do I play all of the factory's audio at the same time or do I play one sound louder? What are the normal practices when doing the RTS unit sound implementation?

Share this post


Link to post
Share on other sites
Normally with sound in a game (RTS or otherwise) you build a mixer program that has logic for deciding which entity sounds are audible from the player. Some examples of priority modifiers:

1) sound is already playing
2) proximity to player
3) player has unit selected or is looking directly at it
4) unit has player as target (more relevant in FPS)

Once you get the priority system worked out then you need some mixer logic. i.e. if priorities change enough that one unit has bubbled off the list you need to fade it out and fade in the new sound.

But definitely you do not want to just play everything in proximity. That'll quickly become a cacophonic nightmare.

-me

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this