Jump to content

Is there any trick to do "per encounter" in the AI tactics ?


Recommended Posts

I like to keep my micro low, and I actually enjoy setting quite advanced tactics for my characters, but I always fail when it comes to setting a "once per encounter" action.

As an example, I would love my ranger to cast Marked for the Hunt once every encounter, and not after that. Or have a sequence of Autoattack>Autoattack>swap weapons to do an opening volley with dual pistol etc.

So far the best I found is setting a cooldown that is longer than the encounter duration, but it is very suboptimal because if I finish the encounter fast, and go to the next one, the cooldown appears to be still running.

Any way around that ?

Link to comment
Share on other sites

I set rules saying that the ranger should attack targets that have the Marked status. The very last rule is that the ranger should cast Marked for the Hunt. So, at least theoretically, the ranger should cast it only once for this encounter, because if there was already Marked target, the ranger would attack it instead of reaching the last rule.

You may need the "More Custom AI conditions" mod for that.

Sometimes I get two Marked enemies at the same time, though. I'm not sure what is causing it.

 

The opening volley with pistols won't work very well, I think. The problem is that after firing, the character will start reloading immediately instead of reading the AI script to find what to do next. At this point you probably want to change to melee weapon already, but you have to wait for the reload to finish. Opening the battle with a bow shot works well though. You can also set up the character to switch to melee weapon when there is an enemy in melee range and switch back to range weapon when there isn't.

Edited by wih
  • Thanks 1
Link to comment
Share on other sites

39 minutes ago, wih said:

I set rules saying that the ranger should attack targets that have the Marked status. The very last rule is that the ranger should cast Marked for the Hunt. So, at least theoretically, the ranger should cast it only once for this encounter, because if there was already Marked target, the ranger would attack it instead of reaching the last rule.

You may need the "More Custom AI conditions" mod for that.

Sometimes I get two Marked enemies at the same time, though. I'm not sure what is causing it.

 

The opening volley with pistols won't work very well, I think. The problem is that after firing, the character will start reloading immediately instead of reading the AI script to find what to do next. At this point you probably want to change to melee weapon already, but you have to wait for the reload to finish. Opening the battle with a bow shot works well though. You can also set up the character to switch to melee weapon when there is an enemy in melee range and switch back to range weapon when there isn't.

 

I didn't know about that mod, I will look into it, there probably will be some useful stuff. For now I think I cannot set the "marked prey/sworn ennemy" as a condition, only as a targeting priority.

 

About the opening volley, my character does not start reloading if there is a swap weapon condition so it actually works decently well. The setup I have for now is, at the very top of my  :


If  Only Ranged weapons> Autoattack (cooldown 10s)
If  Only Ranged weapons> Autoattack (cooldown 10s)
Always True>Swap to weapon set 1 (the melee one)

The behaviour is the one I wanted: My character fires the two guns then instantly swaps to melee weapon set and goes on with the rest of the Tactics for the rest of the battle. The tedious part is that I have to think about manually swapping to the ranged set before the next battle. And I constantly forget Might be just a habit to catch.

 

24 minutes ago, UltimaLuminaire said:

Set based on number of resources available instead of cooldown.

Opening volley with pistols should be tied to HP of healthy enemies. If there are no enemies with that hp value, switch to a different weapon and attack.

Resources available unfortunately won't work because of the limitation in possible numbers (Ie for rogue the only options are at least 2 guile, 3 guile or 5 guile).

Tie it to ennemy HP is very insufficient because even after the opening volley there will inevitably be ennemies that are full hp. That being said, that gave me a decent idea: I should try to set a moderate cooldown (like 60seconds), and a LOT of conditions that only happen at the very beginning of the battle (self health >90%, AC health>90%, not engaging anyone, no afflictions, ennemy health >75%, high ressource pool,  etc.)

Thanks for guiding me on the right path.

  • Like 1
Link to comment
Share on other sites

9 hours ago, Myrtillo said:

