Repository navigation
fix: Fellan's hammering is heard from Alwin's sheep pen - the hammer sound carries 24 m - #574
Merged
Merged
Conversation
…sound carries 24 m Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Contributor
Author
Review (architecture-reviewer + gothic-reviewer)Both reviewers: OK / fits, with nits. Fixed:
Follow-up:
Tried in play by the author:
|
…ble outside AnimationSystem - no behaviour change - AnimationEffectPlayer (Adapters/Animations) plays a track instance's *eventSFX/*eventPFX/*eventPFXStop; AnimationSystem owns one (one-off particles, as before), mobs will own one that builds each effect once and replays it - AnimationSampling (Models/Animations, static, Burst) holds the frame interpolation and Nlerp of AnimationPoseJob - IVirtualObject.IsHingeMob(): the door/chest rule of the VR grab (MobInteractionService.ShouldHandleGrab) in one place Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…) - no behaviour change UseMob's last back transition, AI_StandUp(Quick) and AiHandler.ReEnableNpc cleared the mob, slot, state and body state each on their own. The mob's own animation will stop there. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ads (MobAnimationService) - MobAnimationService (Services/Vobs): which mobs animate (an oCMobInter family member with an .MDS visual - no doors, chests, beds, fireplaces), the track names of a state change (T_S0_2_S1, S_S1, T_S1_2_S0) in the mob's own model script, one-shot logs for missing models/tracks (missing tracks Editor only) - At WorldSceneLoaded the world's mob models are baked and their sounds decoded (P3), with an Editor log of the tracks found per model - IMobAnimator / IMobAnimatorFactory: the port the MobAnimator adapter will implement - AnimationService.GetSkeleton also takes the hierarchy from an .MDL (hierarchy and mesh in one file), like the mesh builder Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…icles (MobAnimator) - nothing calls it yet - MobAnimator (Adapters/Vob, added on first use by MobAnimatorFactory): maps the model's nodes once, samples the rigid nodes on the CPU (AnimationSampling), plays a transition then the state's loop, events through its own AnimationEffectPlayer (one 3D sound, linear to the event's range; particles built once and replayed); Update only while something plays - users per mob (slots): the last one leaving lets a running transition end, plays the way back (T_S1_2_S0) and rests - safety net once per loop round: a user that is gone, culled, dead or no longer at the mob stops it - MobAnimationService: OnStateChanged / Stop / StartHeroUse / StopHeroUse / IsStillUsing; IMobAnimatorFactory bound in ReflexProjectInstaller Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…e an NPC or the hero uses them - the smithy rings, sparks and steams - UseMob: every transition of the user also plays the mob's own (T_S0_2_S1 then S_S1, ...) - NpcService.ReleaseMob stops it; ReleaseMob now also runs at death (NpcDeathDomain.Die - a killed smith frees the anvil) and when a culled NPC is moved to its routine waypoint (AiHandler.DisableNpc, like ReEnableNpc: mob state -1) - the hero: levers/wheels swing into their new state (trigger branch 0 <-> 1); a mob with a dialog (anvil, grindstone, rune table) works while its dialog is open (new GlobalEventDispatcher.MobDialogEnded, raised where DialogService drops the mob dialog anchor); without a dialog (the forge's item swap) it works once, there and back - the safety net also stops for a knocked out user (IsDown) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…bs' own animations (Docs/mobs.md, ADR) - Docs/mobs.md: MobState writers (UseMob, AiHandler, MobInteractionService, VRMobHinge, MobStatesSaveSection), NpcService.ReleaseMob as the one end of a usage, the animation classes and data flow, the light player, follow-ups, a "where does my change go" table - architecture.md: "Where does my code go?" row and principle 8 point to Docs/mobs.md - ADR 2026-11-25-mob-animations: why mobs animate, the hero's smithy, no doors/chests/beds, no forge light, no switch, the own light player (not AnimationSystem per mob) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…y on import) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…e fire no longer roars on after the smith walked away A lever pull without a user still lets its sound play out. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…t user's release resets the mob state in NpcService.ReleaseMob Wld_GetMobState then reads 0 and a save no longer keeps the anvil as used. Before, only a culled NPC reset it (AiHandler). An NPC only walking to the mob doesn't touch its state. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ared (MobInteractionService) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…en when the world is left (MobAnimationService) A mob that isn't loaded yet gets no animator - the hero's lever pull then plays no animation, now with an Editor log. On a world change or a loaded game the hero's mob dialog use is cleared, so it never points at a destroyed mob. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
8 tasks
…ct's name, so more than a joint can share it (VRMouth) - no behaviour change - ExhaleSmoke(pfxName, ...) puffs any particle effect; TryExhaleSmoke picks the first one of a Humans.mds animation (the joint's t_JOINT_S0_2_Stand: LIGHTSMOKE) and warns, like before, when it has none Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ws out its smoke after a drag (IVrMouthSmokable) - nothing implements it yet - IVrMouthSmokable (next to VRMouth): something smoked without being used up names the Humans.mds animation of its smoke and hears when one of its parts touches or leaves the mouth - VRMouth: on enter such a part is no food; when it says it is smoked now, the smoke of that animation is puffed out after the drag delay (_smokeStartDelay), spread over 3 s; taken away before the drag ended, no smoke comes - trigger events only, nothing per frame Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…owards the hand, pulled too far it slips out and swings back; not while an NPC smokes it (VRWaterPipe) - VRWaterPipe (Adapters/Vob): added by VRMobInteraction.Start to a mob whose model ends BIP01 FLEX0..FLEX4 in BIP01 FLEXEND (checked once per built mob, mods' pipes too); a trigger on the mouthpiece (layer VobItemNoWorldCollision: hands and VRMouth see it, the world doesn't) is a handle of its own - while held, HoseIk (CCD over the 5 links, limited turns, no allocations) bends the hose to the hand in LateUpdate; further away than the hose's length + 0.15 m, the grab is let go; released, the links swing back in 0.3 s (to the pose of the pipe's own animation while MobAnimator moves them), then the component is disabled again - busy: mob state > 0 or an NPC at it (VobService.GetOtherMobUsers), checked on hover and grab, never polled - a hand closing at the mouthpiece that caught the pipe's own collider takes the mouthpiece a frame later (IVrRig.TryGrabIntoHand) - the pipe isn't used - ports: IVrBackend.AddHandle (XRI: VrInteractable + GothicGrabInteractable held without moving, kinematic, near and one hand only + bridge with the grab trigger), VrInteractable.CanGrab (asked by GothicGrabInteractable.IsSelectableBy for a new grab) - nothing saved; no prefab changed (components and collider added in code) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… like for an NPC and you blow out smoke, nothing else happens (VRWaterPipe, MobAnimationService) - VRWaterPipe is an IVrMouthSmokable: the held mouthpiece at the mouth starts the hero's use (MobAnimationService.StartHeroUse: S0 -> S1 and its loop, PIPE_BUBBLES, FIRE_SMOKE at BIP01 FIRE); after the drag delay VRMouth blows out HUMANS S_SMOKE_S1's LIGHTSMOKE - away from the mouth, let go, slipped out or culled: StopHeroUse(mob) - a new overload that only stops the hero's use of this mob (not an anvil whose dialog opened meanwhile) - VRMouth: a part coming in again without having left (its exit was missed while culled) starts over - like the original: no item is used, no script runs, nothing is saved - Docs/mobs.md: the water pipe; ADR 2026-11-26-vr-water-pipe Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…port) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…uth - a bigger grab, the mouth meets it where the hand holds it Playtest: the 7 cm grab was nearly impossible to hit, and holding it to the mouth did nothing (no mouth trigger event) - the hose's end fell short of the hand, so its trigger never reached the mouth. Grab radius 15 cm; while held the trigger sits where the hand holds the mouthpiece; the hose IK takes 10 iterations per frame (was 4). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… mouth, and the smoke comes out with a breath when it's taken away Playtest: the smoke came out of the mouth too early, while still drawing. Now the pipe works in its loop (bubbles, smoke at the bowl) as long as the mouthpiece is at the mouth; taken away after at least 0.8 s, a breath out (Human_SnoreIn = Snore_BreathOut) and a cloud of LIGHTSMOKE in front of the face. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ing sound (SMOKE_JOINT), the snoring breath-out wasn't found Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… out Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…oad - busy means a living NPC uses it now, not the mob state The mob state an NPC's use left comes back with a load (MobStatesSaveSection), but no NPC uses the pipe then and ReleaseMob never resets it, so the mouthpiece stayed refused for good (review d24f2a9, gothic bug 1). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…Service.IsUsedByOtherNpc) - the VR water pipe asks it, no behaviour change One rule for the next mob the hero takes hold of, independent of the mob kind (MobState > 0 also means switched or open). Review d24f2a9, architecture finding 3. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… smoking - the mouth forgets it without smoke instead of throwing on its destroyed collider The mouth's state is cleared before anything else, and a smoked part (or its pipe) that is destroyed or deactivated is let go without a breath out and without being told. Before, .name of the destroyed collider threw before the state was cleared, and every later smoke at the mouth threw again (review d24f2a9, gothic bug 2 and issue 3). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…hout a hand) is let go a frame later, not inside the backend's grab event Releasing inside XRI's select event breaks the interaction in progress (architecture.md "Inside Gothic-VR" 4) - now deferred like the take-over already was (review d24f2a9, architecture finding 1). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… it, even while the hand stays at it - its busy check is renewed twice a second while a hand tries to grab The take-over and the refused grab's release remember the frame they were deferred in instead of a flag that culling could leave set (OnDisable doesn't come while the component is idle); OnDisable only stops the hero's use. Removed the dead _smokableExhale field and a stale constant comment in VRMouth (review d24f2a9, gothic issues 4 and 5). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…nd a smokable names its breath-out sound (IVrMouthSmokable.ExhaleSound) - no behaviour change VRMouth keeps the triggers and the eating; VRMouthSmoking holds the smoked part, its drag and the breath out (sound and smoke a second after a drag of at least 0.8 s). The water pipe's sound SMOKE_JOINT moved to VRWaterPipe (review d24f2a9, architecture finding 4). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…top end is a third louder for who wants more Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
fix: sound effects play at Gothic's own volume and the sound effects slider is back - the smithy is no longer deafening
JaXt0r
requested changes
Nov 30, 2026
| private static readonly Dictionary<string, float> _sfxRangeOverridesMeters = | ||
| new(StringComparer.OrdinalIgnoreCase) | ||
| { | ||
| { "HAMMER", 24f } |
Contributor
There was a problem hiding this comment.
Why hardcoded? How is OpenGothic handling it?
…uses it is read from the NPCs' own mob state, no second user list MobAnimationService asks VobService.GetOtherMobUsers (+ IsUsingMob) and the hero's dialog mob to decide whether a user joins or the last one left. MobAnimator only plays tracks; its user list, the per-loop IsStillUsing safety net and the adapter's call back into the service are gone. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… - the anvil stops and is free for others (NpcKnockoutDomain -> ReleaseMob) Like the engine's Npc::onNoHealth, which quits the interaction for death and unconsciousness. Before, only the removed per-loop safety net stopped the mob's animation, and the NPC kept the mob reserved while lying there. ReleaseMob's doc and Docs/mobs.md name the paths; world change/load and UseMob's dropped walk reservation need no release. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…d of staying silent (MobAnimator) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…oup - every sound effect follows it, a voice doesn't All sound effect sources play through AudioMixer's SoundEffects group; Gothic.ini soundVolume sets its exposed SoundEffectsVolume (20*log10, 0 = -80 dB) at Gothic.ini load and when the menu changes it. A source's volume keeps only Gothic's own (C_SFX_DEF vol, a VOB's volume): the per-source registry (SetSfxVolume) and the "* SoundVolume" multiplications are gone, and so is its leak and the clamp at 1. - Prefabs (via UnityMCP): NPC sound (Core + VR oCNpc BIP01), VR door/chest lock picking, the player's mouth. - Runtime sources: AudioService.AddSfxSource (mob animator, burning NPC, barrier thunder, hero body/steps, spell invest loop) and AudioService.PlaySfxAtPoint instead of AudioSource.PlayClipAtPoint (particles, movers, bow, crossbow, torch, backpack, pickpocket, trade, spells, XriSfxPlayer). - NPC dialog voices get no mixer group instead of copying NpcSound's. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… is Gothic's own volume of each sound Gothic.ini soundVolume missing = 1 (the engine's default and the menu slider's), 0 dB on the SoundEffects group. The 0.75 "own volume" position and the louder top end are gone. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ce that sits in its prefab - no source built at runtime, a new NpcSound setting can't be forgotten (AnimationEffectPlayer) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…f the system culture (AnimationEffectPlayer) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…till playing on the source (a forge fire loop) and is logged once (AnimationEffectPlayer, AudioService) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…'s volume and range) is decided in AudioService, the adapter only plays it (AnimationEffectPlayer, AudioService.GetAnimationSfx) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…o, not a private literal in AudioService (behaviour unchanged) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…sModelScriptVisual) and one names a mob's states and their animations (MobStateNames), used by MobAnimationService and UseMob (behaviour unchanged) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… screen, frame by frame, and all of a mob's state tracks are baked, not only S0/S1 (MobAnimationService.WarmWorldMobsAsync, WorldScene, MobStateNames.IsOwnStateAnimation) Before, the warm-up ran synchronously in the WorldSceneLoaded listener (~115 ms in the Editor for G2 Khorinis, more on Quest 2) and only baked T_S0_2_S1, S_S1, T_S1_2_S0 - mobs reaching S2 or STAND<->S0 still baked on first use. Now WorldScene awaits it right after the VOBs; FrameSkipperService yields between tracks. Every state animation in the mob's model script (T_<state>_2_<state>, S_<state>) is baked and its sounds decoded. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…1) and the hammering range The sound effects slider is Gothic's global volume: 1 plays each sound at its own Gothic loudness, lower values turn all sound effects down together. Voices and music are not part of it. Hammering reaches 24 m instead of Gothic's 10 m so Fellan's hammering is heard at Alwin's sheep pen. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…thic - the hammering override is gone (#569) Every animation sound now fades linearly to silence at its own Gothic R: range (cm -> m), as OpenGothic does with OpenAL linear distance, max distance = range. The per-sound override (HAMMER 24 m, Constants.Audio) is removed, so Fellan's hammering is heard up to 10 m again. Whether the original fades more gently is open in #569. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2 tasks
feat: mobs play their own animations, sounds and particles while they are used - the smithy rings, sparks and steams
feat: smoke a water pipe with your own hands in VR - grab the mouthpiece, the hose follows, it bubbles at your mouth and you breathe out the smoke
…sounds keep Gothic's range, nothing more Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ond the original game (on by default) Searching the flag lists every improvement. Production and Lab.HVR.Simulator set it (Unity also wrote the missing EnableWorldLightmaps default into Lab.HVR.Simulator). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…rom Alwin's sheep pen Alwin asks whether you hear the hammering, but Fellan's HAMMER (R:1000 = 10 m) didn't reach his pen ~18 m away. In G2 without a mod and with DeveloperConfig.EnableImprovements, Fellan's HAMMER now carries 24 m (60 m was heard across the whole harbour). Every other sound, and every other NPC's hammering, keeps Gothic's range. Core asks ContextSoundRangeService (no impl = Gothic's range) from AudioService.GetAnimationSfx with the NPC's instance index (AnimationEffectPlayer, -1 for mobs); G2SoundRangeService resolves VLK_480_Fellan once on first use. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…inal goes - the game-version module behind DeveloperConfig.EnableImprovements Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
|
Fellan's hammering is now an "improvement" in the G2 module. The original G2 doesn't let you hear Fellan's hammering at Alwin's sheep pen (checked in a video). Alwin's line "Hörst du nicht das Hämmern?" makes a longer range a nice addition anyway, so it's back as an improvement beyond the original instead of a special case in Core:
Commits: Test (G2): stand at Alwin's sheep pen while Fellan hammers. You should hear it, quietly. Other smiths keep their normal range. 🤖 Generated with Claude Code |
…ange # Conflicts: # Assets/Gothic-Core/Scripts/Adapters/Scenes/WorldScene.cs
23 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
The animation sound
HAMMER(R:1000= 10 m) now carries 24 m. That is a finite list inAudioService.GetSfxRangeMeters, chosen in play: 60 m was heard across the harbour, and 24 m reaches Alwin's pen about 18 m away. Every NPC hammering (smiths too) is heard that far. Other sounds keep their range.Why
Alwin's quest asks whether you hear the madman hammering, but you couldn't from his pen.
How to test manually
Save/load
Nothing.
Known gaps / follow-ups
🤖 Generated with Claude Code