The aim of this thread is to describe and offer possible solutions for an oversight regarding BG1 monster animation soundsets in BG2 and, by extension, BGT. All the insights provided below stem from a discussion we've had during the development of the new Infinity Sounds.
First, I'd like to give a little general background on soundsets. Next, I'll describe two bugs concerning attack sounds. Afterwards, I'll discuss how all this information ties in with the BG1 creatures present in BG2.
At the end, I'll try to offer possible solutions to the issues discussed in this post.
I. SOUNDSETS
This is how monster soundsets work in Baldur's Gate games:
BG1: Creature soundsets are stored in the creature file (CRE).
BG2: Creature soundsets are in table-based files (2DA) linked to animation codes in the game executable. The soundsets within CRE files are still respected if present.
BGT: All the BG1 creature files are copied with the embedded soundsets intact; now the game uses both in-CRE and in-2DA sounds.
When a creature has both variants of soundsets present, the in-CRE soundset has the priority only for battle cry and selection sounds. All in-CRE and in-2DA attack, damage and die entries are recognized and have a chance to be played back simultaneously. (fixed by TobEx AfterLife)
Note: The volume of attack sounds is directly controlled by the file "SNDCHANN.2DA." The in-CRE attack sounds are adjusted by the "SWINGS" value, while the in-2DA sounds are modified by the "MONSTER" entry. The in-CRE attack slot has a minor hardcoded pitch variance. All the in-2DA sounds also have a hardcoded pitch variance.
II. ATTACK SOUNDS BUGS
There are actually two attack sounds bugs:
In-CRE soundsets: There are four attack sound slots: ATTACK_1, ATTACK_2, ATTACK_3 and ATTACK_4. The game only recognizes the first slot, "ATTACK_1," for sound effect playback; the other slots are ignored. (fixed by TobEx AfterLife)
In-2DA soundsets: There is a general ATTACK sound slot and additional slots available for specific animation cycles: SLASH, BACKSLASH and JAB. The original BG2 ToB recognizes only the first and the last column in each slot; the middle columns are ignored. Moreover, the SLASH, BACKSLASH and JAB sounds are completely unrecognized by the game and aren't played back at all. (fixed by TobEx)
III. DEVELOPER OVERSIGHT
Here's what many would consider a big oversight:
BG2: Many BG1 monsters are available in BG2 with all their soundsets ported to the in-2DA format; most of the respective creature files were stripped of the embedded soundsets.
The problem with this approach is that the 2DA files are always linked to specific animations, as represented in the file "ANISND.IDS." While looking at the entries, it's easy to point out some issues:
(...) 0x7900 MSLM2 CGAMEANIMATIONTYPE_SLIME_GREEN 0x7901 MSLM3 CGAMEANIMATIONTYPE_SLIME_OLIVE 0x7902 MSLM4 CGAMEANIMATIONTYPE_SLIME_MUSTARD 0x7903 MSLM5 CGAMEANIMATIONTYPE_SLIME_OCHRE 0x7904 MSLM CGAMEANIMATIONTYPE_GRAY_OOZE 0x7A00 MSPI CGAMEANIMATIONTYPE_SPIDER_GIANT 0x7A01 MSPI CGAMEANIMATIONTYPE_SPIDER_HUGE 0x7A02 MSPI CGAMEANIMATIONTYPE_SPIDER_PHASE 0x7A03 MSPI CGAMEANIMATIONTYPE_SPIDER_SWORD 0x7A04 MSPI CGAMEANIMATIONTYPE_SPIDER_WRAITH 0x7B00 MWLF CGAMEANIMATIONTYPE_WOLF 0x7B01 MWLF CGAMEANIMATIONTYPE_WOLF_WORG 0x7B02 MWLF CGAMEANIMATIONTYPE_WOLF_DIRE 0x7B03 MWLF2 CGAMEANIMATIONTYPE_WOLF_WINTER 0x7B04 MWLF9 CGAMEANIMATIONTYPE_WOLF_VAMPIRIC 0x7B05 MWLF3 CGAMEANIMATIONTYPE_WOLF_DREAD 0x7B06 MWLS CGAMEANIMATIONTYPE_WOLF_SHADOW (...)
Notice that the entries "WOLF," "WOLF_WORG" and "WOLF_DIRE" all share the same animation code; therefore, all three creatures use the same 2DA file for soundsets. This means that they all use the exact same sound effects: in an unmodded game, it's the soundset originally belonging only to the "dire" type of wolves. Thankfully, "WOLF_WINTER," "WOLF_VAMPIRIC," "WOLF_DREAD" and "WOLF_SHADOW" all have their own codes.
According to the listed codes, all spider variants also share one soundset. This is not true; the file "ANISND.IDS" contains errors. BG1 spiders have separate soundset codes for each palette variant.
Note: The entries present in "ANISND.IDS" aren't recognized by the game; it's only a reference chart. All the animation codes are stored within the game executable and cannot be changed by simply modifying the IDS file.
BGT: As mentioned before, BGT uses both in-CRE and in-2DA soundsets due to the fact that it simply copies creature files from BG1.
The first problem here is that BGT doesn't adjust creature soundsets at all. Now, whenever a BG1 monster makes an attack, there is a chance for both in-CRE and in-2DA sound effects to be played. The in-CRE attack sounds are always played with each attack, while the in-2DA are chosen at random from the available columns. In an umodded 2DA, the middle and the third slot are typically "nosound" for BG1 creatures which means complete silence upon such attacks. (fixed by TobEx AfterLife and Infinity Sounds)
This is precisely why when fighting BG1 monsters in BGT, players hear the original attack sounds at an acceptable volume with each attack (in-CRE; volume adjusted by "SWINGS" and well below 100) and then, every once in a while, they get to hear two overlapping sound effects, the second one being the in-2DA sound at the maximum volume (adjusted by "MONSTER": 100). Naturally, the second overlapping attack sound belongs to the creature whose animation is linked to the 2DA soundset causing inconsistency. (fixed by TobEx AfterLife and Infinity Sounds)
BGT + TobEx: With all the information above, it's now easy to understand why sometimes as many as three overlapping attack sounds are played back simultaneously: the in-CRE one, the general ATTACK in-2DA one and any of the SLASH, BACKSLASH or JAB ones. Simply put: it's a mess. (fixed by TobEx AfterLife and Infinity Sounds)
IV. SOLUTIONS
The wolves described before were just an example; there may be more creatures suffering from the same issues. Here are possible solutions to these problems:
Solution #1: Patch all the affected BG1 creature files to remove any in-CRE attack sounds and rely on the animation-specific 2DA files. Correct the affected 2DA files to utilize the best possible attack sounds for all the BG1 monsters which share the same animation code. Naturally, some attack sound variants will be lost.
Solution #2: Patch all the affected BG1 creature files to use the in-CRE attack sounds and set their in-2DA slots to "nosound." The game will respect only the in-CRE soundsets. Obviously, the extra attack sounds will be lost due to the bug described earlier. Also, certain creatures introduced by mods that rely on the default 2DA files may lose sounds.
Solution #3: Use the TobEx injector to enable the in-CRE attack sound slots. Impossible without Ascension64. (Done! Thanks to Insominator's TobEx AfterLife)
Solution #4: Patch the game executable to assign unique codes to the creatures which share the same animation. Unfortunately, with Erephine gone, this solution is virtually unfeasible. (Done! Thanks to Insominator's TobEx AfterLife)
Solution #5: Use Infinity Animations to create unique animation codes for the affected BG1 creatures at the cost of taking up the BG1-monster slots.
I've tried to explain everything as plain as possible. Hopefully, now you understand the problem and could either comment or offer more suggestions.
Feedback: Do you consider taking up the available Infinity Animations slots just to fix the BG1 monster attack sounds a total waste?
Edited by skellytz, 09 February 2022 - 07:23 PM.