Author Topic: Suggestions on a Good Monster AI System?  (Read 1968 times)

Legacy_SuperFly_2000

  • Hero Member
  • *****
  • Posts: 1292
  • Karma: +0/-0
Suggestions on a Good Monster AI System?
« Reply #15 on: August 18, 2010, 02:51:58 pm »


               Personally I don't think the default Bioware AI is so bad. It is actually quite good...as it is quite hard to cheat the system, it is very customizable and it is virtually bug free.

Usually it is just people who don't see the full potential of the default AI system who complain about the it and think that a custom AI is all they need to make things good.

Instead I would say...take heed to what 420 wrote about theese flags that you can set...and ALSO there are variables (refer to the NWN manuals, think it was HotU or SoU) that you can put directly on the creature that does numerous different things, like spawning in hidden, doing random walking and much much more...

@Genisys....and yes...you can make it cas't magic more randomly....at the expense of making worse choices sometimes though. Haven't tried this but im sure it works well. I think what you want, like it to cast perfectly every time is not so easy for a computer at all. Perhaps you should take the casters over as a DM to have full control then....

Also take care when making your encounters and the encounters around it.

You can probably make a lot of tricky and a bit random situations for the players by using all options that are avaliable.
               
               

               


                     Modifié par SuperFly_2000, 18 août 2010 - 01:55 .
                     
                  


            

Legacy_Genisys

  • Hero Member
  • *****
  • Posts: 961
  • Karma: +0/-0
Suggestions on a Good Monster AI System?
« Reply #16 on: August 18, 2010, 04:05:56 pm »


               Tweaking mages or clerics has been a lot of work for me, years actually, giving them the best spell selection, giving them the right special abilities, especially special abilities that are defense (Because the Special Abilities are used first generally if they are the highest level spell), and then properly playtesting them and watching them react to different groups of players. (from a DM perspective)



Superfly_2000 - I'm NOT saying the default AI is all that bad, though it leaves a lot to be desired, for sure, in fact I'm not even complaining, I'm just asking if someone has some custom AI's they can recommend or give the community, furthermore I do heed people's words, give them consideration, and then make decisions based upon the feedback / information provided & already known, which would make me an intelligent thinking creature, like yourself of course.. '<img'>



If you have anything further to ADD to the quality of this post while staying on topic, that would be great, especially if they are SCRIPTS which is what I'm asking for here, AI SCRIPTS specifically, and if you didn't catch that in the other 3 post, let me say it a fourth time for ya...



I'm wanting Monster AI Scripts, do you have any??
               
               

               
            

Legacy_Genisys

  • Hero Member
  • *****
  • Posts: 961
  • Karma: +0/-0
Suggestions on a Good Monster AI System?
« Reply #17 on: August 19, 2010, 03:19:08 pm »


               Recently, I just made a NEW wizard monsters, level 25, followed all the rules in character creation, assigned spell, and even some special abilities, but when I went to actually go test this wizard, he cast only one spell (for himself), and then proceed to try to attack my character, not casting any spells...



If this is the kind of results new builders will get, YOU CAN SEE CLEARLY, this is bad...



Hench I'm asking others if they have custom scripts which may be better than the default scripts, I'm NOT saying the default scripts are bad, I just don't like the AI, as a whole, even with turning different switches on etc...
               
               

               
            

Legacy_DarkStormInc

  • Newbie
  • *
  • Posts: 46
  • Karma: +0/-0
Suggestions on a Good Monster AI System?
« Reply #18 on: August 21, 2010, 09:17:28 am »


               http://nwvault.ign.c...ry_select_id=17 is a good place to start.. ollander and jaspere are the two I have always heard about.. and there is an update to jaspere that is supposed to get rid of the tmi problem. Havent tried it.. soemthing else you may want to look at is NPC Activities by deva or ambient city by Ayath The Loafer and Nereng (based off incomplete ambient system by bioware)
               
               

               
            

Legacy_Shadooow

  • Hero Member
  • *****
  • Posts: 7698
  • Karma: +0/-0
Suggestions on a Good Monster AI System?
« Reply #19 on: August 21, 2010, 10:41:04 am »


               

Genisys wrote...

Recently, I just made a NEW wizard monsters, level 25, followed all the rules in character creation, assigned spell, and even some special abilities, but when I went to actually go test this wizard, he cast only one spell (for himself), and then proceed to try to attack my character, not casting any spells...

