Jump to content

Detecting/guessing spells & reacting to them as they're being cast


Recommended Posts

I'm asking these questions here as I couldn't find the answers I wanted in SCS documentation on my own.

1. Is it possible for SCS AI to detect the exact arcane/divine spell being cast by a PC/creature in that round and do something with this information before that particular spell is finished?

2. Alternatively, can SCS AI detect the school of the arcane/divine spell being cast, try to guess the spell's identity based on that information and react appropriately?

3. What about several spells of different schools being cast simultaneously or nearly so by a group of actors?

Basically, I want enemy casters and smart/wise (or otherwise attuned to/experienced with magic) non-casters to anticipate a particular spell or a range of spells in that round when they see/hear/sense telepathically a spell being cast in their vicinity. Why? Because I (almost always) can see a school-specific casting animation and can hear a school-specific casting sound effect play out before me. This restricts the range of threats I need to watch out for in that round. When I see the white casting animation (Divination), I can be certain the spell being cast is not Abi-Dalzim's Horrid Wilting and I don't need to order my party to scatter ASAP as a precaution.

I'm aware that many/some spells in vanilla, SCS and Spell Revisions have more than 1 school assigned to them, but as far as I know each individual spell has only 1 school-specific casting animation & casting sound assigned to it. Enemies (casters, at least) could possibly take advantage of this knowledge and a full party of PC casters (6 chars in vanilla & 10 chars with GemRB) would have a somewhat harder time drowning them in a swirling sea of spells.

Maybe SCS scripts already perform something like this and I just don't know it...
-----

Edited by Istfemer
changed the topic's title
Link to comment
2 hours ago, Jarno Mikkola said:

Nope. But they can detect every effect you have on.

Which is fantastic, yes. However, even if they can & have done so, it's all post hoc detection. My enemies failed to notice the schools of spells my party had been casting earlier in that round & guess the most likely spells I had tried to use against them in their & my particular circumstances. They lost precious seconds that could've been better spent. I don't know whether SCS has something like 'hostile spell prediction trees'. I suppose it doesn't, but only DavidW can answer that.

Of course if a spell's casting time is short enough (say, 1, 2 or 3) then even if my enemies detect its school in time, it is likely they won't be able to act on their knowledge before my mage finishes casting that spell. Some or even most of the time. And that's perfectly fine. However, if a spell's casting time is sufficiently long, I think my smarter enemies should be able to detect its school properly, restrict in their head that spell to a sufficiently small list of probable picks & react adequately based on that info. e.g. Adjust their plans for their next round's spell & try to squeeze that one into the current round OR interrupt my mage's spell with fast damaging/disabling spells if they believe my mage is casting something *really* hideous OR set up emergency defenses of their own OR use escape items/innates OR try to melee rush my mage OR fall back & switch to ranged combat at safe distance OR do an in-depth tactical retreat).

2 hours ago, Jarno Mikkola said:

So the delay is just 6 seconds at most. And usually, casting instant Time Stop is more beneficial that say Dispel spells.

Not sure I'm following you very well, Jarno. How do the instant version of Time Stop & Dispel effects figure into this discussion? As potential responses enemy casters could make?

Time Stop/Limited Wish/Wish spells aren't in inexhaustible supply for most enemies. Besides, I'm more interested in raising combat intelligence of the low-to-mid level spellcasters & non-spellcasters (especially those from BG1 & early/mid SoA) than combat intelligence of the multi-9th/7th level spell & multi-HLA wielding Ubercaster crowd.

*In this way*, at least.

Edited by Istfemer
added a coda
Link to comment

Obviously, the farther my (hypothetical) party of 6 to 10 casters gets into the game(s) & the higher the levels its members attain, the harder it would be for enemies to predict-on-the-fly the spells my party might use against them.

So, in case SCS doesn't presently have this feature, how feasible would it be for enemies to gain such abilities? Would it be a genuinely good idea? Would it make enemies behave smarter & make them more challenging in a fight? How difficult would it be to introduce this functionality into SCS? Can it be done with the assistance of Tobex or perhaps EEex? Or is GemRB the only thing that can potentially offer a solution here?

Link to comment
20 minutes ago, Istfemer said:

So, in case SCS doesn't presently have this feature, how feasible would it be for enemies to gain such abilities? Would it be a genuinely good idea? W..

1

Well, considering the reason why the opposition is in the game... it would be kinda hard to implement this. I'll come back to the above point later, but I'll first define why the opposition is in the game. They are there to either provide a sufficient challenge for the player to overcome, or be there to block their advance in case they don't have the sufficient muster to get at it.

