Jump to content

Revision of the Dispel Magic mechanic


Recommended Posts

I have this installed in my current game and I see a problem: Remove Magic can dispel Spell Deflection and Globes of Invulnerability. In fact, it can dispel anything, regardless whether the effect has its "resist_dispel" field set to dispellable. This is because the mod uses opcode 220 in the A^DISPE2.spl subspell, to remove all spells of all schools. This might be because I used the "spells over 7th level cannot be dispelled" option - since that can't be achieved with opcode 58. But instead of opcode 220, I would suggest using opcode 221 to remove effects according to sectype. That way spells with certain sectypes that should not be dispellable, like SPELLPROTECTIONS, can be excluded.

Link to comment
On 10/18/2021 at 11:51 PM, subtledoctor said:

I have this installed in my current game and I see a problem: Remove Magic can dispel Spell Deflection and Globes of Invulnerability. In fact, it can dispel anything, regardless whether the effect has its "resist_dispel" field set to dispellable.

I accounted for this when designing my mod; Spell Turning, Spell Deflection and Spell Immunity are all undispellable unless another mod in your install order has changed the spell files. (Minor) Globes of Invulnerability can indeed be brought down by a successful dispel magic, that's per 2nd edition rules, although it was not so in vanilla iirc. Note that there are some other spells like Feeblemind that in AD&D are also undispellable, but I left these untouched so as not to confuse AI scripts that may attempt to dispel the condition.

This is the relevant code from the tp2, it simply changes the spell school for in game effects although not the restrictions/requirements for mage kits. The only way I can imagine this bug appearing is if another mod subsequently overwrites the .spl files in their entirety.

COPY_EXISTING ~sppr701.spl~ ~override~
	      ~spwi318.spl~ ~override~
	      ~spwi420.spl~ ~override~
	      ~spwi420d.spl~ ~override~
	      ~spwi519.spl~ ~override~
	      ~spwi522.spl~ ~override~
	      ~spwi590.spl~ ~override~
	      ~spwi591.spl~ ~override~
	      ~spwi592.spl~ ~override~
	      ~spwi593.spl~ ~override~
	      ~spwi594.spl~ ~override~
	      ~spwi595.spl~ ~override~
	      ~spwi596.spl~ ~override~
	      ~spwi597.spl~ ~override~
	      ~spwi617.spl~ ~override~
	      ~spwi618.spl~ ~override~
	      ~spwi701.spl~ ~override~
	      ~spwi710.spl~ ~override~
	      ~spwi710d.spl~ ~override~
	      ~spwi809.spl~ ~override~
	      ~spwi809d.spl~ ~override~
	      ~spwi902.spl~ ~override~
	      ~spwi908.spl~ ~override~
WRITE_BYTE 0x25 9 //Testing reveals that this does not effect specialist wizard selection of spells

 

Edited by polytope
Link to comment

Ah - you change their spell school? Then yes, this could conflict with several mods - some that overwrite them may have their school set in the new files, and some mods (like one of my own) rebalance spell schools overall to correct some perceived deficiencies in the game's spell set (Enchanters lacking any spells over 5th level, illusion spells doing nothing but turn invisible or create images, etc.). So there are definitely some adverse mod interactions. Beyond that, this change some basic unmodded mechanics - these spells are no longer among the ones that an Abjurer can use to satisfy their mandated Abjuration memorization slot, and they become available to Transmuters when they are not meant to be.

All of which is fine for a mod to do - just outside the scope of what I expected from this one.

Link to comment
27 minutes ago, subtledoctor said:

. Beyond that, this change some basic unmodded mechanics - these spells are no longer among the ones that an Abjurer can use to satisfy their mandated Abjuration memorization slot, and they become available to Transmuters when they are not meant to be.

