TheSuperHackers / GeneralsGamePatch

Community Patch to fix and improve original Generals Zero Hour 1.04
Other
60 stars 19 forks source link

China ECM Tank attack sound is replayed when camera reenters audio range #1560

Open xezon opened 1 year ago

xezon commented 1 year ago

China ECM Tank attack sound is replayed when camera reenters audio range.

https://user-images.githubusercontent.com/4720891/213011229-017153a8-8b6c-4e81-b9d7-5cb0763af001.mp4

xezon commented 1 year ago
AudioEvent FrequencyJammerWeaponLoop
  Control = loop random
  Sounds =  vfrelo2a vfrelo2b vfrelo2c vfrelo2d
  Attack =  vfrelo1a
  VolumeShift= -15
  Volume = 90
  MinRange = 100
  MaxRange = 600
  Limit = 2
  Priority= high
  Type = world shrouded everyone
End

Attack sound is responsible for this. But attack sound is as designed. MinRange and MaxRange in theory should help to decrease the cut off on exit and enter of the Audio Event, but it appears it does not dial down the volume enough. So there is always an audible cut off. This happens on all looping Audio Events.

Adding MinVolume = 0 or MinVolume = 10 does nothing either.

Adding Control = loop random all does nothing either.

All available options are:

AudioEvent
  Filename
  Volume
  VolumeShift
  MinVolume
  PitchShift
  Delay
  Limit
  LoopCount
  Priority
  Type
  Control
  Sounds
  SoundsNight
  SoundsEvening
  SoundsMorning
  Attack
  Decay
  MinRange
  MaxRange
  LowPassCutoff

I think this boils down to Game code feature requirements.

  1. MinVolume needs to work for MaxRange. Not clear to me what MinValue does currently.

  2. Audio Manager should not play Attack and Decay sounds when creating/destroying sound near MaxRange. It should play Sounds straight away.

  3. Audio Manager should not play Attack and Decay sounds when restarting loop sound while source of loop has not just initiated the loop.

With these 2 code changes, audio loops should become pleasant.