Aller au contenu

Photo

Suggestions on a Good Monster AI System?


  • Veuillez vous connecter pour répondre
30 réponses à ce sujet

#26
Shadooow

Shadooow
  • Members
  • 4 465 messages
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...

#27
Genisys

Genisys
  • Members
  • 525 messages
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 .


#28
Genisys

Genisys
  • Members
  • 525 messages
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.. :D)

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 .


#29
Lazarus Magni

Lazarus Magni
  • Members
  • 1 134 messages
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 .


#30
Xovian

Xovian
  • Members
  • 87 messages

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 .


#31
Lazarus Magni

Lazarus Magni
  • Members
  • 1 134 messages
Thanks for the info Xovian. I have been trouble shooting this, and I thought it was too many feats, or them having creature weapons, or being multiclassed. But it turns out If I just add a number of spell slots to their hide or items, then they start casting regardless of any of those other things. Iduno why since I had X number of preparations set already, but apparently they also needed spell slots. Hope that helps someone else out there.