Arsonide / Babbler

Plugin that makes citizens audibly speak in Shadows of Doubt.
MIT License
4 stars 0 forks source link

Babbler

What is it?

This mod aims to make Shadows of Doubt more immersive by having NPCs you encounter speak and emote audibly, whether you are talking to them directly, over the phone, or just hearing them nearby. There are three modes of speech: Synthesis where they speak understandably using text to speech, Phonetic, where they speak in phonetic gibberish similar to the game "Animal Crossing", and Droning where they speak in repetitive gibberish similar to the game "Undertale". The default is Synthesis, because I believe it sounds better, but all three modes work, are set up with decent defaults so they are easy to activate, and are highly configurable. There are also "templates" that allow you to easily configure Babbler to sound like many games. I will outline how to activate and configure them in sections below.

A Note On Gender Identity

In my effort to create an inclusive and immersive experience, I've implemented comprehensive gender identity options in this mod. While the default settings align with the unmodified settings of Shadows of Doubt, extensive configurability is provided, allowing players to tailor these aspects to their preferences. My goal is to represent everyone respectfully, ensuring a diverse and authentic experience for all. As always I welcome any player feedback.

Installation

r2modman or Thunderstore Mod Manager installation

If you are using r2modman or Thunderstore Mod Manager for installation, simply download the mod from the Online tab.

Manual installation

Follow these steps:

  1. Download BepInEx from the official repository.
  2. Extract the downloaded files into the same folder as the "Shadows of Doubt.exe" executable.
  3. Launch the game, load the main menu, and then exit the game.
  4. Download the latest version of the mod from the Releases page on either Thunderstore or Github. Unzip the files and place them in corresponding directories within "Shadows of Doubt\BepInEx...". Also, download the SOD.Common dependency.
  5. Start the game.

Usage and features

Features

Configuration (Basic)

If you read anything in this document, read this section.

In r2modman you should see "Config editor" on the left, in the "Other" section. If you click on that and then open up BepInEx\config\AAAA_Babbler.cfg and click "Edit config", you will have many options available to you to configure Babbler to your liking. Just click "Save" when you are done.

If you do not see AAAA_Babbler.cfg in your options, click "Start modded" to launch the game, then close both the game and r2modman. When you launch r2modman again, the config file will be there.

Note that the mod caches a lot of things when it starts, so it's a good idea to modify these settings before you launch the game, not while the game is running.

Also note that the config starts with "AAAA". The reason for this is that it forces Babbler to initialize before other mods, which it needs to do.

Babbler has a setting that exists to simplify configuration - by modifying one setting you can have Babbler mimic a wide range of games and multimedia speech patterns. You do this by assigning Template in the General section. When it is assigned, the next time Babbler launches it will discard any other existing settings and configure many settings in Babbler for you. Template must be assigned to one of the following values to do this for you:

In case you missed it, assigning Template will DISCARD ANY OTHER CONFIGURATION OPTIONS the next time you launch the game. It's like loading a profile. After it loads that profile, it will reset back to "None", allowing you to further configure Babbler if you want to dive into the advanced settings below.

When you are done modifying the Template value remember to save by clicking "Save" on the top right. You'll also need to do this if you modify any other settings (which are listed below).

Configuration (Advanced)

You will find a ton of other settings in the configuration panel to tweak how NPCs sound to your liking, they are categorized very well. We will go through each category below, and what the options in them do.

If you find the amount of options to be insane, you're probably right, but I believe in giving as much control over this stuff to you, the user, as possible.


1. General

Adding Voices (Synthesis Mode)

Adding new voices in Synthesis Mode is as easy as installing them on your Windows 10 / Windows 11 machine. To do this, go to Settings->Time & Language->Speech. At the bottom under Manage voices you can install new voices. At the time of this writing there are five English packs with eleven voices in them. The more voices you add, the more diverse your NPCs will sound, so I recommend installing as many as you can, because it's great.