If this is the kind of results new builders will get, YOU CAN SEE CLEARLY, this is bad...

Hench I'm asking others if they have custom scripts which may be better than the default scripts, I'm NOT saying the default scripts are bad, I just don't like the AI, as a whole, even with turning different switches on etc...

Right, the new builder would be pissed off from this however, I would like to findd out where is the problem. What character creation rules are you following? Does your wizard have combat casting? Does he get any combat feat?

I always make new creature via copy existing one (which casts without problems) and never ran into this issue.
               
               

               
            

Legacy_Xovian

  • Full Member
  • ***
  • Posts: 158
  • Karma: +0/-0
Suggestions on a Good Monster AI System?
« Reply #20 on: August 21, 2010, 11:52:58 pm »


               Few AI's I remember from back in the day:

Tony K's AI
Orlander's Realistic Systems (includes an AI)
CODI AI

I rewrote one that includes both Olander and CODI, but I was a little disappointed with it, as they would not continue combat actions directly after a resurrection spell was cast on them (because they died), or if too many creatures were attacking at once.

I've since re-written the code to use Standard + CODI with custom onspawn, but i still managed to keep Olander's Crit System in place too. I haven't released this set of scripts yet though, it will come out (and separately) when i release my module in a few months..
               
               

               


                     Modifié par Xovian, 21 août 2010 - 10:53 .
                     
                  


            

Legacy_DarkStormInc

  • Newbie
  • *
  • Posts: 46
  • Karma: +0/-0
Suggestions on a Good Monster AI System?
« Reply #21 on: August 22, 2010, 01:57:25 am »


               Haven't heard of the one by Tony K and forgot about the CODI AI
               
               

               
            

Legacy_Genisys

  • Hero Member
  • *****
  • Posts: 961
  • Karma: +0/-0
Suggestions on a Good Monster AI System?
« Reply #22 on: August 22, 2010, 11:49:24 pm »


               

ShaDoOoW wrote...

Genisys wrote...

Recently, I just made a NEW wizard monsters, level 25, followed all the rules in character creation, assigned spell, and even some special abilities, but when I went to actually go test this wizard, he cast only one spell (for himself), and then proceed to try to attack my character, not casting any spells...

If this is the kind of results new builders will get, YOU CAN SEE CLEARLY, this is bad...

Hench I'm asking others if they have custom scripts which may be better than the default scripts, I'm NOT saying the default scripts are bad, I just don't like the AI, as a whole, even with turning different switches on etc...

Right, the new builder would be pissed off from this however, I would like to findd out where is the problem. What character creation rules are you following? Does your wizard have combat casting? Does he get any combat feat?

I always make new creature via copy existing one (which casts without problems) and never ran into this issue.


Default Assignments for Level Up Mate...  Pretty straight forward...

I'm only changing spells some.. (And Staying within the limitations of spells / level by the book.)
               
               

               
            

Legacy_Shadooow

  • Hero Member
  • *****
  • Posts: 7698
  • Karma: +0/-0
Suggestions on a Good Monster AI System?
« Reply #23 on: August 23, 2010, 12:15:45 am »


               hmm then try my approach if it changes anythink, like I said I never had this issue. Also I many times assigned like 20 spells to creature of given level or spell of the bigger level than he could cast and everytime it worked.
               
               

               
            

Legacy_Terrorble

  • Sr. Member
  • ****
  • Posts: 370
  • Karma: +0/-0
Suggestions on a Good Monster AI System?
« Reply #24 on: August 23, 2010, 01:03:33 am »


               

ShaDoOoW wrote...

Genisys wrote...

Recently, I just made a NEW wizard monsters, level 25, followed all the rules in character creation, assigned spell, and even some special abilities, but when I went to actually go test this wizard, he cast only one spell (for himself), and then proceed to try to attack my character, not casting any spells...

If this is the kind of results new builders will get, YOU CAN SEE CLEARLY, this is bad...

Hench I'm asking others if they have custom scripts which may be better than the default scripts, I'm NOT saying the default scripts are bad, I just don't like the AI, as a whole, even with turning different switches on etc...

Right, the new builder would be pissed off from this however, I would like to findd out where is the problem. What character creation rules are you following? Does your wizard have combat casting? Does he get any combat feat?

I always make new creature via copy existing one (which casts without problems) and never ran into this issue.


