Jump to content


Photo

So the Infinity Animation update..


  • Please log in to reply
190 replies to this topic

#161 Andrea C.

Andrea C.
  • Modder
  • 464 posts

Posted 26 May 2022 - 07:58 AM

Thank you, Insomniator.

 

I've replaced the DLL and enabled the logging options as you mentioned. Should I run into any more crashes, I'll DM you the relevant information and dump files.

 

EDIT: Paperdoll off-hand weapon now displays as expected. :)


Edited by Andrea C., 26 May 2022 - 08:14 AM.


#162 skellytz

skellytz
  • Staff
  • 576 posts

Posted 27 May 2022 - 06:09 PM

fixed inventory colors and lost animation
i hope now un/equipping off-hand weapon do not touch main hand animation

(v8) Main hand colors don't change anymore, but the offhand weapon colors still use CRE values. So, there's always a mismatch, eg main hand sw1h07 -> ITM colors, offhand sw1h07 -> CRE colors. Look at vanilla BG2 offhand color checks; they don't have this issue.
 

false_color moved from extani60 and extani64 to global EXTANIM.2DA
it affects other animation types except 0xxx, 4xxx, Bxxx, Dxxx(tobex dosn't have hooks for this types yet) and all other types without this field like Exxx

Now overriding false_color in EXTANIM doesn't seem to work at all.

 

I never hear armor sound from mages with robes

Try 0x6600 (BG2 char) anim_class=W CLCK09, CLCK14, CLCK16. They will play ARM_02 (leather), ARM_03 (chain) and ARM_04 (plate).

 

I've done some more research into these sounds. Looks like ARM_01 sounds are never used in the original games, but they are supposed to be robe sounds. The game engine simply disables all armor sounds for vanilla mage anims. This could be another cool optional tweak to restore robe sounds.

 

Here's what Bubb dug out in the executable. It should be easy enough to inject in GetSndArmor something like: if ((mage anim or robe item) and armor code > 1) then return "ARM_01" + random_ascii

 

// Called by CGameSprite::AIUpdate 
CGameSprite::ChangeDirection()
{
	if (CGameSprite.m_nNewDirection == CGameSprite.m_nDirection)
	{
		return // Exit function
	}

	CGameAnimationType::SLOW_MOVE_SCALE = 6 // Const
	move_scale = CGameAnimationType::GetMoveScale()

	if (move_scale < CGameAnimationType::SLOW_MOVE_SCALE * 2)
	{
		movement_value = 2 - (move_scale / CGameAnimationType::SLOW_MOVE_SCALE)
		remainder = CGameSprite.m_id % movement_value
		remainder2 = CInfGame.m_worldTime.m_gameTime % movement_value

		if (remainder != remainder2)
		{
			return // Exit function
		}
	}

	goto :armor_sound_logic
}

--------------------------------------------------------------------------------

// Called in many different places, (sequence corresponds to SEQ.IDS)
CGameSprite::SetSequence(new_sequence)
{
	old_sequence = CGameSprite.m_nSequence

	if (new_sequence == old_sequence && new_sequence != 7)
	{
		return // Exit function
	}

	stats = CGameSprite::GetActiveStats()
	state = stats.m_generalState

	if (
		   state & 0x80   != 0 // STATE_STONE_DEATH
		|| state & 0x40   != 0 // STATE_FROZEN_DEATH
		|| state & 0x1000 != 0 // STATE_SILENCED
	)
	{
		return // Exit function
	}

	goto :armor_sound_logic
}

--------------------------------------------------------------------------------

:armor_sound_logic // Inlined in the above two functions

stats = CGameSprite::GetActiveStats()

if (stats.m_generalState & 0x1000 == 0) // Not STATE_SILENCED
{
	if (!CInfGame.m_options.m_bDisableFootstepsDuringCombat || CGameArea.m_nBattleSongCounter <= 0)
	{
		if (  
			   (CInfGame.m_options.m_bAutomatedSoundFootStepsOn && CInfGame.m_options.m_soundFootStepsOn)
		    || (CInfGame::GetCharacterPortraitNum() != -1) // Is one of the "core" 6 party members
		)
		{
			armor_sound = CGameAnimationTypeCharacter::GetSndArmor()

			if (armor_sound != "")
			{
				// Play armor sound
			}
		}
	}
}

--------------------------------------------------------------------------------

CGameAnimationTypeCharacter::GetSndArmor()
{
	animation_id = CGameAnimationTypeCharacter.baseclass_0.m_animationID // ANIMATE.IDS
	armor_code = CGameAnimationTypeCharacter.m_armorCode // (See below)

	// Character has mage animation, or non-mage wearing mage robes (See below)
	if (animation_id & 0xF00 == 0x200 || armor_code == 0x31)
	{
		return ""
	}

	// ARM_04G and ARM_04H exist, but can't be picked by the following random(??)
	random_ascii = rand{ascii a-f or "", equal probability} 

	return "ARM_0" + armor_code + random_ascii
}

--------------------------------------------------------------------------------

m_armorCode is set on the character via CItem::TranslateAnimationType().

// Flags
is_mage_animation = CGameSprite.m_baseStats.m_animationType & 0xF00 == 0x200 // ANIMATE.IDS
is_itm_mage_robes = Item_Header_st.animationType[1] == 0x57 ("W") // Second byte at +0x22 of .ITM

// Return conditions for Armor(2) items:

is_itm_mage_robes  && is_mage_animation  => return Item_Header_st.animationType[0] // First byte at +0x22 of .ITM
!is_itm_mage_robes && !is_mage_animation => return Item_Header_st.animationType[0] // First byte at +0x22 of .ITM

is_itm_mage_robes  && !is_mage_animation => return 0x31 ("1")
!is_itm_mage_robes && is_mage_animation  => return 0x31 ("1")

Edited by skellytz, 28 May 2022 - 07:44 AM.


#163 Salk

Salk
  • Modder
  • 1419 posts

Donator

Posted 27 May 2022 - 09:55 PM

Interesting find that about the unused mage robe sounds...

 

I guess they've been cut because a robe should not produce much sound at all?



#164 Andrea C.

Andrea C.
  • Modder
  • 464 posts

Posted 28 May 2022 - 01:06 AM

It's astonishing how we continue to discover new stuff about these games in 2022!

 

I'd love to hear the robe sounds. Perhaps Bubb could enable them in the Enhanced Editions as well for IS to uncover? :)

 

EDIT:

Just realized if he does, making it work with BG1 sprites is going to be tricky unless he also does something about the robed appearance.

 

The way I work around the robed sprites is by changing the robed appearance code from W to new levels of A:

 

ACTION_DEFINE_ASSOCIATIVE_ARRAY ac_robes_map BEGIN
  
2W => 5A
3W => 6A
4W => 7A

END
  
 COPY_EXISTING_REGEXP GLOB ~.*\.itm~ ~override~
  READ_ASCII 0x22 current (2)
  PATCH_PHP_EACH ac_robes_map AS no => yes BEGIN
   PATCH_IF (~%current%~ STR_EQ ~%no%~) BEGIN
	WRITE_ASCIIE 0x22 ~%yes%~ #2
    END
   END
   BUT_ONLY


All BAMs are renamed to these new armor levels, which are silent and display the robes correctly.

 

If robe sounds are enabled for W armor levels, then my solution won't play them. We'd need to either enable them for 5A / 6A / 7A too, or apply a visual fix akin to Insomniator's for the W code.


Edited by Andrea C., 28 May 2022 - 01:14 AM.


#165 skellytz

skellytz
  • Staff
  • 576 posts

Posted 28 May 2022 - 07:50 AM

I guess they've been cut because a robe should not produce much sound at all?

Not everybody will like those; that's for sure. They're basically exaggerated rustling and shuffling sounds of the bottom part and the cape. The armor sound channel volume is low enough for them to blend in with walking sounds.

 

Just realized if he does, making it work with BG1 sprites is going to be tricky unless he also does something about the robed appearance.

No problem at all. Item_Header_st.animationType can be set to detect both W and A for BGEE.



#166 Andrea C.

Andrea C.
  • Modder
  • 464 posts

Posted 28 May 2022 - 09:28 AM

Just realized if he does, making it work with BG1 sprites is going to be tricky unless he also does something about the robed appearance.

No problem at all. Item_Header_st.animationType can be set to detect both W and A for BGEE.


Brilliant!

 

However my solution's drawback is that robes will not show up for BG2 sprites if installed, so an engine enhancement from Bubb like Insomniator's would still be best (provided that Bubb was willing to code it.)



#167 Insomniator

Insomniator
  • Modder
  • 358 posts

Posted 01 June 2022 - 02:13 PM

Hi skellytz

fixed inventory colors and lost animation
i hope now un/equipping off-hand weapon do not touch main hand animation

(v8) Main hand colors don't change anymore, but the offhand weapon colors still use CRE values. So, there's always a mismatch, eg main hand sw1h07 -> ITM colors, offhand sw1h07 -> CRE colors. Look at vanilla BG2 offhand color checks; they don't have this issue.

Fixed

 

false_color moved from extani60 and extani64 to global EXTANIM.2DA
it affects other animation types except 0xxx, 4xxx, Bxxx, Dxxx(tobex dosn't have hooks for this types yet) and all other types without this field like Exxx

Now overriding false_color in EXTANIM doesn't seem to work at all.

i don't have issue on 64xx and 6xxx animation, when set false_color=0 i see "rainbow" on paperdoll and area animation

 

I never hear armor sound from mages with robes

Try 0x6600 (BG2 char) anim_class=W CLCK09, CLCK14, CLCK16. They will play ARM_02 (leather), ARM_03 (chain) and ARM_04 (plate).

Fixed for IA BG2 animID pool

 

I've done some more research into these sounds. Looks like ARM_01 sounds are never used in the original games, but they are supposed to be robe sounds. The game engine simply disables all armor sounds for vanilla mage anims. This could be another cool optional tweak to restore robe sounds.

It is possible but limited to Wizard.animation and any custom IA animID if W=1 specified n EXTANIM

 

If I'm not mistaken, for mage multiclass and bard, engine selects thief or figther animation, due limited animation context there is no information about source ITM data, only animID, current armor code and MAX armor code is available, no W or A code information. Engine always converts W2,W3,W4 codes to W1 and W2, so armor code 1 is marker for robe, but code 2 is marker for leather armor too, no difference between W2 Robe and A2 Leather Armor when nee to select armor sound EDIT: there is no conversion, level code is untouched


Edited by Insomniator, 03 June 2022 - 05:05 PM.


#168 skellytz

skellytz
  • Staff
  • 576 posts

Posted 01 June 2022 - 04:23 PM

i don't have issue on 64xx and 6xxx animation, when set false_color=0 i see "rainbow" on paperdoll and area animation

I've just tried again. A test creature with 0x6110 anim:

 

v5 with false_color=0 still in EXTANI60 -> works (overrides to unpaletted)

 

v8 with false_color=0 now in EXTANIM -> doesn't work (keeps palette colors)

 

        move_scale  personal_space  color_blood color_chunks    sound_freq  sound_death brightest   light_source    detected_by_infravision false_color resref  resref_paperdoll
0x6110  *           *               *           *               *           *           *           *               *                       0           *       *

 



#169 Andrea C.

Andrea C.
  • Modder
  • 464 posts

Posted 02 June 2022 - 01:00 AM

Insomniator, how much trouble would it be to add ITM information in there so that robe sounds can play for W2 / W3 / W4 levels?

#170 skellytz

skellytz
  • Staff
  • 576 posts

Posted 02 June 2022 - 04:07 PM

How much trouble would it be to add ITM information in there so that robe sounds can play for W2 / W3 / W4 levels?
It is possible but limited to Wizard.animation and any custom IA animID if W=1 specified n EXTANIM

I think "W=1" was just a subconscious shortcut for "anim_class=W" in extani60/64, rather than "W1 level". In other words, the ARM_01 sounds will work for all mage robe levels, but will probably have to be injected as part of the code restricted to vanilla mage animation offsets (62xx), IA BG1 mages (643x), and any animation offset manually overridden in extani60/64 with "anim_class=W". This is all we need.
 

There is no information about source ITM data, only animID, current armor code and MAX armor code is available, no W or A code information. Engine always converts W2,W3,W4 codes to W1 and W2, so armor code 1 is marker for robe, but code 2 is marker for leather armor too, no difference between W2 Robe and A2 Leather Armor when nee to select armor sound

Do you mean to say these snippets of code Bubb posted are different in the classic engine? Well, it doesn't really matter.

 

If I'm not mistaken, for mage multiclass and bard, engine selects thief or figther animation

Yeah, so we don't really need any item type detection; animation type will be enough. After all, it wouldn't make sense to enable robe sounds for non-mage animations for which the robe won't show up anyways.


Edited by skellytz, 02 June 2022 - 07:50 PM.


#171 Insomniator

Insomniator
  • Modder
  • 358 posts

Posted 03 June 2022 - 04:08 PM

Hi Skellytz

i don't have issue on 64xx and 6xxx animation, when set false_color=0 i see "rainbow" on paperdoll and area animation

I've just tried again. A test creature with 0x6110 anim:

 

v5 with false_color=0 still in EXTANI60 -> works (overrides to unpaletted)

 

v8 with false_color=0 now in EXTANIM -> doesn't work (keeps palette colors)

Better to attach your raw EXTANIM.2DA as is, maybe some kind of displaced column error



#172 Insomniator

Insomniator
  • Modder
  • 358 posts

Posted 03 June 2022 - 04:18 PM

Hi Andrea

Insomniator, how much trouble would it be to add ITM information in there so that robe sounds can play for W2 / W3 / W4 levels?

It is possible to enable ARM_01* for any robe - random ARM_01A-ARM_01F for random W* type, no need level information.

Or you want separate ARM_01G-L for W3 and ARM_01M-Q for W4 level ? You need offer 2 additional soundsets


 


Edited by Insomniator, 03 June 2022 - 05:11 PM.


#173 Insomniator

Insomniator
  • Modder
  • 358 posts

Posted 03 June 2022 - 04:41 PM

skellytz,

There is no information about source ITM data, only animID, current armor code and MAX armor code is available, no W or A code information. Engine always converts W2,W3,W4 codes to W1 and W2, so armor code 1 is marker for robe, but code 2 is marker for leather armor too, no difference between W2 Robe and A2 Leather Armor when nee to select armor sound

Do you mean to say these snippets of code Bubb posted are different in the classic engine? Well, it doesn't really matter.

Code is same for classic, but in CGameAnimationTypeCharacter::GetSndArmor() only animation context available, no creature or item data, we have only animation_id and armor_code.

 

Sorry, i was wrong about conversion, W2/W3/W4 was not converted, only any robe on non-mage char converted to armorcode=1


Edited by Insomniator, 03 June 2022 - 05:08 PM.


#174 skellytz

skellytz
  • Staff
  • 576 posts

Posted 03 June 2022 - 06:28 PM

It is possible to enable ARM_01* for any robe - random ARM_01A-ARM_01F for random W* type, no need level information.

Yes, please :)

 

Just to make sure, for mage robes we're also including the bare ARM_01.wav without the extra A-F letters, right? (total number of sounds: 7)

 

random_ascii = rand{ascii a-f or "", equal probability} 

return "ARM_01" + random_ascii

 

Better to attach your raw EXTANIM.2DA as is, maybe some kind of displaced column error

Attached File  extanim.zip   319bytes   100 downloads



#175 Insomniator

Insomniator
  • Modder
  • 358 posts

Posted 03 June 2022 - 08:44 PM

skellytz

It is possible to enable ARM_01* for any robe - random ARM_01A-ARM_01F for random W* type, no need level information.

Just to make sure, for mage robes we're also including the bare ARM_01.wav without the extra A-F letters, right? (total number of sounds: 7)
random_ascii = rand{ascii a-f or "", equal probability} 
return "ARM_01" + random_ascii

filename without last char is substitute when random = 7, no changes on original code


Edited by Insomniator, 03 June 2022 - 08:46 PM.


#176 Insomniator

Insomniator
  • Modder
  • 358 posts

Posted 03 June 2022 - 08:46 PM

Robe Armor sound now works

But engine seems mess up armor sounds

NPC Soldier walking:

Creature::ArmorSound            sound: ARM_03B   ch:20
Creature::AIUpdateWalk          sound: WAL_04    ch:19
CSound::Abort................           sound: ARM_03B   ch:20
Creature::ArmorSound            sound: ARM_03D   ch:20
Creature::AIUpdateWalk          sound: WAL_04C   ch:19
Creature::AIUpdateWalk          sound: WAL_04    ch:19
Creature::AIUpdateWalk          sound: WAL_04B   ch:19
Creature::AIUpdateWalk          sound: WAL_04    ch:19
Creature::ArmorSound            sound: ARM_03C   ch:20
CSound::Abort................          sound: ARM_03C   ch:20
Creature::ArmorSound            sound: ARM_03F   ch:20
Creature::AIUpdateWalk          sound: WAL_04    ch:19
CSound::Abort................           sound: ARM_03F   ch:20
Creature::ArmorSound            sound: ARM_03F   ch:20
Creature::AIUpdateWalk          sound: WAL_04B   ch:19
Creature::AIUpdateWalk          sound: WAL_04    ch:19
Creature::ArmorSound            sound: ARM_03C   ch:20


Mage Char moving at click:

Creature::ArmorSound            sound: ARM_01    ch:20
Creature::Play CRE.SEL_ACTION   sound: MALE005J  ch:7
CSound::Abort................           sound: ARM_01    ch:20
Creature::ArmorSound            sound: ARM_01B   ch:20
Creature::AIUpdateWalk          sound: WAL_04B   ch:18
CSound::Abort................           sound: ARM_01B   ch:20
Creature::ArmorSound            sound: ARM_01D   ch:20
CSound::Abort................          sound: ARM_01D   ch:20
Creature::ArmorSound            sound: ARM_01E   ch:20
CSound::Abort................          sound: ARM_01E   ch:20
Creature::ArmorSound            sound: ARM_01A   ch:20
Creature::AIUpdateWalk          sound: WAL_04B   ch:18
Creature::AIUpdateWalk          sound: WAL_04    ch:18
Creature::AIUpdateWalk          sound: WAL_04B   ch:18
Creature::AIUpdateWalk          sound: WAL_04C   ch:18
Creature::AIUpdateWalk          sound: WAL_04C   ch:18
Creature::AIUpdateWalk          sound: WAL_04B   ch:18
Creature::AIUpdateWalk          sound: WAL_04B   ch:18
Creature::ArmorSound            sound: ARM_01E   ch:20


Fighter Char moving at click:

Creature::ArmorSound            sound: ARM_02D   ch:20
Creature::Play CRE.SEL_ACTION   sound: FEMALE4J  ch:7
CSound::Abort................          sound: ARM_02D   ch:20
Creature::ArmorSound            sound: ARM_02F   ch:20
Creature::AIUpdateWalk          sound: WAL_04C   ch:18
CSound::Abort................           sound: ARM_02F   ch:20
Creature::ArmorSound            sound: ARM_02F   ch:20
CSound::Abort................          sound: ARM_02F   ch:20
Creature::ArmorSound            sound: ARM_02B   ch:20
CSound::Abort................          sound: ARM_02B   ch:20
Creature::ArmorSound            sound: ARM_02B   ch:20
Creature::AIUpdateWalk          sound: WAL_04C   ch:18
Creature::AIUpdateWalk          sound: WAL_04A   ch:18
Creature::AIUpdateWalk          sound: WAL_04B   ch:18
Creature::AIUpdateWalk          sound: WAL_04A   ch:18
Creature::AIUpdateWalk          sound: WAL_04C   ch:18
Creature::AIUpdateWalk          sound: WAL_04    ch:18
Creature::AIUpdateWalk          sound: WAL_04C   ch:18
Creature::AIUpdateWalk          sound: WAL_04A   ch:18
Creature::AIUpdateWalk          sound: WAL_04C   ch:18
Creature::ArmorSound            sound: ARM_02C   ch:20


1) Walk sounds always play without interruption and overlapping
2) Armor sounds conflicts, stop one and play instantly other
3) Main char always plays 5 armour sounds at begin of moving , then long pause and last sound when char stopped at destinaton


