Jump to content


Photo

Issues with Creature and Animation Soundsets


  • Please log in to reply
94 replies to this topic

#41 skellytz

skellytz
  • Staff
  • 554 posts

Posted 09 February 2017 - 02:49 PM

I cannot help with BG:EE testing but I do have a BGT platform to work on.

Thanks  :) I'll send you the test version along with notes on what problem to keep a lookout for when its ready. I need a few more weeks.



#42 skellytz

skellytz
  • Staff
  • 554 posts

Posted 06 March 2017 - 06:44 PM

Some issues from the Beamdog forum have already been transfered to the public bugtracker. Please take a look if anything need to be updated or if you discover any additional issues.

 

 

These have been updated. Thanks to Andrea Colombo :)

 

Due to the nature of the tracker system, the updated repro steps are in the changes history below the original description.



#43 Salk

Salk
  • Modder
  • 1419 posts

Donator

Posted 09 March 2017 - 06:52 AM

Nice to see things moving along...



#44 Miloch

Miloch

    Barbarian

  • Modder
  • 6579 posts

Posted 10 March 2017 - 01:45 PM

It is surprising if the middle INI sounds don't work. As I recall, that was the same issue with middle 2DA sounds in the first place.


Infinity Engine Contributions
Aurora * BG1 NPC * BG1 Fixpack * Haiass * Infinity Animations * Level 1 NPCs * P5Tweaks
PnP Free Action * Thrown Hammers * Unique Containers * BG:EE * BGII:EE * IWD:EE
================================================================
Player & Modder Resources
BAM Batcher * Creature Lister * Creature Checker * Creature Fixer * Tutu/BGT Area Map & List * Tutu Mod List
================================================================
"Infinity turns out to be the opposite of what people say it is. It is not 'that which has nothing beyond itself' that is infinite, but 'that which always has something beyond itself'." -Aristotle


#45 skellytz

skellytz
  • Staff
  • 554 posts

Posted 11 June 2017 - 09:27 AM

Seeing as BG2 Fixpack v11 has been released, some of you will probably want to start summer playthroughs. This gives me enough incentive to pack an alpha of the new Infinity Sounds.

 

I'll personally contact those of you who expressed willingness to test the new patches.

 

Edit: Infinity Sounds v2 is now in beta.


Edited by skellytz, 25 August 2018 - 01:44 AM.


#46 skellytz

skellytz
  • Staff
  • 554 posts

Posted 25 August 2018 - 09:15 AM

Where are we in 2018
 
The following issues discussed in this thread have been addressed in Infinity Sounds v2 for the classic BG2:

More details in the description of component Restored & Tweaked Creature Soundsets.


These issues have been addressed in Restored BG1 Palette Variants for the classic BG2:

 
Below are the bugs fixed by Beamdog in BGEE v2.5 in response to our reports. Special thanks to Andrea Colombo for adding the reports to the Beamdog bug tracker and raising their attention.

 

If there's interest in getting any of the tweaks, restorations or corrections mentioned here or in the Infinity Sounds thread into BGEE, I'll probably see about making the mod compatible.


Edited by skellytz, 25 August 2018 - 11:08 AM.


#47 skellytz

skellytz
  • Staff
  • 554 posts

Posted 28 August 2018 - 08:36 AM

Enhanced Editions v2.5 Report
 

I've done a few quick tests with the new patch. Here's what I've observed so far:


1. General melee attack sound slot has been disabled in the INI soundset.

 

[sounds]
attack=wspid03 // Disabled. This slot won't ever play sounds.
attack_frame=2

 

This is probably because after enabling the slash, backslash, and jab sounds, they realized the general melee slot ("attack=") has battle cries instead of attack sounds in like 90% of INI files. So, they simply disabled the slot on the engine level.

 

2. Sadly, the old issues are still there: overlapping between CRE and INI attack sounds, as well as overlapping between CRE/INI attack sounds and the hardcoded weapon ITM sounds.

 

3. INI soundsets have lots of issues, such as missing sounds, sounds placed in wrong slots, silent attacks, sounds belonging to other creatures, and maladjusted frame delay.

 

4. On the bright side, BG1 creatures with palette variants have separate INI soundsets.

 

5. 2DA soundsets in the classic games have a hardcoded pitch and volume variation, which simulates more sound altenatives. INI soundsets don't have any kind of sound variation.


Edited by skellytz, 31 August 2018 - 02:49 PM.


#48 Salk

Salk
  • Modder
  • 1419 posts

Donator

Posted 13 September 2018 - 06:28 PM

Nice to see you back, skellytz! ;)



#49 skellytz

