Jump to content

SR Revised V1.3.500 (2021 June 7th)


Bartimaeus

Recommended Posts

Posted (edited)
1 hour ago, morpheus562 said:

There would be many issues when trying to get complete compatability with SCS. For starters, many of the new spells (i.e. Dispelling Screen, Mage Armor, etc.) do not update any spell states, so it's impossible to detect if an enemy or player has the spell active. I think this would be a great first step for laying the groundwork for complete SCS compatability. 

Let's look closer at Dispelling Screen and why appropriate spell tracking is necessary. SCS currently checks if the SPELL_IMMUNITY spell state is set at 1 to see if SI: Abjuration is active to appropriately determine what spells to cast at the player. Dispelling Screen updates NOTHING! So SCS will cast spells assuming the player is not protected when in fact the player is. Additionally, there is no way to write player scripts to cast Dispelling Screen because the player will keep casting the spell until every instance of it in their spellbook is used up because there is no way for the script to detect if it's active. Simple solution would have Dispelling Screen update SPELL_IMMUNITY to 1 to mimic SI: Abjuration. This is just one example of many on why tracking spell states matters.

The way detecting enemies with non-detection and improved invisibility is a complete mess. Something is going on at the opcode level preventing scripts from appropriately targeting enemies with this combo active, even when true sight is up by the player attempting to target the enemy. If players are having this issue with scripting, then SCS would equally have this issue when trying to target players with this combo. SCS can partly get around this by using the forcespell scripting command, but that is non-interruptible and a poor work around for an issue with SRR. Players can get around it by manually casting, but scripts won't work.

As SRR is simply an unofficial add-on/revision of SR, I am at the mercy of SCS reacting to and accounting for SR. If the base mod doesn't give e.g. Dispelling Screen its own specific spell state, there's not much I can do about it, since even if I did add one, it would do nothing without the AI knowing how to react to it. Additionally, in regards to hijacking SI: Abjuration's, that makes no sense to me to have Dispelling Screen use that particular spellstate, seeing as that spellstate is for a spell protection and would likely trigger SCS AI into trying to use anti-magic spells like Secret Word to dispel it, when such a spell would be absolutely wasted. There's unfortunately no analogue for Dispelling Screen, as it has a unique function.

This is not the first time this subject has come up in this particular thread: such talk is better directed at the base mod. However, if there are other analogous spell states for spells currently missing them in SR/R that will not cause bad spell detection/behavior, you're more than welcome to suggest them and I can see about implementing them.

Non-Detection + Improved Invisibility is definitely a little wacky, but while SCS AI doesn't always conform to SR's rules in this regard, my experimentation in testing SCS's handling of it seemed to indicate that it does a "good enough" job that it doesn't act either super unfair towards or get completely broken because of it. Player AI, on the other hand, I know nothing about. This actually reminds me that I planned a long while ago on creating an optional settings.ini tweak to allow anti-magic spells to always be able to always pierce through improved invisibility so that the player can do what SCS can do in being able to force spells through - I wonder if that would help with player AI as well?

@Chitown Willie Let's see here...base THAC0 of 20, no THAC0 bonus with weapon, terrible statistics...nothing looks out of the ordinary...but they do have that odd-ball "Swarm" ability - do they have ridiculous THAC0 even if there's only one bat fighting in an area?

Edited by Bartimaeus
Link to comment

I think allowing anti-magic spells to target improved invisible creatures with non-detection active would go a long way to resolving the wonkiness surrounding it. I would make that standard instead of an ini tweak.

Would you be able to create your own spell states and add it to the appropriate ids file? That way scripts can be written to effectively use SRR.

Link to comment
3 hours ago, Chitown Willie said:

Yeah - I think you're onto something.

Only 2 bats averaging +4 to-hit:

And then there's the generic freak bat doing +127?

Hm, this is an ability I've never modified from the base SR package, so theoretically, it isn't my fault. I'll have to muck about and do some testing and find out for sure, though - thank you!

@morpheus562 I have a general policy of defaulting optional tweaks to off so that people don't accidentally get weird stuff enabled they're not expecting coming from having played non-Revised previously. I will implement it sometime within the next week or two, though - it shouldn't be that particularly difficult to implement, but I am a bit busy right now.

In regards to the spell state stuff... It should be noted that I do not play the EEs - as such, spell states as set by opcode 328 do not even exist in my games (instead, stuff like SCS makes use of some other more hacky stuff to more or less the same effect), so I only have a little working knowledge of them. I've added spell states to some miscellaneous things in the past at the behest of a couple of other knowledgeable EE players, but only ones that already existed in the .ids. So I don't know the details of adding an entirely new one, and I don't currently have the time to research and mess around with it. If you want to link me to something that explains or gives an example on how to do it, though, I can look at in the somewhat near-future.

Link to comment
4 hours ago, morpheus562 said:

