Jump to content

Shapeshifting inconsistencies


jmerry

Recommended Posts

In one of the early threads, CamDawg said this: "One thing we can put on the podium alongside death and taxes, though: bugs in Jaheira's romance." I'll add shapeshifting bugs to that. 2.6 fixed many things, particularly crash bugs. It also left many other problems alone and even added new ones.

I put a component for this in my tweak mod, so I'll post what I found here. Voluntary shapeshifting only, at least in this post. Also, I only have BGEE and BG2EE; I can't speak to other games.

- (Not a bug, just annoying) BGEE and BG2EE use different architecture; BGEE attaches the polymorph effect to the transformation spell/ability, while BG2EE attaches it to the creature weapon. As such, any fixes will need different code for each game. The BGEE versions are technically temporary at 500 days, probably because a true permanent duration wouldn't revert after death and resurrection.

- In BG2EE, the creature weapons have the "Forbid off-hand" flag set. In BGEE, they don't. They really should have it in all games; without, you can dual-wield with a manufactured weapon without penalty.

- (BGEE and BG2EE) Druid wolf shapeshift doesn't match description. Description says 15 strength/18 dexterity (PLYWOLF.CRE), actual effect is 18 strength/17 dexterity (WOLFCHAR). The mage wolf polymorph is  PLYWOLF with a +1 damage bonus, so that's what I went with in my version.

- (BGEE and BG2EE) Many shapeshifts get +N damage bonuses, which aren't reflected in the spell/ability descriptions. Mage wolf forms (+1), mage and druid bear forms (+1), avenger wyvern form (+2), avenger fire salamander form (+3), shapeshifter werewolf form (+2), mage ogre form (+1), mage spider form (+1)

- (BGEE) Shapeshifter greater werewolf form lacks the regeneration effect added in BG2EE 2.6. Not relevant in the standard rules, but the item and ability support is there.

- (BG2EE) Druid "Shapeshift: Black Bear" turns you into a brown bear. "Shapeshift: Brown Bear" turns you into a black bear. This one's new in 2.6.

- (BG2EE) Mage "Shapeshift: Black Bear" and Shapeshift: Brown Bear" both turn you into a black bear.

- (BG2EE) Mage ogre form's weapon isn't flagged as magical (as it is in BGEE).

- (BG2EE) "Shapeshift: Greater Werewolf" now grants regeneration as of 2.6 (1 per 2 seconds or 3 per round), but the description doesn't mention it.

- (BG2EE) Druid high-level shapeshifts list their duration as "1 hour". They're actually permanent until dismissed, like the other druid shapeshifts.

- (BG2EE) Shapechange forms that grant higher levels of weapon immunity don't include the lower immunity levels and scripting states standard on weapon immunity effects. For example, the elemental forms have weapon immunity with maximum level 2. IMMUNE3 also has weapon immunity with maximum level 1, weapon immunity to non-magical,  scripting state 25, and one star in proficiency 128. Anything that keys off those effects (such as, for example, the SCS Insect Plague tweak looking for normal weapon immunity) won't react to these forms properly.

- (BG2EE) Iron Golem form lacks most of the immunities its description says it has. The description says "backstab, weapons of +2 immunity or less, sleep, fear, hold, charm, paralysis, poison". Of that list, you only get backstab immunity.

Some shapeshift abilities mention what their weapon hits as, some doesn't. In the component I wrote, I edited the descriptions so that all of them did.

 

For the sheer WTF factor, it's hard to top the bear swap. Just ... how did that sneak in?

Edited by jmerry
Link to comment

Another thing to add, and a slightly gnarlier problem. Adalon's "look like drow" illusion essentially neuters shapeshifting abilities. Her cosmetic transformation, attached directly to the spell effect, takes priority over all of the "when equipped" polymorph effects attached to weapons. This nullifies all of the stat changes that come from that polymorph.

I see two possible approaches here, both of which would require sweeping changes.

- Switch over to the BGEE model, attaching the polymorph effects to the transformation spell/ability instead of the weapon. Then the most recent effect wins, and you can shapeshift properly while illusioned. I think, anyway - testing required.

- Change the polymorph effects on the shapeshift weapons to cosmetic versions, and put all of the stat changes on the weapon as "when equipped" effects. You'll look wrong, but your combat stats will be right.

Edited by jmerry
Link to comment

I'd like to add the following issue affecting WIZARD_POLYMORPH_SELF ("spwi416.spl") and WIZARD_SHAPECHANGE ("spwi916.spl").

We should probably add 2 SPLSTATEs, one for Shapechange and another one for Polymorph Self, so that when the delayed op146 effect triggers for removal, it will revert the caster to its natural form only if it's actually in one of those forms!