About the opening volley, my character does not start reloading if there is a swap weapon condition so it actually works decently well. The setup I have for now is, at the very top of my  :


If  Only Ranged weapons> Autoattack (cooldown 10s)
If  Only Ranged weapons> Autoattack (cooldown 10s)
Always True>Swap to weapon set 1 (the melee one)

The behaviour is the one I wanted: My character fires the two guns then instantly swaps to melee weapon set and goes on with the rest of the Tactics for the rest of the battle. The tedious part is that I have to think about manually swapping to the ranged set before the next battle. And I constantly forget Might be just a habit to catch.

Wow! So the opening volley indeed totally works. I just tested it. Thank you very much for the idea. It seems that the cooldown is the magic trick. I did the following:

  • "Combat time elapsed > 5" NOT -> Attack (cooldown 10s)
  • "Combat time elapsed > 5" NOT -> Attack (cooldown 10s)
  • "Combat time elapsed > 5" NOT -> Swap to weapon set 2
  • "Always true" -> Attack
  • "Always true" -> Swap to weapon set 1

And the character fires his two pistols, then immediately switches to weapon set 2.  I am also looking for a way to force the character to switch back to weapon set 1 at the end of the battle. The final rule is meant to be reached when the last enemy drops dead and there is no more eligible targets. But it is probably better to move the "Swap to weapon set 1" command to the start of the list. For example:

"Combat time elapsed > 5" NOT -> Swap to weapon set 1 (cooldown 10s)

Edited by wih
Link to comment
Share on other sites

I imagine that "combat time elapsed" is probanly a mod feature, though because I have never seen it. I really need to check out this mod.

Swapping at the beginning of combat will trigger the recovery so it's suboptimal if you are not a black jacket with quick switch. I don't know if it's possible to autoswap at the end of combat because, well, combat is over. I'll tinker a bit more.

Link to comment
Share on other sites

Yes, "combat time elapsed" is from the mod.

I did swapping at combat start and it seemed to work great. This way the script ensures the right weapon set is selected before proceeding. Swapping at the end of the combat runs into problems if, for example, the battle finishes too quickly, or if I change the weapon set in between battles, but otherwise it works too. There is enough time between the last enemy falling dead and the actual combat end, so characters have plenty of time to switch.

Edited by wih
Link to comment
Share on other sites

It can be tricky though. It seems that those cooldown timers are not reset at the start of the battle and some actions may not have cooled down from the previous battle. I am at Villario's rest, fighting some boars. Battles with them are very short and this seems to cause some crucial swaps to not happen when they should.

Edited by wih
Link to comment
Share on other sites

18 hours ago, wih said:

Sometimes I get two Marked enemies at the same time, though. I'm not sure what is causing it.

have you set a very long cooldown on your final thing to land a marked shot? just off the top of my head from my experience, with 0 cooldown sometimes the AI will queue up the action multiple times (this was extremely annoying with an  "instant" ability like disciplined barrage).

Link to comment
Share on other sites

2 minutes ago, thelee said:

have you set a very long cooldown on your final thing to land a marked shot? just off the top of my head from my experience, with 0 cooldown sometimes the AI will queue up the action multiple times (this was extremely annoying with an  "instant" ability like disciplined barrage).

I avoid cooldowns when I can, instead preferring to set strict conditions to determine what should happen. For example, with disciplined barrage I check whether self:has inspiration: Aware is false before casting it. With Marked shot I have set up things such that the final rule will only be reached if the character cannot find marked targets to attack. The cooldown is indeed 0 but the whole scheme usually works correctly.

Link to comment
Share on other sites

29 minutes ago, wih said:

I avoid cooldowns when I can, instead preferring to set strict conditions to determine what should happen. For example, with disciplined barrage I check whether self:has inspiration: Aware is false before casting it. With Marked shot I have set up things such that the final rule will only be reached if the character cannot find marked targets to attack. The cooldown is indeed 0 but the whole scheme usually works correctly.

