Jump to content

SCS AI and Damage Resist


Recommended Posts

So, I was tipped off by posts from SubtleDoctor that SCS changes aggro and ignores characters with more than 40% Resistance. I don't know how it works, but it's true, as I just had a brief test with a full SCS install on a fairly clean (just Ascension) BG2EE install and tested with a Dwarven Defender. When running Defensive Stance plus his innate resistance (total 60% resistance), he was totally ignored in favor of any other character in melee range or by archers who would target another charaacter.

 

It kind of defeats the purpose of vanilla "tough" characters such as dwarven defenders or barbarians when their inherent resistance+abilities+items exceed that 40% and they are totally ignored. Let alone installing mods with scaling resistance like FP&PS (I've gone and done some toning down and rebalancing of it, but ToB full plates will still exceed 40% base) or SoB (SubtleDoctor setting a limit of 39% DR in his mod).

 

I'm looking to see how feasible it is to have SCS have the 40% point raised to 60% to account for tougher, but not near immune, resistance. I'm not familiar with digging around SCS, just started looking at it today.

Link to comment

Look at stratagems/ssl/library.slb if you want to edit this yourself.

 

Having said that, Ive just had a look and the threshold is 75% in v31. Are you sure this is specifically about damage resistance, and not just SCS preferring squishier targets? This isnt World of Warcraft; intelligent opponents are not going to waste their attacks on heavily armored fighters when there are other targets in range with lower hit points and worse AC.

Edited by DavidW
Link to comment

This isnt World of Warcraft; intelligent opponents are not going to waste their attacks on heavily armored fighters when there are other targets in range with lower hit points and worse AC.

In fantasy, the orcs aren't nessasarily that intellegent. so an Orc should just attack without even trying to look if the enemy can be hurt... well with the possible exception of resistance > 99%. Meaning all the creatures that have Int of 9 or less. Yes, that's a quite list. But don't worry, an Orc Archer has Int of 11. So they can actually try to be a little intellegent on their target selection.

Link to comment

Look at stratagems/ssl/library.slb if you want to edit this yourself.

 

Having said that, Ive just had a look and the threshold is 75% in v31.

Veeery interesting. Before too much gets attribute to me, I should say I have only reported information that I had gotten 2nd-hand or 3rd-hand a long time ago.

 

My mod adds DR but makes AC slightly worse than vanilla (by way of DEX penalties). So a ranger in leather and a paladin in plate might have the same AC, but the paladin will have ~35% DR. If I can safely increase that to about 50-55% DR without it becoming de facto invisibility, the system could be balanced a bit better. :)

 

Btw we keep talking about DR, but in fact there are 4 different physical resistances. How does SCS determine when it isn't worth attacking? Dare I hope it bears a relationship to the damage type of the creature's equipped weapon?

Edited by subtledoctor
Link to comment

 

This isnt World of Warcraft; intelligent opponents are not going to waste their attacks on heavily armored fighters when there are other targets in range with lower hit points and worse AC.

 

In fantasy, the orcs aren't nessasarily that intellegent. so an Orc should just attack without even trying to look if the enemy can be hurt... well with the possible exception of resistance > 99%. Meaning all the creatures that have Int of 9 or less. Yes, that's a quite list. But don't worry, an Orc Archer has Int of 11. So they can actually try to be a little intellegent on their target selection.

Lions are intelligent enough to prioritize the most vulnerable target; I imagine orcs can figure it out.

 

That said, there are other reasons creatures might have to vary their strategies - honor, brute savagery, etc - and if I were writing AI for a game with a wider range of that sort of thing among humanoids - like IWD - I might do it differently. But the great majority of BG2 humanoids are fairly civilized and well trained, and coding for the exceptions isn’t really worth it in terms of in-game experience.

Link to comment

How does SCS determine when it isn't worth attacking? Dare I hope it bears a relationship to the damage type of the creature's equipped weapon?

DR 75% or higher with respect to the creature’s primary weapon, usually, DR 75% or higher in all four types when the script doesn’t know what that primary weapon is.

Link to comment

Look at stratagems/ssl/library.slb if you want to edit this yourself.

 

Having said that, Ive just had a look and the threshold is 75% in v31. Are you sure this is specifically about damage resistance, and not just SCS preferring squishier targets? This isnt World of Warcraft; intelligent opponents are not going to waste their attacks on heavily armored fighters when there are other targets in range with lower hit points and worse AC.

Hrm, so it is.

 

Did some more testing, and it seems they were going after Jaheira specifically. Because when making it so that available targets was just DD and Minsc, with DD closer target, they did not switch targets, at either the base 10 resistance or buffed 60 resistance. Bringing Jaheira back in so that it was a line of DD, Minsc, Jaheira, they would skip to shooting at Jaheira.

