Jump to content

magic battles revision - how would SCS handle it?


subtledoctor

Recommended Posts

I'm toying with the idea of making some aspects of the BG2 'magic battle' system into innate abilities usable more-or-less at will. (Perhaps with a short cool-down period.)

 

Part 1 is defensive spells: every mage would have an innate ability to raise a Spell Deflection shield, which would block a small amount of spell levels (level/3 or so). The actual spell protections in spell form, memorized in place of other spells, would be more powerful. They would block more spell levels and would come in two variants: reflection (Spell Turning) and Absorption (various versions of Spell Trap).

 

Part 2 is attack spells. The first variant of this idea is to grant mages an innate ability that acts like Spell Thrust, Secret Word, Pierce Magic, Ray of Reversal, or Pierce Shield - depending on the caster's level.

 

The 2nd variant is: the innate ability will simply be a targetable spell with no effect, which acts as a spell of a different level depending on the caster's level (caster level/2).

 

So if you have a Minor Spell turning up that blocks 4 levels, and I'm 6th level so my attack acts as a 3rd level spell, I would have to use it against you twice to burn away your defense, and then cast a spell at you on round 3. Or I could just cast Secret Word once, and then cast a spell at you on round 2. If I was 10th level my innate attack would be a 5th-level spell, so it could burn away a Minor Spell Turning in one go.

 

The point here is that the magic battle system stays around, but this could ease the annoyance of figuring out how many memorization slots you need to fill with those spells. But while I think this would be awesome for the player, AI mages would not get the same benefit. Could SCS handle this kind of thing? Or could it be tweaked to do so?

Link to comment

. Could SCS handle this kind of thing? Or could it be tweaked to do so?

Messing with the way magic attack/defences work is probably not really an option with SCS. You can do other things relatively easy (changing spell school detection, damage type check (I once tweaked magic missile damage type to "missile" and Skull trap to "slashing", making changes for SCS to account for that (cast against Magic Damage, don't cast Skull Trap against stoneskin) took no more than 2 minutes of my time :) and similar.)

It's pretty customizable, now you can make your own library file for home use as well if it suits your fancy. The one thing I wouldn't touch is the spell protection system.

Link to comment

Sigh. There so many parts of these games that need improving, and when I come up with an improvement, I hear "you can't do that, it will screw up SCS!!" (*cough* PfMW) SCS is great and all but sometimes it seems like an impediment to other mods.

 

I would hope there is *some* way to do this. Saying one mustn't touch the magic battle system is not a good answer because the magic battle system sucks. Surely there is a way to improve it that won't break SCS.

 

Like, the '1st variant' of the innate spell attacks simply casts the same spells from a different button. So even if the SCS AI is casting from memorized spells, the player wouldn't know the difference if you balance things well.

 

For instance, if SCS checks to see what is memorized when deciding what to do, then we could replace some of the AI's magic attack spells with ones that are restored after a cooldown period. There - now the AI has innate magic attacks just like the player. I don't know. I'm trying to be creative to make some of the crappy parts of this game less crappy, but I'm not an expert in how SCS works so I could use some guidance on how to design improvements that comport with (or at least don't break) the SCS AI.

Link to comment

Sigh. There so many parts of these games that need improving, and when I come up with an improvement, I hear "you can't do that, it will screw up SCS!!"

The thing is, w/o "some" AI boost, BG2 is actually in a pretty poor state imo.

 

 

For instance, if SCS checks to see what is memorized when deciding what to do, then we could replace some of the AI's magic attack spells with ones that are restored after a cooldown period.

This is doable I think. You'd have to make some kind of patching magic which:

a) searches for all hostile mages in game (there's a list in SCS already I think)

b) add the opcode used for spell restoration on them with the set timer ("Wonderus recall" I think or similar). I don't really know if this could be made so that it always recalls a specific spell.

c) patch spell removals or whatever you want to be unlimited with it

 

It should, ofc, go after SCS. I don't know how AI would behave with it.

Link to comment

I think it would be easier than that. You could simply COPY_EXISTING all .cre files, and use ALTER_EFFECT to change any memorized instances of, say, Secret Word, to a memorized instance of a new and improved Secret Word.

 

The new Secret Word spell would simply have an extra effect, causing itself to be re-memorized after some time (maybe 12-18 seconds). So enemy mages, just operating with the normal SCS scripts, would find themselves able to cast it without limitation. PCs would be different - a repeatable innate ability instead of a repeatable memorized spell. But functionally, the difference would be unnoticeable.

 

And something similar could be done with protections, patching them with a repeatable low-level Spell Deflection. I *think* that should work.

 

Ah! See, this is good, discussion leads to progress!

Link to comment

It would work, yes.

 

What I would like to see in SCS is usage of mod-added spells. It's not too difficult, but it's not very easy anyway. It'll require re-writing several .tpa files and some SSL scripts, besides editing some tables a bit, and adding new more-specific triggers for the spells (only if they need that).

 

Edit: also, the item-finding algorithm needs to recognize immunity to msectype and more stuff like that.

Link to comment

Nice. So if it looks old this could work, then it's worth spending some time doing it. (Though I also need to make sure it will work well with the new version of Spell Revisions.)

 

That said, does anyone have particular thoughts on implementation? E.g.,

 

1) Cooldown periods. I think it's probably actually okay to be able to cast a spell attack at will. Doing so prevents you from casting another, more beneficial spell, giving the opposing mage a 1-round advantage. With wizards, that 1 round can make all the difference in a battle.

 

But what about defenses, raising a shield every round could lead to a stalemate. I'm thinking it should be once every ~5-10 rounds. It should be there as a backup ability if your superior memorized shield falls, but you shouldn't be able to spam it. It should be available once, maybe twice, per battle.

 

2) Power. How strong should the innate shields be? My thought is something like this: they would block level/3 spell levels for generalists and Abjurers, and block level/4 spell levels for other specialists.

 