Now, you said: "party of 6 to 10 casters"... you are playing the game wrong... it's intended to have about 3 casters and 3 near/far-fighters... not 6 casters, definitely not. This will show up in your game timer, where you spend most of your in-game hours sleeping and not actually adventuring. And that's kinda hard to do in BG1 where you are supposed to get attacked nearly at every rest, except in taverns. And will get re-attacked in the same area if you rest as the random monsters get resummoned.

Now, when you said the enemy has limited supply of spells... that's supposed to be far more than the player does. And Limited Wish kinda looses the "Limited" part with multiple casters. Now yes, the Time Stop is a 9th level spell... but there are similar spells earlier in the spell-tree that applies well to the exact role assigned here. There's Contingency and (Minor) Spell Sequencer that are instant for the opposition if you install the component that allows that in SCS. And yes, if the opponent wished, they could use them all in one go. Why they don't do this is cause the player can't, but the enemy can.

"My enemies failed to notice the schools of spells my party had been casting earlier in that round & guess the most likely spells I had tried to use against them in their & my particular circumstances. They lost precious seconds that could've been better spent." Yeah, what would you use your time for then ? Not the biggest over all damaging effect the enemy is not immune to ? But to Dispel the Armor spell the strongest opponent has to disapprove the 6 caster tactic. 😝 Yes, tht effect could be Time Stop, it could be summon or anything .. but also say Fireball.

Link to comment

There’s no great difficulty in letting the AI detect that a spell is being cast, but as for doing something clever with that information... let’s just say you might be overestimating what the IE scripting system is capable of. 

Link to comment
3 minutes ago, subtledoctor said:

A far simpler solution would be to set all spells to use the same casting sound and animation, thus removing your advantage...

Well, that's a radical approach... or you could just not look at the color of the enemy animation/listen to the sounds, after all the zoom out blurs it quite enough and the heavy metal is far better with explosions on the screen with dead goblins, even if those were your goblins.

 

1 hour ago, DavidW said:

...let’s just say you might be overestimating what the IE scripting system is capable of. 

 

I am not convinced by your argument, but let me argue for you. Or am I against you and wrong, you can determine yourself.

See, the game is set up with monsters being reactive against the player with a predictable manner. Some are fighters with no magic, while others are magic users with a set of abilities, which are not endless. ... there are no anti-magic users in the game, just other mages that are usually more powerful than the player character, they might have way too many hitpoints and have better abilities like Dispel spells that work better cause they are at higher base level...

There are guards and the Cowled Wizards ... but there are no strait anti-magic balls on city streets that will dispel/remove and erase magic effects as soon as they detect them. Something like this:

Archon.gif

Now, the trick of how those would work is, that they themselves wouldn't exactly do a thing, if the player didn't, but as soon as the player casts spells, they could cast things, all the while not being hostile to the player, being a street lamp -kinda. Their scripts being full of ReallyForceSpell(O:Target,I:Spell*Spell) -actions. And no walking. Yes, that's an archon from SC2.

Link to comment
6 hours ago, Jarno Mikkola said:

Well, considering the reason why the opposition is in the game... it would be kinda hard to implement this. I'll come back to the above point later, but I'll first define why the opposition is in the game. They are there to either provide a sufficient challenge for the player to overcome, or be there to block their advance in case they don't have the sufficient muster to get at it.

Now, you said: "party of 6 to 10 casters"... you are playing the game wrong... it's intended to have about 3 casters and 3 near/far-fighters... not 6 casters, definitely not. This will show up in your game timer, where you spend most of your in-game hours sleeping and not actually adventuring. And that's kinda hard to do in BG1 where you are supposed to get attacked nearly at every rest, except in taverns. And will get re-attacked in the same area if you rest as the random monsters get resummoned.

Now, when you said the enemy has limited supply of spells... that's supposed to be far more than the player does. And Limited Wish kinda looses the "Limited" part with multiple casters. Now yes, the Time Stop is a 9th level spell... but there are similar spells earlier in the spell-tree that applies well to the exact role assigned here. There's Contingency and (Minor) Spell Sequencer that are instant for the opposition if you install the component that allows that in SCS. And yes, if the opponent wished, they could use them all in one go. Why they don't do this is cause the player can't, but the enemy can.

"My enemies failed to notice the schools of spells my party had been casting earlier in that round & guess the most likely spells I had tried to use against them in their & my particular circumstances. They lost precious seconds that could've been better spent." Yeah, what would you use your time for then ? Not the biggest over all damaging effect the enemy is not immune to ? But to Dispel the Armor spell the strongest opponent has to disapprove the 6 caster tactic. 😝 Yes, tht effect could be Time Stop, it could be summon or anything .. but also say Fireball.

1. From a gameplay point they are; from a narrative point they aren't. And if it would be hard to implement these abilities, it would be not for the reasons you stated. Change my mind if you disagree.