There would be many issues when trying to get complete compatability with SCS. For starters, many of the new spells (i.e. Dispelling Screen, Mage Armor, etc.) do not update any spell states, so it's impossible to detect if an enemy or player has the spell active. I think this would be a great first step for laying the groundwork for complete SCS compatability. 

Mage Armor has a sectype, which SCS knows how to handle. As a combat protection, it can be breached or dispelled. SCS is quite adept at doing such thing, in my experience.

4 hours ago, morpheus562 said:

Let's look closer at Dispelling Screen and why appropriate spell tracking is necessary. SCS currently checks if the SPELL_IMMUNITY spell state is set at 1 to see if SI: Abjuration is active to appropriately determine what spells to cast at the player. Dispelling Screen updates NOTHING! So SCS will cast spells assuming the player is not protected when in fact the player is. Additionally, there is no way to write player scripts to cast Dispelling Screen because the player will keep casting the spell until every instance of it in their spellbook is used up because there is no way for the script to detect if it's active. Simple solution would have Dispelling Screen update SPELL_IMMUNITY to 1 to mimic SI: Abjuration. This is just one example of many on why tracking spell states matters.

Dispelling Screen has a custom sectype, which I think SCS knows about... but even if not, it doesn't really matter. Dispelling Screen blocks one instance of Breach or Dispel Magic; to remove that protection you must cast... Breach or Dispel Magic. Thing thing it protects from is the thing that dispels it; so even if the AI is dumb as a rock and casts Dispel Magic at your Dispelling Screen, it is actually doing precisely what a smart AI would do in the same circumstance.

 

Link to comment
13 minutes ago, subtledoctor said:

Mage Armor has a sectype, which SCS knows how to handle. As a combat protection, it can be breached or dispelled. SCS is quite adept at doing such thing, in my experience.

Dispelling Screen has a custom sectype, which I think SCS knows about... but even if not, it doesn't really matter. Dispelling Screen blocks one instance of Breach or Dispel Magic; to remove that protection you must cast... Breach or Dispel Magic. Thing thing it protects from is the thing that dispels it; so even if the AI is dumb as a rock and casts Dispel Magic at your Dispelling Screen, it is actually doing precisely what a smart AI would do in the same circumstance.

 

But from a player ai scripts perspective, there is no way to track either Mage Armor or Dispelling Screen. Both will continue to be cast by any scripts until all instances in the players spell books are used up. SCS gets around this on buffing the enemies through contingencies, and as you state, it doesn't matter as far as casting on enemies. The difficulty with targeting comes from non-detection and improved invisibility. The changes Bart mentioned should improve targeting in theory.

Link to comment

