Jump to content

enemy sorcerers?


Recommended Posts

Are there any in the game?

If so, does SCS handle them any differently from enemy mages? 

As in, the main advantage of a sorcerer is their spontaneous casting.  A mage might only have two Breach spells memorized, so if they cast both of them and then you cast PfMW or something, then the mage will be unable to remove your protection. Whereas a sorcerer could cast Breach again, as long as they have any 5th-level spell slots remaining.  I'm curious if SCS makes use of that characteristic.

Link to comment

There is not a single creature file set to sorcerer in non-Enhanced BG2 (besides some unused off-Dynaheir called BPDYNAHE). I am unsure about BG2EE, since DLTCEP doesn't let me do searches with it and I don't feel like coding up something to detect it, especially seeing as I'm sure you could do it a lot easier, :p. Nor do I know if SCS sets any mages to sorcerer.

Link to comment

That’s about what I figured. I’m not sure how it could be done well... maybe run it as a mage,  set local variables for each spell level’s spell slots, decrement the value each time a spell is cast, and apply opcode 261 to restore the spell on a 10 second delay if the variable > 0. 

Not a big deal - I’m working on a thing to give players more flexibility in spellcasting, and it would be nice to help enemies as well. (I had the thought that if SCS handles sorcerers, I could simply change every enemy mage into a sorcerer, and let SCS handle the rest.) But even if enemies don’t get this benefit, their processes are opaque to the player so it won’t mar gameplay in a subjective sense. And the player’s advantage in flexible casting will be offset by the need to manage their resources for a whole dungeon, while every enemy caster is in a singular fight for their lives and can thus unleash their entire spellbook. 

Link to comment

Noting this belatedly: there's no fundamental reason why there couldn't be NPC sorcerers, but they'd require somewhat different AI from mages, and since there aren't any NPC sorcerers in the vanilla game, I didn't bother writing any.

SCS's AI will handle sorcerers adequately, I think (though I haven't tested it). The main problem is that optimal AI would hold back a few high-level slots for buffs and debuffs, whereas the mage scripts just outsource that task to spell choices. But I think they'd probably play okay. (But yeah, I wouldn't do a systematic swap.)

Link to comment
49 minutes ago, DavidW said:

but they'd require somewhat different AI from mages

Right, basically what I was asking is, does SCS already come with sorcerer AI scripts. I have a mod that allows player casters to cast their memorized spells spontaneously - if you have four 1st level spells memorized, you can cast each once or cast one of them four times, or two of them twice each, etc. This puts SCS casters at a bit of a disadvantage,* so I thought a possible workaround could be to simply tell SCS that all enemy casters are sorcerers. Then they could use an AI script designed for spontaneous casting, giving them a bit more flexibility. (For instance, players could get enemies to 'burn' a Death Spell on weak summons and then conjure stronger summons; if the enemy casts like a sorcerer, they could use a 6th-level slot to cast another Death Spell.)

The idea is a stretch, it probably wouldn't work anyway. But I figured it was worth looking into.

* (I don't actually think it is a big deal to allow players to use the 5E method while enemies use the old Vancian method. The primary benefit for players is the flexibility to engage in multiple encounters while retaining access to spells they might already have cast; enemies, on the other hand, only ever have to worry about a single combat encounter, in which they can happily unload any and every spell they have prepared.)

EDIT - and upon review, I see that I unknowingly reiterated the exact points in my post just above. :grad:

Edited by subtledoctor
Link to comment
On 9/10/2021 at 10:01 PM, DavidW said:

SCS's AI will handle sorcerers adequately, I think (though I haven't tested it)

I agree with you.

I mean, blocks like this one

IF TRIGGER
	TargetBlock(PCMages|PCsInOrderShort)
	TriggerBlock(Paralyse|MR)
THEN DO
	Action(Spell,WIZARD_HOLD_PERSON|100|50)
END

are perfectly fine for both Mages and Sorcerers.

Randomization (|100|50) should prevent them from casting the same spell twice or more times... And you can always add more randomization via something like

IF TRIGGER
	TargetBlock(PCMages|PCsInOrderShort)
	TriggerBlock(Paralyse|MR)
	OR(2)
		!Class(Myself,SORCERER)
		RandomNumLT(4,3) // 50% chance if I'm SORCERER
THEN DO
	Action(Spell,WIZARD_HOLD_PERSON|100|50)
END

Finally, FWIW, there are some enemy Shamans (which are spontaneous casters like Sorcerers) in SoD. They're scripted ("BDSHM00.BCS") no differently than ordinary Druids, except that there is little to no randomization, so in this case they will tend to use the same spell...

Link to comment

Huh. I assumed the problem would be in tracking spell slots. With normal casters you don’t need to; HaveSpell gates do the work for you. But sorcerers don’t have memorized spells so I assumed they would require some slot-tracking mechanism. 

Unless HaveSpell works for sorcerers. In which case the sole problem is the script’s inability to choose spells based on context rather than a simple hierarchy of best->worst. BD shamans being case in point. 

Link to comment

No, HaveSpell works fine for sorcerers: it returns true for any spell they have in their spellbook, provided they have at least one slot at that level.

If I were doing sorcerer AI from scratch, I'd use globals to set some kind of reserved-slot system to keep slots back for emergency actions, and then turn off the reserved slots for sorcerers who just plain run out of spells. I'd also need quite a different spell allocation system. But (a) there are few or no sorcerers in the unmodded game, and (b) I'm not convinced that the sorcerer/wizard distinction is visible enough to the player to justify the effort.

Link to comment
2 hours ago, DavidW said:

If I were doing sorcerer AI from scratch, I'd use globals to set some kind of reserved-slot system to keep slots back for emergency actions, and then turn off the reserved slots for sorcerers who just plain run out of spells.

Yes, even though there's nothing wrong (at least in principle) with using all your 4-level slots to cast, say, Ice Storm... But that's debatable of course...

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