The Black Wyrm Lair Forums
The Black Wyrm's Lair Terms of Use Help Search Members Calendar

Welcome Guest ( Log In | Register )

> Spellpack and SCS AI
DavidW
post Aug 9 2008, 06:35 PM
Post #1





Forum Member
Posts: 105
Joined: 25-August 06




I'm in the process of revising the AI in the original Sword Coast Stratagems, and I've probably got time to make some modest allowance for the possibility of Spellpack being installed. It would be helpful to know:

(i) some foolproof way of detecting if Spellpack is installed;
(ii) your advice on how clerics, druids and mages optimised for the old spellset ought to be rethinking their strategy and spell choices if Spellpack is installed (L1-5 spells only).

If this turns out to be viable, I'll extend it to SCSII in the fullness of time.
Go to the top of the page
 
Quote Post
 
Start new topic
Replies
DavidW
post Aug 18 2008, 08:39 AM
Post #2





Forum Member
Posts: 105
Joined: 25-August 06




Okay, this is starting to look pretty complicated. How well does the vanilla-game AI handle it, incidentally?

I take it the area of effect of Flame Strike isn't party-friendly. So probably that makes it hard for AI to use without the risk of incinerating one's allies. Is Color Spray area-of-effect or single-target?
Go to the top of the page
 
Quote Post
Galactygon
post Aug 18 2008, 04:51 PM
Post #3



Group Icon

Mod Developer
Posts: 1158
Joined: 22-July 04
From: Sweden




QUOTE(DavidW @ Aug 18 2008, 10:39 AM) *
Okay, this is starting to look pretty complicated. How well does the vanilla-game AI handle it, incidentally?


I have rarely seen them cast it (I have the impression that Creeping Doom is more common), so I thought I could get away with it. Admittedly, the vanilla does a poor job in handling the Plague on the rare occasions it casts it.

QUOTE(DavidW @ Aug 18 2008, 10:39 AM) *
I take it the area of effect of Flame Strike isn't party-friendly. So probably that makes it hard for AI to use without the risk of incinerating one's allies. Is Color Spray area-of-effect or single-target?


Neither of them are party-friendly which can cause potential problems. I have a personal preference against party-friendly spells, and unless the people start rioting I do not want to make everything party-friendly. Colour Spray has the same graphics and area of effect as it did in BG1.

Though even in vanilla + SCSII, I have seen the AI employ a triple skull-trap sequencer. So non-friendly area of effects aren't completely new.

You could handle area of effect spells pretty nicely if you use shouts and LastSeenBy(LastHeardBy(Myself)). I have done some test runs, and I will give you some results:

The AI runs away at a sluggish pace, but it works really well.

I added this to some script that employs Flamestrike.
CODE
IF
  HaveSpell(CLERIC_FLAME_STRIKE)
  See(Nearestenemyof(Myself))
  !Range(Lastseenby(Myself),10)
  !Attackedby(Lastseenby(Myself),MELEE)
  ... // more elaborate checks if needed
THEN
  RESPONSE #100
    Shout(111) // This can be any shout, but I would use something more unique
    Spell(Lastseenby(Myself),CLERIC_FLAME_STRIKE)
END


I added this to WTASIGHT.bcs
CODE
IF
  Heard([0],111) // This can be any shout, but I would use something more unique
  Range(LastSeenBy(LastHeardBy(Myself)),10) // We don't want to run away if we are not within the area of effect
  !StateCheck(LastHeardBy(Myself),STATE_DEAD) // If the caster was killed in the middle of the spell, we will not run away
  !ObjectActionListEmpty(LastHeardBy(Myself)) // It works rarely, but it might account if the spell were disrupted
  !StateCheck(Myself,STATE_MIRRORIMAGE)
  CheckStatLT(Myself,100,RESISTMAGICFIRE)
  ... // more elaborate checks if needed
THEN
  RESPONSE #100
    SetGlobalTimer("RunAway_SPPR503","LOCALS",6) // This is very important to have the creature execute the next block repeatedly
    RunAwayFromNoInterrupt(LastSeenBy(LastHeardBy(Myself)),30)
END

IF
  GlobalTimerNotExpired("RunAway_SPPR503","LOCALS")
  Range(LastSeenBy(LastHeardBy(Myself)),10) // We don't want to run away if we are not within the area of effect
  !StateCheck(LastHeardBy(Myself),STATE_DEAD) // If the caster was killed in the middle of the spell, we will not run away
  !ObjectActionListEmpty(LastHeardBy(Myself)) // It works rarely, but it might account if the spell were disrupted
  ... // more elaborate checks if needed
THEN
  RESPONSE #100
    RunAwayFromNoInterrupt(LastSeenBy(LastHeardBy(Myself)),30)
END


-Galactygon

This post has been edited by Galactygon: Aug 18 2008, 04:51 PM


--------------------
Go to the top of the page
 
Quote Post
DavidW
post Aug 18 2008, 06:23 PM
Post #4





Forum Member
Posts: 105
Joined: 25-August 06




QUOTE(Galactygon @ Aug 18 2008, 05:51 PM) *
Neither of them are party-friendly which can cause potential problems. I have a personal preference against party-friendly spells, and unless the people start rioting I do not want to make everything party-friendly.

I sympathise, but it really is very fiddly to script for in a reliable way. You have to check that your own allies are out of range too, somehow prevent them casually wandering into range, and even then you're sunk if the enemy moves up towards you (which usually doesn't happen when the party casts, as their area-effect spells are usually cast at a point, not an enemy).

QUOTE
Though even in vanilla + SCSII, I have seen the AI employ a triple skull-trap sequencer. So non-friendly area of effects aren't completely new.

I'll hazard a guess that the caster was either a lich, a rakshasa, or had minor globe running, and that any other enemies in the area were summons or otherwise expendable.
Go to the top of the page
 
Quote Post

Posts in this topic


Reply to this topicStart new topic
2 User(s) are reading this topic (2 Guests and 0 Anonymous Users)
0 Members:



- Lo-Fi Version Time is now: 7th October 2025 - 12:45 AM