Jump to content

Protection Against Dispel Magic


Recommended Posts

As I said I'm specifically interested in how SR does it. Is there an array defined somewhere, does it include spells added by orher mods, etc. I've seen Demi talk a lot about what is Breach-able, but I don't know if someone around here is familiar with the code itself. But whatever.

 

Poking around this issue, and glancing at the "AoE Deflection" code, it occurs to me that there's an install order problem. At least with IWDification, which is supposed to be installed after SR. Seems like:

1) IWDification should be installed after the SR main component, and AoE Deflection should be installed after IWDification (easy enough, though I generally try to avoid splitting mods if possible); and 2)

2) SR's AoE Deflection code should account for IWDification spells (I'm not sure it does - it should be using IDS names, but at a glance I didn't see that happening.)

There isn't an array. From top of my head, with morning coffee and cigar in my hand - combat protections would be

Armor

Shield

Barkskin

Stoneskin

Druid's Stoneskin

PfMW

Prismatic Sphere

Moment of Prescience

Apsolute Immunity

 

I probably missed a few.

 

Specific protections would include Pro Fire/Cold type spells, Chaotic Commands, Pro Fear etc.

 

As per IWDification, I think such stuff (adding/changing spells) would best be handled on IWD side.

If "NWN deflection" component is detected, it could use Ardanis' code he wrote so that hostile AoE spells get handled differently.

That is, if you wanna make a mod X compatible with this particular SR component the cleanest solution is to do it on X's side, not SR.

I did try to do that in a megamod setup, but this is a task where you're shooting a moving target. And it can't be done in a satisfactory manner w/o renaming some spells and tweaking the scripts to account for that. Or you get this.

Link to comment

That's a good idea. Is the NWN Deflection code portable (or close to it)? Seems like Camdawg is willing to make changes to IWDification at the moment. We should also do this for FnP/B_Spells. I'll take a look at it.

 