2. 'not 6 casters, definitely not.'
WHY not? Why having 6 casters in my party (whether arcane or divine, pure or multi) should inevitably break the game for me? I understand why having 10 in a party may break it, but 6? I can also understand why having 6 dual-classed casters is bound to break it, as the very concept of dual classing in BG games is badly broken and has been broken for more than 20 years. I'm not aware that EEs changed any of that. Also, I don't like to rest until completely healed. I prefer adventuring instead. BG games are too lenient on consecutive rests for me. Am I playing the game wrong? Hardly so.

3. Yes, it's supposed to be far more. No argument here. Funny that you should mention sequencers & contingencies, as I'd prefer Limited Wish & Wish to work in a somewhat similar manner, kinda like the vanilla sequencers & contingencies did. Like this:

Make LW & W belong to the Universal school. You memorize LW/W then cast it or you use a scroll. No djinni appears, but you gain a *pre-spent* innate with the same name (modify the spell to display an icon with a charge counter pre-set to 0). You'll have to rest first to actually gain LW/W as an innate. When you do that, you'll be able to summon a wish-granting djinni normally. Your innate will then disappear. If you re-cast the spell now, you'll simply re-gain your pre-spent innate & thus waste your spell slot/scroll. This method partially blocks the 'Wish>RegainSpellsWithoutResting>Wish' exploit. I think letting the whole party regain spells in this manner is giving them way too much power. Letting only the caster do it would be enough. I don't know if SCS mages make use of this exploit though.

BTW, I happen to like 'Multiple sequencers/contingencies for enemy mages' or whatever its proper name is. I'm totally okay with that approach. Enemies' LWs/Ws could use the same treatment. Some high-level enemy mages could even be given several uses of Limited Wish/Wish per day.

4. 'Yeah, what would you use your time for then?'

Suppose I'm leading a squad of battle-hardened fighters & assassins against a particularly rude adventuring party that dared to break into our cozy compound. I'd be able to see then that that particular enemy wizard (Conjurer?) over there, yes, the one in red robe and with a weird accent is beginning to cast a *necromantic* spell. He may be casting a damaging spell or not; at us or not. Being a fighter/mage by profession & based on my extensive knowledge of battling casters, I'd be able to guess that the spell he's casting is very likely to be revealed as 'Skull Trap' or 'Abi-Dalzim's Horrid Wilting' when it goes off and is totally not going to be revealed as 'Flame Arrow' or 'Rabbit Horde' or some other dandy *conjuration* spell. I'm sure I'd appreciate this kind of battlefield intel and be able to think of appropriate response -- like taking sensible precautions & ordering my squad to rapidly scatter in organized manner, to regroup later just as rapidly in another spot on the battlefield. It might turn out to be *not* ST or ADHW but another necromantic spell, like Animate Dead. It's up to me to take the risk or not. I choose to play it safe this round. *I* know my fighters' & assassins' skills. They can take down a Skeletal Warrior or even 2-3 of them. Yes, they might be forced to waste a round running back to SW's summoning point and engaging it, and the Red Wizard will undoubtedly respond with something equally nasty afterwards. I understand that. I also understand that my underlings stand no chance as a fighting squad against a direct hit by a very probable ST or ADHW. Getting mass casualties (even without any deaths) from either would compromise if not cripple their fighting ability that even large quantities of healing potions would likely not be able to restore in time. Moreover, getting badly bruised in the opening stages of our battle would only bode ill for the battle's ultimate outcome. (from my point of view)

Edited by Istfemer
clarified a few points
Link to comment
52 minutes ago, Istfemer said:

2. 'not 6 casters, definitely not.'
WHY not? Why having 6 casters in my party (whether arcane or divine, pure or multi) should inevitably break the game for me? I understand why having 10 in a party may break it, but 6? I can also understand why having 6 dual-classed casters is bound to break it, as the very concept of dual classing in BG games is badly broken and has been broken for more than 20 years. I'm not aware that EEs changed any of that. Also, I don't like to rest until completely healed. I prefer adventuring instead. BG games are too lenient on consecutive rests for me. Am I playing the game wrong? Hardly so.

1

Well, have you actually played the BG1 ? Where did you find these 5 other casters ? And how did you travel to them, without getting yourself killed far before that ?

Now yes, you can get Jaheira quite easily, but you can't keep her(as she has a non-magic user companion), Branwen is a bit harder, as you need the gold. The drow biach is behind a HARD fight with plate armored fist dude. Xan needs to get to the mine to get, with goblins, the bane of magic users. Dynaheir you can't keep either. Yes, Xzar is easy to get to... he is not that good, and you shouldn't be able to keep him either. Garrick is easy to get to... but he again has a hard fight to face before you get to keep him. ... Not looking good for this approach. There's Edwin yes...