So I suppose it was Jaheira being part caster that was giving her priority.

 

I then edited to have DD with 40 base resistance, put DD closer with Minsc, again they shot DD until he put up Def Stance, giving 90 resist, at which point they switched to Minsc. Actually behavior got wierd then. After getting shot a couple times, I pulled Minsc back out of sight, and they wandered a bit getting out of sight of DD around corners, then when I chased them down with DD they switched from crossbow to axe and then engaged melee.

 

Alright, thanks.

 

Frankly, I consider 75 too high even, that means someone who is effectively 4 times tougher. I was considering 60% because that would be 2.5 times the effective life.

 

Edit-I should clarify that melee behavior seemed to make it hard to say who was closer when retested, I could flip it between Minsc and DD at the drop of a hat by moving around the melee duergar. That was done at base 10 resist, I consider the ranged tests more important.

Edited by Quickblade
Link to comment

Lions are intelligent enough to prioritize the most vulnerable target; I imagine orcs can figure it out.

Alright, so they have good enough human cultural knowledge that they know the the boy next to them can take them out from a 1000 feet away with a single pull of a button, so they then go at him all of a sudden, but end up as a trophy, for the obvious reasons of being more than the 1000 feet away.

A hunter/predator can have a sort of that... but a common monster doubtfully has that deep knowledge. *

Not even the player is able to know what the x:th monster in the next room has resistances against, without the feedback. Now imagine, not having access to that. How well would you do ?

 

You could use a different script triggers depending on the .cre's stats when they are checking for the resistances. Aka the creature that has Int of 9 or less, get's only a check that the opponent is not 99%+ resistant to a weapon type... while a lich that depends on spells that do certain type of damage can check levels of resistances and decide depending on multiple checks on what's and what to use if available.

 

*if you lack all the info on this, just check out a few nature documents about ant colonies, and I am pretty sure that the colony in them survives, even with a few expendable ants lost. Cause it's not about the survival of a one.

Link to comment

My normal line is that SCS plays opponents as intelligently as they are or as intelligently as it is, whichever is lower- but I estimate it has about INT=4.

 

 

As for orcs, I asked an orcish friend of mine to comment:

 

We may not read all dose boring bookz, but we is smart enough to attack skinny squishy humans in dresses who do dat thing the shaman does and set fire to da boyz, before trying to bash dat dwarf in da big metal suit wot axes bounce off.

Link to comment

My normal line is that SCS plays opponents as intelligently as they are or as intelligently as it is, whichever is lower- but I estimate it has about INT=4.

 

 

As for orcs, I asked an orcish friend of mine to comment:

 

We may not read all dose boring bookz, but we is smart enough to attack skinny squishy humans in dresses who do dat thing the shaman does and set fire to da boyz, before trying to bash dat dwarf in da big metal suit wot axes bounce off.

 

Re: Lions

 

Actually, heheh, there are stats for Lions in both 2e and 3e in the monstrous/monster manuals. 3e, IIRC has a rule that common animals have less than 3 INT, and the lion has 2. 2e, the lion has 2-4 Int.

Link to comment

The most intelligent AI doesn't necessarily equal to most enjoyable to play against. While a designer may see it as a challenge to write the best AI possible, the player experience may dictate otherwise.

 

If you play as a dwarven defender, then chances are you're doing so to take advantage of his tanking ability. Except it ends up completely wasted if AI just starts targeting other characters, so you might as well have taken a kensai instead.

 

Best solution that I'm aware of - randomize targets, so that if you have half party members e.g. protected from charm, then half the casts of it will be unsuccessful. This is the math at its simplest. And you don't need lengthy triggers for this to work either.

Link to comment

Abstractly, I agree. But from the outset its been a core design goal of SCS to play enemies intelligently (mostly because I wrote SCS for me, and my own enjoyment is spoiled when enemies do silly things). At some level, if you dont want that then you dont use SCS. But in practice Ive had a monopoly on AI for ages, so I try to be ecumenical!

Link to comment

Actually, just as an addendum: the way you use a DD in SCS is about the same as in PnP D&D - just put them between the enemy and your casters, so the enemy has to kill you to get at them. SCS will basically respect that: if theres an enemy in attack range, they get attacked. What it wont do is attack the DD if theres someone else squishier in weapon range. Which of course is how a WoW - style system would handle it.

Link to comment

Or in my latest playthrough, Bassilus, who seemingly refuses to fight any sort of melee character at all, and will only target mages no matter how much you have them flee across the map out of sight. Even when you trap him in between a group of fighters with no possible pathing to a mage, he won't fight any melee characters. What a jerk.

Edited by Bartimaeus
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...