skellytz
  • Staff
  • 554 posts

Posted 08 May 2021 - 05:18 AM

I knew I'd missed something in the reports. The in-CRE damage and dying sounds also overlap with the 2DA/INI ones (they play simultaneously). Basically, only the battle cries and selection sounds do not overlap (the in-CRE sounds have priority). To solve these issues, Infinity Sounds removes in-CRE attack, damage and dying sounds from hand-picked vanilla animations and/or individual creature files which use both in-CRE and 2DA/INI soundsets. We're currently testing the new beta version.



#50 Insomniator

Insomniator
  • Modder
  • 358 posts

Posted 30 January 2022 - 06:18 AM

Hi skellytz
 
I have few question about generic ATTACK line in .2DA:

2) Animation INI slash, backslash and jab sounds should be played
MIST03.wav should be played with a ~33% chance when the XXX uses the slash animation
MIST04.wav should be played with a ~33% chance when the XXX uses the backslash animation
MIST05.wav should be played with a ~33% chance when the XXX uses the jab animation

When generic ATTACK sound must be played if slash+backslash+jab give always 100% change to animation-specific sounds ?
 
 

4) Alternative attack sounds referenced in CRE files should be played
ATTACK1 – only played upon slash animations
ATTACK2 – only played upon backslash animations
ATTACK3 – only played upon jab animations
ATTACK4 – only played upon shoot animations

Where this mapping described ? Is it right ?
For example how .CRE can override base ATTACK sound of *sound.2da ?


Edited by Insomniator, 30 January 2022 - 06:19 AM.


#51 Insomniator

Insomniator
  • Modder
  • 358 posts

Posted 30 January 2022 - 03:55 PM

@skellytz
Experiments with BG2 engine:
- CRE's Select_Attack1 sound called from action opcode AttackReevaluate()->Swing() (swing do something with animation and play sound if AnimationFrameType=10 or 6)
- 2DA' ATTACK sound called from CCreativeObject::AIUpdate(), AIUpdate called every game tick (30FPS by default),  if current animation frame = frame from 2DA, sounds start playing
- Tobex's "Sound:Enable Animation Attack Sounds" play specific animation sound simultaneously with 2DA

How it sounds ? Messy, game plays 3 sounds at same time every attack *facepalm*
First i removed playing 2DA sound if tobex detect specific animation sound, sounds better, only two sounds at time.
If CRE's Select_Attack1 is empty, i hear only tobex's specific animation sound synced with animation

CRE's attack synced with unknow logic, some "combat frame" looped in range 1-100,
for WOLF(0x7B00) anim_id at 35,59,86 frames AnimationFrameType changed to 6, at 0 frame changed to 10, in next loop frames different: 27, 54, 81
(i think frame values based on rndbase.bmp)
At frametype=10 and =6 sequence is resetted from WALK to ATTACK (WALK is last state after calling pathfinding stuff)
CRE's sound itself not synced with animation, instead it linked with Area's coordinates (played at start of animation cycle *imho*)

How is it presented ? First CRE's sound is fired, then 2DA specific animation sound, then i see attack animation of wolf.
After animation is over, this cycle is run again

My question is - if we give CRE priority above 2DA, we lost information about frame sync, is it OK ?



#52 skellytz

skellytz
  • Staff
  • 554 posts

Posted 30 January 2022 - 04:43 PM

First a quick explanation of the percentages before someone misinterprets the quote.

 

Play mist03.wav on every attack with the slash animation: (delay the playback by two slash animation frames)

ATTACK_SLASH mist03
ATTACK_SLASH 2

 

50% chance to play mist03.wav on an attack with the slash animation:

ATTACK_SLASH mist03 nosound
ATTACK_SLASH 2      0

 

33% chance to play mist03.wav on an attack with the slash animation:

ATTACK_SLASH mist03 nosound nosound
ATTACK_SLASH 2      0       0

 

When generic ATTACK sound must be played if slash+backslash+jab give always 100% change to animation-specific sounds ?

The way it is now in BG2 + TobEx. No changes needed. ATTACK should play on top of ATTACK_SLASH, ATTACK_BACKSLASH or ATTACK_JAB. This allows the soundset creator to overlay sounds. Of course, as I explained before, BG2 developers did a poor job and simply put battle cries in this slot. I've cleaned up all of them in Infinity Sounds.

 

Note: BGEE completely disabled the playback of ATTACK in the game engine. Not a good idea, because modders could potentially make some creative sound combinations for their animations

 

ATTACK1 – only played upon slash animations
ATTACK2 – only played upon backslash animations
ATTACK3 – only played upon jab animations
ATTACK4 – only played upon shoot animations