Note that any time your available voices change (when you install new ones or uninstall old ones) it will cause the voices of NPCs in existing cities to change to accommodate the newly available voices.

Adding Voices (Phonetic Mode)

It is possible to add new voices to Phonetic mode, but it is a bit more advanced. Phonetic voices are also used for Droning mode. The mod comes with many different phonetic voices, but this is basic instructions on adding even more. First you need to find your mod directory, which should look something like %AppData%\r2modmanPlus-local\ShadowsOfDoubt\profiles\<profile_name>\BepInEx\plugins\Arsonide-Babbler

You will have to replace with the name of your profile in r2modman.

If you locate where the mod is installed under, there is a subdirectory called "Phonemes". In that subdirectory is a folder for each installed voice. The naming conventions on the folders is important because it helps the mod load the phonemes. It would be in the format Name_Frequency. The frequency is the natural frequency of the phonemes in the voice you are adding, which is needed to adjust its pitch.

In the folder for each voice, you will find wav files for each phoneme. Again, the naming conventions here are important, the wav file will be named something_phoneme.wav. If "something" is "phonetic", then the 1-2 characters after the underscore will be the letters that the phoneme is played for.

If "something" is "symbol", then it will be used in very specific circumstances depending on what is after the underscore, normally for spaces and punctuation marks. See the voices that ship with the mod for examples.

Just like adding voices for Synthesis Mode, changing the number of available Phonetic voices will cause the NPCs in existing games to change their voices to accommodate the newly available voices.

Adding Emote Sounds and Themes

Let's start by navigating to the emote directory, which should look something like %AppData%\r2modmanPlus-local\ShadowsOfDoubt\profiles\<profile_name>\BepInEx\plugins\Arsonide-Babbler\Emotes. In that directory you will find subdirectories for each theme. By default, Babbler comes with one theme: Realistic. You can add more themes by adding more folders here. The name of the folder is the name of the theme. To activate a theme in Babbler, just type its name into the Theme option in the configuration settings, under the Emotes category.

For now, let's open the "Realistic" theme by going into that folder, to learn how to add more types of emotes and more sounds for them. Once you are in a theme folder, you are greeted with ... more folders! In this directory, the names of the folders must match the emote dialog in game. For example, a directory name of "Sneeze" will match the dialog "[Sneeze]". So by naming these directories, you can add entirely new emotes if you want. Go ahead and open Sneeze now so we can see what an emote looks like inside, and how to add sound variations for one.

Finally, we are to the actual WAV files that play in-game. You can add more here if you want, but notice they follow a very specific naming pattern with three sections separated by underscores. Let's look at one specific sound: "sneeze_female_347.wav":

Every sound in the emote's folder is considered when playing emotes for a civilian. If there is more than one that matches their gender, they will pick one at random. So you can add multiple variations of the same sound. Non-Binary citizens will first look for non-binary samples, then fall back to whichever gender matches their gender scale more closely if none are found.

Adding String Replacements

There's certain dialog that just sounds weird. Babbler tries to filter this dialog most of the time, but there's another option now: we can replace them with dialog that sounds better. For example, the line "Brrr..." sounds better in Synthesis mode when pronounced "Burr..."

In your Babbler directory, which can be found at %AppData%\r2modmanPlus-local\ShadowsOfDoubt\profiles\<profile_name>\BepInEx\plugins\Arsonide-Babbler, you will find "Replacements.json". Simply open this file and add the line you want to replace and the replacement text. Just note that it must be properly formatted JSON, and how to format JSON is beyond the scope of this document.

Replacements also do not operate on individual words, they operate on whole dialog lines. This is for performance reasons, we don't want to have to process every word at runtime. So we cannot just replace "Brrr", we have to get the whole line: "Brrr..."

License

All code in this project is distributed under the MIT License. Feel free to use, modify, and distribute as needed. That license can be found in License.txt. Attribution and licenses for all third party libraries and assets used in the creation of Babbler can be found in Attribution.txt.