Jump to content


SCS v32: prebuffing

4 replies to this topic

#1 DavidW

  • Gibberlings
  • 4663 posts
  • Gender:Male

Posted 08 November 2018 - 08:48 AM

'Prebuffing' - that is, casting spells immediately at the start of combat, to simulate having cast spells well in advance of combat - is one of the more controversial bits of any AI mod. Pretty much all AI does it to some extent (even in the vanilla game) and without it the player has a huge advantage, but exactly how much prebuffing to use is very much a matter of taste and it's one thing that some players find annoying about SCS.

Version 32 of SCS (now feature-complete and most of the way through its testing cycle) systematises and fine-graines the prebuffing options, and ties them to the difficulty slider (hopefully making it easier for players to adjust prebuffing on the fly if they find it's too much or too little). The system is based on the spell's duration: roughly speaking,

  • defensive sequencers and contingencies are used on all difficulty settings.
  • spells with a duration of several hours or more (like Stoneskin, or (in IWD/SR) Mind Blank) are precast on IMPROVED (setting 2) and higher difficulty.
  • spells with a duration of one turn per level or more are precast on TACTICAL (setting 3) and higher difficulty.
  • spells with a duration of three rounds per level or more are precast on HARDCORE (setting 4) and higher difficulty. They're also precast on TACTICAL difficulty if the spellcaster appears in front of the party (e.g. by teleporting, or because they're in sight when you enter the map).
  • spells with a duration of one round per level or more are precast on INSANE (setting 5) difficulty. They're also precast on HARDCORE difficulty if the spellcaster appears in front of the party.
  • spells with a duration of less than one round per level never get precast.
  • spells that don't fit the usual N rounds per level duration get treated a bit ad hoc, but roughly as if the caster was 10th level, e.g. spells with a fixed duration of 10 rounds count as "one round per level".

As usual, you can fine-tune this difficulty using the difficulty widget. Prebuffing difficulty is independent of the rest of the spellcaster's difficulty, so you can (e.g.) turn off prebuffing entirely and otherwise have the spellcaster fight at INSANE level.

I should say that this is all a bit less systematic in SR, which changes the durations a lot and in particular doesn't have durations proportional to level (I assume at least in part because the way SR was coded would have made it very tedious to implement.) I've kept a vague eye on the changes but for the most part I've just treated SR spells as if they had the vanilla durations.

#2 Ardanis


    A very GAR character

  • Modders
  • 2631 posts
  • Gender:Male
  • Location:Saint-Petersburg, Russia

Posted 08 November 2018 - 11:39 AM

Sounds like a definite improvement over the old all-or-nothing prebuffing routine (thumbup)


On that note, rather than duration you could try segregating buffs by their type instead. In SoD I grouped them like this:

1) Buffs against physical attacks, further split into:

 - Decremental defenses (Stoneskin, Mirror Image)

 - Immunity to weapons (Protection from Weapons/Missiles, Physical Mirror)

2) Buffs against spells, split into:

 - Immunity to spells by level (Spell Turning, Globe of Invulnerability)

 - Invisibility - not really an anti-magic defense with SCS+SR, but nevertheless so in SoD

3) Partial protections (Pro Evil, Fire Shield, Armor of Faith, Blur, Spirit Armor) and combat enhancements (DUHM, Blade Barrier, again Fire Shield).


On Normal difficulty AI would randomly select a subgroup for both anti-attack and anti-magic protections and cast the strongest buff it has available there. If the wizard had no spells in selected subgroup at all, there'd be no buffing in that category. This effectively reduces the amount of buffing by 50%.

On Core there'd be no random rolling, and the strongest buff from each subgroup would be precast. In addition, any extra buff from the third group would also be applied.


For high-level BG2 caster with access to wider array of spells the grouping can be further refined and extended across difficulty levels (the SoD buffing routine was mostly for low to mid levels, and I readily admit I was too lazy to spread it across more than three difficulty levels).

Edited by Ardanis, 08 November 2018 - 11:46 AM.

Retired from modding.

#3 DavidW

  • Gibberlings
  • 4663 posts
  • Gender:Male

Posted 08 November 2018 - 11:56 AM

The idea of duration (over and above having *something* systematic) is that it pays at least lip service to verisimilitude: the higher the difficulty, the more the spellcaster is assumed to be keeping close track of the strategic situation, and so the more precisely they can time their casting. (At one extreme, there's just no excuse for a spellcaster remotely expecting combat *not* to cast Stoneskin, so I wouldn't want to block Stoneskin except on the absolute-easiest difficulty setting.)


But it's something to monitor when I get reports in - theory only goes so far here, and of course SoD had and has a large playtest data-set.

#4 DrAzTiK


    I stopped study at middle school

  • Members
  • 649 posts
  • Gender:Male
  • Location:France

Posted 08 November 2018 - 01:20 PM

great work !

my mod : BuTcHeRy

#5 CamDawg



  • Gibberling Poobah
  • 9751 posts
  • Gender:Not Telling

Posted 08 November 2018 - 02:07 PM

The idea of duration (over and above having *something* systematic) is that it pays at least lip service to verisimilitude

I think this is the more reasonable approach, too. Put another way, the odds that a mage has cast Stoneskin sometime in the last eight hours before meeting the party are substantially higher than he/she casting Protection from Magical Weapons in the last four rounds. The exception being, as you noted, the mages that are ambushing the party.

Why is this Hypnotoad video so popu... ALL GLORY TO THE HYPNOTOAD.

Reply to this topic


0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users