Where this mapping described ? Is it right ?

This isn't described or documented by the original developers at all. This is only my interpretation based on the existing CRE soundsets. Every creature has attack sounds paired with attack animations.

 

For example, wolf has these attacks:

"slash" animation cycle (looks like a bite -> matches wolff05.wav

"backslash" animation cycle (looks like a leap and bite) -> matches wolff06.wav
 

If you play wolff06 on a slash attack animation, or wolf05 on a backslash attack animation, they won't match.

 

Now look at BG1 wolf file (wolf.cre):

ATTACK1 (0xdc) -> StrRef 5558 (wolff05.wav)

ATTACK2 (0xe0) -> StrRef 5559 (wolff06.wav)
 

It's easy to see that ATTACK1 should be a "slash", and ATTACK2 a "backslash". If you look at other BG1 creature files, they follow the same pattern. So, it only makes sense to pair ATTACK3 with "jab" and ATTACK4 with "shoot".

 

That way you can create new creatures with custom attack sounds based on the existing animations, rather than adding it as a new animation. For example: create a new creature file with doppleganger or ettercap animation. Add some cool permanent effects (color, blur, overlay, etc.). Add custom selection, battlecry, damage, dying and attack (slash and backslash) sounds that will play instead of the default 2da animation soundset. You've created something like a wendigo without the need to add a new animation offset with Infinity Animations.

 

How .CRE can override base ATTACK sound of *sound.2da ?

The playback of 2DA soundset ATTACK (and ATTACK_SLASH, ATTACK_BACKSLASH, ATTACK_JAB) should be disabled if a creature has sounds in CRE soundset ATTACK1-4.

 

If we give CRE priority above 2DA, we lost information about frame sync, is it OK ?

Yeah, I know. But that's the best we can do for the legacy CRE soundset.



#53 Insomniator

Insomniator
  • Modder
  • 358 posts

Posted 31 January 2022 - 09:08 AM

Hi skellytz

3. Some BG1 animations do not have 2DA soundsets coded in the game executable (more explanation)

These animation palette variants were supposed to have unique animation soundset codes, but weren't coded properly and default to base animation codes:

 

0x7101 BASILISK_GREATER should be linked with MBAS2.2da, defaults to MBAS.2da (shared with lesser basilisk)

 

0x7203 BEAR_POLAR should be linked with MBER2.2da, defaults to MBER.2da (shared with brown bear, black bear, cave bear)

0x7202 BEAR_CAVE should be linked with MBER3.2da, defaults to MBER.2da (shared with brown bear, black bear, polar bear)

0x7200 BEAR_BLACK should be linked with MBER4.2da, defaults to MBER.2da (shared with brown bear, polar bear, cave bear)

 

0x7401 DOG_WAR should be linked with MDOG2.2da, defaults to MDOG.2da (shared with wild dog)

 

0x7501 DOPPLEGANGER_GREATER should be linked with MDOP2.2da, defaults to MDOP.2da (shared with doppleganger)

 

0x7702 GHOUL_GHAST should be linked with MGHL2.2da, defaults to MGHL.2da (shared with ghoul)

 

0x7B01 WOLF_WORG should be linked with MWLF5.2da, defaults to MWLF.2da (shared with wolf and dire wolf)

0x7B02 WOLF_DIRE should be linked with MWLF6.2da, defaults to MWLF.2da (shared with wolf and worg)

 

0xA000 WYVERN (small wyvern) should be linked with MWYV2.2da, defaults to MWYV.2da (shared with big wyvern)

Technicaly we can take reversed ANISND.IDS from .exe and TobEx can patch engine to make every animation_id to have personal external *sound.2da (see attachment)

Original game and you reference non-exist files: MBAS,MBAS2, MWLF5-6, MWYV2, who will fill it (and probably few new files for  example from InfinityAnimation animset) with proper data ?

 


 

Attached Files



#54 Insomniator

Insomniator
  • Modder
  • 358 posts

Posted 31 January 2022 - 10:45 AM

skellytz,

3. Some BG1 animations do not have 2DA soundsets coded in the game executable (more explanation)

These animation palette variants were supposed to have unique animation soundset codes, but weren't coded properly and default to base animation codes:

Done

 

1) install any tobex with any options
2) update tobex.dll
3) TobExCore.ini: add new line to [Sound] section:
Externalise Animation Sound Reference Override=1
4) edit ANISNDEX.2DA as you wish
5) place ANISNDEX.2DA to overide/ folder

To see filename of played sounds, add to TobExTweak.ini:
Sound: Normalize Volume=1
Sound: Normalize Volume Debug Print=1