I have very much had this issue of my wizards casting 1-3 spells and jumping right into combat.  I do not know much about how the AI setup makes its checks, but I have done things such as lower STR scores, remove some combat feats, remove their weapons, etc.  (none of which seemed to change anything). 

I had some luck by setting them as ambushers because they would run away and when they were far away, would resume spell casting.  I had some luck with making the casters pure wiz or sorc builds too, but not completely.  The best result was doing exactly what was mentioned, I found an NPC that casts spells very well and just used copies of that.  Problem is, that blueprint is a level 40 wiz and I don't like scaling things backwards.
               
               

               
            

Legacy_Shadooow

  • Hero Member
  • *****
  • Posts: 7698
  • Karma: +0/-0
Suggestions on a Good Monster AI System?
« Reply #25 on: August 23, 2010, 01:14:58 am »


               It might be some 1.69 issue. Many peoples doing the mages via monster wizard and it worked before, but some of these monsters stopped casting with new patch and it seems that new mage via monster wizard do not longer cast spell properly? I somehow fixed the wizard which was bugged after installing new patch for one server, but do not longer remember how and what caused it...
               
               

               
            

Legacy_Genisys

  • Hero Member
  • *****
  • Posts: 961
  • Karma: +0/-0
Suggestions on a Good Monster AI System?
« Reply #26 on: August 23, 2010, 06:25:10 am »


               There has always been a need for better AI for mages, I've had problems in old modules before 1.69, but at least the monsters would cast the spells they had, before they attacked..  One too many feats and BLAM, mages act stupid..

If you give a wizard a weapon, forget it, they are going to use it, like or not.. (even a magical staff - not quarterstaff)

Now clerics, it's not so bad, but we still want them casting spells too...

I seen some other strange bugs in 1.69 too, like my drow turning to werewolves..   o.O

I remember the first Paths of Ascension module  just gave the mages a bunch of special abilities, and this is great, except...

When a PC gets 26 or higher Spell Resistance, those Special Abilities are more or less worhtless...

Or, if the PC has great gear (like damage resistance on it) then spells are worthless, once again..

Furthermore, the original POA was designed for Level 20, so level 30 PCs would save versus all of the special abilities due to the low DC on them..

Therefore Special Abilities need to be reduced to only spells that are defensive...

Since you can more or less apply all the buffs you want through scripting, there is really no need for special abilities..

Besides, a Monster or NPC caster that are wasting their time buffing is a Dead Monster or NPC, for the PCs will rip them to shreds long before they get to cast a real spell on the PC....

I've had to tweak mages many times over, and check them every time to ensure they worked properly..

I know that if you don't have these mages perfect, then they will bug out for some reason...

It takes a lot of work just get a them to work correctly, so I'm just half temped to create them a special AI to MAKE them cast the spells I want in a random order, this of course would ignore any and all problems they could have...

I'll have to test some more, to see if I can't tweak these mages to make them work correctly...



Funny thing is, in the On Module Load... it reads this...

 Warning:
    Using some of these switches may change your games
    balancing and may introduce bugs or instabilities. We
    recommend that you only use these switches if you
    know what you are doing. Consider these features
    unsupported!
               
               

               


                     Modifié par Genisys, 23 août 2010 - 05:34 .
                     
                  


            

Legacy_Genisys

  • Hero Member
  • *****
  • Posts: 961
  • Karma: +0/-0
Suggestions on a Good Monster AI System?
« Reply #27 on: August 23, 2010, 07:03:57 am »


               Ok, I have what I feel is a better mage, this is how it's done, properly...


Level up a Mage to say level 3, remove all his spells, then go to the level tab and without using the Level up Wizard, give the wizard as many levels as you want them to have as a caster, now go back to the Spells Tab and manually give them the spells you want them casting...  (If you give a NPC or Monster too many feats, this will bug them bad..)


Next, set these Variables on the Monster / NPC to control how they act...

Variable = What it does..   (Variables are set as Integers not strings!)

X2_L_BEH_OFFENSE  =  Chance of Peforming an Offensive Action (0 (never) to 100 / 100 = all the time)

(This more or less controls how often they cast a defensive spell or summons or a Hostile Spell)
(40 would mean more defensive casting, where 70 would mean more offensive casting)

