Jump to content

spellcaster AI assessment so far


Recommended Posts

People playtesting: I'd be interested to know how well the enemy AI seems to be working.


Obviously adding HLAs and the like is bound to make a big difference, but I'm more interested in how spellcasters are using the abilities they already get: are they targetting spells right? Do they use their antimagic attacks sensibly? Do their sequencers / triggers work usefully? that sort of thing.

Link to comment
are they targetting spells right? Do they use their antimagic attacks sensibly? Do their sequencers / triggers work usefully?


In my experience so far, yes to at least two out of three.


The sequencers and contigencies are definitely firing, and I'm seeing a variety of protection spells with them.


As far as the targetting goes that's a bit harder for me to assess. I keep my most vulnerable NPCs, Yoshi and Edwin, back from the fray. I also tie up the spellcaster with my tanks, keeping the most vulnerable party members out of their perception range. Most of the time anyway. And this usually works.


How do you have the targetting generally set up? What should we be looking for?

Link to comment

I've not played too much for RL problems but i think Spellcaster Ai is working fine and are surely the finest i've seen that don't use cheats (Improved Anvil, Tactics,...).


I've only encountered a few till now so i'll let you know more as soon as i can.


One note: some of them like Ellesmine clone or a duergar mage at second floor of the first dungeon do fight well but seems to walk a little at random here and there...

Link to comment

lol, the spellcaster AI is pretty vicious (and I also think it superior to Improved Anvil - primarily because it seems to be more diverse. In IA you know almost all the mages will cast SI: Abjuration in combo with loads of spell/melee protections, so every time you go into battle you memorise lots of Ruby Ray of Reversal spells. With SCSII, you are not sure what they will cast - and I think this unpredictability makes it harder). The most difficult battles I've had so far have tended to be ones where several mages are grouped together - eg. the 3 yuan-ti mages in Mekrath's lair. Might have been easier if I had Keldorn, but with my current party, it is pretty hard work. Part of the difficulty is the fact that they keep moving around (just stay put while I hack through your stoneskins, dammit!)


Targetting: mostly fine, I've mentioned the case about Viconia being targeted by Acid Arrow but that was pretty much the only really poor decision I've seen spellcasters make. Not so much a targeting thing, but I've had some enemy priests cast Unholy Blight on my all evil party, which was a bit of a waste (actually, it might have been the spirit trolls rather than priests, can't quite recall).


Antimagic: yes, I've had Edwin running around naked after he has had his spell/stoneskin protections stripped so these seem to be working. I have Haer'dalis now so it will be interesting to see how enemies choose between them in terms of using antimagic.


Sequencers, triggers: yes, working fine. Multiple magic missiles/acid arrows have killed off one of my party members on lower health a few times.


One irritation is the "refreshing" of spell buffs when I go out of sight. eg. with the aforementioned yuan-ti, every time I ran off and came back, their buffs were renewed. Admittedly, it is debatable as to whether running away is cheese or not - but personally I'd prefer the refreshing to occur if I leave the area, not just lose sight of them.

Link to comment

@Lemernis: I'm looking for two things, really:


1) do they waste spells on people who are protected from them? (e.g. the Acid Arrow at Viconia thing that Coaster mentioned)

2) do they seem to choose sensible targets (out of the ones visible to them, anyway)? e.g., charm magic at warrior-types, magic missiles at people with low hit points remaining.


More generally, how often do you find yourself thinking "that was a dumb choice, you'd have done much better to cast that spell on her rather than him"? (It's bound to happen sometimes - a 15,000 line computer game script does not a human brain make - but I'd like to minimise it).


@Demivrgvs: the running around is intentional (for the reasons Coaster mentions).


@Coaster: the variety is actually partly there for the purposes of making the game more fun. (I played Tactics last time I played through BG2 and got quite bored of the same old Chain Lightning/Chaos/Remove Magic combo). But I think you're probably also right that making things unpredictable also makes them harder.


I'm fairly sure it's the trolls who try Unholy Blight without doing an alignment check: I tend to assume they lack the combination of divination magic and basic smarts to work out whether it's going to work. I might set it up so they notice after the first time, though. (Ideally I'd do that sort of thing for mages too, but it just makes the script unmanageably long).