Here's an example:

  1. Suppose you're polymorphed into a mustard jelly (as per WIZARD_POLYMORPH_MUSTARD_JELLY) and WIZARD_POLYMORPH_SELF is about to expire.
  2. Use Relair's Mistake ("clck04.itm") to turn into a Wolf.
  3. When the delayed op146 from WIZARD_POLYMORPH_SELF triggers, it will cancel your Wolf form (from Relair's Mistake) and that would be incorrect.

Alternatively, if you don't want to waste 2 SPLSTATEs just for this task, then I suggest adding two op206 effects (resource="spwi489", resource="spin150") to all relevant polymorph weapons, i.e.:

  • all but the ones granted by
    • WIZARD_POLYMORPH_FLIND, WIZARD_POLYMORPH_OGRE, WIZARD_POLYMORPH_SPIDER, WIZARD_POLYMORPH_MUSTARD_JELLY, WIZARD_POLYMORPH_BROWN_BEAR, WIZARD_POLYMORPH_BLACK_BEAR, WIZARD_POLYMORPH_WOLF, WIZARD_POLYMORPH_BORING_BEETLE, WIZARD_POLYMORPH_POLAR_BEAR, WIZARD_POLYMORPH_WINTER_WOLF
    • SHAPECHANGE_MIND_FLAYER, SHAPECHANGE_IRON_GOLEM, SHAPECHANGE_GIANT_TROLL, SHAPECHANGE_GREATER_WEREWOLF, SHAPECHANGE_FIRE_ELEMENTAL, SHAPECHANGE_EARTH_ELEMENTAL, SHAPECHANGE_WATER_ELEMENTAL
  • As far as WIZARD_POLYMORPH_FLIND, WIZARD_POLYMORPH_OGRE, WIZARD_POLYMORPH_SPIDER, WIZARD_POLYMORPH_MUSTARD_JELLY, WIZARD_POLYMORPH_BROWN_BEAR, WIZARD_POLYMORPH_BLACK_BEAR, WIZARD_POLYMORPH_WOLF, WIZARD_POLYMORPH_BORING_BEETLE, WIZARD_POLYMORPH_POLAR_BEAR, WIZARD_POLYMORPH_WINTER_WOLF are concerned, only add 206 immunity to "spin150" (the one related to WIZARD_SHAPECHANGE).
  • As far as SHAPECHANGE_MIND_FLAYER, SHAPECHANGE_IRON_GOLEM, SHAPECHANGE_GIANT_TROLL, SHAPECHANGE_GREATER_WEREWOLF, SHAPECHANGE_FIRE_ELEMENTAL, SHAPECHANGE_EARTH_ELEMENTAL, SHAPECHANGE_WATER_ELEMENTAL are concerned, only add 206 immunity to "spwi489" (the one related to WIZARD_POLYMORPH_SELF).
Edited by Luke
Link to comment
On 3/21/2022 at 8:16 AM, jmerry said:

- (Not a bug, just annoying) BGEE and BG2EE use different architecture; BGEE attaches the polymorph effect to the transformation spell/ability, while BG2EE attaches it to the creature weapon. As such, any fixes will need different code for each game. The BGEE versions are technically temporary at 500 days, probably because a true permanent duration wouldn't revert after death and resurrection.

IMHO, all games should follow the BG2EE architecture (i.e., everything should be attached to the poly weapon as an equipped effect).

In so doing, druid forms (and notably WIZARD_POLYMORPH_OTHER!) will indeed have a permanent duration (until manually reverted / dispelled / character death).

Edited by Luke
Link to comment

Funny. I was leaning toward the BGEE architecture myself, because of the Ust Natha problem. Adalon's transformation has to be attached to a spell for multiple reasons, and that means it effectively blocks all weapon-attached transformations because of the order things get evaluated in.

The closest to a fix you can get for that in the BG2EE architecture is to make the transformations cosmetic-only, move all the creature stats over to the weapon as equip effects, and have characters that look like drow while they fight like werewolves (or whatever).

Link to comment
21 hours ago, jmerry said:

Adalon's transformation has to be attached to a spell for multiple reasons, and that means it effectively blocks all weapon-attached transformations because of the order things get evaluated in.

Right...

So, what about attaching a SPLSTATE (f.i. DROW_CHANGE, or whatever) to "spin825.spl" (DROW_CHANGE)...? In so doing

  • all polymorph abilities (the SPL files!) will apply an op321 effect conditionally (op326) to SPLSTATE = DROW_CHANGE (or whatever)
  • as a result of the previous point, the attached op135 effect on the poly weapons will now work as expected (since we've just removed the Drow animation)
  • all "Return to Natural Form" abilities will apply "spin825.spl" (DROW_CHANGE) conditionally (op326) to SPLSTATE = DROW_CHANGE (or whatever)
  • all "Resurrection" files will apply "spin825.spl" (DROW_CHANGE) conditionally (op326) to SPLSTATE = DROW_CHANGE (or whatever)

Am I missing something...?

21 hours ago, jmerry said:

... make the transformations cosmetic-only, move all the creature stats over to the weapon as equip effects

Yes, this would be another good change (i.e., all those op135 effect should use "parameter2 = 1|Appearance only").

I'd like to recall that

"op135, parameter2 = 0|Change into" is bugged when you shapechange between two different non-natural forms. In particular:
All your equipment will be considered as "unequipped" (in particular, you will lose passive bonuses/maluses granted by your Rings, Amulet, Helmet and the like).

This is particularly relevant for personal (unremovable) gear such Nalia's ring, Edwin's Amulet, etc... In all such cases, you'll be forced to save & reload your game (since “Equipping” also occurs when game loads). Using "parameter2 = 1|Appearance only" will bypass this issue.

One final note about "parameter2 = 0|Change into" vs. "parameter2 = 1|Appearance only":

the former sets the 59|POLYMORPHED stat to 1, the latter does not.
Is it important...? I don't think so, but I'm not 100% sure...

Edited by Luke
Link to comment

Sounds intriguing, and definitely worth testing. I might whip something up once I'm done with my current little project.

My general stance here? Shapeshifting is cool. I want it to work. And if that takes a whole lot of changes under the hood, so be it. "It never worked before, and often crashed the game" is no excuse for not at least trying.

Link to comment

I was looking through things and running a few tests before I start tinkering with this stuff again...

That "unequipped items" bug can be used to put Hexxat in a state where she dies and stays dead. Hit her with a raise spell, and she's fine. Save and reload, and she's on the party sidebar but not actually present, dead but regenerating, and still not in her coffin. Waiting won't bring her back; you have to hit her with a raise spell (which she's normally immune to when in the coffin).

And then there's the Cloak of the Wolf. It's a mess. In both games, its shapeshift is an opcode 53 when the weapon is equipped, not matching either set of standards. It doesn't grant the cold and electric resistances standard to other wolf shapeshifts, though that's excusable - those resistances are standard on Dread Wolves but not other enemy wolves. In BG2EE, it grants a Natural Form ability but only removes part of the list of Natural Form abilities, so you could do something like cast Shapechange and then use the cloak to have two of them. And finally, the weapon cdwolfm? Its BG2EE version has some visual effects with timing mode 3 and a delay of 117; they're about three seconds long, and the weapon creation ability has duration 120. Those trigger repeatedly as long as the item is equipped, meaning they'll start playing about when the natural expiration point is and continue for as long as you had the ability active. Those effects have to go.

Link to comment
3 hours ago, jmerry said:

And then there's the Cloak of the Wolf. It's a mess. In both games, its shapeshift is an opcode 53 when the weapon is equipped, not matching either set of standards

Yeah, this one uses op53, probably because someone realized that op135 is bugged when it comes to shapechanging between two different non-natural forms... I mean, unless I'm missing something, there should be no difference between "op135, p2=1" and "op53, p2=0" (they're both cosmetic changes)... Anyway, I'd use either one or the other...

 