3) The memorizable spell protections would need to be buffed. (Minor) Spell Deflection would become (Minor) Spell Absorption... but should the number of spell levels they block be raised? (Slightly?)

Link to comment

Hmm, this would still be complicated. Here's a much easier alternative: simply make all spell attacks able to be cast repeatedly, full stop. No innates for PCs, just this: edit the .spl files to be repeatable, so if you decide to devote one of your spell slots to Pierce Magic, you can cast Pierce Magic as much as you want (perhaps with a cooldown? Thoughts?)

 

On the defense side, just turn Minor Spell Deflection into a 1st level spell, re-castable with a cooldown, and nerf it to block (level/5) spell levels. Then turn Spell Deflection at 6th level into Spell Absorption (or, Minor Spell Trap).

 

So just changing about 8 files, you get a rough approximation of my idea, and SCS should be able to handle it perfectly.

Link to comment

Make them use the Remove ability opcode and then the Give ability opcode with a delayed/permanent (so it takes X time to the ability to be ready to be used).

 

My thoughts one balancing:

- innate shields: what about 1 soaking one spell level like Spell Trap but one more every 5 levels of the caster (4 for generalists and abjurers). The perfect cooldown would be 1 round/lvl, and make the duration something like that too... Maybe give the cooldown 5 rounds after the last casting expired? But I dunno what that would do if it gets dispelled...

 

- Minor Spell Trap sounds cool.

 