Be carefull, Normalize option will pump up volume of all sounds
 

 

https://ufile.io/3xbyxnky



#55 skellytz

skellytz
  • Staff
  • 554 posts

Posted 31 January 2022 - 07:06 PM

Original game and you reference non-exist files: MBAS,MBAS2, MWLF5-6, MWYV2, who will fill it (and probably few new files for  example from InfinityAnimation animset) with proper data ?

I will add these missing 2DA soundsets with Infinity Sounds. TobEx could be packaged with Externalise Animation Sound Reference Override=0 by default, not to disable vanilla sounds for players who don't install IS. Then IS will patch TobExCore.ini to enable it and tweak ANISNDEX.2DA.

 

3. Some BG1 animations do not have 2DA soundsets coded in the game executable (more explanation)

These animation palette variants were supposed to have unique animation soundset codes, but weren't coded properly and default to base animation codes:

Done

Awesome! Thank you for allowing us to finally fix these  :) I've already tested it a little bit and everything seems to work fine. The debug feature is also very useful.



#56 Insomniator

Insomniator
  • Modder
  • 358 posts

Posted 01 February 2022 - 10:33 AM

Hi skellytz

1. CRE soundset attack sounds 2, 3 and 4 do not work
2. CRE attack, damage and dying sounds overlap with 2DA animation sounds

Done

1) if Cre has ATTACK1:
on slash animation play Cre.ATTACK1, no random
+disable 2DA.ATTACK
+disable 2DA.ATTACK_SLASH

if Cre has empty ATTACK1, play 2DA.ATTACK + 2DA.ATTACK_SLASH simultaneously

2) if Cre has ATTACK2:
on backslash animation play Cre.ATTACK2, no random
+disable 2DA.ATTACK
+disable 2DA.ATTACK_BACKSLASH

if Cre has empty ATTACK2, play 2DA.ATTACK + 2DA.ATTACK_BACKSLASH simultaneously

3) if Cre has ATTACK3:
on backslash animation play Cre.ATTACK3, no random
+disable 2DA.ATTACK
+disable 2DA.ATTACK_JAB

if Cre has empty ATTACK3, play 2DA.ATTACK + 2DA.ATTACK_JAB simultaneously

4) if Cre has ATTACK4:
on shoot animation play Cre.ATTACK4, no random
+disable 2DA.SHOOT

if Cre has empty ATTACK4, play 2DA.ATTACK + 2DA.SHOOT simultaneously

EDIT: if Cre has empty ATTACK4, play  2DA.SHOOT

ATTACK4 not tested, i don't know how to create creature without embedded weapon sounds, maybe Beholder ?

5) if Cre has DAMAGE/DYING, 2DA.DAMAGE/DIE is disabled

To enable fixes, temporarily use existing setting TobExTweak.ini (i will create separate option):
Sound:Enable Animation Attack Sounds=1
 
logging sounds:
Sound: Normalize Volume=1
Sound: Normalize Volume Debug Print=1