X2_SPELL_RANDOM = Set that they randomly pick spells (not in order)  (Set to TRUE or 1)
(This can make them do bizzare actions, like cast a Horrid Wilting first followed by a buff spell)
(Which can be good for the PCs, giving them time to recover from pain.. '<img'>)

X2_L_BEH_MAGIC  =  Determines what %  you want them casting magic..

So if you set it to 80, then they will use spells 80% of the time, and attack too
100 = Use Spells ONLY!



This will produce a very highly desirable caster, now you can also give them Haste & Quicken Spell 1/2/3 to make them a super mage!

I'm going to be tweaking monsters over the next few months, comming up with better monsters, overall..



Here are all of the other options you have for ALL Monsters / NPCs...

Simply set the variable on the monster/npc (variables use Parentheses "" )


//------------------------------------------------------------------------------
//                     How to Modify C R E A T U R E S Combat AI
//------------------------------------------------------------------------------

//------------------------------------------------------------------------------
// * see x2_ai_demo for details
//------------------------------------------------------------------------------
const string CREATURE_VAR_CUSTOM_AISCRIPT = "X2_SPECIAL_COMBAT_AI_SCRIPT";


//------------------------------------------------------------------------------
// * Setting this variable on a creature will make its use a
// * random name.
// * see nw_c2_default9 for details.
//------------------------------------------------------------------------------
const string CREATURE_VAR_RANDOMIZE_NAME = "X2_NAME_RANDOM";

//------------------------------------------------------------------------------
// * Setting this variable on a spellcaster creature will make its spelluse a
// * bit more random, but their spell selection may not always be appropriate
// * to the situation anymore.
//------------------------------------------------------------------------------
const string CREATURE_VAR_RANDOMIZE_SPELLUSE = "X2_SPELL_RANDOM";

//------------------------------------------------------------------------------
// * Set to 1 to make the creature activate stealth mode after spawn
//------------------------------------------------------------------------------
const string CREATURE_VAR_USE_SPAWN_STEALTH = "X2_L_SPAWN_USE_STEALTH";

//------------------------------------------------------------------------------
// * Set to 1 to make the creature activate detectmode after spawn
//------------------------------------------------------------------------------
const string CREATURE_VAR_USE_SPAWN_SEARCH = "X2_L_SPAWN_USE_SEARCH";

//------------------------------------------------------------------------------
// * Set to 1 to make the creature play mobile ambient animations after spawn
//------------------------------------------------------------------------------
const string CREATURE_VAR_USE_SPAWN_AMBIENT = "X2_L_SPAWN_USE_AMBIENT";

//------------------------------------------------------------------------------
// * Set to 1 to make the creature play immobile ambient animations after spawn
//------------------------------------------------------------------------------
const string CREATURE_VAR_USE_SPAWN_AMBIENT_IMMOBILE = "X2_L_SPAWN_USE_AMBIENT_IMMOBILE";

//------------------------------------------------------------------------------
// * Set to 1 to make the creature immune to dispel magic (used for statues)
//------------------------------------------------------------------------------
const string CREATURE_VAR_IMMUNE_TO_DISPEL = "X1_L_IMMUNE_TO_DISPEL";

//------------------------------------------------------------------------------
// * Set this variable to 1 on a creature to make it walk through other creatures
//------------------------------------------------------------------------------
const string CREATURE_VAR_IS_INCORPOREAL = "X2_L_IS_INCORPOREAL";

//------------------------------------------------------------------------------
// * Set this variable to 1 - 6 to override the number of attacks a creature has based on its BAB
//------------------------------------------------------------------------------
const string CREATURE_VAR_NUMBER_OF_ATTACKS = "X2_L_NUMBER_OF_ATTACKS";

//------------------------------------------------------------------------------
// * The value of this variable (int) is added to the chance that a creature
// * will use magic in combat. Set to 100 for always, 0 for never
//------------------------------------------------------------------------------
const string CREATURE_AI_MODIFIED_MAGIC_RATE = "X2_L_BEH_MAGIC";

//------------------------------------------------------------------------------
// * The higher value of this variable, the higher the chance that the creature
// * will use offensive abilities in combat. Set to 0 to make them flee.
//------------------------------------------------------------------------------
const string CREATURE_AI_MODIFIED_OFFENSE_RATE = "X2_L_BEH_OFFENSE";

