Best way to give player explosion tinnitus?
Moderator: GZDoom Developers
Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. If you still don't understand how to use a feature, then ask here.
Please bear in mind that the people helping you do not automatically know how much you know. You may be asked to upload your project file to look at. Don't be afraid to ask questions about what things mean, but also please be patient with the people trying to help you. (And helpers, please be patient with the person you're trying to help!)
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. If you still don't understand how to use a feature, then ask here.
Please bear in mind that the people helping you do not automatically know how much you know. You may be asked to upload your project file to look at. Don't be afraid to ask questions about what things mean, but also please be patient with the people trying to help you. (And helpers, please be patient with the person you're trying to help!)
Best way to give player explosion tinnitus?
I'm trying to do that effect when the player is too close to an explosion and they get a bit of temporary tinnitus.
I'm thinking that modifying explosions to give the player some inventory item via A_RadiusGive and having an A_JumpIfInventory check in the player's code somewhere to jump to a state that plays the sound locally for that player.
Would that be a suitable way, or can anyone think of something better/more efficient?
I'm thinking that modifying explosions to give the player some inventory item via A_RadiusGive and having an A_JumpIfInventory check in the player's code somewhere to jump to a state that plays the sound locally for that player.
Would that be a suitable way, or can anyone think of something better/more efficient?
- phantombeta
- Posts: 2159
- Joined: Thu May 02, 2013 1:27 am
- Operating System Version (Optional): Windows 10
- Graphics Processor: nVidia with Vulkan support
- Location: Brazil
Re: Best way to give player explosion tinnitus?
I know this isn't a real answer to the question and seriously frowned upon here, but...
As someone with tinnitus: Please don't. Seriously. It's horrible for us and it triggers the real thing.
And even for people who don't have it, it's uncomfortable and painful for a gimmicky effect.
As someone with tinnitus: Please don't. Seriously. It's horrible for us and it triggers the real thing.
And even for people who don't have it, it's uncomfortable and painful for a gimmicky effect.
- Caligari87
- Admin
- Posts: 6225
- Joined: Thu Feb 26, 2004 3:02 pm
- Preferred Pronouns: He/Him
- Contact:
Re: Best way to give player explosion tinnitus?
Probably a million ways to do it. ThinkerIterator and an inventory item that plays the sound on the owner would be much more modern than A_RadiusGive and A_JumpIfInventory in the player's code.
Agree with Phantom though. If this is meant for shipping something to other people, a toggle off would be appreciated. A deafening/muffling effect using a reverb environment would be a bit more user-friendly and accessible, if slightly more complex to set up.

Agree with Phantom though. If this is meant for shipping something to other people, a toggle off would be appreciated. A deafening/muffling effect using a reverb environment would be a bit more user-friendly and accessible, if slightly more complex to set up.

