Index | FAQ | Search | Memberlist | Usergroups | Profile | Log in to check your private messages | Log in | Register

Built-in Reverb for Quake? Goto page 1, 2 Next

| Inside3d Forums Forum Index -> Engine Programming

View previous topic :: View next topic
Author | Message
--- | ---
OneManClan Joined: 28 Feb 2009 Posts: 62 |

Posted: Wed Mar 17, 2010 2:21 pm Post subject: Built-in Reverb for Quake? |

Hi all, I'm a newbie programmer, and this would be WAY out of my league, but I was wondering: Can simple software FX be 'installed' into quake? Eg: put a little reverb on all sounds when you're outdoors like in HL2? I don't even know if this is a server issue because, the processing would have to be done on the client... ?
Possible? How does Source Engine do the reverb effects?
OneManClan
Last edited by OneManClan on Wed Mar 17, 2010 2:27 pm; edited 1 time in total

Back to top |

Spike Joined: 05 Nov 2004 Posts: 944 Location: UK |

Posted: Wed Mar 17, 2010 2:27 pm Post subject: |

look in to eax extensions. its an extra com class which can be queried from your directsound object, and then configured to set the enrionment/room properties. _________________ What's a signature?

Back to top |

OneManClan Joined: 28 Feb 2009 Posts: 62 |

Posted: Wed Mar 17, 2010 2:40 pm Post subject: |

Spike wrote:
look in to eax extensions. its an extra com class which can be queried from your directsound object, and then configured to set the enrionment/room properties.

