Jump to content

Removing that dang spinny-head animation


Recommended Posts

This is spun off of the general EE content bug thread, starting with this report handed over by Andrea C.

On 5/16/2022 at 2:18 AM, Andrea C. said:

Remove Paralysis doesn't remove the paralysis VFX *

*apparently a generalized problem with some VFX not being removed when the relevant spell is dispelled.

And while my original plan was truly a showcase of my work ethic:

On 5/24/2022 at 5:22 PM, CamDawg said:

I'm going to spin this off into its own topic, namely because I think I can foist this off on @DavidW as part of the 109/175 stuff.

... I'm going to tackle these myself. A brief overview of the spinny-head animation follows:

  • The animation itself is spmindat.bam. It is played by spmindat.vvc for many, many different effects--primarily fear, hold, and feeblemind.
  • Because of the overlap, spells which might block spmindat.vvc from playing (a spell such as Resist Fear) would end up blocking it correctly if it was sourced from a spell such as Horror, but incorrectly if it came from Hold Person.
  • As a result, BG2 Fixpack cloned it into an identical animation, cdhorror.vvc. Spells which caused fear were updated to use cdhorror instead of spmindat, and spells which provided fear immunity were updated to block cdhorror instead of spmindat. Both VVCs still play the same underlying animation, spmindat.bam, but the different VVCs allow us to block one or the other via spell effects.
  • However, oBG2 can only block animations, not remove them. So a creature who gets hit with Horror, and then had their panic removed with Remove Fear, would no longer be panicking, but the spinny-head animation would remain.
  • EEs added the ability to remove the effects from specific spells. As such, spells which 'cure' fear were updated to also remove all the effects of e.g. Horror, to avoid the above.

Which brings us to today. The shortcomings in the above plan were 1) we should have given the the same treatment to spells which cause/cure feeblemind as we did to cause/cure fear and 2) we should have updated hold cures to remove hold spells explicitly, as we did for fear cures. The good news is that the new immunity scheme we're using already addresses some of this. So the process from here:

  1. Clone spmindat.vvc into cdfeeble.vvc and cdstun.vvc
  2. Update spells which play spmindat as part of a feeblemind to play cdfeeble instead
  3. Update spells that provide immunity to feeblemind to block cdfeeble instead of spmindat
  4. Spells that cure feeblemind (pretty much anything that dispels magic) should now explicitly remove these feeblemind spells
  5. Update spells which play spmindat as part of a stun to play cdstun instead
  6. Update spells that provide immunity to stun to block cdstun instead of spmindat
  7. Spells that cure stun should now explicitly remove these stun spells
  8. Update the handful of EE fear spells that are still using spmindat to use cdhorror
  9. Update the spells that cure fear to explicitly remove the above, plus any other new fear spells that play cdhorror
  10. Update the spells that cure hold/paralyze to explicitly remove the various spells that play spmindat as part of their hold/paralyze effects. Despite hold and paralyze being separate effects (and more differentiated thanks to DavidW's work) they're both removed by the same opcode so they have to be batched here.

Most of this will have to be sorted on a per-game basis since we're having to explicitly target specific spells.

Once this is sorted I'll be looking at the other effects which 'cure' things that play animations, such as confusion.

Link to comment
11 hours ago, CamDawg said:
  • However, oBG2 can only block animations, not remove them. So a creature who gets hit with Horror, and then had their panic removed with Remove Fear, would no longer be panicking, but the spinny-head animation would remain.

If @Insomniatorcould fix the above via ToBEx AfterLife, could this fix be applied to the classics as well via BG2FP?

It would create a dependency on ToBEx AL for that particular component but IMO it would be worth it.

Link to comment

No. We made the decision early on to not include TobEx for BG2FP for a number of reasons, primarily because we wanted BG2FP to be platform-agnostic and TobEx is Windows-only. We still highly recommend it for Windows players.

I'll happily pitch in for a solution and (if it'll help) add some support code as an OBC like we did for dispelling paws.

Link to comment
On 5/27/2022 at 8:24 AM, Andrea C. said:

Perhaps ToBEx AL could include the whole fix, engine and scripting? Depending on whether @Insomniatoris onboard.

Sure. If there's anything I can do to help, let me know.

Now, on to the EEs:

There are several places where the engine plays persistent effects to go along with normal spell effects. The issue here, specifically, are visuals attached to an effect that can be cured through something like a cure spell, e.g. Confusion causes the animation of two circling birdies, and Confusion can be cured with Greater Restoration. However, Greater Restoration does not clear out the animation.

