Bug Tracker – Full Text Bug Listing

Bug 619

Summary: switch echo sound problem
Product: Odamex Reporter: ufon <vratajin>
Component: ClientAssignee: Odamex Bug Reporter <odamex-bug-reporter>
Severity: normal CC: elykdav, mike, nibbler, Ralphis
Priority: P2    
Version: (old) 0.5.0 - 0.5.5   
Hardware: All   
OS: All   
Bug Depends on:    
Bug Blocks: 620    
Attachments: Emulate vanilla doom's switch sound behavior, R1
Emulate vanilla doom's switch sound behavior, R2

Description ufon 2010-08-29 16:31:53 CDT
There seems to be a problem with the sound effect of the switch which can be seen in doom2.wad map01.

Press the elevator switch, you can hear the switch sound which is a loud "click" and then another click about a second later as loud as the first one. We tested this in other ports like chocolate and prboom, and it seems to us the second sound(echo-like) is supposed to die off with distance, which is not the case with odamex, where the echo can be heard as loud as the first click regardless of the distance from the switch.

I was testing this with vain and we both came to the conclusion the sound is not correct. Here you can hear the switch sound effect in multiplayer chocolate doom from a player standing in the blue room(the player pressing the switch is muted): http://nibbler.net.tvtrinec.cz/MVI_0246.AVI , you can hear the first click, not the second one.
Comment 1 Mike Lightner 2010-09-08 13:17:39 CDT
0.6-dev r1862 applies a fix for this bug.
Comment 2 Ralph Vickers 2010-09-11 02:02:47 CDT
Fix in 1862 causes weird issues in netplay (not single player curiously). This includes hearing your own weapons firing from a specific direction. I've found the issue is easiest to hear by running in a diagonal line while firing the SSG or BFG. Unsure of any other sound issues may have arisen.
Comment 3 ufon 2010-09-20 08:42:59 CDT
finally being able to compile and test this, i'm afraid the switch sound is completely eliminated now since r1862, when you hit the lift switch in map01, you can hear only the lift coming down, not the switch itself, when you take the lift up and hit the other switch, it makes no sound at all - which of course is incorrect
Comment 4 vain 2010-09-20 11:50:38 CDT
Same problem is in map02. Both swtiches on the start does not make sound when you push them since r1862.
Comment 5 Kyle 2010-10-03 19:13:00 CDT
I tested this and I can hear the second click when I am really close to the switch, otherwise, it is silent. Also, Ralphis mentioned there might be other sound side-effects. I have observed that recently the BFG explosion sometimes is silent.
Comment 6 Mike Lightner 2010-12-10 13:48:58 CST
r2027 reverts the commit Nes put in to attempt to fix this as it seems to have caused more problems than helped.
Comment 7 Dr. Sean 2011-05-16 19:39:27 CDT
Created attachment 247 [details]
Emulate vanilla doom's switch sound behavior, R1

The behavior of switches in Odamex stems from an attempt to fix a bug in vanilla Doom where the sound of a repeatable switch resetting is played at the map coordinates (0,0), and thus sounding much quieter than the initial switch trigger, which is heard at full volume anywhere on the map.

I have created a patch that emulates the vanilla Doom switch sound behavior if the cvar "co_vanillaswitches" is set (default).

Note:  Calling S_Sound() using x & y values instead of pt (an array of fixed_t to denote a map location) results in the sound never being attenuated since S_AdjustSoundParams isn't called when pt is null.  My code creates a static array of fixed_t for the switch sound location to get around this shortcoming.  It may be worth fixing this issue if there are further sound-related bugs.
Comment 8 Dr. Sean 2011-05-16 22:55:49 CDT
Created attachment 248 [details]
Emulate vanilla doom's switch sound behavior, R2

Updated patch to include different switch sound behavior when "co_vanillaswitches" is disabled.  In that mode, switch sounds attenuate with distance like plats and doors.  The initial switch sound and the reset sound for repeatable switches are centered in the sector containing the switch.
Comment 9 Mike Lightner 2011-05-17 00:24:36 CDT
r2177 applies the patch for this, with a small change in terms of semantics.  co_vanillaswitches is now co_zdoomswitches, defaulted to 0.  I flipped the code executed in the conditionals in p_switch.  Please test to verify.
Comment 10 Ralph Vickers 2011-05-20 02:13:35 CDT
Have tested and verified this fix with Dr. Sean. The enabled behavior of co_zdoomswitches needs to be fixed but that will be filed in an enhancement bug!