Jump to content

Home

stoffe -mkb-'s improved AI (was Question about behaviors...)


J_Slash

Recommended Posts

  • Replies 110
  • Created
  • Last Reply
Originally posted by Achilles

Everything seemed ok, but I've only played Peragus with it so far. I couldn't figure out where all the grenades were coming from, but then I remembered that T3 was now a grenader :D

 

T3M4 is using grenades when set to the Grenadier AI with these files installed?

 

Then something is not right, he shouldn't do that. Grenadier droids shouldn't even run the standard grenadier AI routine, they should run their own "use droid weapons" routine instead. Hmm...

Link to comment
Share on other sites

I have tried out the grenadier script with T3 and HK in my party. My exile had a moderate blaster, so that she didn't kill too much on her own. The droids made heavy use of their special weapons. A bit too much for my taste. I have seen them regularly ready two or three flame thrower attacks in a row. T3 once used his molten cannon seven times consecutively. This is fine with his shock arm, but the other weapons got depleted quickly.

 

HK used his power blast quiete often, when he used his blaster. The interceptions also worked nicely. When I attacked a far away enemy, they would run towards them and then come back after a few steps. I didn't see the droids throwing grenades.

 

There is one things I don't understand:

Only party NPCs with a wrist rocket launcher will automatically use grenades (and rockets) with this style selected to make more effective use of those resources.
I didn't see the droids throwing grenades like Achilles. But I can't make Mira a grenadier.

 

I played on Korriban.

Link to comment
Share on other sites

Originally posted by stoffe -mkb-

T3M4 is using grenades when set to the Grenadier AI with these files installed?

 

Then something is not right, he shouldn't do that. Grenadier droids shouldn't even run the standard grenadier AI routine, they should run their own "use droid weapons" routine instead. Hmm...

Oops...yes, he was. Let me know what I can do to help.
Link to comment
Share on other sites

I cleaned out my savegame folder last week and didn't have any savegame left with Mira prior to making her a Jedi, so the Mira/Grenadier/Rocketlauncher thing isn't tested. From the code it should work as described, though things have a tendency of not working as intended when they haven't been tested.

 

Likewise, T3 is the only one of the droids I haven't used when I tested the altered AI a few days ago. Would be rather typical if there was a problem with him. :)

 

As for over-use of droid weapons, perhaps it needs some tweaking. I tend to only equip them with droid weapons I want them to use.

 

It uses a randomizer now to determine whether to use a special attack or fall through to the default attack AI. It currently has a 75% chance of doing its special attack routine. If so it has a 25% chance of using a combat feat rather than a droid weapon. If the droid has no suitable droid weapon equipped it will also try a combat feat instead.

 

Perhaps I should make that a 50%/50% chance instead.

 

If you want to experiment with it yourself, open k_inc_generic and scroll down to the function called ST_RunBotAIRoutine() right at the bottom of th file. This is where the randomizer is used to determine how often it will try to use droid weaponry.

 

Don't forget to recompile all relevant files if you change something though. Running "compileall.bat" should take care of that.

 

(It is perhaps best to mention that I use the slightly older version of nwnnsscomp.exe that doesn't require you to add a version commandline parameter for it to compile TSL scripts. If you use the new one you'll need to edit the batch file first to add that parameter.)

Link to comment
Share on other sites

Originally posted by Achilles

FWIW, I just looked and realized that I saved the files to the incorrect folder (SWKOTOR2 instead of Override). Sorry for the mix up.

 

Thanks, that saves me some time trying to figure out what was going on. Though it is perhaps best to take T3M4 out for a test drive as well, just to be on the safe side. :)

 

Speaking of T3... Would it be a good idea to add a few lines to the AI to make him automatically activate his renewable shield in combat if it isn't already up (and he has it installed of course), or would that be too annoying?

Link to comment
Share on other sites

It sounds nice but I'm iffy about it. I'd rather just see him using his shock arm without having to be told ;)

 

If you're taking requests, how about something that tells Bao-Dur to use Shield Breaker if his opponent has one activated or am I just being silly now?

Link to comment
Share on other sites

Originally posted by Achilles

It sounds nice but I'm iffy about it. I'd rather just see him using his shock arm without having to be told ;)

 

If you're taking requests, how about something that tells Bao-Dur to use Shield Breaker if his opponent has one activated or am I just being silly now?

 

He should hopefully use the shock arm every now and then if you set him to grenadier AI with the modified scripts installed.

 

As for the shield breaker, does it work differently when used against shielded opponents than against "door" force fields? For the latter it seems he can pummel them down even if he has a weapon equipped. Does he need to be barehanded against enemies? (That question should tell you how often I have used that ability :) )

Link to comment
Share on other sites