There are, broadly speaking, five areas where the engine plays persistent visuals which do not get cleared by their respective counters:

  • Confusion - cleared by things like Greater Restoration, plays spconfus.vvc
  • Fear - cleared by things like Remove Fear, updated by BG2FP to play cdhorror.vvc instead of spmindat.vvc
  • Feeblemind - cleared by Cure Disease and explicitly by most versions of dispel magic, updated to play cdfeeble.vvc instead of spmindat.vvc
  • Hold - cleared by things like Remove Paralysis, plays spmindat.vvc
  • Stun - cleared by things  like Free Action, updated to play cdstun.vvc instead of spmindat.vvc

Outside of confusion's spconfus, all of these played the same animation (spmindat.bam) and are visually identical. spflayer.vvc, used generally by psionic spells, is also the same visual.

While there are other specific effects and counters (poison vs. antidote potions) there are no persistent visuals, so we don't need to worry about them. In Icewind Dale, only hold has a persistent visual; the remainder are concerns only for BG/BG2. Fixing this is pretty straightforward, as delineated in the first post: basically, if a spell causes, say, confusion and plays a persistent visual, then anything that cures confusion also needs to roll back the entire spell so that spconfus goes away. (If something causes confusion without a persistent visual, we don't care.) Since the specific visual spmindat is used by all of the five above except confusion, as indicated above we clone it into cdhorror (already done from BG2FP), cdfear, and cdfeeble and make sure that spells that play visuals play the right one to accompany their effect.

This is done in three commits. The above doesn't really need to be expounded upon, so I'll highlight some other changes that had to be made for discussion.