Edited by Insomniator, 03 June 2022 - 08:53 PM.


#177 skellytz

skellytz
  • Staff
  • 576 posts

Posted 03 June 2022 - 09:21 PM

Robe Armor sound now works

But engine seems mess up armor sounds

I think I know what you mean, but let me test v9 so I can compare results.
 



#178 Insomniator

Insomniator
  • Modder
  • 358 posts

Posted 04 June 2022 - 03:21 AM

skellytz,

Better to attach your raw EXTANIM.2DA as is, maybe some kind of displaced column error
attachicon.gifextanim.zip


Confirm, after reverting to v8 i see this bug, now fixed, your 2DA is OK



#179 Insomniator

Insomniator
  • Modder
  • 358 posts

Posted 04 June 2022 - 03:25 AM

skellytz,

Robe Armor sound now works

But engine seems mess up armor sounds

I think I know what you mean, but let me test v9 so I can compare results.

this is original engine behaviour, new sound text debug just shows how this bioware's magicbox really works
 



#180 Insomniator

Insomniator
  • Modder
  • 358 posts

Posted 04 June 2022 - 03:33 AM

Hi All,

 

v10 is last snapshot of Tobex AL/Improved GUI

 

to enable robe sound:

TobExTweak.ini

Sound:Enable Robe Armor Sound=1

 

to enable morale break icon:

TobExTweak.ini

 UI:Morale Break Icon=1

 

v10 includes many small fixes for Improved GUI when i discovered playing BG1 part of BGT

 

https://ufile.io/is9mvb7v