I assure you this isn't a problem, the kit/alignment exclusion flags are stored separately in the header of the .spl file to the actual school for purposes of in game effects (0x001e vs 0x0025). Also, unless you were starting in ToB it wouldn't matter as you wouldn't be able to choose spells of 5th level on character creation. Out of curiosity I just did and no, a transmuter was not able to select Spell Shield, Minor Spell Turning or Spell Immunity at 5th.

Link to comment

I've updated the original post with version 2, which now supports Spell Revisions so long as it is installed afterwards, I've also included a new component to shore up the "dispellability" of Project Image, and the option to move Project Image to a HLA, whilst replacing the original 7th level spell with something entirely new.

Edited by polytope
Link to comment

One suggestion: at line 174 of the new .tp2, you have:

ACTION_IF  FILE_EXISTS_IN_GAME ~k1#scre.spl~ THEN BEGIN      
  COPY_EXISTING ~sppr303.spl~ ~override~
	      ~spwi302.spl~ ~override~
	      ~spwi326.spl~ ~override~
	      ~spcl231.spl~ ~override~
    LPF ADD_SPELL_EFFECT INT_VAR
	opcode	= 146
	target = 2
	power = 0    
	timing	= 3
	duration = 1
	parameter1 = 0
	parameter2 = 1
	STR_VAR
	resource = ~spwi513c~
	END

I would precede that ADD_SPELL_EFFECT with this:

LPF DELETE_EFFECT INT_VAR match_opcode = 146 STR_VAR match_resource = ~spwi513c~ END

Just so that if another mod already had Remove Magic casting SPWI513c (ahem), this will make sure there is only one such 146 effect when all is said and done.

Link to comment
8 hours ago, subtledoctor said:

Just so that if another mod already had Remove Magic casting SPWI513c (ahem), this will make sure there is only one such 146 effect when all is said and done.

Just checked, and with Spell Revisions SPWI513C uses opcode 221; remove spells of a particular secondary type up to the designated maximum level, rather than opcode 230; remove one spell of said sectype up to the max level, so duplication should be harmless in the unlikely case that it occurs.

Link to comment

My mod adds a 146 effect casting spwi513c to spwi302 et al. I’m in the process of redesigning it and trying to make it as instal-order-agnostic as possible. Right now if PolyDisp is installed after mine and mine after SR, then Remove Magic will cast spei513c twice. If we both add a DELETE_EFFECT line then we ensure there will be one and only one such instance. (I cannot fathom a situation where you would want that to happen twice, so this should be safe.)

It’s not urgent. I’m just noting a possible edge-case compatibility issue. 

Edited by subtledoctor
Link to comment

I fail to see the issue, because opcode 221 is comprehensive and noncumulative in its effects, unlike 230, and the only thing the SPWI513C sub spell does is apply this opcode. It doesn't matter if subsequent or prior mods duplicate it.

I'm not going to release another version just to correct something that is:

  1. Not going to occur in the vast majority of installations; even players who use Spell Revisions + SCS + Polydisp (not the most likely combination, I never designed for balance with SR changes to gameplay in mind*) in its original form won't see it, it would only occur if they also installed your "Magic Battles Revised" mod with mine, in addition to the above.
  2. Both tactically and aesthetically irrelevant because of the noncumulative behavior of opcode 221 and because SPWI513C (unlike SPWI513B) does not have any associated text string or visual effects.

How can I put this? Releasing multiple new versions of the same mod in a very short time span harms consumer confidence, it gives the impression that your work is bug riddled and deters players from trying it out or prompts them to uninstall and probably not use it again if they don't have the latest version.

*On this topic, there is a limit to how compatible two mods can be when they are both seeking to overhaul some fundamental behavior of the magic system. For instance Improved Anvil and SCS have quite different approaches to Spell Immunity, particularly the old chestnut of an untargettable mage running Improved Invisibility -> SI:Divination. IA simply made Spell Immunities non-stackable, so that anyone protected from divination magic is still entirely vulnerable to Dispel Magic removing their invisibility. SCS went in a different direction, making it so that protection removal spells can be targeted through Improved Invisibility.

