• Advertisement
Sign in to follow this  

Need help with DirectSound RTS

This topic is 3815 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

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
Advertisement
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
Sign in to follow this  

  • Advertisement