[Bugfix] Game crashes when equipping off-hand weapons
AndreaColombo
Member Posts: 5,530
CURRENT BEHAVIOR:
When BG1 character animations are equipped with off-hand weapons, the game crashes due to the following issues:
1. The main creature animations for attacking with two weapons do not exist (A[789]) nor do the main weapon animations (A[789]) or the offhand weapon animations (OA[789]). The most dire issue. Furthermore, you can't simply steal the weapon animations from the 0x5/6### series [i.e. WQL prefix] because you will have to restructure the BAMs to fit the 0x64## framework, namely by either forcing users to use Sprite Mirror, or picking out the Extended [E suffix] series of animations from those BAMs.
2. There is no code to handle equipping a weapon in the offhand. It gets loaded into the main weapon animation vid cells instead. This could theoretically be remedied by putting in some extra code, but to warrant this at all, you would have to remedy #1.
3. The way that the offhand weapon animations are named means that with the current weapon prefixes for the Extended series of animations, the BAM names end up being 9 characters long. Not so bad if you rename all the weapon prefixes for the entire 0x64## series
DESIRED BEHAVIOR:
BG1 character animations can be equipped with off-hand weapons without the game crashing (i.e. fix items #2 and #3 on the list) so that modders can do the missing animation work (i.e. item #1).
Alternatively, you could fix item #1 as well and provide us with dual-wielding capable BG1 character animations
When BG1 character animations are equipped with off-hand weapons, the game crashes due to the following issues:
1. The main creature animations for attacking with two weapons do not exist (A[789]) nor do the main weapon animations (A[789]) or the offhand weapon animations (OA[789]). The most dire issue. Furthermore, you can't simply steal the weapon animations from the 0x5/6### series [i.e. WQL prefix] because you will have to restructure the BAMs to fit the 0x64## framework, namely by either forcing users to use Sprite Mirror, or picking out the Extended [E suffix] series of animations from those BAMs.
2. There is no code to handle equipping a weapon in the offhand. It gets loaded into the main weapon animation vid cells instead. This could theoretically be remedied by putting in some extra code, but to warrant this at all, you would have to remedy #1.
3. The way that the offhand weapon animations are named means that with the current weapon prefixes for the Extended series of animations, the BAM names end up being 9 characters long. Not so bad if you rename all the weapon prefixes for the entire 0x64## series
DESIRED BEHAVIOR:
BG1 character animations can be equipped with off-hand weapons without the game crashing (i.e. fix items #2 and #3 on the list) so that modders can do the missing animation work (i.e. item #1).
Alternatively, you could fix item #1 as well and provide us with dual-wielding capable BG1 character animations
Post edited by Balquo on
15
Comments
Mods used: I played BG-Tutu (which ports BG1 into the BG2 engine), with Degreen-Filter, G3-Fixpack, G3-Tweakpack, SCS I+II, various NPC mods and additional PC-AI schripts. Aside from not being able to use Open GL high res, this setup works fine and stable.
Tutu already does many things that you devs are planning for EE, so I hope very much you can get in touch with the Tutu creators (the same goes for Trilogy).
A very quick way to reproduce the problem in vanilla BG2ToB:
1. Make a copy of SKELET01.CRE
2. Add a SW1H01 to SLOT_SHIELD
3. CLUAConsole:CreateCreature("SKELET01")
The vanilla assertion error that results is The TobEx-modified assertion is:
The resolution and dual-wielding cannot be totally unrlated, since the crash specifically occured when I equipped an off-hand weapon.
It basically comes down(in my test case): it tries to put the string WPMSSOA1E (9 chars) into the 8 char RESREF. I'm thinking of adding a ANIMOVER.2DA that looks something like. I've got the defaults for a female human cleric animid in there. Along with a "fixed" skeleton The game would use this 2DA to override the existing settings. I'll probably have to add more columns based on what all gets set when going through the anim creation code. This way the offhand skeleton would use WMSSOA1E which is the proper 8 chars.
Thoughts?
I agree 9 character BAMs are an issue. I did try to fix this by making the files 8 chars (shorting the prefix as you have done) but was unable to find suitable BAMs to correctly show the weapon equipped as offhand. If I took some BAMs from the 0x5/6### series [i.e. WQL prefix] of animations, some orientations would look OK, but others were mismatched.
If @ScottBrooks could take care of the struct for the animations and the missing code, and BG1 character animations were added to the BG:EE game resources (albeit unused), then it could eventually be possible to do the missing animation work to make them dual-wield (which is what spurred my request in the first place).
BG1 animations are a lot better for quite a few people, so being able to use them so we can enjoy the game better would always be a plus.
Since we can't have new stuff in graphics then at least we could have an option to use the BG1 anims instead :]
Some stuff will never have BG1 animations (no Monks in BG1 for example), but at the moment I don't remember any ability that requires a special character animation. What are you thinking of?
Oh, that's what you meant. I didn't consider it because AndreaColombo had already mentioned that if this problem were fixed that he'd work on animating dual-wield.
In the direction of being able to use BG1 animations and all, for those who prefer them.
Also, do you think you could add BG1 character animations to the BG:EE game resources even if you're not using them by default? It would make it possible to use them for those who'd rather give up on dual-wielding than on those animations.
Having the BG1 animations for everything, then if you equip an offhand weapon, the model switches back to the BG2 standard. The same if you select the monk class.