right, i'm saying that from experience (having also set up a "self:has inspiration:perception" FALSE disciplined barrage script) that sometimes i've seen Eder use disciplined barrage like umpteen times in a row (burning up a significant chunk of class resource in the process). I don't know what causes it, but sometimes the AI gets evaluated repeatedly or does multiple things because it queues up a bunch of abilities because at the time the abilities are being queued up, the condition evaluates to true, and the condition doesn't get re-checked as the queued up abilities get used. I ended up having to put a short cooldown on these sorts of scripts to prevent this kind of multiple-use from happening.

 

edit - another reason for cooldowns - things like suppress affliction can really mess up AI scripts that are based on looking for an inspiration or affliction. suppress affliction will make those evaluate as "not being present" but if the ability is used the inspiration or affliction won't get applied (because it's the same as a suppressed ability). without a cooldown, your AI script will happily keep using their ability on someone who's had the relevant affliction/inspiration suppressed.

edit 2 - a much more mundane reason why you might see multiple marked enemies is because the enemy you marked gets withdrawn or stasis-ed or mule kicked or somehow else rendered untargetable, even extremely temporarily (mule kick and monk's  knock up stuff only have untargetability for 1 second). which would get your AI script to mark someone else.

Edited by thelee
  • Like 1
Link to comment
Share on other sites

8 minutes ago, thelee said:

right, i'm saying that from experience (having also set up a "self:has inspiration:perception" FALSE disciplined barrage script) that sometimes i've seen Eder use disciplined barrage like umpteen times in a row. I don't know what causes it, but sometimes the AI gets evaluated or does multiple things because it queues up a bunch of abilities because at the time the abilities are being queued up, the condition evaluates to true, and the condition doesn't get re-checked as the queued up abilities get used. I ended up having to put a short cooldown on these sorts of scripts to prevent this kind of multiple-use from happening.

 

edit - another reason for cooldowns - things like suppress affliction can really mess up AI scripts that are based on looking for an inspiration or affliction. suppress affliction will make those evaluate as "not being present" but if the ability is used the inspiration or affliction won't get applied (because it's the same as a suppressed ability). without a cooldown, your AI script will happily keep using their ability on someone who's had the relevant affliction/inspiration suppressed.

Good points. I will start placing short cooldowns then.

Link to comment
Share on other sites

Ok so with the mod and the various discussions I was finally able to get the behaviour I wanted, which is:
Opening volley, then swap to your main weapon and proceed as normal, and at the end of combat swap to ranged again to prepare for the next encounter.

There is something VERY satisfying (especially in ship battles) in seeing your entire party firing an opening volley of bullets/bolts, de-popping one or two ennemies in the process, then autoswap and proceed with their regular roles with a very small recovery. 

Pushing it even further: I always avoided blackjacket gunslinging for the tedious micro, but being able to set the AI tactics to an automatic initial rotation between 3 slots of guns/crossbows and swapping to melee suddenly has a massive appeal.

Link to comment
Share on other sites

40 minutes ago, Myrtillo said:

Pushing it even further: I always avoided blackjacket gunslinging for the tedious micro, but being able to set the AI tactics to an automatic initial rotation between 3 slots of guns/crossbows and swapping to melee suddenly has a massive appeal.

I set up an AI script with the axe in SSS that upgrades might inspirations a tier. With a blackjacket/barbarian multiclass, whenever I lacked a might inspiration, my AI script would do frenzy (for strong inspiration), then switch to the axe to upgrade strong to tenacious, switch back to main weapon, then switch back to axe to upgarde tenacious to energized, then switch back to main weapon. It took a while to get right, but it was real nice to have this tedious micro happen automatically and get like 100% uptime on energized. (importantly, when set up correctly, the script switches through the weapons so quickly that you only get the 1/2 second weapon witch delay from blackjacket once)

Edited by thelee
Link to comment
Share on other sites

16 minutes ago, thelee said:

