GwendolyneFreddy / Infinity-Animations

This mod patches Baldur's Gate II: Throne of Bhaal to support additional creature and character animations (referred to as 'animation slots'). It also offers a dynamic automated process for claiming new animation slots. Thus, it acts as a central hub, usable by anyone who would like to add animation entries to the game without being bogged down by issues of mod conflicts and incompatibilities.
11 stars 3 forks source link

Feature request – More weapon animations for humanoids #2

Closed 4Luke4 closed 3 years ago

4Luke4 commented 5 years ago

As you probably know, certain (giant)humanoid creatures (Hobgoblins, Goblins, Ogres, Orcs, Orogs, Kobolds, Gnolls/Flinds, Lizard Men and so forth) support only a fairly restricted amount of weapon animations => e.g., vanilla Ogre Berserkers are equipped with Two-Handed Swords but the in–game sprite wields an invisible weapon because that weapon animation is not supported. Another one: some cleric Hobgoblins are equipped with Maces but the in–game sprite wields an invisible weapon because that weapon animation is not supported.

I was wondering if it is possible to do something in this regard (at least on EE games)

GwendolyneFreddy commented 5 years ago

I know it might be a bit confusing but vanilla animations files are very limited in terms of weapons. For example, Hobgoblins can only display equipped swords and bows on screen. As 3D sources are not available, it is quite impossible to create new weapons animations. Moreover they belong to a special animation type, which is called BG1 MONSTER in IA and classic games (mostly because this type of animations were used in BG1 and has been later abandoned to the more efficient BG2 type). What might be done would be to patch each creature's equipment to provide them with accurate weapons (or brand new hand melee weapons), so that they stop mimicking fighting with invisible weapons. ;)

4Luke4 commented 5 years ago

@GwendolyneFreddy

I see.

So you're basically suggesting to edit the CRE files so that they have a weapon with the appropriate appearance – e.g., make all Ogre Berserkers wield a weapon whose appearance (located at offset 0x22) is MS and so forth.....

Yeah, that can be done, even though it may be weird in some cases (e.g., Hobgoblin Priests wielding swords......). I'm not sure what you mean by "brand new hand melee weapons"......

GwendolyneFreddy commented 5 years ago

That's the idea. ;)

If you provided me with a list of cre files involved, I could add a WeidU sub-routine to the main component that would patch them accordingly.

"brand new hand melee weapons" would be melee attack weapons such as BM-nnn.itm and so on used by the game to mimic attacks. For example, I could add a hobmace.itm that would act as a mace but would use the sword animation, then add (or no) a mace in the cre inventory.

4Luke4 commented 5 years ago

That's the idea. ;)

If you provided me with a list of CRE files involved, I could add a WeiDU sub-routine to the main component that would patch them accordingly.

Will do as soon as possible.......

"brand new hand melee weapons" would be melee attack weapons such as BM-nnn.itm and so on used by the game to mimic attacks. For example, I could add a hobmace.itm that would act as a mace but would use the sword animation, then add (or no) a mace in the cre inventory.

Oh, I see now. Yes, it can be done (Flinds are already coded that way – they're equipped with a sword that acts as a "flindbar"). Again, it may be a little bit weird (a sword that deals crushing damage!?), but it's probably better than swinging an invisible weapon......

GwendolyneFreddy commented 5 years ago

I know it is far from being a perfect solution, but according to the available raw source files, I am afraid we can ever find a better one.

I will wait for your list, then send you a fix to be tested before including it to the main component.

4Luke4 commented 5 years ago

I will wait for your list, then send you a fix to be tested before including it to the main component.

OK, here's the list of CRE files (please note that I don't own the original games, so I cannot check them...).

BG:EE/SoD

BDWAVE16 // Current weapon appearance: "S3"
BPOGMA01 // Current weapon appearance: None
OGREMA03 // Current weapon appearance: "S3"
OGREMA_D // Current weapon appearance: "S3"
KAHRK // Current weapon appearance: "S3"
DROTH // Current weapon appearance: "S3"
NEOGRE // Current weapon appearance: "S2"
OGREBERZ // Current weapon appearance: "S2"
BDHOBG04 // Current weapon appearance: "MC"

BG2:EE