//------------------------------------------------------------------------------
// * The higher value of this variable, the higher the chance that the creature
// * will aid friendly creatures in combat. Not that helping usually degrades
// * the overall difficulty of an encounter, but makes it more interesting.
//------------------------------------------------------------------------------
const string CREATURE_AI_MODIFIED_COMPASSION_RATE = "X2_L_BEH_COMPASSION";

//------------------------------------------------------------------------------
// * This allows you to script items that enhance a palemaster's summoned creatures. You need
// * to put the name of a script into this variable that will be run on any creature called by
// * the pale master's summon undead ability. You can use this script to add effects to the creature.
// * You can use the OnEquip/OnUnEquip event hooks set this variable.
//------------------------------------------------------------------------------
const string CREATURE_VAR_PALE_MASTER_SPECIAL_ITEM = "X2_S_PM_SPECIAL_ITEM";




This is a template for Custom AI...
You have to set the variable X2_SPECIAL_COMBAT_AI_SCRIPT on the NPC / Monster for this script.


//::///////////////////////////////////////////////
//:: Custom AI Demo Template
//:: x2_ai_demo
//:: Copyright © 2003 Bioware Corp.
//:://////////////////////////////////////////////
/*
   This is a template for those who want to
   override the standard combat AI NWN uses.

   The code in this file effectivly replaces
   the DetermineCombatRound() function in
   nw_i0_generic.nss, which is the core of the
   NWN combat AI.

   To override the default AI with this or any
   other AI script you created, you can either
   call the SetCreatureOverrideAIScript from
   x2_inc_switches

*/
//:://////////////////////////////////////////////
//:: Created By: Georg Zoeller
//:: Created On: 2003-08-21
//:://////////////////////////////////////////////

#include "nw_i0_generic"
#include "x2_inc_switches"
void main()
{
   // The following two lines should not be touched
   object oIntruder = GetCreatureOverrideAIScriptTarget();
   ClearCreatureOverrideAIScriptTarget();


   // ********************* Start of custom AI script ****************************


   // Here you can write your own AI to run in place of DetermineCombatRound.
   // The minimalistic approach would be something like
   //
   // TalentFlee(oTarget); // flee on any combat activity


   // ********************* End of custom AI script ****************************

   // This line *** has to be called here *** or the default AI will take over from
   // this point and really bad things are going to happen
   SetCreatureOverrideAIScriptFinished();
}
               
               

               


                     Modifié par Genisys, 23 août 2010 - 12:32 .
                     
                  


            

Legacy_Lazarus Magni

  • Hero Member
  • *****
  • Posts: 1837
  • Karma: +0/-0
Suggestions on a Good Monster AI System?
« Reply #28 on: March 21, 2011, 08:09:08 pm »


               I have been having some trouble with this too. Just a couple quick questions about setting the variables. Will these work regardless of the mod because they are inherent in NWN, or do you have to upload some script or something to the mod so that it understands what those variables mean?

Regarding mages having weapons, does this include creature weapons? (Claws, bites, ect)

Thanks, Laz
               
               

               


                     Modifié par Lazarus Magni, 21 mars 2011 - 08:10 .
                     
                  


            

Legacy_Xovian

  • Full Member
  • ***
  • Posts: 158
  • Karma: +0/-0
Suggestions on a Good Monster AI System?
« Reply #29 on: March 21, 2011, 09:32:49 pm »


               

Lazarus Magni wrote...

I have been having some trouble with this too. Just a couple quick questions about setting the variables. Will these work regardless of the mod because they are inherent in NWN, or do you have to upload some script or something to the mod so that it understands what those variables mean?


Is dependant on which module load event you are using.
Provided X2_inc_switches is part of that event, it can be applied for any module.

For the original poster there are 3 AI's I can recomend:
(in no paticular order)

-Tony K's Battle AI
-CODI AI
-Olander's Realistic systems.

Each has their pros and cons for what they do. They each acomplish something the default ai does not, but they acomplish it with mixed results.

CODI AI is more random and generally takes a lot of custom on spawns.
Tony K's is a fairly generic (but highly effective) AI that has npc's actualy use feats/skills and such that don't often get used.
Olander's is kinda a mix of both but has many custom scripts to acomplish its design, and can be very dependant on things such as class or race.

I recomend downloading them all and see which works best for the module you are using, as I have had success with running all 3 of them.
               
               

               


                     Modifié par Xovian, 21 mars 2011 - 09:38 .