A handful of items that were immune to something (e.g. fear) lacked the companion effect that makes them immune to the associated visual (e.g. cdhorror) and were fixed as a matter of course. If a spell caused fear and the wrong animation (e.g. spmindat) then it was also updated as a matter of course to use the proper visual. However, cdhorror was not assigned to everything that causes fear. Additional changes of note:

  • [sod] Piercing Shriek (used, oddly enough, by Shriekers) had, among its laundry list of effects, confusion. To avoid confusion cures from purging all of the non-confusion effects, the confusion bits have been shuffled into a subspell. The confusion cures remove just the subspell.
  • [bg, bg2, iwd] Similar to Piercing Shriek, the hold from the Bounty Hunter's Special Snare has also been shuffled into a subspell.
  • [bg2] Demogorgon's Insanity Gaze can cause both confusion and feeblemind, so it gets two subspells.
  • [bg, bg2] Psychic Drain had been using spmindat (hold) and has been shifted to use spflayer instead since other, generic psionic spells use this. Visually these are the same, but spflayer is not blocked by creatures immune to hold and will not be removed by curing hold.
  • [bg, bg2] Psionic Blast was shifted from spflayer to cdstun, since it should be blocked by creatures who are immune to stun. Visually these are the same.
  • [bg2] The githyanki Anti-Paladin has immunity to fear, but an error in its effects was preventing this from working. (It was 101'ing against a 101. Somewhere Xzibit is smiling.)
  • [iwd] Revenants were blocking spmindat, though they had no immunity to hold. The animation block has been removed.
  • [iwd] The Siren's Yearning bard song stuns creatures, but used the spmindat (hold) animation. The animation has been removed, as everything else that stuns in IWD doesn't play a persistent animation.
Link to comment

This seems like as good a place to mention it as anywhere - I ran into another spell with a nonstandard effect combination. Mimic Glue (SPIN914 in BG2EE) imposes paralysis (109), a "Held" portrait icon, and a Grease overlay (158). Plus some shorter duration lighting effects.

I noticed this because Hexxat failed her save and got the grease overlay without the portrait icon or the paralysis.

Obviously, the general update to immunities should cover at least some some of this. Paralysis immunity should block the glue now. Grease immunity ... I don't think that's being separated out, and it's not obvious to me whether it should block the effect. Removing paralysis should clear the whole thing too, which may require an additional update.

Link to comment
3 hours ago, jmerry said:

This seems like as good a place to mention it as anywhere - I ran into another spell with a nonstandard effect combination. Mimic Glue (SPIN914 in BG2EE) imposes paralysis (109), a "Held" portrait icon, and a Grease overlay (158). Plus some shorter duration lighting effects.

Obviously, the general update to immunities should cover at least some some of this. Paralysis immunity should block the glue now. Grease immunity ... I don't think that's being separated out, and it's not obvious to me whether it should block the effect. Removing paralysis should clear the whole thing too, which may require an additional update.

That doesn't sound like a paralysis effect at all though.  Should probably be treated same as the Bigby's spells.

Link to comment
17 hours ago, jmerry said:

and a Grease overlay (158)

The Grease Overlay has been changed to an ordinary Play Visual Effect (215) – this ability is not supposed to be a grease-based attack. As a result, it should not set the GREASE stat...

13 hours ago, kjeron said:

That doesn't sound like a paralysis effect at all though.  Should probably be treated same as the Bigby's spells.

I agree. It should use op185...

Edited by Luke
Link to comment
On 5/27/2022 at 1:26 AM, CamDawg said:

... but the spinny-head animation would remain.

I think it is worth mentioning that a similar argument holds for (delayed, timing=4) sound effects (op174).

If you're hit by, say, "bdbonbat.itm" (Sod, Bonebat attack), Remove Paralysis will certainly free you... But the delayed (ending) sound effect in "bdbonbat.itm" would still play (even if you are no longer paralyzed), and that would be incorrect...

Link to comment

Just as an FYI, I am reviewing this to catch delayed sound effects and the like. David also suggested that, rather than dumping 321s on individual spells/items, we should instead route them to an external spell to be applied, similar to the the way that 2.6 uses #rdremov for resurrection spells. This will make it easier for modders--e.g. spells which cause fear with extended effects will need to be added to the 'cure fear' spell's 321 list, whereas a spell that cures fear will just need a single 326 to apply the 'cure fear' spell.

It's a long slog as I'm reviewing pretty much anything with a 'cure' opcode, but I did want to post that it's in progress at least.

Link to comment

OK, so I've got this done for BG2EE and will be moving on to BGEE and IWDEE next. It's tedious, to say the least, but progress is happening. There are now 'cure spells' for berserk, blind, confusion, deafness, disease, drunkenness, fear, feeblemind, hold/paralyze, invisibility, level drain, non-detection, pause, poison, silence, sleep, and stun. A handful of these (deafness, level drain, non-detection) don't have any 321s to apply because none of the effects being cured need to be addressed beyond the cure opcode (and optional portrait icon removal). However, they're implemented anyway to provide a complete framework for modders.

Some other notes:

  • Moondog Howl's fear effects have been shunted into a subspell. Same with Emotion's sleep effects.
  • The hold effect from the bounty hunter special snare is moved to a subspell.
  • Paralyze effects from undead attacks were shunted to subspells when the attack also caused other effects (nausea or disease)
  • Stun effects from blizzard trolls were also moved to a subspell to separate them from the DEX drain.
  • F Chromatic Orb. No less than four subspells to get this to work. Since Chromatic Orb is going to keep on Chromatic Orbing, I've reserved the namespace for when I inevitably have to make the other five headers into subspells, too. This GD spell.

Stuff I found and fixed while I was working on the rest (aka "the real bug fixes were the ones we made along the way"):

  • Blackmist's blindness ability plays two sound effects instantly on its target. One of these is supposed to be an expiry sound.
  • The Wand of Glitterdust is altered to just cast the spell.
  • Found and fixed multiple instances of combat feedback (op 139) being applied with limited timing and/or a duration.
  • Some sirine attacks set the feeblemind icon while setting INT to 3. However, it's not formally a feeblemind attack so I've changed the icon to the more generic 'ability score drained' since stuff that cures/blocks feeblemind won't actually fix this.
  • A different sirine attack was causing feeblemind and setting INT to 3. Given that feeblemind already sets INT to 3, the INT effect is deleted as redundant.
  • The Harp of Discord causes confusion but was setting the intoxication portrait icon.
  • Slayer Fear (spin807) had mismatching durations between its fear and fear icon, and is fixed despite being unused.
  • The drunk outcome from Wish (spwish33) also had mismatching durations for its drunk effect and icon.

Something for discussion: four fear spells (dragon, vampire, Aramentes' aura, and the one from the Hell Fear trial) include a -2 thac0 penalty as part of the spell. The thac0 penalties all use the same save as the primary fear effects, so it appears tied to it. Should these thac0 penalties be blocked by fear immunity and removed by fear cures?

 

Edited by CamDawg
Link to comment
2 hours ago, CamDawg said:

Something for discussion: four fear spells (dragon, vampire, Aramentes' aura, and the one from the Hell Fear trial) include a -2 thac0 penalty as part of the spell. The thac0 penalties all use the same save as the primary fear effects, so it appears tied to it. Should these thac0 penalties be blocked by fear immunity and removed by fear cures?

IMO, yes. In this specific case, they appear to be a byproduct of the fear effect. With the fear effect gone, there is no reason for its byproducts to stick around.

Link to comment
On 6/20/2022 at 5:49 PM, CamDawg said:

OK, so I've got this done for BG2EE and will be moving on to BGEE and IWDEE next.

Just a FYI: I have just committed something similar for IWDEE to make sure "7eyes.2da" works properly.

I also started to include some BG(2)EE resources (for later compatibility with IWDification, which is supposed to ship the Seven Eyes spell), but then just stopped because I think we are doing the exact same thing...

Let me know if you're fine with my work on IWDEE...

Link to comment
Guest
This topic is now closed to further replies.
×
×
  • Create New...