Activating the renewable shield would be a huge help, actually. If he has it equipped. Any other shield he'd waste pretty fast.

 

Does the shield breaker even work against enemies? I thought it only worked against forcefield doors, for some reason. Hmm.

Link to comment
Share on other sites

Originally posted by stoffe -mkb-

 

Speaking of T3... Would it be a good idea to add a few lines to the AI to make him automatically activate his renewable shield in combat if it isn't already up (and he has it installed of course), or would that be too annoying?

 

I'm with Jennaida, actually, would it be a good idea to let NPCs (droid or not) activate their sheilds after they suffer a certain amount of damage??

 

Thanx Stoffe, i tested the thing it was nice, the excessive use of special weapons is not a big problem, i only equip them when i see a BIG fight comin'!! and i usually find a lot of special weapons throughout the game anyway..:)

Link to comment
Share on other sites

Originally posted by stoffe -mkb-

As for the shield breaker, does it work differently when used against shielded opponents than against "door" force fields? For the latter it seems he can pummel them down even if he has a weapon equipped. Does he need to be barehanded against enemies? (That question should tell you how often I have used that ability :) )

Errr...mechanics-wise, I have no idea. In theory it's the same thing, but something tells me that it might not be when it comes to the code. In combat, shield breaker is one of BD's combat feats (in other words you can select it in the gui). Not sure how much that helps.
Link to comment
Share on other sites

Originally posted by stoffe -mkb-

I cleaned out my savegame folder last week and didn't have any savegame left with Mira prior to making her a Jedi, so the Mira/Grenadier/Rocketlauncher thing isn't tested.

My mistake. I didn't know grenadier is replaced with jedi support. As a scout she does use rockets and grenades from time to time.

 

I have toned the droid weapon usage with your instructions from 75/75 to 75/25 per cent which is more reasonable, just IMHO.

 

I agree that having T3 automatically activate his renewable shield would be good.

Link to comment
Share on other sites

I've done some more changes to the Support/Grenadier AI styles, and updated the archive with the changed files.

 

This is what I've modified:

* Changed frequency for how often droid weapons are used. There's still a 75% chance that the special droid AI will run. But when it runs there's a 25% chance that it will use a droid weapon if available (and thus 75% chance that it will try to use a combat feat). However, I made an exception for T3s shock arm, it will have a 50% chance of being used if picked by the AI, since it has infinite uses.

 

* If T3 is equipped with his/her/its renewable shield, it will automatically try to ensure that the shield is up and stays up during combat.

 

* If Bao-Dur is fighting unarmed, he'll use his Shield Breaker feat if the enemy he is targeting has an energy shield active.

 

The shield breaker only works when fighting with his fists, and i figured it'd be a bit annoying if the script would automatically put away equipped weapons and charge an enemy, so I made it only try to use it if already unarmed.

 

I've tested the changes for about an hour and they seem to work, but you never know... If anyone finds any problems, please let me know.

 

If you have any other suggestions of similar things that could be fixed, added or improved in the script, please tell.

Link to comment
Share on other sites

Originally posted by Jennaida

*looks at the archive*

 

Hmm... which k_ai_master.ncs are you modding from, the stock one? Or the one from the Hardcore mod, which makes the new support more useful? I'm hoping it's the latter, since the original was too easy from go ;)

 

I took the files that came standard with the game and modified those. I don't have the Hardcore mod so I don't know what it modifies or does.

 

The only 3rd party mods I have are a few reskinned model textures and some new lightsaber models. Thus it's safe to assume that these modified files are not compatible with any Mods that modify the creature AI.

 

EDIT: I downloaded the Hardcore mod and had a look at it. It seems that it only adds a single function call to k_ai_master and have all its other code in an include file of its own, so it should be pretty simple to use both.

 

Copy the Hardcore mod source (except k_ai_master.nss) into the same folder as these modified files are. Open the k_ai_master.nss that I modified, with a text editor and go to line number 141. Add a blank line there and paste this code from the hardcore mod at that place:

 

if (!GetPlayerRestrictMode(OBJECT_SELF) && !GetFeatAcquired(FEAT_IMPLANT_LEVEL_1, OBJECT_SELF)) {
   Hardcore_Mod(); 
}

 

Then go up to line number 16 (still in k_ai_master.nss), add a blank line and paste in:

 

#include "Hardcore_Mod"

 