I don't entirely love either approach, in Improved Anvil mages who are much higher level than your casters can't be dispelled and subsequently targeted. Also, in IA you end up with party mages suffering a "bottleneck" of 7th level spells because of the necessity of Ruby Ray of Reversal - the only spell that removes SI:Abjuration - to peel through Spell Turning + Globe of Invulnerability + Spell Immunity.

With SCS on the other hand I have a problem accepting the logic of some single target spells but not others conveniently bypassing Improved Invisibility and also with the stackability of Spell Immunity against multiple schools, which feels very illegitimate to me. True, SI stacks in the unmodded game, also in the unmodded game you can cast Armor of Faith four times (at caster level 20th) for 100% physical damage resistance, was that intended? I think not.

My own preference would have been for Improved Anvil's take on Spell Immunity (only one active at a time) but...

  • Cleric spell Invisibility Purge changed to abjuration magic and arcane spell Oracle changed to conjuration, hence either could remove Improved Invisibility from mages under SI:Divination. I don't think players used those spells before, Invisibility Purge is too slow and Oracle too high level for what it does.
  • Pierce Magic and Spellstrike are included in the alteration school, reducing the dependence on Ruby Rays a bit.

However, it's too late now! Too much work has gone into the respective AI scripts of Anvil and SCS, it would be up to me at this point to rewrite every mage script in the game to get my perfect, intended behavior and I haven't either the time or, realistically, the audience to make that worthwhile.

Edited by polytope
Just a note that Polydisp is in fact incompatible with Improved Anvil.
Link to comment

I'm not demanding you release any new versions. There is a weird effect doubling that might occur and while I like your percentages and I want anyone using my stuff to be able to use your mod as well, there are things that I cannot control for if mine is not installed later. So I noted the interaction in your mod thread and included a simple one-line drop-in solution. If you ever happen to release a new version in some distant future (as sometimes happens around here), then here is a thread with feedback to consider. If you don't care, you don't care - that is also something I cannot control for.

8 hours ago, polytope said:

On this topic, there is a limit to how compatible two mods can be when they are both seeking to overhaul some fundamental behavior of the magic system.

I mean, this mod on its face just changes the percentages and max levels of a single spell effect. That's why I was surprised to see that it interfered with other systems. Now I understand why, and while I still think there are cleaner ways to achieve the result, I can also try to account for it. My overhaul is going to change Remove Magic but leave Dispel Magic alone; since I like your percentages, I would like players to have the option using my system for Pierce/Breach/RM, while using your version of DM. Glancing more at his this mod works, it seems to just copy in a folder full of files and overwrite a lot of stuff, so at the end of the day if players want that I think they will just have to pay close attention to install order and install this earlier.

Of course setting aside the question of efforts to make the mods compatible, there is also the question of whether know about mods' compatibility. Say, as a f'rinstance, a mod wanted to make illusionists a bit more special, like they were in 1E. Say the mod wants to make illusions immune to abjurations - after all, if a magical effect is merely illusory, then there's nothing to dispel, right? So it marks them as undispellable. A player using that mod reading this description would not realize its effects would be undone by installing this one, which just says "the percentages are changed and you can optionally limit Dispel to 6th-level spells."  Solution: a bit of discussion in the mod thread can help people know what they're getting into.

Mission accomplished, then, I'm off for coffee.

Link to comment
11 hours ago, subtledoctor said:

 Glancing more at his this mod works, it seems to just copy in a folder full of files and overwrite a lot of stuff, so at the end of the day if players want that I think they will just have to pay close attention to install order and install this earlier.

This is simply not true. My mod patches, rather than overwrites files when it's reasonable to do so, including all HLAs that need to be schoolless in order to be undispellable as intended and potions that need an associated school to be dispellable, considering that removing magical effects only up to the 7th level - if player chooses that - requires they also be removed by school.