New option in TobExTweak.ini:
Sound:Mute Generic Attack Sound=1
disable base 2DA.ATTACK from playing like BGEE (for people like me who don't like cacophony)

Bugs:
Original engine sometimes play CRE.AttackX before CRE.Battlecry, i think when enemy appears very closely to victim and immediately start fight
 
I wait your tests (i did't test every CRE<->2DA combination) and feeback.
 
https://ufile.io/a3pvz1d4
 
 


Edited by Insomniator, 02 February 2022 - 08:16 PM.


#57 skellytz

skellytz
  • Staff
  • 554 posts

Posted 01 February 2022 - 09:56 PM

You're really good at this stuff :clap: It wouldn't be possible without you. Thank you very much for all the work!

 

if Cre has empty ATTACK4, play 2DA.ATTACK + 2DA.SHOOT simultaneously

2DA.ATTACK should be melee only (slash, backslash and jab animations, but not shoot). So, it should be: If Cre has empty CRE.ATTACK4, play 2DA.SHOOT. I think that's how it works now (and in vanilla BG2 engine), but you simply described it incorrectly here?

 

4) if Cre has ATTACK4:

on shoot animation play Cre.ATTACK4, no random
+disable 2DA.ATTACK
+disable 2DA.SHOOT

Looks like a bug sneaked in. Currently it works like this:

 

If CRE has ATTACK4:

on shoot animation play CRE.ATTACK1 (should be play CRE.ATTACK4)

+disable 2DA.ATTACK
+disable 2DA.SHOOT

 

ATTACK4 not tested, i don't know how to create creature without embedded weapon sounds, maybe Beholder ?

Here's a debug wolf for testing ranged sounds:

Attached File  debug-wolf.zip   885bytes   117 downloads

 

CRE.ATTACK1 (slash) -> bbear01.wav

CRE.ATTACK4 (shoot) -> hspid01.wav
2DA.SHOOT -> cow01.wav

 

CRE.ATTACK1, CRE.ATTACK2 and CRE.ATTACK3 seem to work. Later I'll do some more extensive tests and with other animation types.



#58 Insomniator

Insomniator
  • Modder
  • 358 posts

Posted 02 February 2022 - 07:35 PM

As Irenicus said "It is time for more experiments", this time is *sound.2da files :

  • ATTACK                              1 works
  • AWAKE                                0 doesn't play when frame is 0
  • CAST                                  1 works
  • CONJURE                           1 works
  • DAMAGE                             1 works
  • DIE                                      1 works, before diying
  • HEAD_TURN                       1 works, when stoped after walking
  • READY                                1 works, before walking + when attacking in cycle
  • SHOOT                                1 works, ranged weapon
  • TWITCH                               1 works, after diying
  • WALK                                   1 works, play one time while walking
  • ATTACK_SLASH                  1 works
  • ATTACK_BACKSLASH        1 works
  • ATTACK_JAB                       1 works
  • EMERGE                             1 works on ankheg, when climb above ground
  • HIDE                                    1 works on ankheg, not tested on thief
  • SLEEP                                 1 works
  • Battle_Cry                           1 works
  • Selection                             1 works


AWAKE - engine uses reversed animation(?), frame_number decreased from last frame to first
to play sound need to set number of last frame or patch engine to assume value -1 as starting sound from any frame


Edited by Insomniator, 02 February 2022 - 08:25 PM.


#59 Insomniator

Insomniator
  • Modder
  • 358 posts

Posted 02 February 2022 - 07:36 PM

BG2 engine also uses some hardcoded sound routines:
GetSoundArmor()
anim_mask=5xxx         ARM_0*.wav      Not MAGE(x2xx), Not Robe(?)
anim_mask=6xxx         ARM_0*.wav      Not MAGE(x2xx), Not Robe(?) (IA add L_MAGEs at 6430-6435)

GetSoundReady()
anim_mask=10xx               WAL_77*.wav     WYVERN_BIG, (IA add NABASSU, DEMON_BLUE, WYVERN_WHITE_BIG)
anim_mask=7F03, 7F2D   WAL_PS.wav      IMP, WYVERN_FAMILIAR
anim_mask=A0xx              WAL_77*.wav     WYVERN

GetSoundWalk()
TobEx has externalization, see "Externalise Animation Walking Sounds"

GetSndDeath()
plays when CRE.DYING and 2DA.DIE are empty, depending on creature size(?) select one of FAL_01B/FAL_02B/FAL_03B.wav

TobEx Afterlife has workaround for new InfinityAnimation IDs, thanks to Andrea C. and Prozh for issue reporting


Edited by Insomniator, 02 February 2022 - 07:39 PM.


#60 Insomniator

Insomniator
  • Modder
  • 358 posts

Posted 02 February 2022 - 08:14 PM

Hi skellytz


if Cre has empty ATTACK4, play 2DA.ATTACK + 2DA.SHOOT simultaneously

2DA.ATTACK should be melee only (slash, backslash and jab animations, but not shoot). So, it should be: If Cre has empty CRE.ATTACK4, play 2DA.SHOOT. I think that's how it works now (and in vanilla BG2 engine), but you simply described it incorrectly here?

Yes, my description is wrong, 2DA.ATTACK never played on ranged attack
 


4) if Cre has ATTACK4:

on shoot animation play Cre.ATTACK4, no random
+disable 2DA.ATTACK
+disable 2DA.SHOOT

Looks like a bug sneaked in. Currently it works like this:
 
If CRE has ATTACK4:
on shoot animation play CRE.ATTACK1 (should be play CRE.ATTACK4)
+disable 2DA.ATTACK
+disable 2DA.SHOOT

This is because original engine don't handle ATTACK4 anyway,  i found and restored only existing internal mapping in code (same on bg2ee v2.5) and i didn't tested attack4 before (thanks for test creature!):
attack1->ATTACK_SLASH
attack2->ATTACK_BACKSLASH
attack3->ATTACK_JAB
if any other ->ATTACK_SLASH
 
You described before same minimal mapping, but ATTACK4 is new mapping and need more patching. i will upload next version with requested ATTACK4 mapping


Edited by Insomniator, 02 February 2022 - 08:30 PM.