I set up an AI script with the axe in SSS that upgrades might inspirations a tier. With a blackjacket/barbarian multiclass, whenever I lacked a might inspiration, my AI script would do frenzy (for strong inspiration), then switch to the axe to upgrade strong to tenacious, switch back to main weapon, then switch back to axe to upgarde tenacious to energized, then switch back to main weapon. It took a while to get right, but it was real nice to have this tedious micro happen automatically and get like 100% uptime on energized. (importantly, when set up correctly, the script switches through the weapons so quickly that you only get the 1/2 second weapon witch delay from blackjacket once)

That's a bit too exploity for my taste. 😄 Also, I imagine it would produce some wonky macarena-like animation.

Link to comment
Share on other sites

2 minutes ago, Myrtillo said:

Also, I imagine it would produce some wonky macarena-like animation.

that was half the fun! :) i also knew every time it would happen because i would hear a rapid succession of *chunk* noises as they switched through their weapon sets rapidly. adds to the dance fever

Edited by thelee
Link to comment
Share on other sites

3 minutes ago, thelee said:

that was half the fun! :) i also knew every time it would happen because i would hear a rapid succession of *chunk* noises as they switched through their weapon sets rapidly. adds to the dance fever

I am just too attached to clean aesthetics I guess.
I mean, I am depriving myself of one of my dream builds (a greatsword wielding wanderer forbidden fist/ghost heart) just because the FF animation looks terrible with a weapon in the main hand. I wish I had the abilities to mod that, but I digress.

 

Link to comment
Share on other sites

11 hours ago, Myrtillo said:

Ok so with the mod and the various discussions I was finally able to get the behaviour I wanted, which is:
Opening volley, then swap to your main weapon and proceed as normal, and at the end of combat swap to ranged again to prepare for the next encounter.

There is something VERY satisfying (especially in ship battles) in seeing your entire party firing an opening volley of bullets/bolts, de-popping one or two ennemies in the process, then autoswap and proceed with their regular roles with a very small recovery. 

Pushing it even further: I always avoided blackjacket gunslinging for the tedious micro, but being able to set the AI tactics to an automatic initial rotation between 3 slots of guns/crossbows and swapping to melee suddenly has a massive appeal.

I'm trying to create a script for a character with four weapon slots and I have the thing working in principle, but it is still very glitchy. My main problem currently is that the character often just plainly refuses to switch to the first weapon set, despite this being the very first rule in the script. The rule is like this:

Discipline: at least 3 -> Weapon set 1 (Cooldown 10)

The character has 3 discipline initially and my intention is to burn through the discipline and guile while  weapon sets change from 1 to 4, using the class resources as counters. But the first rule is not executed and I don't know why. I need to do more debugging.

Edited by wih
Link to comment
Share on other sites

So I made a concept party, all multiclassed blackjackets with four weapon slots, 1 to 3 slots are for automated opening salvoes. Here is the script of the party leader, who carries 6 pistols and a melee weapon. Requires the More Custom AI Conditions mod.

Blackjacket/Rogue
Both scripts should be executed in list order. The script is in two parts, to be more manageable.

Part 1. Melee script
- Self: Aware      NOT -> Disciplined strikes cooldown 5

- at least 2 guile NOT
  Range weapon equipped-> weapon set 4 cooldown 5

- Self: Only melee weapons equipped -> Attack...
  ... Whatever rules are there, they should be accompanied with the condition Self: Only melee weapons equipped.

Part 2. Salvo script
- at least 4 guile -> weapon set 1 cooldown 10 (guile is 4)
- at least 4 guile -> Crippling  strike  cooldown 10 (guile is 3)

- at least 3 guile -> weapon set 2 cooldown 10 (guile is 3)
- at least 3 guile -> Crippling strike   cooldown 10 (guile is 2)

- at least 2 guile -> weapon set 3 cooldown 10 (guile is 2)
- at least 2 guile -> Crippling  strike  cooldown 10 (guile is 1)

The second script is placed in the second AI slot, but is actually executed first. Only after it is executed, the conditions in the first script become true and the melee fight can begin.

The script requires some maintenance. Those seven rules that refer to the guile resource count need to be incremented when the character levels up and gets more guile.