@Jarno Spell Turning = Greater Spell Deflection. Spell Trap and Shield of the Archons work the same way, they block 99 spell levels. (Not sure I like that... might be worth Spell Trap at keast, to use a difference opcode (Turning probably). Then it could stack with Deflections.

Edited by subtledoctor
Link to comment

That's a good idea. Is the NWN Deflection code portable (or close to it)? Seems like Camdawg is willing to make changes to IWDification at the moment. We should also do this for FnP/B_Spells. I'll take a look at it.

 

@Jarno Spell Turning = Greater Spell Deflection. Spell Trap and Shield of the Archons work the same way, they block 99 spell levels. (Not sure I like that... might be worth Spell Trap at keast, to use a difference opcode (Turning probably). Then it could stack with Deflections.

NWN code is fairly straightforward to use iirc.

Spell Turning opcode + NWN deflection result in horrible, horrible mess. Don't use it. Example - you cast Insects on the ground, but it spreads to a mage protected by Turning. With NWN deflection, they'll turn back on druid who cast it. AI (SCS or not) isn't able to cope with that change, they'll end up killing themselves with their own AoE spells.

Link to comment

 

That's a good idea. Is the NWN Deflection code portable (or close to it)? Seems like Camdawg is willing to make changes to IWDification at the moment. We should also do this for FnP/B_Spells. I'll take a look at it.

 

@Jarno Spell Turning = Greater Spell Deflection. Spell Trap and Shield of the Archons work the same way, they block 99 spell levels. (Not sure I like that... might be worth Spell Trap at keast, to use a difference opcode (Turning probably). Then it could stack with Deflections.

NWN code is fairly straightforward to use iirc.

Spell Turning opcode + NWN deflection result in horrible, horrible mess. Don't use it. Example - you cast Insects on the ground, but it spreads to a mage protected by Turning. With NWN deflection, they'll turn back on druid who cast it. AI (SCS or not) isn't able to cope with that change, they'll end up killing themselves with their own AoE spells.

I was thinking Trap wouldn't block AoE. Deflection already does that, and I have Greater Deflection blocking 21 levels. I think it's fair that if you need to protect yourself from AoE spells (including really nasty high-level ones) then you need to refresh your Deflection; meanwhile, Trap would stop spells being cast at you, giving your the breathing room to refresh your Deflections.

 

Basically there are three situations at the moment (grandiosely including my own alpha mod among them):

 

1) In vanilla, you can stack Minor Deflection + Minor GOI + Minor Turning + Deflection + GOI + Turning + Trap + Spell Shield. (+ SI:Abj + Inp. Invis. but let's leave those aside.) Each one requires a separate removal spell, each one blocks different amount of spells of different levels (in more than one case a high-level protection only blocks lower-level spells, which is mind-boggling), and frankly even 20 years after the game was released I'm not sure I could tell you the precise numbers on that. In addition to removals, there are DM and RM and Breach which bypass all of those defenses. Only about half of these spells are actually in PnP D&D, and there seem to be multiple parallel systems of magic battle coexisting very uneasily. (Protections vs. removals which is finicky and complicated; RM/DM vs. SI:Abj. which is facile and dumb; Imp. Invis. vs. divination attacks which is a whole other conversation; and Breach vs. nothing which ends up being the crutch every player relies on.) Read the forums and you'll see a lot of players saying stuff like "I don't like the magic battle system, I find it opaque and annoying." The main reason other players find it tolerable is likely because the AI doesn't actually do it very well.

 

2) In SR, you can stack Minor Deflection + (M)GOI + Deflection + Greater Deflection + Trap + Spell Shield. (I don't think MGOI and GOI stack... do they?) There are still differences in the level of which spells that get blocked - you can be totally immune to low-level spells, and absorb a certain amount of mid-level spells, and maybe absorb high-level spells, but hen again maybe not, depending on your strongest Deflection. The number of mid-/high-level spell levels you can absorb does not stack, but different Deflections do stack with regard to the number of removals required to make you vulnerable. That is important because protections now block Breach. Mages go from having Breach as their ultimate Achilles heel to something that can barely even work against them. Especially with SCS, the best strategy is more or less to forget the magic battle system and use RM which is the new silver bullet. Although generally (and especially with SCS) enemy mages are higher level than the player so RM is a bullet to which only the player is vulnerable.

 

3) In the mod I just posted, you can basically stack one variant of Deflection/Trap, + Spell Shield. The number of spell levels you can absorb is identical to scenario 2 - well, slightly higher because I buffed the Deflections - the main difference is that without GOI you can no longer have total immunity to low-level spells (big whoop). But the number of removals required to crack your defenses drops drastically, from 6 to 2. At the same time, RM is no longer a silver bullet, being blocked by protections; and Breach is blocked as usual. Now your protections protect you better while they are up, but they are easier to take down. So the incentive is to engage with the magic battle system instead of finding a way around it; and when you do engage it, it should hopefully be less frustrating. I think the result is simpler, and integrates the various parallel systems more seamlessly.

 

However, I think only needing 2 removals to make a mage vulnerable is probably too simple - especially given the innate advantage players have who can concentrate fire much more effectively than the AI. By changing Spell Trap to use opcode 200, it affords high-level mages a proper extra layer of protection, which I think they deserve. The actual Turning effect is meaningless; SCS isn't dumb enough to cast spells at it and neither is any sensible player. Its advantage over the Trap opcode is that it can't be used for infinite-spell exploits.

 

Alternatively, maybe reintroduce Spell Turning as a mid-level spell. (Easiest to simply take GOI's place.) This way you can get 3 layers of protection earlier, and high-level mages still get the benefit of massive amounts of AoE absorption. Making it work for the AI might be tricky, but then again maybe not. DavidW, can SCS still detect Spell Turning if SR is installed? Or does SR's exclusive reliance on Deflection mean you drop Turning/Trap recognition from your scripts?

Link to comment

 

 

The actual Turning effect is meaningless; SCS isn't dumb enough to cast spells at it and neither is any sensible player. Its advantage over the Trap opcode is that it can't be used for infinite-spell exploits.

 

This is exactly what will happen with Turning opcode. The only way to avoid it would be for AI to check for Turning, and if active, don't cast *anything* at it, apart spell protection removals. Better yet, don't cast anything remotely near to it.

In effect, one Turning active, whole party protected from AoE spells.

Or, AI doesn't detect it, kills itself with own spells.

Either way, no go.

 

You cannot differentiate Turning/Trap opcodes so it doesn't "block" AoE with NWN deflection. They're hardcoded to block single target spells, which is what NWN turns aoe spells into. I hope it's clear enough....

 

If you wanna avoid "stackability" of Deflection type spells, it's fairly straightforward with EEs anyhow - "remove effects from resource" does it iirc.

 

Edited by kreso
Link to comment

You cannot differentiate Turning/Trap opcodes so it doesn't "block" AoE with NWN deflection. They're hardcoded to block single target spells, which is what NWN turns aoe spells into. I hope it's clear enough....

Ah - this is what I was missing. Looking at the code more, I can see that now.

 

If you wanna avoid "stackability" of Deflection type spells, it's fairly straightforward with EEs anyhow - "remove effects from resource" does it iirc.

Opcode 321 would be a bit complicated in practice. Well, or it would mean you could cancel your high-level deflection by casting a lower-level deflection. Which would be fine as long as nobody ever does it. Anyway my method (which is not dependent on EE stuff) eliminates their stackability.

Link to comment

Hmm... why not just turn Spell Trap into a "Super GOI" that blocks all spells up to 9th level? It would naturally block AoE effects, as GOI already does. Would that be functionally any different from the current [99 levels of Deflection + NWN-style AoE blocking]? (Aside from the possibility of having 99 levels of protection burned through by AoE spells...)

Link to comment

Really? Even a very high power? (9?)

yes. It changes the very fundamentals of this spell. Try using this tweak on Ascesion finale if you don't believe me.

 

 

Hmm... why not just turn Spell Trap into a "Super GOI" that blocks all spells up to 9th level? It would naturally block AoE effects, as GOI already does. Would that be functionally any different from the current [99 levels of Deflection + NWN-style AoE blocking]? (Aside from the possibility of having 99 levels of protection burned through by AoE spells...)

You'd probably end up with the same thing - pretty much total magic invulnerability for as long the spell is in effect.

But....

If you don't use the opcodes used by GOI (immunity to spell level), you might have something interesting here to think about.

 

The thing is:

new EE patch finally fixed the long-standing spell shield opcode bug. (I might be wrong here, I don't have the latest patch but running through change-log I think it's fixed)

"Old" spell shield used a special opcode which was bugged in several ways; but what it was supposed to do was to block one single attack coded as "magical" (Secret Word, Spellstrike etc.) and then remove itself.

Part of the buginess was in the opcode itself, while the other part was in the fact that some attacks were wrongly coded as "magical" like some Dragon breath attacks and similar which Spell shield would protect you from.

I did test the opcode vs "offensive" type attacks few years ago, seemed to work as it should. Apart the sporadic bug which would prevent the protection from ever getting depleted, which made the opcode non-usable and made SR and SCS use a custom secondary type + splitting spell removals into 2 different spells.

Now, if this is all fixed---------------------------------------- :jump:

 

Just an example of what could be done:

- Spell Trap prevents x ammount of "offensive damage" type spells

- Chaotic commands prevents x ammount of "disabling"

- you name it...,maybe one could append the table with extra attack types as well for a full-blown gameplay overhaul....

 

What's great about it is that it would work automatically, even with mod-added spells, for as long as they have their secondary type correctly set.

Imagine a system where AI doesn't depend on detecting your protections like Chaotic Commands, but rather uses the spells Chaotic Commands is meant to stop to remove it from you. You could probably make it scale with levels (level 10; 2 disabling attacks blocked, level 15; 3 attacks etc. - similar to stoneskin blocking physical attacks). Hell, Mind Flayers would now be worth those 9k xp you get for killing them.

How AI would play along with this; I can't say. It would be far less reliant on Dispel/Breach, that's for sure.

Link to comment
On 10/13/2018 at 4:11 PM, kreso said:

 

On 10/12/2018 at 4:38 PM, subtledoctor said:

Really? Even a very high power? (9?)

yes. It changes the very fundamentals of this spell. Try using this tweak on Ascesion finale if you don't believe me.

I've literally never played the Ascencion final battle. Always seemed too much like a Tactics-style setup, being near to impossible until you "solve" the scenario. Frankly I've only played the vanilla TOB ending a handful of times... usually BG fatigue sets in pretty soon after the end of SoA. What passes for epic-level adventuring in these games has never appealed to me.

 

Which is to say, I have no clue what might be affected by a RM spell with power=9...

 

On 10/13/2018 at 4:11 PM, kreso said:

But....

If you don't use the opcodes used by GOI (immunity to spell level), you might have something interesting here to think about.

 

The thing is:

new EE patch finally fixed the long-standing spell shield opcode bug. (I might be wrong here, I don't have the latest patch but running through change-log I think it's fixed)

"Old" spell shield used a special opcode which was bugged in several ways; but what it was supposed to do was to block one single attack coded as "magical" (Secret Word, Spellstrike etc.) and then remove itself.

Part of the buginess was in the opcode itself, while the other part was in the fact that some attacks were wrongly coded as "magical" like some Dragon breath attacks and similar which Spell shield would protect you from.

I did test the opcode vs "offensive" type attacks few years ago, seemed to work as it should. Apart the sporadic bug which would prevent the protection from ever getting depleted, which made the opcode non-usable and made SR and SCS use a custom secondary type + splitting spell removals into 2 different spells.

Now, if this is all fixed---------------------------------------- :jump:

 

Just an example of what could be done:

- Spell Trap prevents x ammount of "offensive damage" type spells

- Chaotic commands prevents x ammount of "disabling"

- you name it...,maybe one could append the table with extra attack types as well for a full-blown gameplay overhaul....

 

What's great about it is that it would work automatically, even with mod-added spells, for as long as they have their secondary type correctly set.

Imagine a system where AI doesn't depend on detecting your protections like Chaotic Commands, but rather uses the spells Chaotic Commands is meant to stop to remove it from you. You could probably make it scale with levels (level 10; 2 disabling attacks blocked, level 15; 3 attacks etc. - similar to stoneskin blocking physical attacks). Hell, Mind Flayers would now be worth those 9k xp you get for killing them.

How AI would play along with this; I can't say. It would be far less reliant on Dispel/Breach, that's for sure.

I have lost myself in your words but Boo thinks you are just ducky.

 

Are you saying that SR SS doesn't use the vanilla SS opcode? And that, if that opcode is fixed, then it could be used for other purposes - like sectype-specific spell absorption?

 

That sounds like the kind of thing I would do. If it's EE-only, maybe it woild be a good fit for Tome & Blood.

Edited by subtledoctor
Link to comment

Wait, wait - on the EEs at least, there's no need to give RM a power level. Thanks to the nifty new 2.5 patch behavior that cancels the whole spell when your deflections run out, I can add a 206 effect, or even better a 101 effect, to the Deflection spells.

 

Progress!

 

(I tell ya, I honestly don't know why people are anti-EE. It's like preferring TOB without ToBEx... EE is like ToBEx on steroids.)

Edited by subtledoctor
Link to comment

Basically there are three situations at the moment (grandiosely including my own alpha mod among them):

...

You missed one from your list: vanilla with SCS's slight tweaks. I suspect that's actually the system most people encounter: non-SCS AI isn't really sophisticated enough that the player needs to understand the spell-combat system, and on the basis of various reports I think only a minority of SCS players use SR.

 

SCS makes two tweaks. Firstly, antimagic attacks can penetrate improved invisibility; secondly, and much more importantly, breach is blocked by spell deflection/turning/trap and by SI:Abjuration (in other words: it gets its MAGICATTACK sectype removed).

 

For the record, I remain perfectly happy with that system, though of course I'm happy to try to be helpful with other systems too if they have wide support. (And of course that system has the advantage of being the one I was actually using when I coded and playtested the SCS 'Smarter Mages' system, whereas at least my support of other systems is mostly based on theory.)

Edited by DavidW
Link to comment

Yes - Deflection blocks Breach in SR.

From an average player's perspective, SCS alone is functionally close enough to SR that I would lump them together. The main thing both mods do is take away Breach as the silver bullet. The protection spells at 3rd, 5th, 6th (with SCS), 7th, and 9th levels are all separate stackable layers, and are in turn protected by SS. Here DM/RM becomes amazing - it bypasses everything. Further, I know SCS doesn't cheat but I'd call this borderline due to the mechanics of opcode 58. Players cannot ever hope to resist being dispelled by high-level enemy casters; and they cannot ever hope to dispel high-level enemy casters. RM is a silver bullet which is, de facto, available to the AI and unavailable to players. That's why Inquisitors and Carsomyr are so ridiculously overvalued by players: the former gives them a chance to dispel with caster-level parity; and the latter ignores the opcode's % chance system altogether and is the Colt 45 of dispelling: it works every time. (Which honestly I sort of consider a bug.)

The simple answer to that silver bullet, of course, is SI: Abjuration. It goes from being useful to being necessary. Which is why threads like this get started when players realize their SI:Abj. got taken away. But it seems to me this raises a question similar to the one about spell protections. What's the point of of opcode 200 (turning) or 259 (trap) if, when the game is played right, you'll never see them occur? SR just gets rid of them and boils the system down to how many layers of Deflection you have. Apply the same logic to SI:Abj. - if the only correct way to engage in wizard battles is to have SI:Abj. up, then why even bother with it? Just obviate it by having spell protections block RM. Especially in the context of SR (we are in the SR forum after all), which endeavors to eliminate the SI: spells, it seems like having Deflection block RM is the most expedient way to allow SI:Abj. a graceful exit.

 

As far as supporting other systems: like I say, the two extant systems are more or less, 1) vanilla, where you can pretty much ignore it; and 2) SR/SCS, where rendering mages vulnerable to anything is a long and involved process. I think it might be worth a 3rd option for players who like the idea of mage duels, but want something a bit less involved than SR/SCS. Drop the layers of protection from 6 to 3, and nerf silver bullets that allow an end-run around the system. (Speaking of nerfing, how do you like this: if I give spell protections opcode 101 protection against dispel instead of giving RM a power level, the spell deflections will protect against Carsomyr! :devlook: )

SCS makes two tweaks. Firstly, antimagic attacks can penetrate improved invisibility;

This is neither here nor there, but that bit always bothered me about SCS. Mostly because it's a misnomer: Improved Invisibility doesn't stop spells from penetrating; it stops the protected person being targeted by spells in the first place. In the context of the game, the difference is important. With SCS alone that tweak solves a problem, and the problem needs solving so fine. But SR solves the problem in an extremely elegant way: any spells can penetrate Improved Invisibility if you cast the "See Invisible" spell. With SR, in other words, it does what it says on the tin. (Even moreso with Tome & Blood.) So in that case the tweak becomes superfluous. It's not that big a deal - See Invisible is only a 2nd-level spell and I just retcon it such that the enemy wizard had cast it prior to the battle, or something. But if you're doing some custom scripts for SR in v32, you might want to actually have mages cast See Invisible or True Sight to play by the same rules. (Granted, of course, this is an extremely minor point - there is no tactical counter to See Invisible so it really is only a question of a 2nd-level spell slot.)

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