skellytz,
next version of DLL:
- added ATTACK4 mapping
- more detailed text output
- fixed tobex crash on objects without soundset
Posted 03 February 2022 - 06:54 AM
skellytz,
next version of DLL:
- added ATTACK4 mapping
- more detailed text output
- fixed tobex crash on objects without soundset
Posted 03 February 2022 - 08:03 PM
next version of DLL:- added ATTACK4 mapping
Works as intended. Good job and thanks! Tested all four attack sounds with BG1, BG2 and IWD anims. Everything sounds good so far, but I'll do some more tests at the weekend.
- more detailed text output
I didn't get anything other than "Sound: xxx" in this ver, both CRE and 2DA sounds (with "Sound: Normalize Volume=1" and "Sound: Normalize Volume Debug Print=1")
GetSndDeath()
plays when CRE.DYING and 2DA.DIE are empty, depending on creature size(?) select one of FAL_01B/FAL_02B/FAL_03B.wav
Looks like they play even if there are sounds in CRE.DYING or 2DA.DIE. But that's good, because they are more like "falling on the ground" sounds that should play along with "dying" sounds.
Here's one more engine-related issue that I'm sure you can help us with. Animations have hardcoded walking speeds, so whenever you add a new animation with Infinity Animations they always have the default BG2 walking speed. You can add effects to cre files to change the speed, but that may cause other problems. We need a 2DA with externalized walking speeds, like in BGEE (EXTSPEED.2DA). That way modders can add custom walking sounds with ANIWKSND.2DA and adjust the walking speed for their animations with EXTSPEED.2DA (change to your preferred filename).
There's also a small problem with ANIWKSND.2DA: if you set custom walking sounds for any animation added with Infinity Animations, they're hardcoded to use BG2 walking sound length (play for about 0.5 sec, cut off play again). So, for example, if you want to add a new BG1-type dog or wolf and use WAL_31 (which is one continuous 10 sec audio file), each time the walking sounds play they will cut off after 0.5 sec. But vanilla BG1 dogs and wolves are hardcoded to play the full walking sound for 10 sec without cutting off. Maybe there's a way to externalize walking sound length, too?
Edited by skellytz, 03 February 2022 - 08:49 PM.
Posted 04 February 2022 - 06:27 AM
Hi skellytz
- more detailed text outputI didn't get anything other than "Sound: xxx" in this ver, both CRE and 2DA sounds (with "Sound: Normalize Volume=1" and "Sound: Normalize Volume Debug Print=1")
Sorry, i forget about all required option (not for end-users)
Sound: Normalize Volume=1
Sound: Normalize Volume Creatures Only=1
Sound: Normalize Volume Debug Print=1
you can also try "tabbed" text version for better readability
Posted 04 February 2022 - 06:48 AM
skellytz,
Here's one more engine-related issue that I'm sure you can help us with. Animations have hardcoded walking speeds, so whenever you add a new animation with Infinity Animations they always have the default BG2 walking speed. You can add effects to cre files to change the speed, but that may cause other problems. We need a 2DA with externalized walking speeds, like in BGEE (EXTSPEED.2DA). That way modders can add custom walking sounds with ANIWKSND.2DA and adjust the walking speed for their animations with EXTSPEED.2DA (change to your preferred filename).
original EXTSPEED.2DA has animation_id in decimal form, do you want keep this format or classic hexadecimal ?
There's also a small problem with ANIWKSND.2DA: if you set custom walking sounds for any animation added with Infinity Animations, they're hardcoded to use BG2 walking sound length (play for about 0.5 sec, cut off play again). So, for example, if you want to add a new BG1-type dog or wolf and use WAL_31 (which is one continuous 10 sec audio file), each time the walking sounds play they will cut off after 0.5 sec. But vanilla BG1 dogs and wolves are hardcoded to play the full walking sound for 10 sec without cutting off. Maybe there's a way to externalize walking sound length, too?
In text log you can see that bg2 fires walking sound very frequently and select random sound every time: WAL_04, WAL_04B, WAL_04C, etc..
Let we patch engine and allows it play 10 sec one file, but dog can walking stop before and we must stop sound. I'm afraid that this can be complex, i need to check first if is possible without rewriting walking code
Edited by Insomniator, 04 February 2022 - 06:49 AM.
Posted 04 February 2022 - 08:10 PM
original EXTSPEED.2DA has animation_id in decimal form, do you want keep this format or classic hexadecimal ?
How about hexadecimal for consistency with aniwksnd.2da and anisndex.2da?
In text log you can see that bg2 fires walking sound very frequently and select random sound every time: WAL_04, WAL_04B, WAL_04C, etc..Let we patch engine and allows it play 10 sec one file
The problem is that each animation seems to have a hardcoded AIUpdateWalk sound rate. For example BG1 wolf (0x7B00) plays walking sounds every ~10 sec, even if you change it to a short audio file. BG1 werewolf (0x7E00) has much higher AIUpdateWalk sound rate and plays walking sounds every ~0.5 sec, which means it cuts off any longer audio files. We can't simply let the engine play the full length of audio files for every creature, because then the sounds won't be synced with walking animations. This must be adjusted per-animation. Do you think the AIUpdateWalk sound rate could be externalized into a 2DA table (or as another column either in aniwksnd.2da or extspeed.2da)?
Edit: BGEE externalized the AIUpdateWalk sound rate as "sound_freq" in the INI soundset file. For example, wolf (7b00.ini) has sound_freq=150 and werewolf (7e00.ini) has sound_freq=5.
but dog can walking stop before and we must stop sound. I'm afraid that this can be complex, i need to check first if is possible without rewriting walking code
No need to change that. The original BG1 and BG2 engines allow the walking sound to continue playing even if the creature animation has stopped walking. The sound cut-off is based on the AIUpdateWalk sound rate, but it also stops current playback if the creature starts another action (so that walking sounds don't stack or overlap). These long sounds are typically for creatures like wolves, bears, dogs and basilisks which are more like animal breathing, panting, clicking etc. rather than footsteps. So it's ok for "walking" sounds to continue playing when the walking animation stopped, just like in the unmodded engine.
Edited by skellytz, 05 February 2022 - 08:11 AM.
Posted 05 February 2022 - 08:53 AM
Hi skellytz
How about hexadecimal for consistency with aniwksnd.2da and anisndex.2da?original EXTSPEED.2DA has animation_id in decimal form, do you want keep this format or classic hexadecimal ?
Done
1) Add to TobExCore.ini, [Engine] section:
Externalise Animation Movement Speed Override=1
2) Customize EXTSPEED.2DA and place to override/
EXTSPEED.2DA works as override, no need to fill it with all animation_id
BGEE externalized the AIUpdateWalk sound rate as "sound_freq" in the INI soundset file. For example, wolf (7b00.ini) has sound_freq=150 and werewolf (7e00.ini) has sound_freq=5.
For IA animation i can externalise this, new column to EXTSPEED.2DA as skip_tick_count(150) or wave length (10) ?
So it's ok for "walking" sounds to continue playing when the walking animation stopped, just like in the unmodded engine.
OK
Posted 05 February 2022 - 09:17 AM
How about hexadecimal for consistency with aniwksnd.2da and anisndex.2da?original EXTSPEED.2DA has animation_id in decimal form, do you want keep this format or classic hexadecimal ?
Done
Very cool. Thanks!
For IA animation i can externalise this, new column to EXTSPEED.2DA as skip_tick_count(150) or wave length (10) ?
Ticks will be easier to work with and match the original behavior. For example skip_tick_count=5 is easier to input than skip_seconds=0.333 (assuming 1 tick = 1/15 sec)
Posted 05 February 2022 - 10:46 AM
Edited by Insomniator, 05 February 2022 - 10:47 AM.
Posted 05 February 2022 - 11:27 AM
There is hardcoded "Personal Space"(Foot Size/Creature Diameter) and "BloodColor" in animation data, second is number 1-255
Do you need customization of it per anim_id for IA ?
The foot circle size (normal, large, huge) can be chosen when we add new animation offsets with IA, but they are limited. So, yes, it would be nice to be able to override the foot circle size and blood color in a 2DA.
Posted 06 February 2022 - 02:29 AM
Hi skellytz
There is hardcoded "Personal Space"(Foot Size/Creature Diameter) and "BloodColor" in animation data, second is number 1-255
Do you need customization of it per anim_id for IA ?The foot circle size (normal, large, huge) can be chosen when we add new animation offsets with IA, but they are limited. So, yes, it would be nice to be able to override the foot circle size and blood color in a 2DA.
Done
1) EXTSPEDD.2DA renamed to EXTANIM.2DA, column names taken from EE
2) value * skip overriding
3) currently 4 data column
Posted 06 February 2022 - 06:51 AM
1) EXTSPEDD.2DA renamed to EXTANIM.2DA, column names taken from EE
2) value * skip overriding3) currently 4 data column
Fantastic!
How about merging ANISNDEX.2DA with EXTANIM.2DA? Then EXTANIM.2DA could be enabled with a single TobExCore.ini hack "Externalise Animation Data Override" (=1 by default). I suggest these column names:
2DA V1.0 * SPEED WKSND_FREQ PERSONAL_SPACE COLOR_BLOOD SNDSET 0x7B00 8 150 3 47 MWLF
Infinity Sounds on its own would then append to EXTANIM.2DA to add the override animation offsets for SNDSET to be fixed.
Edit: You didn't provide the new TobExCore.ini key for testing, I found it with xvi32: "Externalise Animation Config Override" is a good key name as well.
Initially I thought in the classic BG2 engine personal space and circle size were interpreted together, but it looks like they work like in BGEE: "personal space" changes only the space around the animation, but not the foot circle. Maybe the foot circle size (in BGEE "ellipse=") could be added too?
There's also "color_chunks=" in BGEE. Looks like it doesn't change the blood color, but rather determines whether chunked death is enabled for that animation: color_chunks=0-254 (enabled chunked death), color_chunks=255 (disabled chunked death). I think it works like that in the classic engine, too. For example, wolf animations are hardcoded not to chunk. Could this be externalized as CHUNK_DEATH, 1=enable (sets the value internally to 0), 0=disable (sets to 255 internally)?
Edited by skellytz, 06 February 2022 - 09:02 AM.
Posted 06 February 2022 - 10:41 AM
skellytz,
How about merging ANISNDEX.2DA with EXTANIM.2DA? Then EXTANIM.2DA could be enabled with a single TobExCore.ini hack "Externalise Animation Data Override" (=1 by default). I suggest these column names:
i prefer to keep two files and two TobExCore.ini options:
ANISNDEX.2DA - fix for programmer's mistypos in engine and design doc's ANISND.IDS
EXTANIM.2DA - for overriding existings parameters
Edit: You didn't provide the new TobExCore.ini key for testing, I found it with xvi32: "Externalise Animation Config Override" is a good key name as well.
sorry, Externalise Animation Movement Speed Override -> Externalise Animation Config Override
Initially I thought in the classic BG2 engine personal space and circle size were interpreted together, but it looks like they work like in BGEE: "personal space" changes only the space around the animation, but not the foot circle. Maybe the foot circle size (in BGEE "ellipse=") could be added too?
BG2 has "personal space" and "ellipse" parameters, ellipse calculation based only on personal space
for example for pers_space=3, ellipse (really it is rectangle) is (-16, -12,16,12), virtual center at X=0,Y=0
foot circle - size of selection circle or something other ?
There's also "color_chunks=" in BGEE. Looks like it doesn't change the blood color, but rather determines whether chunked death is enabled for that animation: color_chunks=0-254 (enabled chunked death), color_chunks=255 (disabled chunked death). I think it works like that in the classic engine, too. For example, wolf animations are hardcoded not to chunk. Could this be externalized as CHUNK_DEATH, 1=enable (sets the value internally to 0), 0=disable (sets to 255 internally)?
i didnt ask about this because it is set zero(default) or -1 (~ half of animations),
please test before (how it works) before adding to 2da, for wolf change hex pattern C6 42 19 FF 8B 85 18 FC FF FF C6 40 06 08 8B 8D to C6 42 19 00 8B 85 18 FC FF FF C6 40 06 08 8B 8D in bgmain.exe to force 00 (0x418ffd bgmain.exe offset) value
there is more "deep" parameters per anim_id (not every animation has all of it):
castframe - number of casting animation frames ? (default=4, dragons,demogorgon=9)
bBrightest - boolean ?
bBrightestDesired - boolean ?
bLightSource - boolean ?
neckOffsets - array of 8 points (0, 10), ( -10, 10), ( -10, 0), ( -10, -10), ( 0, -10), (10, -10), (10, 0), ( 10, 10)
bUseColorRange - boolean ?
currentBamSequence - start animation frame ? (default=1)
currentBamDirection - start orientation ? (default=9)
falseColor - ?
bCanLieDown - show permanent corpse on map?
bDetectedByInfravision
bPathSmooth - pathsearch related ?
Edited by Insomniator, 06 February 2022 - 10:43 AM.
Posted 06 February 2022 - 12:03 PM
BG2 has "personal space" and "ellipse" parameters, ellipse calculation based only on personal spacefor example for pers_space=3, ellipse (really it is rectangle) is (-16, -12,16,12), virtual center at X=0,Y=0
foot circle - size of selection circle or something other ?
Yeah, by "foot circle" I mean the selection circle. When you override personal space with TobEx, only the physical space around the creature changes (search map units), the foot circle stays the same as original.
i didnt ask about this because it is set zero(default) or -1 (~ half of animations),
please test before (how it works) before adding to 2da, for wolf change hex pattern C6 42 19 FF 8B 85 18 FC FF FF C6 40 06 08 8B 8D to C6 42 19 00 8B 85 18 FC FF FF C6 40 06 08 8B 8D in bgmain.exe to force 00 (0x418ffd bgmain.exe offset) value
Forcing 00 worked and enabled chunked death for the wolf animation. Changing back to FF disabled it. So, it seems like it was intended to be an off switch: 0xFF (255) = disable chunked death. Changing bits around didn't affect the animation, values 0-254 = enable chunked death.
there is more "deep" parameters per anim_id (not every animation has all of it):
castframe - number of casting animation frames ? (default=4, dragons,demogorgon=9)
bBrightest - boolean ?
bBrightestDesired - boolean ?
bLightSource - boolean ?
neckOffsets - array of 8 points (0, 10), ( -10, 10), ( -10, 0), ( -10, -10), ( 0, -10), (10, -10), (10, 0), ( 10, 10)
bUseColorRange - boolean ?
currentBamSequence - start animation frame ? (default=1)
currentBamDirection - start orientation ? (default=9)
falseColor - ?
bCanLieDown - show permanent corpse on map?
bDetectedByInfravision
bPathSmooth - pathsearch related ?
IESDP info about those. I don't think we need to mess around with most of them, but light source, height offset and infravision seem useful.
Edited by skellytz, 06 February 2022 - 12:38 PM.
Posted 06 February 2022 - 01:22 PM
IESDP info about those. I don't think we need to mess around with most of them, but light source, height offset and infravision seem useful.
BG2 supports bLightSource and bDetectedByInfravision,
height offset is EE only
Posted 07 February 2022 - 06:32 AM
Hi skellytz
1) added CHUNK_DEATH to EXTANIM.2DA (* or 1 or 0)
2) circle selection size fixed
Posted 07 February 2022 - 03:12 PM
1) added CHUNK_DEATH to EXTANIM.2DA (* or 1 or 0)
2) circle selection size fixed
Thanks! Works as intended.
Posted 09 February 2022 - 07:41 PM
All the sound engine issues in the classic BG2 mentioned in this thread have already been fixed in the upcoming versions of Infinity Sounds and TobEx AfterLife. Big thanks to Insominator for all the required engine patches!
Here's BGEE/SoD/BG2EE v2.6.6 report that has been passed on to Beamdog (thanks to Galactygon!). Hopefully, similar engine fixes will be applied in v2.7, so that any necessary INI and CRE soundset patches can be easily added to the base game as well.
1. [BGEE, BG2EE] CRE soundset ATTACK2, ATTACK3 and ATTACK4 don't play
Creatures have four attack sound slots in the CRE soundset:
* ATTACK1 (0xdc)
* ATTACK2 (0xe0)
* ATTACK3 (0xe4)
* ATTACK4 (0xe8)
Only ATTACK1 plays its sound, the other attack soundset slots don't work. For example, in BGEE wolf.cre:
* ATTACK1 -> StrRef: 5558 (wolff05.wav) always plays on every attack
* ATTACK2 -> StrRef: 5559 (wolff06.wav) never plays on any attack
All four ATTACK soundset slots should be enabled.
Most creatures have separate audio files for different attack animations (slash, backslash, jab). These sounds were designed to be played on specific attack animations. Back to the wolf example:
* wolff05.wav matches only the slash attack animation cycle (the wolf bites with its fangs)
* wolff06.wav matches only the backslash attack animation cycle (the wolf leaps with its paws and bites)
The attack sounds should be matched with the attack animations:
* ATTACK1 should play only on the SLASH attack animation cycle
* ATTACK2 should play only on the BACKSLASH attack animation cycle
* ATTACK3 should play only on the JAB attack animation cycle
* ATTACK4 should play only on the SHOOT attack animation cycle
If these ATTACK sounds simply played at random on any attack, there would be lots of mismatches between the attack sounds and the attack animations.
2. [BGEE, BG2EE] INI sounds overlap with CRE sounds
* INI.DAMAGE overlaps with CRE.DAMAGE (0xec)
* INI.DIE overlaps with CRE.DYING (0xf0)
* INI.ATTACK_SLASH overlaps with CRE.ATTACK (0xdc)
* INI.ATTACK_BACKSLASH overlaps with CRE.ATTACK (0xdc)
* INI.ATTACK_JAB overlaps with CRE.ATTACK (0xdc)
These sounds play at the same time. For example, BGEE wolf:
* dwolf08.wav in 7b00.INI.DAMAGE plays at the same time as wolff08.wav in WOLF.CRE.DAMAGE when the creature gets damaged
* dwolf09.wav in 7b00.INI.DIE plays at the same time as wolff09.wav in WOLF.CRE.DYING when the creature dies
* dwolf05.wav in 7b00.INI.ATTACK_SLASH plays at the same time as wolff05.wav in WOLF.CRE.ATTACK when the creature attacks with the slash animation
* dwolf06.wav in 7b00.INI.ATTACK_BACKSLASH plays at the same time as wolff05.wav in WOLF.CRE.ATTACK when the creature attacks with the backslash animation
* dwolf06.wav in 7b00.INI.ATTACK_JAB plays at the same time as wolff05.wav in WOLF.CRE.ATTACK when the creature attacks with the jab animation
INI sounds should be disabled if a given creature has sounds in the corresponding CRE soundet:
* INI.DAMAGE shouldn't play if a creature has CRE.DAMAGE sound
* INI.DIE shouldn't play if a creature has CRE.DYING sound
* INI.ATTACK_SLASH shouldn't play if a creature has CRE.ATTACK1 sound
* INI.ATTACK_BACKSLASH shouldn't play if a creature has CRE.ATTACK2 sound
* INI.ATTACK_JAB shouldn't play if a creature has CRE.ATTACK3 sound
* INI.SHOOT shouldn't play if a creature has CRE.ATTACK4 sound
The engine already properly disables:
* INI.SELECTION if a creature has CRE.SELECT_COMMON
* INI.BATTLE_CRY if a creature has CRE.BATTLE_CRY
All this will allow for creatures with the same animation to have completely different soundsets.
3. [BGEE, BG2EE] Hardcoded ITM weapon sounds overlap with INI and/or CRE attack sounds
The following weapon items are hardcoded to play sounds on attacks:
* ANGHEG1.itm -> ANKHG06.wav
* ANGHEG2.itm -> ANKHG05.wav
* BASIL1.itm -> BASIL06.wav
* BASIL2.itm -> BASIL05.wav
* BASILG1.itm -> GBASI05.wav
* BASILG2.itm -> GBASI06.wav
* BASILG3.itm -> GBASI07.wav
* ETTERC1.itm -> ETTER05.wav
* ETTERC2.itm -> ETTER06.wav
* WYVERN1.itm -> WYVER05.wav
* WYVERN2.itm -> WYVER06.wav
* WOLFWI1.itm -> WWOLF07.wav
* WOLFWI2.itm -> WWOLF06.wav
These hardcoded item sounds overlap with any attack sounds in the INI or CRE soundsets (they play at the same time). The hardcoded weapon item sounds should be disabled. They are leftovers from the legacy BG1 engine which didn't allow for setting different sounds for melee and ranged attacks. In the current engines we use INI and CRE soundsets to set sounds for attack animations.
4. [BGEE] Right-click INI.SELECTION sounds don't work
This has been fixed only for BG2EE engine. From 2.6.6 patch notes:
"Creature Sounds | Right-clicking on creatures will once again play their default sound"
The same fix should be applied to the BGEE engine.
Posted 10 February 2022 - 12:48 AM
Just chiming in to say a big thank you to skellytz and Insomniator for all the work that went into this.
It is fantastic to see this game receive so much passion and attention so many years after its release. I look forward to playing BGT again with all these nifty updates, and it will be amazing to play the Enhanced Editions too if these fixes make it to v2.7
Awesome work is awesome. Thank you, guys!
Edited by Andrea C., 10 February 2022 - 12:49 AM.
Posted 10 February 2022 - 03:10 AM
Hi skellytz
3. [BGEE, BG2EE] Hardcoded ITM weapon sounds overlap with INI and/or CRE attack sounds
The following weapon items are hardcoded to play sounds on attacks:
* ANGHEG1.itm -> ANKHG06.wav
* ANGHEG2.itm -> ANKHG05.wav
* BASIL1.itm -> BASIL06.wav
* BASIL2.itm -> BASIL05.wav
* BASILG1.itm -> GBASI05.wav
* BASILG2.itm -> GBASI06.wav
* BASILG3.itm -> GBASI07.wav
* ETTERC1.itm -> ETTER05.wav
* ETTERC2.itm -> ETTER06.wav
* WYVERN1.itm -> WYVER05.wav
* WYVERN2.itm -> WYVER06.wav
* WOLFWI1.itm -> WWOLF07.wav
* WOLFWI2.itm -> WWOLF06.wav
BG2 has same issue, ankheg plays 3 sounds at same time with melee attack, textlog:
Creature::Swing sound: ANKHG05 2DA Generic attack sound: ZWOLF0_2 2DA SEQ_ATTACK_JAB sound: ZWOLF3_1
1) CRE.attack3 is empty
2) MAKH.2da: (customized for debug)
ATTACK ZWOLF0_1 ZWOLF0_2 ZWOLF0_3 (generic attack)
ATTACK_JAB ZWOLF3_1 ZWOLF3_2 ZWOLF3_3
because Creature::Swing() ignores CRE.Attack* for special Item list (as you wrote)
Edited by Insomniator, 10 February 2022 - 03:20 AM.
Posted 10 February 2022 - 04:19 AM
BG2 has same issue, ankheg plays 3 sounds at same time with melee attack, textlog:Creature::Swing sound: ANKHG05 2DA Generic attack sound: ZWOLF0_2 2DA SEQ_ATTACK_JAB sound: ZWOLF3_1
1) CRE.attack3 is empty
2) MAKH.2da: (customized for debug)
ATTACK ZWOLF0_1 ZWOLF0_2 ZWOLF0_3 (generic attack)
ATTACK_JAB ZWOLF3_1 ZWOLF3_2 ZWOLF3_3
because Creature::Swing() ignores CRE.Attack* for special Item list (as you wrote)
Yes, that's right. Infinity Sounds already has a fix for that (doesn't need engine hacking).