Separately, WIZARD_POLYMORPH_OTHER probably needs further tweaks. In particular, "squirp.itm" should also block Item usage (BUTTON_USEITEM, BUTTON_QUICKITEM[1-3]), otherwise nothing prevents you from activating something like the Cloak of the Wolf to bypass/overwrite the squirrel form... And that's clearly not intended... Now that I think of it, it should also block BUTTON_INNATEBUTTON (or grant 100% innate spell failure), otherwise druids can polymorph into, say, bears and bypass/overwrite the squirrel form...

I mean, while in squirrel form, you should be able to do literally nothing (except from walking and attacking as 3-STR squirrel with 5 HP) until character death / a Dispel Magic is cast successfully upon the affected creature... I know this does sound quite OP for a 4-th level spell, but the spell also seems to be intended to work in this way...?

Link to comment
On 4/2/2022 at 1:56 PM, jmerry said:

My general stance here? Shapeshifting is cool. I want it to work. And if that takes a whole lot of changes under the hood, so be it. "It never worked before, and often crashed the game" is no excuse for not at least trying.

My own stance is that, while shapeshifting is cool, gamebreaking bugs in the critical path are not cool. If there’s an elegant way to have our cake and eat it, fine. But I don’t want shapeshifting to end up being a hacky unreliable mess in order to address this specific localized issue.

Link to comment
5 hours ago, Luke said:

Separately, WIZARD_POLYMORPH_OTHER probably needs further tweaks. In particular, "squirp.itm" should also block Item usage (BUTTON_USEITEM, BUTTON_QUICKITEM[1-3]), otherwise nothing prevents you from activating something like the Cloak of the Wolf to bypass/overwrite the squirrel form... And that's clearly not intended... Now that I think of it, it should also block BUTTON_INNATEBUTTON (or grant 100% innate spell failure), otherwise druids can polymorph into, say, bears and bypass/overwrite the squirrel form...