Edited by wih
  • Like 1
Link to comment
Share on other sites

1 hour ago, wih said:

So I made a concept party, all multiclassed blackjackets with four weapon slots, 1 to 3 slots are for automated opening salvoes. Here is the script of the party leader, who carries 6 pistols and a melee weapon. Requires the More Custom AI Conditions mod.

Blackjacket/Rogue
Both scripts should be executed in list order. The script is in two parts, to be more manageable.

Part 1. Melee script
- Self: Aware      NOT -> Disciplined strikes cooldown 5

- at least 2 guile NOT
  Range weapon equipped-> weapon set 4 cooldown 5

- Self: Only melee weapons equipped -> Attack...
  ... Whatever rules are there, they should be accompanied with the condition Self: Only melee weapons equipped.

Part 2. Salvo script
- at least 4 guile -> weapon set 1 cooldown 10 (guile is 4)
- at least 4 guile -> Crippling  strike  cooldown 10 (guile is 3)

- at least 3 guile -> weapon set 2 cooldown 10 (guile is 3)
- at least 3 guile -> Crippling strike   cooldown 10 (guile is 2)

- at least 2 guile -> weapon set 3 cooldown 10 (guile is 2)
- at least 2 guile -> Crippling  strike  cooldown 10 (guile is 1)

The second script is placed in the second AI slot, but is actually executed first. Only after it is executed, the conditions in the first script become true and the melee fight can begin.

The script requires some maintenance. Those seven rules that refer to the guile resource count need to be incremented when the character levels up and gets more guile.

With cooldowns you don't really need to tie the actions to the resources. Put a 20 sec on everything with a time elapsed>20 sec / not, and every order will be executed only once from top to bottom, even after levelling up.

 

Also, I don't remember the exact mechanics of reloads and full attacks but I know that under some conditions they can give you a free bullet. It might be possible to go attack>crippling strike without triggering a reload, effectively giving you 3 shots with no reload before swapping sets.

Or maybe the free bullet thing only works when the off-hand gun is empty?

EDIT: with your setting you also get the -35% damage from a full attack, so if the 3 shots thing is not working, it is better to use 2 regular attacks instead of crippling strike.

Edited by Myrtillo
Link to comment
Share on other sites

26 minutes ago, Myrtillo said:

With cooldowns you don't really need to tie the actions to the resources. Put a 20 sec on everything with a time elapsed>20 sec / not, and every order will be executed only once from top to bottom, even after levelling up.

 

Also, I don't remember the exact mechanics of reloads and full attacks but I know that under some conditions they can give you a free bullet. It might be possible to go attack>crippling strike without triggering a reload, effectively giving you 3 shots with no reload before swapping sets.

Or maybe the free bullet thing only works when the off-hand gun is empty?

EDIT: with your setting you also get the -35% damage from a full attack, so if the 3 shots thing is not working, it is better to use 2 regular attacks instead of crippling strike.

You are probably right about the cooldowns, but I was afraid that the cooldowns may be still active when the next battle starts, so I tried to make them as short as possible. I was getting too much glitchy behaviour and this is my first reliable version. It doesn't depend on timing. But I need to test whether the cooldowns can indeed persist for the next battle. Maybe what I'm assuming is not actually correct.

I tested to see whether I can get three attacks out of two pistols. It turned out that if I place a regular attack, followed by a full attack ability, then I indeed get three attacks, however the third attack is just an animation. The game recognizes that the first pistol is empty :)

Edit: But if I place two regular attacks, then I will have to depend on the cooldowns only. I'm somewhat afraid of that.

Edited by wih
Link to comment
Share on other sites

1 hour ago, wih said:

Edit: But if I place two regular attacks, then I will have to depend on the cooldowns only. I'm somewhat afraid of that.

I think cooldowns work really fine. It's only wonky with long cd's because they don't reset per encounter, but there should never realistically be less than 20 sec between the beginning of one encounter and the beginning of another. And 20sec is enough to do the full rotation unless you get hard cc'ed.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...