Sherlock Holmes: Serrated Scalpel

General chat related to ScummVM, adventure gaming, and so on.

Moderator: ScummVM Team

digitall
ScummVM Developer
Posts: 1200
Joined: Thu Aug 02, 2012 1:40 pm

Re: Sherlock Holmes: Serrated Scalpel

Post by digitall »

zafos
Posts: 2
Joined: Wed Sep 16, 2015 3:14 pm

Re: Sherlock Holmes: Serrated Scalpel

Post by zafos »

Praetorian wrote: Sat Nov 29, 2025 9:16 am
zafos wrote: Fri Nov 28, 2025 11:35 pm https://www.youtube.com/watch?v=ui-7TBGkat4
Hello! Is this your work? Can you tell us more about the process and any challenges you've encountered?
Hello.

This started as an experiment using Claude to explain a large codebase I was unfamiliar with that I always had the intention to work on. I guided the prompts, interpreted outputs, and refined them for clarity, but the content was generated with the model’s assistance, so ti would be unfair to call it my work.

My main goal is to spark renewed interest in the project and implement this long forgotten task. There were minor challenges like figuring out the filename format for the videos, but the main challenge so far has been keeping text and speech in sync. I initially used a heuristic of 60 ms per character, which works in most cases but sometimes fails badly. I’ve started experimenting with retrieving the number of frames from each video and dynamically calculating a suitable duration per character, assuming 15 fps. Unfortunately I don’t have the time to fully develop this, as it would require extensive testing to achieve reliable results.
User avatar
Praetorian
ScummVM Developer
Posts: 1039
Joined: Tue May 08, 2007 8:54 am
Location: Greece
Contact:

Re: Sherlock Holmes: Serrated Scalpel

Post by Praetorian »

Interesting! I don't have the full game (in either platform) but it seems like a cool project.

Maybe others will find the work helpful and progress further.
mbabigd
Posts: 1
Joined: Sat May 02, 2026 1:51 am

Re: Sherlock Holmes: Serrated Scalpel

Post by mbabigd »

Hi all,

I've been working on a personal mod for The Lost Files of Sherlock Holmes: The Case of the Serrated Scalpel that adds AI-generated voice narration to the DOS version, using ScummVM's Scalpel engine. What started as an audio-content project grew into something more interesting because I kept finding engine-side bugs while building it. Sharing in case it's useful — and to get input before considering a public release.

Up front: I'm not a C++ engine developer. The implementation work is done by Anthropic's Claude Code, with me directing architecture, validation, and decisions. The diagnostic-first methodology (instrument, reproduce, log, fix) is central to the workflow. Mentioning this because some findings below contribute to understanding the Scalpel engine.

What the mod does

The 1992 DOS release shipped without voice acting. The 1994 3DO version added voice files for character dialogue but not for narrator text. My mod fills both gaps:
  • Narrator audio for object examines, inventory descriptions, and journal entries — voiced by xAI's Leo TTS for narration prose, ElevenLabs IVC clones for character-specific narration (Watson reads journal entries, Lestrade voices his letter to Holmes, etc.)
  • 3DO dialogue audio preserved as-is (the original voice acting is canonical)
  • Bridge between the two systems when a TLK script has no corresponding 3DO .stream file
About 916 narrator entries plus the existing 3DO dialogue corpus, wired into the engine via per-category hooks.

Engine-side findings

Things I found that aren't in any documentation I could locate:
  1. Pattern D — cross-scene dialogue continuation. Any TLK script with a mid-reply OP_GOTO_SCENE opcode silently broke. The engine synthesizes .stream filenames using scene._currentScene instead of the script's home room (encoded in the script name itself). When a script transitions scenes mid-utterance, the synthesizer looks in the wrong directory. Compounded by _3doSpeechIndex being unconditionally reset on every loadTalkFile — so post-transition talkWait fired sub=0 again, replaying earlier segments. Both bugs hid each other (silence either way) until the home-room fix surfaced the counter-reset. Diagnostic case: Inspector Gregson bringing Holmes from Morgue to Scotland Yard. Likely affects other multi-scene scripted dialogue (Watson during carriage rides, escort sequences) — silently broken in the original 1992 game and through every ScummVM build since.
  2. _3doSpeechIndex encodes speaker turn. Even sub_idx ≈ Holmes (statement_text); odd sub_idx ≈ NPC reply. But OP_SWITCH_SPEAKER opcodes mid-reply create nested speaker turns that defy parity. Auto-triggered scripts with empty statement_text (Z/W/Y/X suffixes — 156 of 428 scripts) put NPC at sub=0 instead of Holmes.
  3. r27 bust hotspot. The "examine the bust" interaction in Farthington's library uses a FLAG_SET zone that doesn't reliably trigger on walk-through traversal. Fixed via engine click-resolution hook rather than data patch.
  4. Music subsystem META 0x80 handling. The MIDI parser handles loops on the audio thread via jumpToTick. Converted to "track ended" so a main-thread polled restart can intervene with a configurable delay (currently 30s between iterations).
Audit toolchain

To find missing 3DO .stream files, I built a Python toolchain:
  • Standalone Python decoder for the 3DO IFF container + ADP4 codec (~150 lines)
  • Bytecode walker for talk.lib enumerating (script, selector, sub_idx) tuples
  • Per-character speaker mapping via OP_SWITCH_SPEAKER tracking
  • Text-similarity ranking for missing-file remediation candidates
Surfaced ~1,409 enumerated tuples, ~1,048 with high-confidence remediation candidates (often byte-identical or near-identical to existing files — the original devs sometimes voiced one delivery and assigned it to multiple selectors).

AI voices — posture

For narrator prose: xAI's Leo TTS. For character voices (Watson, Lestrade, Smithson): ElevenLabs IVC, trained on extracted clean speech from each character's existing 3DO dialogue (~60 seconds per character).

I know AI-voice tooling is a sensitive topic. My posture: this is a mod for a 30-year-old game whose original voice acting is preserved as-is. AI voices fill gaps where no audio was ever recorded. I'm not generating new audio in original actors' voices for content they originally voiced — Watson's IVC is used for narrator content (his journal entries), not for re-voicing dialogue he originally spoke.

Acknowledgments

This work builds on zafos's earlier contributions to the community. His initial work was the foundation that made it practical to extend the engine in this direction. Thanks for setting the table.

Thanks also to the ScummVM team — the Scalpel engine source is well-commented and was the entry point for understanding the audio subsystems. The existing checkSongProgress() infrastructure (originally for Tattoo) made the music delay implementation a tiny extension rather than a new system.

What's next

Working through a systematic playthrough QC pass and a few outstanding dialogue UX issues. After that, considering making the repo public — would appreciate input on:
  • Best practices for distributing AI-generated audio that voices someone else's copyrighted dialogue (fair-use mod context)
  • Whether the engine fixes (Pattern D especially) might be of interest for upstream consideration
  • License posture — engine fork is GPL by inheritance, audio assets are AI-generated + Pixabay/Freesound community-licensed for SFX
Happy to share specific findings, decoder source, or audit reports.
digitall
ScummVM Developer
Posts: 1200
Joined: Thu Aug 02, 2012 1:40 pm

Re: Sherlock Holmes: Serrated Scalpel

Post by digitall »

@Praetorian It should be noted that this was previously rejected as a PR due to the issues with mixing of datafiles from a much rarer game version i.e. 3DO which is not currently available from any digital storefront. See https://github.com/scummvm/scummvm/pull/7211
Post Reply