creature AI and special abilities
#1
Posté 17 mars 2011 - 12:00
expample: Bombardier Beetles should spit acid mine never use the ability
I also have kolbolds with tanglefoot bags who never use them
is there a script or variable that needs to be set? Is it an inteligence or wisdom thing? I have messed with it a bit and can't quite figure it out.
Please help!
#2
Posté 17 mars 2011 - 12:21
#3
Posté 17 mars 2011 - 01:15
The Fred wrote...
AFAIK, the AI will actually use all of these things by itself. However, it often doesn't. The only real fool-proof way I can think of doing is to script each creature to do it with custom AI, so as to force a desired course of action. For this the best way is probably to use the HotU AI override system - I think there are example scripts in the game which you can look at.
Yes, there are some ideas having to do with the relative weight given to different tactics in the AI. I wish that Tony K's came with NSS as well as NCS files so that we could see the details, but alas it doesn't. I've found that if I give a dragon a fire breath ability, it'll use it almost every time, but if it's frost, it will use it extremely rarely (but not never).
I'm pretty sure that what The Fred is refering to ("the HotU AI override system") is what is defined in nw_i0_generic. There's a constant defined:
...and a local string with this name is then retrieved by DetermineCombatRound:const string VAR_X2_SPECIAL_COMBAT_AI_SCRIPT = "X2_SPECIAL_COMBAT_AI_SCRIPT";
string sSpecialAI = GetLocalString(OBJECT_SELF, VAR_X2_SPECIAL_COMBAT_AI_SCRIPT);
if (sSpecialAI != "")
{
SetLocalObject(OBJECT_SELF, VAR_X2_NW_I0_GENERIC_INTRUDER, oIntruder);
ExecuteScript(sSpecialAI, OBJECT_SELF);
if (GetLocalInt(OBJECT_SELF, VAR_X2_SPECIAL_COMBAT_AI_SCRIPT_OK))
{
DeleteLocalInt(OBJECT_SELF, VAR_X2_SPECIAL_COMBAT_AI_SCRIPT_OK);
return;
}
}
I've used this system a bit and it works very well. All you have to do is attach a local string to the creatures in question with the name "X2_SPECIAL_COMBAT_AI_SCRIPT".
#4
Posté 17 mars 2011 - 03:38
A lot of it is inside the henchspells.2da in a packed bit, and the other provided 2da's. I think these abilities need to be redone as feats to let the AI know they are there, and also so a player can use them when shapechanged. I am still trying to figure out the data format, which bit means what in the stored values.
#6
Posté 17 mars 2011 - 03:15
I was going to post on the same subject ....
Will check this out later.
Lance.
EDIT: (It's later.) OK, I have tried attaching a basic magic missile special ability to a creature and it does not use it at any time as far as I can see. However, if I give the same creature a wizard level and give it the spell that way, then it will use the spell in combat.
However, I was hoping to just be able to attach monster abilities as opposed to give additional classes to make them use the ability. Is there any known way to force these abilities to be used, like they are in the case of having classes added?
Is it anything to do with the talent functions? (Although I just read in the Lexicon that TalentSpell does not work.
Thanks in advance.
Lance.
Modifié par Lance Botelle, 17 mars 2011 - 11:10 .
#7
Posté 18 mars 2011 - 02:02
kevL wrote...
Did you guys look in his erfsource? it seems to me the uncompiled scripts are all there.
if so, bravo Tony
That has the NSS files for the GUI scripts, not the nw_c2_default* scripts that are of greatest concern to me.
painofdungeoneternal wrote...
We have the nss files, the SOZ expansion uses tonyk's ai.
My understanding was that some aspects of Tony's work were not included with SoZ, though some were. Specifically, I seem to recall him talking about item usage. While I don't care about item usage for companions (if my companions ever use items without me telling them to I get very cranky) I certainly do care about item usage for monsters.
#8
Posté 18 mars 2011 - 03:22
MasterChanger wrote...
That has the NSS files for the GUI scripts, not the nw_c2_default* scripts that are of greatest concern to me.
mine does *shrug
All 9 of 'em. Load up 'compmonai.erf' in Tanita's packer ..
#9
Posté 18 mars 2011 - 03:58
#10
Posté 18 mars 2011 - 05:47
kevL wrote...
MasterChanger wrote...
That has the NSS files for the GUI scripts, not the nw_c2_default* scripts that are of greatest concern to me.
mine does *shrug
All 9 of 'em. Load up 'compmonai.erf' in Tanita's packer ..
You're totally right. I think I must have been lazy since I think erf's are so icky. Being able to load them up in NWPacker rather than the TS makes it much easier, though.
I've started digging through the various hench_i0* and hench_o0* scripts to look at how Tony handles special abilities and usable items. It's possible that his changes in these particular areas only affect henches and not monsters (I know that other parts of his AI do affect monsters).
#11
Posté 18 mars 2011 - 06:37
#12
Posté 18 mars 2011 - 07:48
Note that i am not changing the AI, i am just recreating functions in it, making it more organized and trying to reduce a lot of redundant dead weight, and while i am not testing it in the OC, unless i added errors it should work fine there. From testing it seems to really make creatures think better and allows more creatures as seen in this very old screen shot where i am testing how things work with hundreds of creatures at once. ( not recommended to go this far but you can do a lot more without causing lag issues )
A lot of the issues relate to the special abilities being hard to access in the engine, there is no function to iterate a creatures spells, feats, and special abilties, which is also why the AI has to do so many loops. I am pretty sure a lot of the followers not listening issues are where the AI hits a loop and just dies. Fixing issues like this seems to help.
Right now my focus in on henchspells.2da. Make sure that is available. If a spell is not in that, the AI won't use it. However it's impossible to read, using shifted bits, masks, and bitwise operations to pack a LOT of data into what looks like big integers. I am developing an editor so i can review it, and from what i see so far, the values are all over the place, either blank, wrong, or just could be a little better. The example is pretty simple but all those check boxes in effect type define the number above them. Quite a few of the values for rows are just plain nonsense, or not even touched.
The issue here is these are so hard to read they are only understood by programmers, and those who are better at vetting rules like this cannot read these values.
We still need to approach the core issue, that special abilities are a short cut for doing feats. If a monster is done like a class, with feats and the like, then the AI and tools, not to mention shapechanging/shifters could use those abilities too. These abilties don't have icons/descriptions for the most part, are assumed a player will never use them, even though it is desired by most players to be able to magically become monsters with abilities. If you treat them as equal in setup to what you'd give the players, it would actually improve them without needing to do a custom AI for each monster, the henchspells and feats would be able to notice them, and you'd be able to do custom ui's based on the AI code to show the "feats" the monster now has. This is basically a long term goal with my various projects.
#13
Posté 21 mars 2011 - 12:22
A lot of what you said is over my head, and that is where I trust you guys. Would you say your refactored AI in its current state is better than the stock SoZ AI? If so what would one need to do to impliment it? It is compatible with HCR2?





Retour en haut