Enemies shouldn't be rebuffing as soon as you get out of sight; if they are, that's a bug. (I do think running away is cheese, personally, but I also think that you're welcome to play the game however you like.) They're supposed to rebuff 2000 seconds after the first time they buff. If that's not happening, something's wrong - I'll look into it.

Link to comment
Enemies shouldn't be rebuffing as soon as you get out of sight; if they are, that's a bug. (I do think running away is cheese, personally, but I also think that you're welcome to play the game however you like.) They're supposed to rebuff 2000 seconds after the first time they buff. If that's not happening, something's wrong - I'll look into it.


2000 seconds = 33 minutes, 20 seconds. Is that real time or game time (which is compressed)? If it's real time that'a a very long time.


In the battle with the lich that I described next to the temple ruins lava room, the lich rebuffed whenever the party reapproached. I had to go let him do that many times until the lich had used up all his chain contingencies. I guess at level 35 he's going to have a lot of them memorized!

Link to comment

I don't have too much to add to the above, except to repeat that in general the magic-using AI is pretty smart! and I do like the variety. I've had the occasional experience with spells being targeted less than brilliantly, but then, I do the same at times, so this is not unrealistic!


In one contest with a beholder the beholder tried to charm a character who was mind-protected, and also sent an anti-magic ray at someone who didn't have any buffs, but he was unleashing a vast number of attacks on my party, and most were intelligent.

Link to comment

I'm not sure what's actually scriptable by way of enemy spellcasters being able to detect what protections party members have placed upon them...


But in terms of realism, it's fair to ask: how would the enemy spellcaster be able to detect such a thing? How would a Beholder, for example, know that warrior behaving furiously in battle is immune to his mind affecting spells? Or how would he detect that a priest has cast Chaotic Commands beforehand? Or that a character may be equipped with an item that confers immunity to mind control spells?


If there was a legitmate spell that could be cast to divine such things, then okay. But otherwise, what good are the game's protective spells if the enemy is always given a way of working around them?

Link to comment

@Lemernis: fair comments.


The technical answer: these days, with a bit of work, you can script the engine to detect pretty much any protective spell / item.


As for scripting, there are basically three options (for any given protection):


1) enemies never see the protection at all

2) enemies see it immediately

3) enemies see it after a short delay (usually a round or two after the first time they try the ability, or something similar).


For some abilities (e.g. very visible ones, like Stoneskin or Spell Turning), (2) is obviously the right answer on realism grounds.


(1) is almost always the wrong answer, I think, even for hidden effects - maybe the first time, the lich is taken by surprise when Jaheira's Harper Pin absorbs the magic missiles, but what about the second time?


For hidden protections, I think (3) is the best answer. The problem with it is technical: implementing it makes scripts a great deal longer and tends to load them down with lots of additional timers. That doesn't matter much when scripts are the length of the original game's (or even of Tactics' or Ascension's scripts). But SCSII has huge scripts. For instance, the current SCS standard script for a high-level mage is 19,895 lines long (the vanilla game version is 275 lines long). Even given how much faster computers are now than when BG2 came out, I really, really didn't want to clog SCS with the extra code required to do really effective detection of buffs.


So I took a strategic decision to go with (2) throughout (both here and in the original SCS). In realism terms, your enemies might get unusually lucky but they'll never do immersion-breakingly stupid things like repeatedly targeting people who are clearly immune; in tactical terms, obviously it increases the challenge, and to some extent evens the odds, since players normally have a pretty clear idea of their foes' defences.



As for the point of protections: well, of course lots of creatures either don't detect things at all or only do so after a few moments (I've implemented that when scripts are short enough). And of course many spells are area-effect; there, the buffs are vital. But it's fair to say that in SCSII, the main point of, e.g., a Helm of Charm Protection is deterrence: if you're wearing that helm, you won't even be targetted with a charm spell, let alone be affected by it. So they're still as useful to the original wearer; it's just that the enemy won't waste spells on you.


It's not perfect, but I think it's the best I can manage.

Link to comment

Incidentally, this is why SCS is pretty up-front about what your opponents are doing. There's no particular reason why you should know what buffs they've cast or what that potion they just drank does, but SCS still tells you. Fair's fair.

Link to comment

Having checked: I'd forgotten this, but beholders are an example of a creature that only detects protections after a round or two. It makes their script roughly twice as long, but that's still only 10,000 lines so it's tolerable.

Link to comment


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

  • Create New...