Don't forget all the other ways to turn people into squirrels (bolts, wands, wild surges, etc), not all of which are treated the same. They all do the same 3 strength thing, but the bolt polymorph forgets to take away all those Natural Form abilities and uses a different weapon...

Actually, I'm pretty sure the solution here is to add a HOSTILE_POLYMORPH splstate. That state should block all voluntary shapeshifting spells/abilities, plus the various magic weapon creation spells.

In its current state, you can transform out of the squirrel form, but you still need a dispel to get your strength, dexterity, and hit points back. Here, have this cool phantom sword. And by the way, you're not a squirrel anymore.

Another loophole ... if you are transformed out of the Slayer form by a means other than "End Slayer Change" - a voluntary shapeshift, a hostile polymorph, magic weapon creation - the delayed damage effects are still there. Since we're already throwing spell states around, how about gating those damage effects by a SLAYER_FORM state? We might even be able to get rid of the temporary magic damage immunity after transforming back.

Link to comment

My current thoughts on the structure here ...

We'll need at least four spell states for this in BG2EE.

HOSTILE_POLYMORPH: Granted by shapeshift weapons for the Slayer form and all involuntary transfomations - mostly squirrels, though there's one rabbit transformation and one wolf transformation. Blocks (via 324) all abilities that polymorph you or create a magic weapon, except for "End Slayer Change". And maybe the voluntary slayer change too; it seems that should be powerful enough magic to override a conventional transformation.

SHAPECHANGE: Granted by the weapons for the Polymorph Self forms. The involuntary reversion when Shapechange expires (SPIN150.SPL) only applies if you have this state.

POLYMORPH_SELF: Granted by the weapons for the Polymorph Self forms. Split off the weapons for druid bear forms and cloak jelly form, so they don't give false positives. The involuntary reversion when Polymorph Self expires (SPWI489.SPL) only applies if you have this state.

POLYMORPH_IMMUNITY: Blocks (via 324) hostile polymorph abilities, replacing the current incomplete list of 206 abilities. It's either that or externalizing things to new subspells and adding those to the 206 list.

The drow change issues are trickier. Removing the existing transformation so polymorphs look right during that sequence? Sure; we don't even need a spell state for that. Reapplying it when the transformation ends? That's harder. Transformations can end with an explicit natural form ability, death and resurrection, being dispelled, or simply timing out depending on the variety of transformation. We can't just attach a re-transform to a few spells and make it work.

So, my revised thoughts on this one: SPIN825 DROW_CHANGE sets a local variable - let's call it "ActuallyLooksLikeDrow", though that name will have to be shorter to fit properly. All polymorph effects remove the effects of SPIN825 and zero out "ActuallyLooksLikeDrow". Then we put a scripting state on all polymorph weapons - call it POLYMORPHED or something. The scripts (either the underdark area scripts, or the global baldur.bcs) detect the combination - global PlayerLooksLikeDrow = 1, local ActuallyLooksLikeDrow 0, stat POLYMORPHED zero - and reapply SPIN825 to that player. Or actually, a clone of SPIN825 without the visual effects. There might be a slight delay, but your drow looks will come back. When the sequence ends, SPIN830 UNDER_NORM removes all effects from both SPIN825 and the clone.

Thoughts, before I start coding this stuff? So far, I have my BG2EE pre-processing fixing a bunch of individual issues (for one not mentioned yet: DECK_MAGICIAN tries to turn you into a rabbit and a squirrel at the same time) and a not-yet-tested version of a function to turn creature stats into item equip effects for polymorph purposes.

Link to comment

Revising that last post: actually, I'm fine with being able to polymorph out of squirrel form. Oh, you turned me into a squirrel? I'll turn into a bear, then.

Nullifying it, or a voluntary form, with a spell like Phantom Blade is definitely not OK, though.

So: POLYMORPHED is now a spellstate, and it blocks all magic weapon creation spells that aren't polymorphs.

HOSTILE_POLYMORPH is not a thing. Slayer form should  block all voluntary polymorphs except "End Slayer Change". Since some of these are item abilities rather than actual spells, we probably do need a SLAYER_FORM state to 324-block them.

Link to comment

STAT POLYMORPHED already exists, why waste spellstates for this.

There's no reason for the voluntary Slayer Change to block other polymorph/shapechanges.  The involuntary Slayer Change already comes with losing player control, so there is no risk of canceling that.

Adalon's Drow illusion is just that - an illusion.  It should override the appearance of any polymorph/shapechange.

The numerous "Human/Natural Form" abilities need to go, condensed into a single ability.

Link to comment

Join the conversation

You are posting as a guest. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...