Save this modified k_ai_master.nss file and re-compile all the relevant scripts. (If you have nwscript.nss and the nwnnsscomp.exe that doesn't need a version parameter, simply running the compileall.bat batch file should take care of that.)

 

I haven't tested this, but I can't see why it shouldn't work. :)

Link to comment
Share on other sites

So far this is awesome. May I make one more suggestion/request? Either remove the maximum range from Jedi Support or increase it enough that Guardians can use Force Jump without getting shot in the back while running back to the party leader. Since Ranged weapons see a lot more action in TSL, it might be best just to remove the restriction from that support type, but I'll leave that decision in your capable hands.

 

Thanks again!

Link to comment
Share on other sites

Originally posted by Achilles

So far this is awesome. May I make one more suggestion/request? Either remove the maximum range from Jedi Support or increase it enough that Guardians can use Force Jump without getting shot in the back while running back to the party leader. Since Ranged weapons see a lot more action in TSL, it might be best just to remove the restriction from that support type, but I'll leave that decision in your capable hands.

 

Thanks again!

 

Hmm, would you really need to have guardians set to Jedi Support though? Aren't they better to set to Aggressive AI, that way they would attack at any range. They aren't big on using force powers anyway, which is the main advantage of setting them to Jedi Support, and they'll still use a power on occasion when set to Aggressive. (Unless I remember incorrectly I applied the "use best feat/forcepower" and forcepower usage filters fix to all classes and not just those two.)

 

 

 

Still, if you need your guardians on Jedi Support for some reason I can look into it. I'd prefer to make it an option you could toggle in some way though, since "caster" characters like Kreia works best when they don't run off to saber that enemy they just spotted waaaaay across the other end of the room. :)

 

I could make it check a local boolean on the character to determine if they will stay within 10 meters or not when using Jedi Support. The question then becomes how you'd toggle that boolean for each character. I suppose I could make it into a 0 cost force power with no cast animation, but that would require 2da editing which I'd rather avoid since my spells.2da is already quite modified with a bunch of custom force powers I've made... :/

 

A simpler, though more inflexible way, would be to exempt characters with the Force Jump feat from the "stay close" condition...

 

Any ideas on what would be preferable?

Link to comment
Share on other sites

stoffe -mkb-,

 

I usually set all Jedi to Jedi Support regardless of class simply because the default behavior includes Aggressive. I almost never give Guardians offensive force powers, so it's nice when they cast Armor, Valor, Speed, etc all by themselves. If you're telling me that your revamped Aggressive behavior will do this too, then that's good enough for me. Just let me know where I'm misunderstanding. THANKS!

 

DarthSmallz,

 

The game already has one. You can remove multiple post by clicking Edit>Delete.

Link to comment
Share on other sites

Originally posted by Achilles

stoffe -mkb-,

 

I usually set all Jedi to Jedi Support regardless of class simply because the default behavior includes Aggressive. I almost never give Guardians offensive force powers, so it's nice when they cast Armor, Valor, Speed, etc all by themselves. If you're telling me that your revamped Aggressive behavior will do this too, then that's good enough for me. Just let me know where I'm misunderstanding. THANKS!

 

Well, it didn't, but it shouldn't be too hard to change. It's probably the easiest solution. :)

 

I've updated the archive with this modification. If a Jedi is set to Aggressive AI they'll now have a 25% chance of trying to use a buff power. (If they already have the power active the AI picks though it will attack as usual even then.) I don't know if that's a reasonable balance or if they should try to buff more often?

 

 

 

I was thinking of adding extra checks before buffing instead when partymembers are set to Agressive AI... Make them check the number of enemies nearby, what kind of weapons they are armed with and how powerful they are in relation to the party. And then only use buffs when it would be worthwhile. Does this sound like a better solution or it would just be over-the-top needlessly complicated? :)

Link to comment
Share on other sites

  • 3 weeks later...

Still lovin' this mod, however I've noticed that T3 likes to zap Kreia with his shock arm. Right after a battle he'll just give her a jolt for no reason and then go along his merry way. He doesn't do it any other time and (from what I can tell) he doesn't do it with any other party member. Any thoughts? Anyone else notice this?

 

BTW: He only does it some of the time. I can't determine any kind of trigger.

Link to comment
Share on other sites

Originally posted by Achilles

Still lovin' this mod, however I've noticed that T3 likes to zap Kreia with his shock arm. Right after a battle he'll just give her a jolt for no reason and then go along his merry way. He doesn't do it any other time and (from what I can tell) he doesn't do it with any other party member. Any thoughts? Anyone else notice this?

 

BTW: He only does it some of the time. I can't determine any kind of trigger.

 

Well, astromech droids are known to become eccentric if they go for a long time without a memory wipe... :)

 

Seriously, I haven't noticed this behavior myself so I can't say for sure what causes it, but I've updated the scripts with a bunch of extra hostility checks, and made sure that if a partymember gets another partymember passed as oIntruder they won't attack them.

 

Don't know if it'll fix your problem but it may be worth a try. The archive is updated with this new version. Hopefully it won't cause any other problems, as I've only had time to test it briefly, but I can't see how it could.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.


×
×
  • Create New...