- I don't think anything that isn't an innate should be repeatable... Imagine being able to cast lots of Dragon's breath or Comet without having to rest... No way sir, that is something I don't like (unless it's for Sorcs).

 

Also, I think this type of abilities are more suitable for Sorcerers than for mages... I mean, mages are the ones that study and memorize spells, while it seems cool that Sorcerers would be able to have some innate magic abilities to play around with than mages.

Link to comment

Make them use the Remove ability opcode and then the Give ability opcode with a delayed/permanent (so it takes X time to the ability to be ready to be used).

Precisely. My mod already has powers that do it, it would be super simple to adapt the technique to this application. I've only tried it on innate abilities, not memorized spells, so I need to confirm whether it will work.

 

- I don't think anything that isn't an innate should be repeatable... Imagine being able to cast lots of Dragon's breath or Comet without having to rest... No way sir, that is something I don't like (unless it's for Sorcs).

Well, I agree, and my original idea was to use innate abilities - a *skill* you learn as a mage, instead of a spell. But repeatable innates are what run afoul of SCS. Making repeatable *spells* is certainly weird, but at least the AI would seamlessly be able to use it without any adjustments. And balance-wise, it's actually in the middle, since you would have to give up a spell slot to keep yang this repeatable ability. If they were innates, you could use that slot for an extra Fireball or Improved Haste, etc.

 

And it would involve tactical decisions and trade-offs: at ~14th level, do you want to devote one of your precious 7th-level slots to Ray of Reversal to bring down any spell protection? Or do you get by with Secret Word, memorizing a different 7th-level spell but running the risk that you encounter a mage with protections you can't bring down? Player choice is good.

 

It wouldn't be ideal; but the real question is, would it be better than vanilla?

 

EDIT: hmm, how does SCS handle item abilities? If I put a Wand of Spell Striking into the hands of an SCS mage, would they use it intelligently? Because another option, instead of innate abilities, is to use an invisible item with item abilities.

Link to comment

 

EDIT: hmm, how does SCS handle item abilities? If I put a Wand of Spell Striking into the hands of an SCS mage, would they use it intelligently? Because another option, instead of innate abilities, is to use an invisible item with item abilities.

 

Depends on the wand; but I doubt mages use Spell Striking wand.

Link to comment

Okay well, back to the drawing board. I hoped it would be as easy as just using opcode 171 and referencing a spell instead of an ability, but it doesn't work. I can try to "Wondrous Recall" opcode but I don't think you can specify spells with it.

 

How does SCS check for available spells? What if I just whole-hog switch SPWI318 to be innate instead of a spell? I checked a .CRE file in Near Infinity, and innates show up among the "known spells" but not among the "memorized spells." Would SCS mages use an innate ability, if it has the same filename as the spell? Or would they ignore it because it isn't one of their "memorized spells?"

Link to comment

And it would involve tactical decisions and trade-offs: at ~14th level, do you want to devote one of your precious 7th-level slots to Ray of Reversal to bring down any spell protection? Or do you get by with Secret Word, memorizing a different 7th-level spell but running the risk that you encounter a mage with protections you can't bring down? Player choice is good.

I never know which spells I should pick for levels 7 and 6. The direct-damage spells on those levels suck, there aren't many good disabling spells and you don't memorize as much Project Images as you can (at least I don't).

Okay well, back to the drawing board. I hoped it would be as easy as just using opcode 171 and referencing a spell instead of an ability, but it doesn't work. I can try to "Wondrous Recall" opcode but I don't think you can specify spells with it.

 

How does SCS check for available spells? What if I just whole-hog switch SPWI318 to be innate instead of a spell? I checked a .CRE file in Near Infinity, and innates show up among the "known spells" but not among the "memorized spells." Would SCS mages use an innate ability, if it has the same filename as the spell? Or would they ignore it because it isn't one of their "memorized spells?"

SCS checks with HaveSpell(S:SPELL.IDS*). I dunno if there's a RES version of HaveSpell. It doesn't work for Innate spells which don't have their level set to 1.

 

Wondrous Recall gives back 2 spells from levels < 6 only and they're selected randomly I think. Youll be better off checking the IESDP.

Link to comment

iiSpellSystemAdjustments works on system where spells recharge after a certain time, but it too uses the Restore Lost Spells opcode (261). So it doesn't restore particular spells, the first expended spell of the appropriate level. And it works on the entire set arcane and/or divine spells (except Identify, IIRC).

 

http://www.shsforums.net/topic/49924-iispellsystemadjustments/

 

EDIT:

 

Yes, there is a HaveSpellRES:

 

http://gibberlings3.net/iesdp/scripting/triggers/bgeetriggers.htm:

 

0x4031 HaveSpellRES(S:Spell*)

ToB only. Returns true if the active CRE has the specified (by the string parameter) spell memorised.
Link to comment

What's the difference between HaveSpell and HaveSpellRES? I know nothing about scripting. (That's why I know nothing about SCS, and need to come here and ask for nice people to tell me how it works.)

 

So, there doesn't seem to be a reliable way to make memorized spells repeatable. (Apart from scripting :p )

 

And, it sounds like SCS uses HaveSpell to detect which abiltites are available for its mages. And HaveSpell can detect (known? memorized? is there much of a difference in the context of innates?) innate abilities. But the scripts, as regards magic battles, are going to look for the normal attack and protection spells in SPELL.IDS. So creating new powers is a no-go.

 

And innate abilites that are any level other than 1 will cause crashes when checked with HaveSpell.

 

So, one step at a time. On the defense side, we could simply change Minor Spell Deflection. Keep its filename as SPWI318.SPL, and keep it the same in SPELL.IDS... but make it an innate ability, level 1. Make it repeatable with Remove Ability/Give Innate Ability global effects. Very weak - have it block 2 spell levels. And give it to all wizards via CLAB. Voila - we now have, basically, a spell protection cantrip! And SCS should detect and use it appropriately. A good start!

 

Spell attacks are a tougher nut to crack. You could just take the basic three - Spell Thrust, Secret Word, Ruby Ray - and make them innates that are gained at different levels. But you would have to change them to level 1. Would that mean they wouldn't work against rakshasas, liches, etc.? Plus you would lose them as spells.

 

What about a more limited tack: just use Spell Thrust. It's a pretty useless spell anyway - seriously, how many people actually keep that memorized? You could convert it to a level 1 innate, and maybe (unlike Minor Deflection) have it grow in power over time. It could dispel protections of level (caster level / 3), maxing out at 8 (it would never dispel a Spell Trap, you would need a specialized, memorized, spell for that).

 

So maybe we can convert the spells in a non-game-breaking way, and any AI mages that have them will be able to detect and use them properly... but how many AI mages have Minor Spell Deflection or Spell Thrust? Not many I bet. Powerful mages probably just skip right over those spells. So just as players would get it via CLAB, at install time we would want to do a COPY_EXISTING_ REGEXP to find all .CRE files that have the higher level protections and attacks memorized, and ADD_CRE_EFFECT these innates to their .CRE.

 

Right? Am I missing anything?

 

I'll get working on it this weekend.

 

(EDIT: to get around the level-1-ability-not-affecting-rakshasa issue, could make it a level 1 innate ability that uses opcode 146 to cast a higher-level spell? So at high levels, maybe the level 1 Spell Thrust ability could cast a level 7 Ruby Ray?)

Link to comment

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...