Jump to content


Photo

Issue with BG1 mage sprites - Robes not showing - WIP solution


  • Please log in to reply
5 replies to this topic

#1 Andrea C.

Andrea C.
  • Modder
  • 458 posts

Posted 26 April 2021 - 04:53 AM

Restored BG1 mage sprites suffer from an engine limitation whereby they never show any armor levels other than unarmored (i.e. equipping any robe won't change their appearance.)

 

In order to circumvent the issue it is necessary to change all robes' appearance from 2W / 3W / 4W to 5A / 6A / 7A, then alter the relevant animation BAMs accordingly. This is the solution I used on the Enhanced Editions and it worked like a charm.

 

This is the code I'm using to change robes' appearance:

 

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


I also have all BG1 mage sprites from Infinity Animations renamed to comply.

 

However, applying the code above and dumping the renamed BAMs into the override folder won't do. I reckon I need further code to tell the engine to use the renamed BAMs somehow?

 

Any help would be appreciated.



#2 Andrea C.

Andrea C.
  • Modder
  • 458 posts

Posted 01 May 2021 - 06:19 AM

Tried once again and it just makes the game crash. EDIT: it was crashing for an unrelated reason. The mod simply does nothing.

 

I'm attaching the mod in case anybody wants to take a look at it.

 

Attached File  setup-mageanimfix.zip   16.55MB   118 downloads


Edited by Andrea C., 01 May 2021 - 06:32 AM.


#3 The Imp

The Imp

    Not good, see EVIL is better. You'll LIVE.

  • Member
  • 5150 posts

Posted 01 May 2021 - 11:55 PM

Could you tell me why ? -the backup folder is in:

BACKUP ~weidu_external/backup/maf~

And not in:

BACKUP ~MageAnimFix/backup~

As in, you need to make this a little more clean for #¤%//cheese sake.

 

And to respond to the armor thing in the game, the games avatars respond to the same race_class_armortier system as the animations do. The 1PP has a solution for SOME of this in respect to the characters class in all the items, where the armors set the character in the class flag in respect to what the armor is.

 

As originally: the mage character with a full plate only has some color changes to it's avatar without any other changes, which looks really bad.

Rogues have their own...

The priest(cleric/druid) have their own armor tiers, as you have seen... for each armor tier. Excluding the robes. Which look exactly like the platemail in mages, "some color changes".

And the fighters have their own for armors, again excluding the robes.

 

I would imagine that the best solution would be to make the armors/robe tier dictate the exact outlook that the character would be wearing... but it needs more tiers not class based ones. So the tiers would be; none, Monk, leather, studded leather/hide mail, ring mail, scale mail, half plate, plate, robe 1, robe 2 and robe 3. And we need a way to identify which item is which. In mod added items too. The Item Revision has done some of this, but I bet it's not perfect.


Yep, Jarno Mikkola. my Mega Mod FAQ. Use of the BWS, and how to use it(scroll down that post a bit). 
OK, desert dweller, welcome to the sanity, you are free to search for the limit, it's out there, we drew it in the sand. Ouh, actually it was still snow then.. but anyways.


#4 Andrea C.

Andrea C.
  • Modder
  • 458 posts

Posted 02 May 2021 - 01:15 AM

Could you tell me why ?


Two reasons:

 

  • Immutability (which, among other things, requires that the backup folder be outside the main mod folder.)
  • "MageAnimFix" is a quick and dirty proof-of-concept, not a mod meant for distribution. Even discounting immutability, it could stand to be sloppy so long as it does what it is meant to (which it presently doesn't, and that's unrelated to its backup folder's location.)

 

 

And to respond to the armor thing in the game, the games avatars respond to the same race_class_armortier system as the animations do. The 1PP has a solution for SOME of this in respect to the characters class in all the items, where the armors set the character in the class flag in respect to what the armor is.


I am well aware.

 

The reason why BG1 mage sprites don't display robe armor levels is due to the engine containing a piece of code that says, "If the animation type of the item is W, and you are not a mage animation, then use armor level 1.  If the animation type is not W, and you are a mage animation then use armor level 1." (this is what causes the behavior you describe.) Problem is, the way the engine identifies mage animations is based on the animation slot's number. If the second digit in the slot is not "2", then the animation is not treated as a mage animation. (This is from former Beamdog's programmer Scott Brooks.)

 

Since the restored BG1 mage sprites from Infinity Animations are not occupying a slot whose second digit is "2", they don't display their robe armor levels.

 

The solution I employed for the Enhanced Editions captures mod content just fine, so long as the BG1 sprites are restored after said content. Since the classic engine is supposed to treat animations in the same way with regards to the behavior illustrated above, I'm trying to understand why employing the same solution doesn't work.



#5 The Imp

The Imp

    Not good, see EVIL is better. You'll LIVE.

  • Member
  • 5150 posts

Posted 02 May 2021 - 02:12 AM

Two reasons: Immutability (which, among other things, requires that the backup folder be outside the main mod folder.)
Nope. You could just delete the listed backup folder from the archive after you have installed the mod into the game, if you do. That's how you get immutable mod from an installed game folders files. Which is an approach you probably should never follow, as copying the files into the games folder would serve you better before each install, but who cares, you are already down a deep hole at this time and place.
it could stand to be sloppy so long as it does what it is meant to (which it presently doesn't, and that's unrelated to its backup folder's location.)
If every one would have believe this, either no mod would have been released ever, or it would have been a circus. Aka, if you think of making a mod, you are better at making use of proper structures intended for mod use rather than a mock ups, that you need to later recode.

Hmm, did you actually notice what you did wrong ? You are not loading the animation files at all, so you can't then be saving them as the new assorted files ... with edits to the file names. You are just sorting portion of the file name, while ignoring that you need to tie in a file at all into the mix.
Aka, you need:
COPY_EXISTING ~*.bam$~ ~override~
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 
Or something such.

Yep, Jarno Mikkola. my Mega Mod FAQ. Use of the BWS, and how to use it(scroll down that post a bit). 
OK, desert dweller, welcome to the sanity, you are free to search for the limit, it's out there, we drew it in the sand. Ouh, actually it was still snow then.. but anyways.


#6 Andrea C.

Andrea C.
  • Modder
  • 458 posts

Posted 02 May 2021 - 02:30 AM

Hmm, did you actually notice what you did wrong ? You are not loading the animation files at all, so you can't then be saving them as the new assorted files

 

 

What did you think the bottom part of the code is for?

 

It drops all the renamed animation files into the override folder.

 

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
      
  PRINT ~Copying...~
  COPY ~MageAnimFix/FixedAnim~ ~override~