Re: Best way to give player explosion tinnitus?
It was actually just intended as an "I've seen games that do this, I wonder if I can do it too" kind of thing. There is no current plan for a mod that would use it. I just like to "doodle" with GZDoom features every now and again. Sometimes it becomes something worth expanding on. Most of the time it doesn't, but it keeps me amused.
As someone who has constant tinnitus myself, I totally understand the objection.
I did think about employing reverbs somehow, but I have been using reverbs quite heavily in my test maps (more doodling) so it probably gets even more complicated when there are different sound environments around the map.
As someone who has constant tinnitus myself, I totally understand the objection.
I did think about employing reverbs somehow, but I have been using reverbs quite heavily in my test maps (more doodling) so it probably gets even more complicated when there are different sound environments around the map.
Re: Best way to give player explosion tinnitus?
The exact implementation in other (commercial) games that have this effect can't be done in accurately in ZDoom, anyway, at least not easily.
There's two components to it:
1 - a lowpass filter applied over EVERY other sound
2 - the actual high-pitched ringing noise
(2) can be easily done by just fading the sound in and then out
(1) is the almost-impossible part. There's no way to affect the entire sound mix as a single group, and there's definitely no way to programmatically apply a dynamic lowpass filter across all the sounds.
The lowpass filter is what makes everything sound muffled (AKA the sound loses treble)
(Side note, I believe OpenAL does have low and highpass parameters for sounds, it's just not exposed to mods in ZDoom)
There's two components to it:
1 - a lowpass filter applied over EVERY other sound
2 - the actual high-pitched ringing noise
(2) can be easily done by just fading the sound in and then out
(1) is the almost-impossible part. There's no way to affect the entire sound mix as a single group, and there's definitely no way to programmatically apply a dynamic lowpass filter across all the sounds.
The lowpass filter is what makes everything sound muffled (AKA the sound loses treble)
(Side note, I believe OpenAL does have low and highpass parameters for sounds, it's just not exposed to mods in ZDoom)
Last edited by Nash on Sat Apr 19, 2025 11:59 am, edited 1 time in total.
Re: Best way to give player explosion tinnitus?
Thanks for the input. I had guessed that something along the lines of what you describe was going on for (2) - though not as expertly as you, of course. As you said, (1) is straight forward enough - it was just figuring out how to trigger it. (2) I hoped might be possible (which is why somehow messing with reverbs/sound environments seemed like a possibility) but if it can't be done particularly well...
Like I said, it was mostly an "I wonder if I can do it" thing with no specific project other than continuing to learn GZDoom features. So, I guess the answer is "sort of, but not very well, and people wouldn't like it anyway."
Like I said, it was mostly an "I wonder if I can do it" thing with no specific project other than continuing to learn GZDoom features. So, I guess the answer is "sort of, but not very well, and people wouldn't like it anyway."

Re: Best way to give player explosion tinnitus?
Yeah, to my ears, to get the effect to sound really convincing, the lowpass part is needed. Otherwise you'll just be playing a high-pitched ringing noise over the normal sounds, which, uh, I guess might sound even more annoying/hurtful...
- Caligari87
- Admin
- Posts: 6225
- Joined: Thu Feb 26, 2004 3:02 pm
- Preferred Pronouns: He/Him
- Contact:
Re: Best way to give player explosion tinnitus?
I'm certain reverb environs can do the lowpass. It's not even hard to apply the reverb, you just change the environment variable on the sector. Annoying part is applying it to every sector the player might be in, saving any existing reverb environments (including "none"), and restoring those environments when the effect is over. Also the fact you can't blend the change to fade the effect out, it'll just pop back to normal. Could maybe mask this with a low noise rumble or something, or have several reverbs defined with different levels of lowpass.


- Chris
- Posts: 2969
- Joined: Thu Jul 17, 2003 12:07 am
- Graphics Processor: ATI/AMD with Vulkan/Metal Support
Re: Best way to give player explosion tinnitus?
It does, and you're correct. Currently a low-pass filter is applied to all non-UI sounds when underwater (which also forces the Underwater reverb preset and lowers the pitch of those sounds), but there aren't any functions exposed to apply them to sounds outside of that.
Re: Best way to give player explosion tinnitus?
It was explicitly the underwater preset (255, 255) applied to a reverb thing that I thought might be useful when attempting this. However, it seems like it's probably not really that useful without a whole bunch of extra trickery which may, or may not, even be possible (particularly in respect of getting current reverbs and restoring them once the tinnitus effect is over).
- Caligari87
- Admin
- Posts: 6225
- Joined: Thu Feb 26, 2004 3:02 pm
- Preferred Pronouns: He/Him
- Contact:
Re: Best way to give player explosion tinnitus?
Eh, I don't think it's that bad. The map struct has functions for setting the sound environment directly in ZScript. You don't need to futz with reverb things.
native void SetEnvironment(String env);
native void SetEnvironmentID(int envnum);
What I consider the more annoying part is you'd have to loop over every sector, save all the existing sound environments in an array, set the new environment, then loop over again to restore everything. If there was a way to just do a reverb override for the whole mix that'd be better.
(of course, having full DSP control would be ideal buuuuuut....)

native void SetEnvironment(String env);
native void SetEnvironmentID(int envnum);
What I consider the more annoying part is you'd have to loop over every sector, save all the existing sound environments in an array, set the new environment, then loop over again to restore everything. If there was a way to just do a reverb override for the whole mix that'd be better.
(of course, having full DSP control would be ideal buuuuuut....)

- Ullyia
- Posts: 1
- Joined: Sun Apr 20, 2025 12:13 pm
- Preferred Pronouns: He/Him
- Operating System Version (Optional): Windows 10-11
- Graphics Processor: nVidia (Modern GZDoom)
Re: Best way to give player explosion tinnitus?
Maybe by blowing up someone’s ears in real life? Serious answer by the way.
"earrape" explosion video removed ~~Caligari87
"earrape" explosion video removed ~~Caligari87
Last edited by Caligari87 on Sun Apr 20, 2025 1:21 pm, edited 1 time in total.
Reason: Removed video
Reason: Removed video
- Caligari87
- Admin
- Posts: 6225
- Joined: Thu Feb 26, 2004 3:02 pm
- Preferred Pronouns: He/Him
- Contact:
Re: Best way to give player explosion tinnitus?
No, that's not a serious answer and not a good look for your first post on the forums. Be better.

