Skip to content

[Bugfix] Game crashes when equipping off-hand weapons

AndreaColomboAndreaColombo Member Posts: 5,530
edited November 2012 in Original BG1 Bugs
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 ;)
Post edited by Balquo on
«13

Comments

  • AndreaColomboAndreaColombo Member Posts: 5,530
    Original post edited to comply with @CameronTofer 's bug reporting guidelines.
  • WardWard Member Posts: 1,305
    I shall now have to bump you sir.
  • LuneverLunever Member Posts: 307
    Interestingly, in Tutu the game only crashed on equipping off-hand weapons when I ran the game at higher resolutions than 1024 x 768 .
  • AndreaColomboAndreaColombo Member Posts: 5,530
    @Lunever - what happened when you did so at lower resolutions?
  • LuneverLunever Member Posts: 307
    @AndreaColombo When I switched to 1024 x 768 I didn't hava any such problem at all.
  • AndreaColomboAndreaColombo Member Posts: 5,530
    @Lunever - It's impossible to make BG1 animations dual-wield because the animation work is completely missing, as well as the lines of code required for the off-hand weapon to appear in the off-hand. This should not depend on resolution. Are you 100% sure your game didn't crash under these circumstances? Which mods were you playing with?
  • LuneverLunever Member Posts: 307
    I am absolutely sure. At first I also didn't get the idea, that resolution could be the cause. I deinstalled and reinstalled, with and without mods for several hours, and finally I found some old thread in some old support forum that said, that this crash occurs only on high resolutions (though it didn't offer a technical explanation why). I switched to 1024 x 768 and eveything was fine.

    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).
  • AndreaColomboAndreaColombo Member Posts: 5,530
    @Lunever - I can't seem to find that thread, do you happen to have a link handy? It could prove useful to the devs looking into this issue. Maybe @Ascension64 could also chime in, since it's him who tested the crash in the first place.
  • WispWisp Member Posts: 1,102
    edited July 2012
    Resolutions higher than 1024x768 (the Bioware ones; not the Widescreen-mod ones) are well known to make the original game crash-happy. It is an issue unrelated to dual-wielding BG1 animations making the game crash.
  • WispWisp Member Posts: 1,102
    edited July 2012
    snafu

  • Ascension64Ascension64 Member Posts: 560
    edited July 2012
    Tutu doesn't use BG1 animations in the standard format. It simply copies over a bunch of animation BAMs so that BG1 animations appear to be used.
    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
    ASSERTION FAILED!
    File: ChVidImage3d.cpp
    Line: 899

    Exp: FALSE

    Msg: no msg.
    Run Debugger?
    The TobEx-modified assertion is:
    [Sun 08 Jul 2012 10:17:55] ASSERTION FAILED! Return Address: 0x9FFB75 File: ChVidImage3d.cpp Line: 899 Expression: FALSE Message: CVidCell::FXRender3dSetPalette: LoadFrame() failed
  • LuneverLunever Member Posts: 307
    I don't have the link at hand and right now I'm coming home pretty pissed from a cool birthday party of a friend, but tomorrow I gonna try to retrieve it.

    The resolution and dual-wielding cannot be totally unrlated, since the crash specifically occured when I equipped an off-hand weapon.
  • Ascension64Ascension64 Member Posts: 560
    I don't dispute there may be an issue with resolution and dual-wielding that is not related to the problem described in the initial post. The specific problem described here is with the 0x64## series of animations only.
  • AndreaColomboAndreaColombo Member Posts: 5,530
    Thank you very much for clarifying, @Ascension64!
  • ScottBrooksScottBrooks Member Posts: 687
    edited July 2012
    @Ascension64 thanks for the quick repro case.

    It basically comes down(in my test case): it tries to put the string WPMSSOA1E (9 chars) into the 8 char RESREF.

    m_heightCode+resref+"A1E" // m_heightCode = "WPM", resref = "SSO"
    WPM = Weapon Medium
    SSO = Short Sword Offhand
    A1E = vidcell A1, Extended
    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

    2DA V1.0
    NO_AREA
    ANIMID RESREF HEIGHTCODE HEIGHTCODEHELMET SHADOW MOVESCALE
    24592 CHFC WPM WPM CSHD 9
    25603 MSKL WM WM CSHD 9
    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?
  • Ascension64Ascension64 Member Posts: 560
    Thanks for looking into this, @ScottBrooks.
    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.
  • AndreaColomboAndreaColombo Member Posts: 5,530
    edited July 2012
    @Ascension64 - I apologize in advance if this sounds like a stupid question, but I'm a noob at these things. Could the mismatch be fixed by repositioning the weapon animation via DLTCEP or other tool? Or, even better, by repositioning the existing BG1 weapon animations so that they show up in the off-hand?
  • Ascension64Ascension64 Member Posts: 560
    Have a re-read of the issues in the first post. In short, you can restructure the BAMs so they look OK offhand. Then, you are stuck with the old code not recognising that this series of animations only process one weapon animation at a time, so equipping an offhand weapon will only show the offhand weapon and not the main weapon. The struct for the animation needs changing and further code would be required to display weapons in both hands.
  • AndreaColomboAndreaColombo Member Posts: 5,530
    @Ascension64 - thanks for clarifying.

    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).
  • taletotelltaletotell Member Posts: 74
    I can't see this being a problem with the enhanced edition. I assume both games will run on the same engine with the same animations.
  • AndreaColomboAndreaColombo Member Posts: 5,530
    @taletotell - Yes, BG:EE will use BG2 animations by default. However, if this issue is solved, I'll be able to add the missing animation work required to make BG1 animations dual-wield, which will make them a viable alternative to BG2 animations.
  • MornmagorMornmagor Member Posts: 1,160
    If we can make this work it would be awesome seriously.

    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 :]
  • bigdogchrisbigdogchris Member Posts: 1,336
    edited July 2012
    If we can make this work it would be awesome seriously.

    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 :]
    Because of the requirements to have BG2 skills available, since the engine is BG2:Throne, I don't know if it would be possible to mix and match in BG1 animations.

  • TanthalasTanthalas Member Posts: 6,738
    @bigdogchris

    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?
  • bigdogchrisbigdogchris Member Posts: 1,336
    edited July 2012
    I'm specifically thinking about Dual Wield. I know Drizzt dual wields in BG1, but is there an actual animation for his offhand? I can't remember. I've seen some mods restore BG1 animations though, so maybe it is possible.
  • TanthalasTanthalas Member Posts: 6,738
    @bigdogchris

    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.
  • WispWisp Member Posts: 1,102
    edited July 2012
    Drizzt appears to be dual-wielding in BG1 because he uses a unique sprite with the artistic equivalent of hardcoding. He is not actually dual-wielding, though.
  • MornmagorMornmagor Member Posts: 1,160
    Yeah, Drizzt is a different issue, if we can make the game not crash on dual wielding, then new possibilities open, but at least making a dual wield character with BG1 sprites would be possible,even if his off hand does not have an animation.

    In the direction of being able to use BG1 animations and all, for those who prefer them.
  • AndreaColomboAndreaColombo Member Posts: 5,530
    Any news on this fix, @ScottBrooks? (if it's NDA-ish information, you can fire me a PM; I just need to quench my curiosity ;-)).

    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.
  • KenKen Member Posts: 226
    The quickest fix would be:
    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.
Sign In or Register to comment.