Skip to content

fix: sound effects play at Gothic's own volume and the sound effects slider is back - the smithy is no longer deafening - #581

Open
BoroBongo wants to merge 4 commits into
feature/mob-animationsfrom
fix/sfx-volume
Open

BoroBongo wants to merge 4 commits into
feature/mob-animationsfrom
fix/sfx-volume

Conversation

@BoroBongo

Copy link
Copy Markdown
Contributor

What

Sound effects are no longer too loud, and the sound effects slider in the sound options is back and works.

  • Gothic's own volume per sound. Animation sounds of NPCs and mobs play at the volume of each sound instance (C_SFX_DEF vol / 127), like the engine. Examples: anvil Forge_Anvil 50 = 39%, grindstone Forge_Sharpen 20 = 16%, Pipe_bubbles 40 = 31%, SMOKE_JOINT 20. Before, every one played at 100%. Random variants (_A1...) use their own vol.

  • The slider is back. "Głośność efektów" (Gothic.ini [SOUND] soundVolume) was hidden as unsupported (VmService disabled menu items) and applied to nothing. It is shown again and scales:

    • world VOB sounds and day/night sounds, loops included;
    • NPC and mob animation sounds and footsteps;
    • eating, drinking and smoking at the VR mouth;
    • Snd_Play 2D sounds.

    A change applies at once, also to playing loops (event, no polling).

  • Room to go louder. The slider at 75% plays Gothic's own volume; the top end is a third louder (author's choice). The default when the ini has no value is 75%.

Technical:

  • Volume lookup. SfxModel.GetRandomSound(out volume) and AudioService.GetRandomSoundClip(name, out volume).
  • The slider. AudioService.SoundVolume (slider / 0.75) and AudioService.SetSfxVolume(source, volume) keep playing sources at "own volume × gain".
  • NPC animation clips. They now play on their own child source _AnimationSfx, not on the shared NpcSound. Setting the shared source's volume would have turned the NPC's hits, draws and spells down to the last clip's volume.

Stacked on #578 (AnimationEffectPlayer).

Why

Playtest: Harad's smithy (anvil, grindstone, forge, with #578) was far too loud, and the sound effects slider was missing from the sound options.

How to test manually

  • G2 Khorinis smithy, 07:00-08:00: the anvil, grindstone and forge are clearly quieter. In the editor, mob sources read anvil 0.39, grindstone 0.16, forge 0.39 at a 75% slider.
  • Options → Sound: "Głośność efektów" has a slider. Moving it makes the smithy, the harbour's world sounds and footsteps quieter or louder at once. Music and dialog voices don't change.
  • Slider at 100%: a third louder than at 75%.
  • Hits, spells, bows and the torch still sound as before (not yet on the slider, see below).

Save/load

Nothing new. The slider is Gothic.ini. An existing Gothic.ini with soundVolume=1 is now a third louder than Gothic's own volume; set the slider to 75% for the original volume.

Known gaps / follow-ups

🤖 Generated with Claude Code

BoroBongo and others added 4 commits November 26, 2026 22:14
… anvil, grindstone, quench and water pipe are no longer all at full volume

- SfxModel caches each instance's C_SFX_DEF vol (0..127 as 0..1); a random variant (_A1, _A2) has its own
- AudioService.GetRandomSoundClip(name, out volume): the picked sound's volume, 1 for a plain .wav name
- AnimationEffectPlayer: a clip plays at it, a footstep one-shot gets it as volumeScale
- an NPC's animation clips play on an own source next to NpcSound (_AnimationSfx, created on the first clip with
  NpcSound's settings): hits, weapon draws and steps play on NpcSound as one-shots and were turned down by the last
  clip's volume (and range) otherwise; a mob's source is its own already
- VRMouth: eating, drinking and smoking at the VR mouth use it too (SMOKE_JOINT 20)

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…mob animation sounds follow it, a playing loop at once

Gothic.ini [SOUND] soundVolume (MENU_OPT_AUDIO) was written by the menu but applied to nothing.
- AudioService.SoundVolume: the option 0..1, read on first use and again when the menu changes it (logged, LogCat.Audio)
- AudioService.SetSfxVolume(source, volume): Gothic's volume of the sound times the slider; the source is remembered
  and set again on the option change (no polling), destroyed ones are dropped on the next world
- VOB sounds and day/night sounds (VobInitializerDomain), NPC and mob animation clips (AnimationEffectPlayer) use it;
  footsteps, eating/drinking/smoking at the VR mouth and Snd_Play sounds get it when they play
- voices and music are untouched (music has its own slider)

Co-Authored-By: Claude Opus 5.5 <[email protected]>
… - it was hidden as unsupported

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…top end is a third louder for who wants more

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant