I’m back and working on the next version of the Companion and Monster AI

First one important question, how do I get access to my content on this site from the migrate wizard?

I am well into a version 2.3 with the following changes:

  1. Animal companion and familiar flee options when hurt or facing a challenging enemy.

  2. Animal companion and familiar inventory access.

  3. Updates for Kaedrin’s PrC pack 1.41.4.

  4. Add support for casting free or swift actions in AI. Golem gas breath is now set to use this. (along with unlimited use every 1d4 rounds)

  5. Improved support for stealthed, invisible, and ethereal opponents and allies.

  6. Reworked monster heartbeat animations. Added support for avian, herbivore, and omnivore behavior. Monsters will return to starting location after combat. Added global option for monster heal and rest outside of combat.

  7. Some bugs have been fixed too.

  8. A few other things will probably get added.

At this point I have removed the multiple summons support but may get back to it for a later release.


Ask @Fester_Pot. There used to be a specific thread for that but I can’t remember what it was called and it hasn’t been used in ages.


1 Like

That’s a very good news!
Thanks a lot for your amazing works some of used and are using. :slight_smile:

I just uploaded version 2.3:.https://neverwintervault.org/project/nwn2/script/companion-and-monster-ai-23

I plan on working on supporting metamagic for spontaneous spellcasting classes (bard, sorcerer, favored soul, and spirit shaman). I have prototyped this and believe the game engine will support it with the following restrictions: can’t be used with mixed spellcasting classes except warlock and spells with subspells will not use metamagic. This will require a fair amount of work finish up.

Some other things I noticed while testing – probably should try to do something about pathfinding issues and persistent spell handling. The multi summons support has some bugs in it and requires a fair amount of work to finish so I might delay doing that.

I put the bug and feature list into the downloads. This thread can be used for requests for things to do.


Congrats! I’ve used your AI before. I’ll be sure to check this out.

Implementation of metamagic for spontaneous casters is almost complete. I found one other game limitation – at least one remaining casting for a spell level must exist for ActionCastSpellx to apply metamagic and work vs. stand there and do nothing.

Support for all metamagics done except for quicken – not sure how it should get used. Silent spell is used when silenced, still spell if there is arcane spell failure risk, extend spell for short and medium duration buffs, empower and maximize for damage dealing attacks, inflicting, and healing. Persistent spell is only used during buffs for haste and divine favor treating them as long term buffs. Maximize vs. empower is determined by how much maximize increases damage when the henchspells.2da is created, the damage factor must be 1.65x or greater. The AI will also works around the game issue by trying to use metamagic if only one spell level cast is available – useful for buffs or repeating a good damage spell again and again. Epic auto metamagics are accounted for and if the spell does not have a verbal or somatic component.

I view this as a significant improvement for the AI so will probably release with just this one enhancement. During testing, Qara was much more effective casting maximized fireball, ice storm, and flame arrow and empowered delayed blast fireball and magic missile. The spell selection also seems better, there is a randomness to the earlier talent based system that could skip good spells like protection from good/evil. If possible, using a similar scheme may improve the spell selection for non spontaneous casters – this will be looked at after the release.

There are a few of unrelated bugs and issues to look at before release – dispel is cast too much and one case when it shouldn’t be – target is silenced.


if (is under melee attack by 2+ enemy)


Something like that, but it is probably better to use challenge rating instead. Since quickened spells take a half round (3 seconds) instead of instant like PnP, they are not so useful. The AI framework supports quicken and if some simple rules can be defined it can be put in. I did this with persistent spell where only two spells when buffing are used. This idea came from the nwn2 fandom site: https://nwn2.fandom.com/wiki/Persistent_Spell. Support for quicken metamagic can be always be done later.

The AI framework also checks for the Arcane Scholar of Candlekeep improved metamagic feats. I had to test these out since getting the spell level increase wrong or the game not supporting it correctly will mean the AI controlled creature could stand around trying to cast something it can’t.

  • edited to get quote in.

hm, tough one…

question: Are you using any randomization when 2+ spells (metamagic or otherwise) weight roughly equally, or is the algo purely deterministic at present?

( im thinking that Quicken, when appropriate, could be given a slight percentage to cast instead of another, roughly equally appropriate, spell )

There isn’t any randomness in the AI for the effect weighting to decide what spells to use. However, the spell weighting is changed quite a bit already by monster and PC party positions and relative health. As part of testing the AI, I run certain saved game battles and the spells used can vary a fair amount based on how the battle proceeds.

Quicken might be implemented as only certain spells if they would be cast anyway are quickened. Or a boost to the quickened spell weighting could be added to get the spell used more.

1 Like

sounds good,

So i’ve been wondering, why/when would i cast a quickened spell?

  • when a tough mob is running at me and I want a damage shield (or similar) up fast.
  • when multiple high CR melee-types are hitting on me and I want to increase the odds of making a Concentration check (3sec round vs 6sec round?)
  • or if im a non-spontaneous caster, sometimes i use a metamagic slot for a given spell if all slots of its non-metamagic spell-level are taken …

/just ideas