Sorry bout the newbie questions, but what's a 'com class'?
[EDIT, it's cool, Im googling]
Why has no-one done it yet? Would the solution involve including new functions into the server code? This diagram implies that it only works for people w soundblaster hardware.
Where can I get more info?
OneManClan

Back to top |

Teiman Joined: 03 Jun 2007 Posts: 309 |

Posted: Wed Mar 17, 2010 3:40 pm Post subject: |

OneManClan wrote:

Spike wrote:
look in to eax extensions. its an extra com class which can be queried from your directsound object, and then configured to set the enrionment/room properties.

Sorry bout the newbie questions, but what's a 'com class'?
[EDIT, it's cool, Im googling]
Why has no-one done it yet? Would the solution involve including new functions into the server code?

Is a clientside effect. If you emit sounds on the server, only the guy hosting will get the effect, so need to be emited by the clients. Thats how quake work, anyway.
You may also "replicate" this effect in a "cheap way" by having two versions of all sound files. The normal one, and another one with the reverberation effect added with a sound editor. Using one of the another based on conditions. Thats look like x2 more work, but is guarantee to work.

Back to top |

OneManClan Joined: 28 Feb 2009 Posts: 62 |

Posted: Wed Mar 17, 2010 3:52 pm Post subject: |

Teiman wrote:
You may also "replicate" this effect in a "cheap way" by having two versions of all sound files. The normal one, and another one with the reverberation effect added with a sound editor. Using one of the another based on conditions. That's look like x2 more work, but is guarantee to work.

Well I originally rejected this idea as too 'inefficient', but I suppose it would involve a one-time download of a 10-20mb set of the extra sounds, and as you say it's guaranteed to work..
So the whole thing can be done in quake C? Somehow get the size of the room, and decide what sound to play accordingly...?
OneManClan

Back to top |

Spike Joined: 05 Nov 2004 Posts: 944 Location: UK |

Posted: Wed Mar 17, 2010 5:06 pm Post subject: |

FTE supports eax, there's an snd_eax cvar which can be used to switch it on, but all it really supports is underwater or not. I don't have a Creative sound card, and my solution sometimes worked and sometimes didn't. Most onboard sound cards have some sort of environment settings thing now, which is basically what I was changing.
OpenAL also supports eax features too, it would probably give more reliable success.
What I feel I should point out is how halflife knows to change sounds - it does it based upon triggers. Walk into a special trigger and your sound environment is changed. Basically, we don't have the info for that in quake's maps.
You can theoretically test the size of the room by using tracelines. Doing it in such a way that doesn't trigger when you are standing in a corner of an otherwise open room may be more tricky (consider a pit vs a pipe, which is more enclosed, but which will result in more echos?). You could detect based upon texture names, which would be the more stable way.
Testing for underwater is easy.
_________________
What's a signature?

Back to top |

frag.machine Joined: 25 Nov 2006 Posts: 728 |

Posted: Wed Mar 17, 2010 5:20 pm Post subject: |

Spike wrote:
What I feel I should point out is how halflife knows to change sounds - it does it based upon triggers. Walk into a special trigger and your sound environment is changed. Basically, we don't have the info for that in quake's maps.

Besides the water check you already mentioned, vanilla Quake already detects outdoors areas in order to play the default "wind" sound ( i guess it checks if there are any CONTENT_SKY in the PVS, not sure though - maybe checking if the SKY texture was used in the last frame would work ?). However, things like big rooms or caves would be hard to detect in a reliable way.
_________________
frag.machine - Q2K4 Project
http://fragmachine.quakedev.com/

Back to top |

Teiman Joined: 03 Jun 2007 Posts: 309 |

Posted: Wed Mar 17, 2010 5:28 pm Post subject: |

Yea.. the other problem is how to detect "Big Room". Most people would do it with tracelines. Launch 8 tracelines (N, NW, W,SW,S,SE,E,NE), and somehow calculate the "area" this tracelines explore. Based on this area, activate or not the use of reverberation.
Or doing a traceline to the sky, and detecting the colision with the sky... but that will fail in some maps that have incorrect content-types for sky. Yet another way is mapping these areas with solid triggers and such thing.
The spike idea of using the floor texture is also good. If the player is walking on snow, bets are he is on the open. You can use that one for engines that support this feature (originally designed for awesome footsteps on metal and wood)

Back to top |

mh Joined: 12 Jan 2008 Posts: 910 |

Posted: Wed Mar 17, 2010 5:56 pm Post subject: |

In most cases you can rely on stuff in the previous frame remaining valid for the current frame, as things don't really change too much from frame to frame (especially if the game is running fast). It's only if you do something like teleport that there will be a discontinuity, but even then it will only be for one frame.
I've experimented with DirectSound effects in the past, and my experience is that they don't actually work on a lot of hardware. In general the end result is either no sound at all or no change at all.
However, Quake does all of it's sound mixing in software anyway, with only the final mixed-down end result going to the output device (whether this be a DS buffer, wave out mixer or whatever is irrelevant). It should be possible to construct algorithms that apply effects on sounds and use them while sending to the output.
Anything that needs an FFT would be right out (it needs to scan ahead to data that might not even be present in the buffers yet), but simpler effects that distort or change the waveform, like extra spatialization, echo, gargle and so on should be achievable.
_________________
DirectQ Engine - New release 1.8.666a, 9th August 2010
MHQuake Blog (General)
Direct3D 8 Quake Engines

Back to top |

Chip Joined: 21 Jan 2009 Posts: 314 Location: Romania |

Posted: Wed Mar 17, 2010 8:07 pm Post subject: |

No, no, no. As I was reading through all your comments, an idea came up, and I was looking forward to reach the end of the page to write it down. You could use some invisible brushes, with names. Like func_sound_brush. This brush should have a parameter like 'sfx' and a value of 'reverb', 'mute', 'underwater', 'echo', etc. These brushes are to be added by the mapper in certain areas of the map.
Then, back in QuakeC, have something like:
This is pseudocode:

Code:
if(is_inside(func_sound_brush)) { trigger_function_sound_effect(self.sfx); };

You should also have this function - trigger_function_sound_effect() - that I guess should be coded inside the engine.
What say you?
_________________
My Projects: Quake 1 Mods | OpenQuartz 2 | ChipQuake

Back to top |

frag.machine Joined: 25 Nov 2006 Posts: 728 |

Posted: Wed Mar 17, 2010 9:21 pm Post subject: |

@Chip: Some time ago I made something in this line for a different purpose: to define arbitrary "regions" in a big map. I had two kind of point-like entities to mark the min/max coordinates of imaginary bound boxes and using this information I could query via QC where I was to centerprint stuff like "you're leaving the castle" or "you're entering the forest". The same could be used to change audio effects, light level, etc. The only advantage in my idea was that I wouldn't need to force the player to touch any trigger to correctly retrieve the region info.
_________________
frag.machine - Q2K4 Project
http://fragmachine.quakedev.com/

Back to top |

Teiman Joined: 03 Jun 2007 Posts: 309 |

Posted: Thu Mar 18, 2010 9:52 am Post subject: |

All ideas are good. Doing it "programatically" make it work on old maps, while if you need to add entities or new clip solids, will only work on new maps.

Back to top |

Chip Joined: 21 Jan 2009 Posts: 314 Location: Romania |

Posted: Thu Mar 18, 2010 10:58 am Post subject: |

Teiman wrote:
All ideas are good. Doing it "programatically" make it work on old maps, while if you need to add entities or new clip solids, will only work on new maps.

Right Tei, my idea would work for new maps only. But then again, OneManClan needs this for HIS mod, and he will create new maps.
He is not trying to implement these changes into old mods. And the work to have compatibility for ALL mods (some of them pretty hacky) is not justified.
_________________
My Projects: Quake 1 Mods | OpenQuartz 2 | ChipQuake

Back to top |

Teiman Joined: 03 Jun 2007 Posts: 309 |

Posted: Thu Mar 18, 2010 1:04 pm Post subject: |

Chip wrote:

Teiman wrote:
All ideas are good. Doing it "programatically" make it work on old maps, while if you need to add entities or new clip solids, will only work on new maps.

Right Tei, my idea would work for new maps only. But then again, OneManClan needs this for HIS mod, and he will create new maps.
He is not trying to implement these changes into old mods. And the work to have compatibility for ALL mods (some of them pretty hacky) is not justified.

Then either a CLIP, or doing a traceline for checking a "sky texture" are cool solutions.

Back to top |

Chip Joined: 21 Jan 2009 Posts: 314 Location: Romania |

Posted: Thu Mar 18, 2010 2:01 pm Post subject: |

Teiman wrote:

Chip wrote:

Teiman wrote:
All ideas are good. Doing it "programatically" make it work on old maps, while if you need to add entities or new clip solids, will only work on new maps.

Right Tei, my idea would work for new maps only. But then again, OneManClan needs this for HIS mod, and he will create new maps.
He is not trying to implement these changes into old mods. And the work to have compatibility for ALL mods (some of them pretty hacky) is not justified.

Then either a CLIP, or doing a traceline for checking a "sky texture" are cool solutions.

Yeah, so far, so good.
But what if I fall into a large sewer pipe and I want my footsteps to reverb? Or if I enter a large cathedral and I want echo?
What he needs is a general purpose function to be used with multiple effects. I don't know if such sound effects could be called via a function, but I was thinking some kind of a Winamp plugin with all sorts of effects. Those are realtime, press a button and have a song played with a certain effect. I'm sure you know what I'm talking about.
Unfortunately, I know nothing about that kind of programming.
_________________
My Projects: Quake 1 Mods | OpenQuartz 2 | ChipQuake

Back to top |

Display posts from previous:

| Inside3d Forums Forum Index -> Engine Programming | All times are GMT Goto page 1, 2 Next
Page 1 of 2

Jump to:

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

Powered by phpBB © 2004 phpBB Group