Jump to content
The Dark Mod Forums

Sfx Overlap Problem

Recommended Posts

I'm trying to get the SFX for an objective to be played, but it seems like only one thing can play "globally" at once, even though it might look like it's on two different channels because it's on two different entities. This means that if the ambient music is playing globally, and the "objective complete" sound cuts in, it will cut off the ambient music (and possibly leave it off).


Does this make sense? Maybe one way around this would just be to play the sound on the player, set the falloff settings such that it maintains constant volume within the distance from your feet to your ears (your origin is your feet so that's where the sound will play) and set it to omnidirectional (so it's not global, but it will seem that way).

Link to post
Share on other sites

That sounds like the best solution to me, especially if (as we were talking about in another thread) the player needs to hear the "objective completed" sound while still hearing the background music. If it were left as a global and got cut off that would be an abrupt interruption in the ambient sounds.


It's a shame that the engine is limited like that, but thinking about it from a programmer's point of view I guess it makes sense. The global should only be whatever is in that world or map at the time and the local sounds would be played for local events. The "objective complete" or "objective failed" sounds shouldn't affect the rest of the world, only the player. Whereas, the ambient sounds are part of the global world.


Okay, I had to put my object oriented hat on for that one!

"Without music to decorate it, time is just a bunch of boring production deadlines or dates by which bills must be paid."- Frank Zappa

Link to post
Share on other sites

Wait, we only have one global sound channel? This is bad. We can't make smooth transitions between two areas with global ambients like that! Or am I missing something?


Whereas, the ambient sounds are part of the global world.

That would be SFX, no? I always called sounds not created by the environment as ambient.

Link to post
Share on other sites

Yeah I'm not sure how we could crossfade the ambients. We can still make physically placed sounds omnidirectional, and could conceivably have two ambient-spheres overlapping to crossfade. But the geometry is pretty restricted to that.


I could be wrong about this, I was just basing it on Dram's library map with an ambient, and I had put in the start mission sound to play on a globally on the worldspawn, but as soon as the ambient kicked in it cut off the start sound. There may be a way for mappers to set up ambients so they don't hog the channel, I'm not sure.


"Global" is just supposed to be a flag anyway, just meaning that the volume never falls off. It's not supposed to be a channel and I would have expected multiple globals to be able to play. It could be that something else is happening in that map example.

Link to post
Share on other sites

There are some open source libraries for doing that, so we might be able to create it on the fly. But then, we don't have the source for the sound engine, so I'm not sure how we could do that when a sounds is in the middle of playing.


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...