HOBSHA01 // Current weapon appearance: "MC"
HOBWIZ01 // Current weapon appearance: "MC"
PLSHHG02 // Current weapon appearance: "MC"
PALKNI01 // Current weapon appearance: "S2"
PALKNI02 // Current weapon appearance: "S2"
PALKNI04 // Current weapon appearance: "SP"
OHBLIZ02 // Current weapon appearance: "SP"

IWD:EE

SS1gob1 // Current weapon appearance: None
SS1gob2 // Current weapon appearance: None
SS1gob3 // Current weapon appearance: None
SS1liz3 // Current weapon appearance: None
SS1liz4 // Current weapon appearance: None
SS2gob1 // Current weapon appearance: None
SS2gob2 // Current weapon appearance: None
SS2gob3 // Current weapon appearance: None
SS2liz5 // Current weapon appearance: None
SS2liz6 // Current weapon appearance: None
SS2liz7 // Current weapon appearance: None

More to come...?

4Luke4 commented 4 years ago

@GwendolyneFreddy

Do you need anything else from me?

GwendolyneFreddy commented 3 years ago

I solved the issue with most creatures, except PALKNI02 and PALKNI04. Both are OGRE animation that is hard coded and can only display a MS.

As for Goblin animations in IWD:EE, it is the same : the animation displays.

So OGRE and GOBLIN_WITH_AXE animations will always display respectively a MS or an AXE whatever the weapon the cre are equipped with. So what is the issue ?

4Luke4 commented 3 years ago

So OGRE and GOBLIN_WITH_AXE animations will always display respectively a MS or an AX whatever the weapon the cre are equipped with. So what is the issue ?

That's why you might want to replace their weapons with other weapons whose animations are MS and AX respectively.

So for instance, both PALKNI02 and PALKNI04 should be equipped with BLUN06 (ordinary Morning Star) instead of SW2H01 (ordinary Two-Handed Sword)...