Ah, well if you're just talking about player scripts then I confess I don't use those so I don't really pay attention. I've never found them good enough to make me want to cede control to a script (especially for mages - for fighters or thieves or even clerics, it's not as big a deal). But, for the sake of argument:

There are only so many spellstates you can add to the game; talking about applying one for each spell like Mage Armor is a start down a path toward infeasibility. Maybe something like a broad "AC buff" category, which could include Armor, Shield, Blur, Ghost Armor, Spirit Armor, etc. If the script finds that you are without any buffs, then it can check what you have memorized and apply something. Some important defensive spells, like Stoneskin, do already apply a detectable state. PfMW might or might not, I forget. As to Mage Armor in particular, I'll not that it has a long casting time and an all-day duration, and is thus clearly meant to be applied before combat starts. If my mage loses his buffs to a Breach and the script starts casting Mage Armor, I would be pretty annoyed at that script. That's not a spell I ever want to cast mid-combat.

I still don't really understand what the issue is with Nondetection or Improved Invisibility. What is the behavior you are seeing that you find objectionable? SR's See Invisible and True Seeing apply opcode 193 "invisibility detection by script," which makes anyone - anyone - a valid target for spells or attacks, regardless of invisibility or non-detectibility. If you cast True Seeing and your mage script isn't targeting an invisible enemy, then my guess would be that the problem is in the player script. Player scripts don't account for the player having opcode 193 - it's generally reserved for a select few enemies and scripted cut-scenes. So the player scripts might have conditional stuff like, "if target is not invisible, then cast spell A." With SR installed, that won't work well. The answer is to remove such targeting conditions from the scripts. (Letting spells target improved invisible enemies is not a good solution, because then they could be targeted even if you don't cast True Seeing, and then really what is the point of True Seeing?)

Link to comment

I should mention, if there is "going on at the opcode level preventing scripts from appropriately targeting enemies" with ND and II, then it is hardly an issue with SR. If that's really the case, then I would guess it is something hard-coded about Nondetection. The way the game treats invisibility and nondetection has always been screwy. If that's the case, then you might want to look at what I've done with Tome & Blood. It changes Nondetection into "Protection from Divinations" - closer to a true replacement for SI:Div. It does this by adding an opcode 205 effect, blocking spells with the DIVINATIONATTACK sectype. (It also adopts SR's use of opcode 193 for See Invisible and True Seeing, so a caster with True Seeing cannot remove the protected person's invisibility (or  Mirror Image etc.), but can still see and target that person.

With opcode 205 in place, I suppose there is no need for the vanilla "nondetection" opcode 69. So the lastest master of TnB, just uploaded now but not yet set as a "release," eliminates the opcode 69 effect.  If opcode 69 was indeed interfering with player scripts, then maybe they will work better with the TnB tweaks.

Link to comment

The 69 opcode just makes it so...spells like True Seeing can't dispel the stealth status, right? So yeah, that would already be covered by protecting wholesale against invisibility-detection spells, so it's a bit superfluous. Would be indeed good to know if that particular opcode causes scripting problems.

Link to comment

Generic AC buff is how Mage Armor has to be checked, but it's a bad way to check since the ac adjustment changes based on mage level. Scripts can easily be written to cast Mage Armor out of combat, but the issue is there is no way yet to check if the player has it active. Same goes with Dispelling Screen. 

I've done hours of testing SRR non-detection and improved invisibility, and it doesn't matter what conditions I have set within the scripts, enemies with those spells up will not be targeted by the scripts even if spells can be cast manually. Zero issues with targeting using vanilla spells. SRR, non-detection, and improved invisibility are the only outliers.

Edited by morpheus562
Link to comment
1 hour ago, morpheus562 said:

Zero issues with targeting using vanilla spells. SRR, non-detection, and improved invisibility are the only outliers.

With vanilla spells, you simply cannot target an enemy who has II + ND. (Heck, you can;t target an enemy who only has II - ND doesn't even factor into it.) So I'm not clear on what you are comparing here.

I have definitely had occasions when I turned on player AI by mistake, and one of my characters started attacking an invisible enemy. So invisible enemies can definitely be targeted with SR installed. (In fact that is partly what caused me to go out and make my own invisibility tweak mod.)  I don't know whether that enemy had Nondetection cast... probably not. So maybe adding Nondetection into the mix can screw with player scripts? But if so, it sounds like it is something, as you say, "at the opcode level." I can't see how SR could be causing it; SR doesn't really change Nondetection. The only thing SR does to Nondetection is add an opcode 282 effect, setting the value to 3. I have no idea what that is for - I assume it is something to do with Detectable Spells?

Link to comment
18 minutes ago, subtledoctor said:

With vanilla spells, you simply cannot target an enemy who has II + ND. (Heck, you can;t target an enemy who only has II - ND doesn't even factor into it.) So I'm not clear on what you are comparing here.

I have definitely had occasions when I turned on player AI by mistake, and one of my characters started attacking an invisible enemy. So invisible enemies can definitely be targeted with SR installed. (In fact that is partly what caused me to go out and make my own invisibility tweak mod.)  I don't know whether that enemy had Nondetection cast... probably not. So maybe adding Nondetection into the mix can screw with player scripts? But if so, it sounds like it is something, as you say, "at the opcode level." I can't see how SR could be causing it; SR doesn't really change Nondetection. The only thing SR does to Nondetection is add an opcode 282 effect, setting the value to 3. I have no idea what that is for - I assume it is something to do with Detectable Spells?

Let me clarify, in vanilla my scripts will identify a character has non-detection and improved invisibility up and immediately take it down using True Sight. From there, the characters will get to work stripping spell protections to take down pfmw if it's up. Otherwise, they will autoattack. 100% success rate, no fuss, spells are appropriately identified by the scripts and dealt with.

With SRR, it gets wonky. Even with a character who cast true sight, something at the opcode level is preventing the scripts from targeting the enemy and taking down the appropriate spell protections even though the spells can be cast manually. The enemy is still not targetable by spells, from the scripts point if view, even though spells can be manually cast. Autoattack still works, but you can still attack an enemy with improved invisibility up so long as they revealed themselves. I want to be clear, there are no checks preventing spells being cast, they should 100% work; however, some other check in one of the opcodes is preventing it.

Edited by morpheus562
Link to comment

And they are targetable with II but no ND?

My gut says it's something to do with opcode 69, if that's the case. (Though I've been wrong before. This game engine is wacky.) Which would mean this problem is already solved by my mod. :p (Though, it could create other issues, like Nondetection becoming too strong... at least against priests. Their only counter would seem to be Faerie Fire. )

What happens in SRR with someone has Nondetection and you cast Invisibility Purge?

EDIT - it might also be something wacky about the "invisibility detection by script" effect. IIRC this is generally applied in-game to enemies, and those enemies will generally make physical attacks. Maybe this only supports scripted targeting for physical attacks? Anyone recall whether there are enemies with scripted invisibility detection who cast spells? Maybe some fiends? Will they successfully target a player with II + ND?

Edited by subtledoctor
Link to comment
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...