The vanilla game files overwritten by my mod are:

  • Each form of dispel and remove magic; arcane, clerical and inquisitorial (4 files). I explained previously in this thread why I don't build the large and complex spell files on installation through weidu.
  • Projimag.spl, the main change is adding an innate A^ENDSP.spl with target 7 so the caster can instantly dissolve the image whenever they choose (per the spell's 2nd edition description), but while I was at it I fixed the timing of certain effects and disabled item quickslots (cheese). I could have patched this but it was simpler to bundle the changes together in a prepared .spl, sue me.
  • Sw2h10; Carsomyr and Arow07; Arrow(s) of Dispelling, if the optional component to bring them in line with the PnP is used, in order to be as close as possible to their AD&D descriptions they are indeed overwritten. Incidentally Crysomer should be a long sword, rather than a 2-hander, but this would be a bridge too far.
  • SPWI703 again if the user selects the optional component to recognize the power of Project Image by making it a HLA, the 7th circle spell obviously needs to be replaced with something else (Malec-Keth's Flame Fist), when a spell is drastically changed overwriting rather than patching is the obvious solution.

So, 5 files in total overwritten on a basic installation of Polydisp, one of which should arguably have been patched instead.How many files does Spell Revisions overwrite, again?

Now, before releasing my mod I should indeed have investigated how SR handles Spell Immunity, because it's quite a popular G3 mod and these kind of incompatibilities need to be apprehended. However, your comments in this vein are uncalled for; no other player who gave feedback on my mod (Suy for instance) noticed the bug of Spell Deflection or Spell Shield being dispellable, because it doesn't exist unless a subsequent mod overwrites those spell files. My first thought, on seeing an extremely visible bug that obviously departs from intended behavior and which no one else has reported would be "Ah, this problem is brought about by some sort of cross-mod interaction" rather than telling people "with polytope's Revised Dispel Magic installed, a Remove Magic spell can remove my spell protections, even though they are set to be undispellable. If you use SR and/or SCS and especially with my "Magic Battles Revised" tweaks, you probably care about the 'mage duel' system and this is a pretty undesirable result...For now, if the spell battle system is at all important to you, I would steer clear of that mod.'"

Edited by polytope
Link to comment

It does copy a folder full of files, so it simply is true. I didn't say it should patch instead of overwrite - I'm not evangelizing here. But when I got around to looking at your actual code to see if there was an easy way to achieve cross-mod compatibility, I saw

COPY ~polydisp/dispel~ ~override~

COPY ~polydisp/dispel~ ~override~

...which means there is not.

On 10/27/2021 at 10:22 PM, polytope said:

no other player who gave feedback on my mod (Suy for instance) noticed the bug of Spell Deflection or Spell Shield being dispellable, because it doesn't exist unless a subsequent mod overwrites those spell files.

I have no other mod that overwrites those files. I have a mod that selectively patches the school/primary type of almost every spell, to balance things out among specialists. For whatever reason, I want spells' school to reflect their actual school. (I note that even if your mod is installed with normal behavior, dispelling up to 9th level, it still remoevs spells by school instead of just applying opcode 58 with guaranteed success in the subspell.)

On 10/27/2021 at 10:22 PM, polytope said:

rather than telling people "with polytope's Revised Dispel Magic installed, a Remove Magic spell can remove my spell protections, even though they are set to be undispellable. If you use SR and/or SCS and especially with my "Magic Battles Revised" tweaks, you probably care about the 'mage duel' system and this is a pretty undesirable result

I realized that your mod was making changes beyond what was advertised on the tin, and I did not yet understand how or why. So that was the best thing I could figure about how to describe what I was seeing.  Now that I understand how each mod works, I have stated things more clearly in my new mod's readme:

  • "if this mod is installed after Polytope's Revised Dispel Magic mod (PolyDisp.tp2), then it will overwrite the PolyDisp to limit Dispel Magic to 6th-level spells; with PolyDisp + MBR Dispel Magic can dispel all spells up to 9th-level. Conversely, if you install PolyDisp after this mod, then PolyDisp will overwrite MBR's new 'mini-Breach' version of Remove Magic and revert it to the spell's original 'similar-to-Dispel-Magic' behavior."

 

Edited by subtledoctor
Link to comment
9 hours ago, subtledoctor said:

It does copy a folder full of files, so it simply is true. I didn't say it should patch instead of overwrite - I'm not evangelizing here. But when I got around to looking at your actual code to see if there was an easy way to achieve cross-mod compatibility, I saw

COPY ~polydisp/dispel~ ~override~

COPY ~polydisp/dispel~ ~override~

I think I've explained why four of the five vanilla game .spl files overwritten on a basic installation of Polydisp are so overwritten, rather than patched. Those four files are not "'a lot of stuff", Spell Revisions overwrites a much larger number of .spl files, I don't complain about that.

Note that overwriting a spell is completely different to overwriting a .cre, a .dlg, a .bcs or (worst of all) an .are or a .2da for compatibility purposes. Memorizable spells are by their nature non-unique, and will not have an important item added to their inventory or given by dlg, nor set an important game variable on death. Your insistence that my mod is likely to break compatibility with many other mods is fanciful. None of the other 70 or so users who downloaded the first Polydisp release noticed a bug occurring here.

9 hours ago, subtledoctor said:

I have no other mod that overwrites those files. I have a mod that selectively patches the school/primary type of almost every spell, to balance things out among specialists. For whatever reason, I want spells' school to reflect their actual school. (I note that even if your mod is installed with normal behavior, dispelling up to 9th level, it still remoevs spells by school instead of just applying opcode 58 with guaranteed success in the subspell.)

In my years of playing this game with a variety of tactical mods I have never before seen another author make changes to the spell school of spell protections, I did so with reluctance and purely to prevent spell protections being removed by Dispel Magic, yes, it's foiled if another mod subsequently overwrites or revert those spells by patch to having a school.

I've already explained that the school change has no effect on specialist wizards, because the exclusion flags are separate to the actual school in the .spl file and because specialist saving throw penalties are irrelevant for a self targeted buff that doesn't allow a saving throw. I didn't use opcode 58 even for the choice of spells above 6th level being undispellable mostly for consistency between install options and so that the player can see which school of magic they've dispelled.

Link to comment
On 11/4/2021 at 8:17 PM, polytope said:

I've already explained that the school change has no effect on specialist wizards, because the exclusion flags are separate to the actual school in the .spl file

I don't care about opposition schools, I think opposition exclusions are stupid and I remove them. My bigger concern is that, for instance, an Abjurer must use one memorization slot in each spell level for an abjuration spell. Normally I can memorize Minor Spell Deflection to satisfy this requirement among 3rd-level spells. With your mod, I cannot. (This is true at character creation, and while the base game otherwise ignores this PnP rule, Kjeron has a nice PnP mod that enforces it.)

More generally, you seem to think I am trying to argue, or to prescribe the way you should code your mod. I am not. Really. I may do things differently, like dispel by secondary type instead of by primary type. But that is immaterial to how you make decisions, except insofar as you see any wisdom in what I have to say. I bring this stuff up solely because, while the impact of how the mod works does not matter to you, it may matter to other people who set up their game differently. As long as they know what the effects are, they can make intelligent decisions about how and in what order to install mods. In most cases, installing this mod is an intelligent decision! It is certainly better than the base game, or the base game + SCS. But as players make more tweaks to how spells schools and memorization requirements work, or how their spell protections work, they may need a better grasp of the mod interactions. Now they have that.

Link to comment

Hi @polytope. While I understand that this mod is not that important in BG1, I wanted to try it regardless there, and when I was going to install it, I got a message saying that ToB is required. The check seems to be:

BEGIN @10 DESIGNATED 10

REQUIRE_PREDICATE FILE_EXISTS_IN_GAME ~mel01.cre~ @13

So, how comes that such thing is needed? Isn't BG1EE technically enough? Thank you.

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...