Yes, I am aware that you can single/multiplayer cheat to get to 6 party members... but that's a boring CHEAT. Or use Level 1 NPCs NPC components... but you still run into too few hit point and no good armor -ringer.

Link to comment
52 minutes ago, Jarno Mikkola said:

Where did you find these 5 other casters ?

 

Xzar, Imoen dualed, Garrick, Jaheira, and Edwin/Branwen even before you hit the Nashkel Mines. Sub out Jaheira for Xan at the bottom of the mines/Dynaheir at the Stronghold if you insist upon five arcane casters.

Link to comment
2 hours ago, DavidW said:

There’s no great difficulty in letting the AI detect that a spell is being cast, but as for doing something clever with that information... let’s just say you might be overestimating what the IE scripting system is capable of.

I very well might be. I'm not as familiar with it as I'd like to be. I'm curious to know just how much I am overestimating here.

1 hour ago, subtledoctor said:

A far simpler solution would be to set all spells to use the same casting sound and animation, thus removing your advantage...

Simpler? Yes. Simpler does not necessarily mean better. I have this advantage as a player and I'm convinced that the AI should have it as well. Having it as a *mutual* advantage/disadvantage would make for a better, more tactical game in my opinion. Setting every spell to use the same casting sound and animation would make the game look less colorful and sound more monotonous.

Now, disabling some casting animations (just those displayed during a spell's "charging up" phase) for improved-invisible/sanctuaried casters is an interesting approach. Same goes for disabling casting sounds for casters affected by silencing spells AND/OR Vocalize. In the latter case Silence does this by default. I don't quite remember how Vocalize deals with various 'shut up' effects. Vocalize appears to only override opcode 0x26 (State: Silence) with opcode 0x30 (Cure: Silence), so it looks like we require a separate opcode that would only block the casting sounds and nothing more. Were these tweaks actually implemented as a "simpler solution", Improved Invisibility/Sanctuary + Vocalize (+ SI:Divination/SR's Non-Detection) combo would only gain in value for enemy casters. It would give most of them a special advantage of surprise in spell combat that they never had before, and thus make life harder for player's casters.

Link to comment
47 minutes ago, CamDawg said:

Xzar, Imoen dualed, Garrick, Jaheira, and Edwin/Branwen even before you hit the Nashkel Mines. Sub out Jaheira for Xan at the bottom of the mines/Dynaheir at the Stronghold if you insist upon five arcane casters.

But did Khalid, Montaron and Minsc get to be their stone statuettes before the mine. Imoen dualed ... yeah... at level 2, not so good thief she is, got Xzar killed on the exit out of the mine and all that, cause she couldn't see the darn traps, and she put everypoint she got to it.

I would rather see "Heavy" as the leader, and B, A, N, D and . as the 6 bard party.

46 minutes ago, Istfemer said:

Same goes for disabling casting sounds for casters affected by silencing spells AND/OR Vocalize. In the latter case Silence does this by default. I don't quite remember how Vocalize deals with various 'shut up' effects.

2

These effects are reverse ones, so if you do this, they get their VOCALS BACK. As you can't cast without vocals. Which is by-the-by the same effect that reverses the invisibility during casting. 

Edited by Jarno Mikkola
Link to comment
1 hour ago, Jarno Mikkola said:

Well, have you actually played the BG1 ? Where did you find these 5 other casters ? And how did you travel to them, without getting yourself killed far before that ?

Now yes, you can get Jaheira quite easily, but you can't keep her(as she has a non-magic user companion), Branwen is a bit harder, as you need the gold. The drow biach is behind a HARD fight with plate armored fist dude. Xan needs to get to the mine to get, with goblins, the bane of magic users. Dynaheir you can't keep either. Yes, Xzar is easy to get to... he is not that good, and you shouldn't be able to keep him either. Garrick is easy to get to... but he again has a hard fight to face before you get to keep him. ... Not looking good for this approach. There's Edwin yes...

Yes, I am aware that you can single/multiplayer cheat to get to 6 party members... but that's a boring CHEAT. Or use Level 1 NPCs NPC components... but you still run into too few hit point and no good armor -ringer.

I have. Original Saga edition with Baldurdash fixes (BG1FixPack v1.1 & BG1TOSCGameTextUpdate v1.1 by Kevin Dorner), 16 replacement .mus files and nothing else. 10 or so years ago I made a (nearly) complete playthrough with that configuration. Since then there have been several brief excursions into several select BG1/TotSC areas. Nothing major. Why? What does it have to do with this topic? I'm seriously not getting what you're getting at. :laugh2:

Link to comment

Jarno: it's not that you couldn't have blocks that reacted to PC casting, it's that (in my judgement, which is fallible but based on quite a lot of scripting experience) the combinatorics to have spellcasters do it intelligently, and avoid doing it in situations where it's obviously silly, are prohibitively long and cumbersome. 

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