IWD:EE goblins should be equipped with a weapon whose animation is AX . You could clone their current weapon and edit just the animation field at 0x22 (they're currently equipped with generic unnamed weapons such as P1-6, whose animation is none...)

IWD:EE lizard men should be equipped with a weapon whose animation is either AX, QS, HB, or MS, at your choice I guess. You could clone their current weapon and edit just the animation field at 0x22 (they're currently equipped with generic unnamed weapons such as B1-12, whose animation is none...)

GwendolyneFreddy commented 3 years ago

Here is the code I used for BG2:EE creatures

ACTION_DEFINE_ASSOCIATIVE_ARRAY GW_fix_weapon_anim BEGIN // Creature Animation weapon app => new weapon // ---- 0 ---------- 1 ------- 2 -- 3 -------------- HOBSHA01, HOBGOBLIN, blun04, S1 => t-hobb04 HOBWIZ01, HOBGOBLIN, blun04, S1 => t-hobb04 PLSHHG02, HOBGOBLIN, blun04, S1 => t-hobb04 PALKNI01, OGRE_MAGE, sw2h01, S1 => t-ogrths UHOGRE01, OGRE_MAGE, blun06, S1 => t-ogrb06 / PALKNI02, OGRE, sw2h01, S1 => t-ogrths PALKNI04, OGRE, sper01, S1 => t-ogrspr MUGGER4, OGRE, blun06, S1 => t-ogrb06/ END

ACTION_PHP_EACH GW_fix_weapon_anim AS donnees => newweapon BEGIN ACTION_IF FILE_EXISTS_IN_GAME "%donnees_0%.cre" BEGIN ACTION_IF NOT FILE_EXISTS_IN_GAME "%newweapon%.itm" BEGIN COPY_EXISTING "%donnees_2%.itm" "%newweapon%.itm" WRITE_ASCIIE 0x22 "%donnees_3%" BUT_ONLY END COPY_EXISTING "%donnees_0%.cre" "%donnees_0%.cre" ADD_CRE_ITEM "%newweapon%" #0 #0 #0 "identified&unstealable&undroppable" "WEAPON1" EQUIP BUT_ONLY END END

The problem with PALKNI02 and PALKNI04 is that they are genuine paladins polymorphed into ogres by Firkraag. And they regain their original appearance when you kill them, hence your problem with the Radiant Heart if you are a paladin... So, there is no point in making them use a custom weapon as they attack you with their 2hd sword and spear, regardless the fact that you see them as ogres...

GwendolyneFreddy commented 3 years ago

I run a WeiDU code to check games and here is the list of cre with potential issues.

Classic ToB GORSTA06 (HOBGOBLIN) - wyvern1 ( ) does not match S1 BW GORSTA06 (HOBGOBLIN) - wyvern2 ( ) does not match S1 BW HOBSHA01 (HOBGOBLIN) - BLUN04 (MC) does not match S1 BW HOBWIZ01 (HOBGOBLIN) - BLUN04 (MC) does not match S1 BW KALAH (OGRE_MAGE) - SLNG01 (SL) does not match S1 PALKNI01 (OGRE_MAGE) - SW2H01 (S2) does not match S1 PLSHHG02 (HOBGOBLIN) - BLUN04 (MC) does not match S1 BW UHOGRE01 (OGRE_MAGE) - BLUN06 (MS) does not match S1

BGT GORSTA06 (HOBGOBLIN) - wyvern1 ( ) does not match S1 BW GORSTA06 (HOBGOBLIN) - wyvern2 ( ) does not match S1 BW HOBSHA01 (HOBGOBLIN) - BLUN04 (MC) does not match S1 BW HOBWIZ01 (HOBGOBLIN) - BLUN04 (MC) does not match S1 BW IHOBGOB (HOBGOBLIN) - XVARTIL (SS) does not match S1 BW KALAH (OGRE_MAGE) - SLNG01 (SL) does not match S1 PALKNI01 (OGRE_MAGE) - SW2H01 (S2) does not match S1 PLSHHG02 (HOBGOBLIN) - BLUN04 (MC) does not match S1 BW UHOGRE01 (OGRE_MAGE) - BLUN06 (MS) does not match S1

Tutu GORSTA06 (HOBGOBLIN) - wyvern1 ( ) does not match S1 BW GORSTA06 (HOBGOBLIN) - wyvern2 ( ) does not match S1 BW HOBSHA01 (HOBGOBLIN) - BLUN04 (MC) does not match S1 BW HOBWIZ01 (HOBGOBLIN) - BLUN04 (MC) does not match S1 BW KALAH (OGRE_MAGE) - SLNG01 (SL) does not match S1 PALKNI01 (OGRE_MAGE) - SW2H01 (S2) does not match S1 PLSHHG02 (HOBGOBLIN) - BLUN04 (MC) does not match S1 BW UHOGRE01 (OGRE_MAGE) - BLUN06 (MS) does not match S1 _IHOBGOB (HOBGOBLIN) - _XVARTIL (SS) does not match S1 BW

BGEE DROTH (OGRE_MAGE) - SW1H43 (S3) does not match S1 IHOBGOB (HOBGOBLIN) - XVARTIL (SS) does not match S1 BW KAHRK (OGRE_MAGE) - SW1H43 (S3) does not match S1 OGREMA03 (OGRE_MAGE) - SW1H44 (S3) does not match S1 OGREMA_D (OGRE_MAGE) - SW1H43 (S3) does not match S1

SOD BDBATTUK (HOBGOBLIN) - SW1H01 (S0) does not match S1 BW BDCCHOB1 (HOBGOBLIN) - SW1H01 (S0) does not match S1 BW BDCCHOB2 (HOBGOBLIN) - AX1H01 (AX) does not match S1 BW BDCRU02D (HOBGOBLIN) - HALB01 (HB) does not match S1 BW BDCRU102 (HOBGOBLIN) - SW1H01 (S0) does not match S1 BW BDCRU117 (HOBGOBLIN) - DAGG01 (DD) does not match S1 BW BDCRU46 (HOBGOBLIN) - SW1H07 (SS) does not match S1 BW BDCRUM44 (HOBGOBLIN) - SW1H07 (SS) does not match S1 BW BDCRUM48 (HOBGOBLIN) - SW1H01 (S0) does not match S1 BW BDCRUML7 (HOBGOBLIN) - SW1H01 (S0) does not match S1 BW BDCRUR26 (HOBGOBLIN) - SW1H01 (S0) does not match S1 BW BDCRUS14 (HOBGOBLIN) - DAGG01 (DD) does not match S1 BW BDCRUSM5 (HOBGOBLIN) - SW1H01 (S0) does not match S1 BW BDDSARC4 (HOBGOBLIN) - SW1H07 (SS) does not match S1 BW BDHOBG03 (HOBGOBLIN) - SW1H07 (SS) does not match S1 BW BDHOBG04 (HOBGOBLIN) - BLUN04 (MC) does not match S1 BW BDMURS (OGRE_MAGE) - BLUN15 (MS) does not match S1 BDMURS2 (OGRE_MAGE) - BLUN15 (MS) does not match S1 BDOGRE05 (OGRE_MAGE) - BLUN01 (CL) does not match S1 BDWAVE16 (OGRE_MAGE) - SW1H43 (S3) does not match S1 BDWAVE42 (HOBGOBLIN) - SW1H07 (SS) does not match S1 BW BDWAVE53 (HOBGOBLIN) - SW1H07 (SS) does not match S1 BW DROTH (OGRE_MAGE) - SW1H43 (S3) does not match S1 IHOBGOB (HOBGOBLIN) - XVARTIL (SS) does not match S1 BW KAHRK (OGRE_MAGE) - SW1H43 (S3) does not match S1 OGREMA03 (OGRE_MAGE) - SW1H44 (S3) does not match S1 OGREMA_D (OGRE_MAGE) - SW1H43 (S3) does not match S1

BG2EE GORSTA06 (HOBGOBLIN) - wyvern1 ( ) does not match S1 BW GORSTA06 (HOBGOBLIN) - wyvern2 ( ) does not match S1 BW HOBSHA01 (HOBGOBLIN) - BLUN04 (MC) does not match S1 BW HOBWIZ01 (HOBGOBLIN) - BLUN04 (MC) does not match S1 BW KALAH (OGRE_MAGE) - SLNG01 (SL) does not match S1 OHBLIZ02 (LIZARD_MAN_ELITE) - SPER02 (SP) does not match CL HB QS PALKNI01 (OGRE_MAGE) - SW2H01 (S2) does not match S1 PLSHHG02 (HOBGOBLIN) - BLUN04 (MC) does not match S1 BW UHOGRE01 (OGRE_MAGE) - BLUN06 (MS) does not match S1

I will check all of them because there are many potential false positives.

I delay IWD:EE for the very end because I am not used with this game I don't like very much... :wink:

4Luke4 commented 3 years ago

The problem with PALKNI02 and PALKNI04 is that they are genuine paladins polymorphed into ogres by Firkraag. And they regain their original appearance when you kill them, hence your problem with the Radiant Heart if you are a paladin... So, there is no point in making them use a custom weapon as they attack you with their 2hd sword and spear, regardless the fact that you see them as ogres...

Ah, yes, you're right (in fact, their CLASS at 0x273 is set to PALADIN...).

I will check all of them because there are many potential false positives.

I guess/seem to recall that Hobgoblins equipped with maces are coded as CLERIC (that's why the mace instead of a sword...) The same may hold for other CRE files, so yes, they should be checked one at a time...

However, as you have already said, you could add a "hobmace.itm" that would act as a mace but would use the sword animation, then add (or no) a mace in the CRE inventory... It will sound a bit odd, but at least they won't swing "invisible" weapons...

I delay IWD:EE for the very end because I am not used with this game I don't like very much... 😉

That's unfortunate... IMHO, the only problem with this game is its terrible AI, but this another topic... 😉

GwendolyneFreddy commented 3 years ago

The patch is done for BG2, ToB, Tutu, BGT, BG:EE w/o SoD and BG2:EE. All worked fine till I installed 1pp on classic games. As it introduces new weapon appearances (S0 for bastard swords and BS for Short bows), I need to modify the code to be sure it will be effective regardless 1pp is installed or not. Fortunately, it will be easy to write. :wink:

GwendolyneFreddy commented 3 years ago

Issue solved: this WeiDU routine reads this array to create cloned weapons.

You will find here all animations causing issues. I only fixed weapons causing animation issues. For those that are not RP, I think the fix would be more accurate in a Fixpack or Tweaks mod. Once IA will be released, I will write a routine to be included into BG2 Fixpack or Anthology to solve weapons slot inconsistency.

Sampsca commented 3 years ago

So the fixes will be included in IA, but later you will also offer them to a fixpack?

GwendolyneFreddy commented 3 years ago

Sorry, it seems I have not been clear enough. There are to types of glitches: