From 505fb8b254022aeaf1bacc15726a812bcbd28ff2 Mon Sep 17 00:00:00 2001 From: BoroBongo Date: Thu, 26 Nov 2026 22:46:36 +0000 Subject: [PATCH 1/2] fix: a small house echoes like a small room, not an empty church - caves and mines keep their big echo Gothic placed EAX reverb zones per area (zCZoneReverb, not read by ZenKit); we measure instead. Under a ceiling with near walls every place got the stone corridor's long echo, a wooden hut too. Inside a portal room (a house) it's now a small room's short echo, a stone room's in a big hall (walls further than 8 m on average); outside houses (caves, mines) the stone corridor / cave as before. Co-Authored-By: Claude Opus 5.5 --- .../Scripts/Adapters/Audio/EnvironmentReverb.cs | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/Assets/Gothic-Core/Scripts/Adapters/Audio/EnvironmentReverb.cs b/Assets/Gothic-Core/Scripts/Adapters/Audio/EnvironmentReverb.cs index 5db05dbce..8a16fa991 100644 --- a/Assets/Gothic-Core/Scripts/Adapters/Audio/EnvironmentReverb.cs +++ b/Assets/Gothic-Core/Scripts/Adapters/Audio/EnvironmentReverb.cs @@ -3,6 +3,7 @@ using Gothic.Core.Extensions; using Gothic.Core.Logging; using Gothic.Core.Services.Vobs; +using Gothic.Core.Services.World; using Reflex.Attributes; using UnityEngine; using Logger = Gothic.Core.Logging.Logger; @@ -13,6 +14,8 @@ namespace Gothic.Core.Adapters.Audio /// Sounds echo in mines, caves and temples. Gothic set an EAX environment per zone (zCZoneReverb, not read by /// ZenKit); this measures it instead: under a ceiling of the world mesh the reverb zone around the listener gets a /// room's echo - a cave's when the walls are far, a stone corridor's when they're near. Outside it's off. + /// Inside a house (a portal room, RoomService.HeroRoom) it's a small room's short echo - a wooden hut sounded like + /// an empty church with the stone corridor; a big hall (town hall, monastery) gets a stone room's. /// On Rain.prefab, which follows the player's head (RainFollower) in VR and Flat. /// public class EnvironmentReverb : MonoBehaviour @@ -20,11 +23,14 @@ public class EnvironmentReverb : MonoBehaviour private const float _checkSeconds = 0.5f; private const float _wallRayLength = 20f; private const float _narrowMeters = 5f; + // Inside a house: walls further than this on average make it a hall (stone room), nearer a small room. + private const float _hallMeters = 8f; // The zone moves with the head - big enough to always contain the listener. private const float _zoneRadius = 1000f; private const int _wallRays = 8; [Inject] private readonly VobService _vobService; + [Inject] private readonly RoomService _roomService; private AudioReverbZone _zone; private float _nextCheckTime; @@ -59,6 +65,7 @@ private AudioReverbPreset GetPreset(Vector3 position) if (!GroundSoundDomain.IsUnderWorldCeiling(position, _vobService.IsVobCollider)) return AudioReverbPreset.Off; + var isInHouse = !string.IsNullOrEmpty(_roomService.HeroRoom); var distance = 0f; for (var i = 0; i < _wallRays; i++) { @@ -69,7 +76,11 @@ private AudioReverbPreset GetPreset(Vector3 position) : _wallRayLength; } - return distance / _wallRays < _narrowMeters ? AudioReverbPreset.StoneCorridor : AudioReverbPreset.Cave; + var averageWallMeters = distance / _wallRays; + if (isInHouse) + return averageWallMeters < _hallMeters ? AudioReverbPreset.Room : AudioReverbPreset.StoneRoom; + + return averageWallMeters < _narrowMeters ? AudioReverbPreset.StoneCorridor : AudioReverbPreset.Cave; } } } From 037a3a4084e915b3e8c1861b68727de53d5c8f8c Mon Sep 17 00:00:00 2001 From: BoroBongo Date: Thu, 26 Nov 2026 22:47:01 +0000 Subject: [PATCH 2/2] fix: the reverb preset is Unity's Stoneroom - the build compiles Co-Authored-By: Claude Opus 5.5 --- Assets/Gothic-Core/Scripts/Adapters/Audio/EnvironmentReverb.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Assets/Gothic-Core/Scripts/Adapters/Audio/EnvironmentReverb.cs b/Assets/Gothic-Core/Scripts/Adapters/Audio/EnvironmentReverb.cs index 8a16fa991..03fd423ad 100644 --- a/Assets/Gothic-Core/Scripts/Adapters/Audio/EnvironmentReverb.cs +++ b/Assets/Gothic-Core/Scripts/Adapters/Audio/EnvironmentReverb.cs @@ -78,7 +78,7 @@ private AudioReverbPreset GetPreset(Vector3 position) var averageWallMeters = distance / _wallRays; if (isInHouse) - return averageWallMeters < _hallMeters ? AudioReverbPreset.Room : AudioReverbPreset.StoneRoom; + return averageWallMeters < _hallMeters ? AudioReverbPreset.Room : AudioReverbPreset.Stoneroom; return averageWallMeters < _narrowMeters ? AudioReverbPreset.StoneCorridor : AudioReverbPreset.Cave; }