Author Topic: Looking for some advanced strategies and their counters  (Read 8920 times)

Offline Xilmi

  • Moderator
  • Commander
  • ***
  • Posts: 642
    • View Profile
Re: Looking for some advanced strategies and their counters
« Reply #15 on: November 14, 2022, 01:48:39 pm »
Yes, if new AI is fully configurable (aka I could be more in some cases more dumb or deadly if modder want) then I would not be against inclusion.
If I recall correctly, Meridian was weakly against your current approach, this means that if you AI will have enough community support then there is chance that Meridian could be convinced to include your changes to OXCE.
The requirements Meridian told me where actually much less conflicting with how I envisioned it than what you told me in the comments about the initial pull-request.

They were:

1. Fully backwards-compatible, which just means that when not using the option, the game behaves exactly like before. That seemed most easy to realize by using my own methods for everything and leaving the methods of the base-AI alone. But that approach is something that you seemed to have taken an issue with due to duplicating code. I have not copied any method that I didn't change at least something in. In the later iterations the changes have become bigger and bigger. So even the initially almost unaltered methods are now quite different than what their origin looked like. They still often fulfill the same task but in a way meant to optimize efficiency rather than emulating OG-behaviour.

2. No work in progress. This was only a problem to me as long as I had no alternative to allow people to test my work beforehand. But we found a compromise where he builds versions for me from a separate branch. I now even prefer it this way as it allows me to experiment with things I probably wouldn't have experimented with before and can tidy everything up later. But that also means it will definitely not happen anytime soon. Developing AI has a bigger scope than adding a new button that does something very specific. So it definitely will take some time until I run out of things to improve.

What you were asking in those comments, however, seemed much more difficult to realize than what Meridian asked for. Especially since it seemed to be partially conflicting with Meridian's requirement #1.

I really do not want to mess around with the original AI code and inject all of my stuff there. This would make ensuring backwards-compatibility very, very difficult and lead to almost incomprehensible code within those methods.

I think at this point it would be even better to add my AI as a completely new class to keep it even more strictly separated.

Your other point was to make different behaviors of the AI configurable separately. I think that something like that only really starts to make sense when the AI is mostly finished and thoroughly tested so one can actually have an overview of what would make sense to be configurable.

I definitely do not think that every single thing about it should get it's separate switch.

Right now I see 2 main options that I think make sense for it:

1. Respect limitiations. => There's some optional (and controversial, if I read the threads about these correctly) limitations for the regular AI that are active by default. I want my AI to ignore these limitations by default but think there should be a way to reenable all of the them as an option.

2. Giving modders control of when to use it or not. I'm not really sure though what possibilities a modder has when it comes to defining conditions for something like that. There's many potential possibilities and I don't know just yet. For example: Assign it to certain units/unit-ranks. Could, for example have the Leaders and Commanders use it but not the basic soldiers. Or you could want to make the Sectoids use it but not the Mutons.
Other possible scenarios could be to enable it with a turn-timer in a mission... or a month-timer in the game... or for specific mission-types. There's a lot of thinkable scenarios and I don't know yet if I have to specify them separately or if the modder can control all of them with only one hook in the code.

As I said, when it comes to sub-routines also being moddable, we'd first need to define for which sub-routines that makes sense in the first place. This would have to be based on feedback in the sense of: "I wished they could still do that but would not do that."

Offline Xilmi

  • Moderator
  • Commander
  • ***
  • Posts: 642
    • View Profile
Re: Looking for some advanced strategies and their counters
« Reply #16 on: November 14, 2022, 02:49:38 pm »
@The Reaver of Darkness

On your first point about facing where X-Com can approach: I actually managed to conjure an algorithm yesterday that does that. I had a similar one previously but it was a bit whacky at times and sometimes had weird results. The new one, however, seems to make really good predictions and when I combine it with some other ideas could lead to really good decision-making about guarding at good positions vs. trying to attack. I think this really allows for advanced tactical considerations. Move in when the enemy is surrounded but don't move in when the enemy has set up a trap and is waiting for you to make a move.

I've also considered part of the counter to the counter in the sense that the algorithm that determines where to "camp" a specific position prefers greater distance and units avoiding to stand too close to one another. So instead of just standing there in one place and inviting a grenade, they spread all over the place.

The algorithm also will consider self-made holes. But of course if you do it all in one turn, it can't react so the counter to that is still valid. And sending in well-armored units first of course also will remain helpful in any case.


I'm not a fan of the proposed counter to smoke. Exactly because of the counter to the counter you mentioned. It would be rather exploitable if you knew the AI would react in that way to smoke. I think what I taught the AI to do when it cannot see is pretty decent in combination with it's ability to alter move-order at will. It can send in a spotter and have units from far away shoot at whatever the spotter can see. It's not perfect and risky for them too. But it kinda does the trick.


Yeah for Spotter/Sniper coordination, doing exactly that and doing it properly is one of the main reasons that make my AI hard to fight against. I actually shunned away from "firing blindly at sniper-positions". That's mostly because it's hard to emulate "guessing" in a believable way. If the AI "guesses" correctly, it feels like it's cheating. Not that it isn't cheating at all, but I think there's a line that must not be crossed with the cheating and blindly firing at the right positions imho crosses that line.

Staying away from anything that could be used as a sniper-positions is a must against my AI anyways. Fighting anywhere outdoor, especially on maps with little obstacles like arctics or deserts is already extremely tough and makes smoke kind of a must... And then you realize that at least with default-settings Floaters in the air see you anyways.


When it comes to blaster-bombing the command/navigation room on the first turn, I guess there's not really anything the AI can do about. Your counters are not things the AI has control over. That's a map-generation-issue. The player always moving first means there cannot be any counter the AI could possibly employ.

Doing the same thing back to X-Com is not really a counter. It's more a question of opportunity. If they get that opportunity, then they should of course go ahead and do it. Mind-control would also be awesome to counter X-Com using weapons too powerful compared to their armor.

I've also implemented my own version of explosiveEfficacy, which reduced the aliens hesitency to use explosive stuff by making any net-positive in kill:casualty-ratio "worth a shot". Also in particular does a mind-controlled soldier see itself as an enemy worth killing with explosives too! I think that blaster-wielding aliens should probably ignore themselves instead counting themselves as a casualty. Because they usually only have the blaster and when they are the last remaining alien their option is to take the enemy with them or die anyways.

Offline Yankes

  • Global Moderator
  • Commander
  • *****
  • Posts: 3349
    • View Profile
Re: Looking for some advanced strategies and their counters
« Reply #17 on: November 14, 2022, 08:54:29 pm »
The requirements Meridian told me where actually much less conflicting with how I envisioned it than what you told me in the comments about the initial pull-request.

They were:

1. Fully backwards-compatible, which just means that when not using the option, the game behaves exactly like before. That seemed most easy to realize by using my own methods for everything and leaving the methods of the base-AI alone. But that approach is something that you seemed to have taken an issue with due to duplicating code. I have not copied any method that I didn't change at least something in. In the later iterations the changes have become bigger and bigger. So even the initially almost unaltered methods are now quite different than what their origin looked like. They still often fulfill the same task but in a way meant to optimize efficiency rather than emulating OG-behaviour.



OXCE is not fully "compatible" with OG, there is multiple changes in behavior (and even AI) but most of them are subtile and do not affect game play aside of some corner cases.

If feature was critical and important then Meridian would allow small changes in OG behavior, but as he think that new BrutalAI is neither, and because of this, he demand no changes at all in default behavior.
I personalty could permit more changed in OG behavior at least if they are faithful to OG. But for now if Meridian explicit require it from you then I will not try override his request and I consider it still holding.

For you code, as I previously said if your new function is fully configurable then I could accept duplication of code as it make easier to realize Meridian requirements. Only thing I require more is that new AI could be configure in that way that for normal user will not see difference to old AI. This mean not work exactly same but overall similar and you could ignore corner cases. This should be relative easy to do.



2. No work in progress. This was only a problem to me as long as I had no alternative to allow people to test my work beforehand. But we found a compromise where he builds versions for me from a separate branch. I now even prefer it this way as it allows me to experiment with things I probably wouldn't have experimented with before and can tidy everything up later. But that also means it will definitely not happen anytime soon. Developing AI has a bigger scope than adding a new button that does something very specific. So it definitely will take some time until I run out of things to improve.

What you were asking in those comments, however, seemed much more difficult to realize than what Meridian asked for. Especially since it seemed to be partially conflicting with Meridian's requirement #1.

I really do not want to mess around with the original AI code and inject all of my stuff there. This would make ensuring backwards-compatibility very, very difficult and lead to almost incomprehensible code within those methods.

Magic word: Refactor
Some times function it impossible to change but you can rewrite it in that way its behavior do not change but adding new functionality is trivial.
This could even make code easier to read. At least this would be approach I would take to improve code like AI.
This would require lot of skill and time but in long run would reduce work you need to do in improving AI.

Another benefits of refactor like this would be closing all holes in engine logic, some thing like this could even permit changes in visible behavior of aliens.


Again this is not that you should do it now, but how I would try approach this problem. I already apply this approach to some changes I did before in OXCE, last one was custom move cost that required lot of refactor of handle both TU and Energy as limits. This could be inspiration how it could be done for AI.




I think at this point it would be even better to add my AI as a completely new class to keep it even more strictly separated.

Your other point was to make different behaviors of the AI configurable separately. I think that something like that only really starts to make sense when the AI is mostly finished and thoroughly tested so one can actually have an overview of what would make sense to be configurable.

I definitely do not think that every single thing about it should get it's separate switch.

Right now I see 2 main options that I think make sense for it:

1. Respect limitiations. => There's some optional (and controversial, if I read the threads about these correctly) limitations for the regular AI that are active by default. I want my AI to ignore these limitations by default but think there should be a way to reenable all of the them as an option.

2. Giving modders control of when to use it or not. I'm not really sure though what possibilities a modder has when it comes to defining conditions for something like that. There's many potential possibilities and I don't know just yet. For example: Assign it to certain units/unit-ranks. Could, for example have the Leaders and Commanders use it but not the basic soldiers. Or you could want to make the Sectoids use it but not the Mutons.
Other possible scenarios could be to enable it with a turn-timer in a mission... or a month-timer in the game... or for specific mission-types. There's a lot of thinkable scenarios and I don't know yet if I have to specify them separately or if the modder can control all of them with only one hook in the code.

As I said, when it comes to sub-routines also being moddable, we'd first need to define for which sub-routines that makes sense in the first place. This would have to be based on feedback in the sense of: "I wished they could still do that but would not do that."

Now goes my requirements (for now this is only things I will require in future before inclusion of your code to OXCE):

For 1. even if you make separate AI it should obey configs set by modder, as whole point of them was to control AI, if you do not want this restriction make mod that set them all to zero, and this mod could be part of default OXCE install (same how we handle features from UFOextender).
And this should be way how your change be enabled, special mod that can be enabled with any other mod.

For 2. Make simple `struct AiConfig { bool UseBrutalAi, UseBehaviorA, CheckForX, IgnoreZ; void load(const YAML::Node&); };`, AI object get copy of this struct and read only from  it, and do not check any global state. How AI get this struct should not bother you now any way, this will be for future to decide, for now it could be one object for whole `class Mod`.
Every function as part of AI class have access to this `AiConfig` and check for `if (_config.SomeFeatureC)` if you need alter behavior in some subroutine.
For start, function that you will need to allow configure is one that make biggest departure from original AI, this mean modder can restore partially old behavior.
This mean you do not need exactly implement old behavior, but it need be close enough that is easy to miss when you do not know for what to look.
e.g. Door blocking by Xcom soldier, normally AI will fail to open them, but your can do it, you add `if (_config.OpenBlockedDoors)`and this could be `true` by default for your AI.

Offline Xilmi

  • Moderator
  • Commander
  • ***
  • Posts: 642
    • View Profile
Re: Looking for some advanced strategies and their counters
« Reply #18 on: November 14, 2022, 10:19:34 pm »
This is a screenshot from Remnants of the Precursors, which I worked on before.
Which AI to play against is simply an option you choose before you start the game.

One Option for each AI.

This is basically what I intended it to be like for OpenXcom as well.

I must say that what you are asking for exceeds what I'm willing to do.

Emulating the entire current behavior and making every single aspect of it, even little things like opening doors, configurable adds a lot of work that would be no fun for me to do. I do not see AI as something to be microconfigured with mods. To me the relationship between mod and AI is primarily that the AI knows what to do with the toys that modders can give to it.

That's what I'd expect/hope for as a modder. The decision which AI to play against is a decision I want to leave at the player.

As I said, if in feedback some modder asks about disabling or configuring certain aspects of my AI, I'd see some point. But developing all of that in advance for the theorethical possibility that someone might potentially want to mess with it, simply seems to be a bad cost:effort-ratio to me.

I'd also ask to consider the aspect of https://en.wikipedia.org/wiki/Overchoice

Offline Yankes

  • Global Moderator
  • Commander
  • *****
  • Posts: 3349
    • View Profile
Re: Looking for some advanced strategies and their counters
« Reply #19 on: November 14, 2022, 11:08:33 pm »
I nowhere ask for "emulation" only for similar behavior and this is big difference and should not dramatically affect implementation.

Of corse I can't force you to do anything, this is your code and you can do anything you want but we have our own cost/benefits ratio
and for now I do not see if your branch will pass this threshold.

Offline Xilmi

  • Moderator
  • Commander
  • ***
  • Posts: 642
    • View Profile
Re: Looking for some advanced strategies and their counters
« Reply #20 on: November 15, 2022, 01:58:43 am »
I playtested for several hours straight and put most of it on video. All in one play-list now.

Smoke grenades really are extremely potent. I basically emulated the same thing the aliens are supposed to do when there's smoke. Except I have the big advantage of placing the smoke where I want it and having several HE-grenades on everyone. It is also extremely helpful to act quickly to disrupt the aliens from better preparing.

Sometimes some aliens still were in the UFO by the end of the mission. I guess they may have been blocked from exiting it. I think I need a version of the path-finding that ignores their own units so they can at least start to walk out when someone is in the way and go close to the alien blocking the exit.

Edit: Okay, so I did a little experiment: I repeated the same mission twice and also acted the same way, except for one small but crucial difference: In the second attempt I skipped 5 turns at the beginning to allow the aliens to position themselves in the way they want to be positions. And it made a massive difference. The difference that when their spotter closes in on me there's 7 other aliens shooting and not only one or two. So the key to the success is to act quickly and disrupt their preparation.

So what I'm thinking now is that they should continue their preparation and only start to employ their anti-smoke-behavior when the preparation has progressed further.
« Last Edit: November 15, 2022, 02:31:05 am by Xilmi »

Offline Xilmi

  • Moderator
  • Commander
  • ***
  • Posts: 642
    • View Profile
Re: Looking for some advanced strategies and their counters
« Reply #21 on: November 15, 2022, 01:22:03 pm »
Here's my thought process on the situation and approach for the aliens in a clearer wording than what I was capable to deliver at 2 AM:

The problem is not how the aliens deal with smoke-grenades but when. They immediately start shortening the distance in the hope of getting into visual contact. An approach that only really makes sense when you can count on the support of your friends.

However, we have an asymmetry due to map-generation. Since the aliens start scattered across the map and some are in positions that take several turns to participate in any combat, it can be considered suicidal to start charging before everyone is in position. However, staying passive when x-com is advancing towards your position also is no long-term-option.

So my idea is the following: The aliens that spawn outside should try to avoid combat for as long as possible to buy time for their teammates to get into a better position.

They could do that for as long as no X-Com has been spotted. Spotted in this case includes being attacked. If it happens immediately they would fight back. But when X-Com acts slowly. For example by first throwing smoke and then advances from smoke-cloud to smoke-cloud, this delay should be welcomed and used for improving their position. If contact can be delayed for several turns the prospects of an engagement are vastly imroved as a spotter will not enable just one or two other aliens to open fire but ideally all of them.

I can't wait to try this approach and see how it impacts what the missions feel like. Should hopefully increase the tension before combat starts happening and the intensity when it does. Also put more pressure on the player to act more quickly as approaches like skipping the first turn to avoid reaction-fire will come with the disadvantage of giving the aliens more time to organize their own battle-plans.

Offline psavola

  • Commander
  • *****
  • Posts: 827
    • View Profile
Re: Looking for some advanced strategies and their counters
« Reply #22 on: November 15, 2022, 07:09:17 pm »
Most advanced players usually also use motion scanner a lot, especially in non-open maps, next to ufos or if you have substantial amount of smoke. It provides information on whether someone moved within 9 squares in each direction. This is essentially a must have when breaching UFOs, but also essential with buildings, city terror missions etc. to verify whether there are aliens [or civilians] nearby (e.g. in nearby buildings). In OXCE, pressing down ALT after a scan shows the locations on your screen, providing an easy and usable interface to the results.

Looking at the vids, you've nicely adopted the basics of smoke grenades. Bear in mind, however, that thickness of smoke decreases further away you get from the center (and with time, but not sure if the decrease is gradual). While visually "iwthin" smoke, usually about 2-3 squares closest to the edge do not provide guaranteed protection from visibility to the outside.

Offline Xilmi

  • Moderator
  • Commander
  • ***
  • Posts: 642
    • View Profile
Re: Looking for some advanced strategies and their counters
« Reply #23 on: November 16, 2022, 11:22:52 am »
I actually tested how the smoke slowly degrades by disabling the alien's anti-smoke mechanism and just clicking end of turn. Over time more and more of my soldiers became visible and thus shootable again. The process, however, is relatively slow and doesn't play much of a role as by the time it's mostly gone the mission would already have been over.

I have also tested my idea from my last post and frankly it did not change the result by a lot. It did change how the mission plays out though. But not in a way that makes it more interesting. So I scrapped it.

I have a hard time with coming up with other counters for the aliens. One idea is to mimic my own approach more in the sense that the aliens would also use a dedicated spotter instead of closing in with everyone. That way they should at least avoid presenting themselves as easily nadable targets and have more TUs for shooting. However, I'm not seeing how that resolved their main-problem of at best finding my spotter but having access to the rest of my squad denied. It might actually even be disadvantageous as it decreases the chance they will get a first-strike-advantage at all. I'll have to test that though.

In theory they would seek to circumvent my spotter(s) and flank my backline. But that's a very abstract idea that requires quite some thought as to how something like that could actually be put in place.

About the motion-scanners:
Interesting. So the combination of motion-scanners and smoke-grenades seems like a way of gaining a pretty big tactical advantage over the aliens. And with that GUI-trick, You can essentially "see" them without actually having to make visual contact. From the AI's perspective that seems like a tough disadvantage to overcome. So far I really wanted to stick to the unwritten rule that the AI must never attack someone who it hasn't made visual contact with. The player being able to make visual contact much harder to achieve for the aliens and even having ways of not having to make it themselves to shoot them, really is something I'm not sure how to deal with.

Offline Yankes

  • Global Moderator
  • Commander
  • *****
  • Posts: 3349
    • View Profile
Re: Looking for some advanced strategies and their counters
« Reply #24 on: November 16, 2022, 11:28:48 am »
btw, you should not hardcode smoke as opaque for AI as some alines can clearly see though it, and another thing is that fire could blind some alines too.

Offline Xilmi

  • Moderator
  • Commander
  • ***
  • Posts: 642
    • View Profile
Re: Looking for some advanced strategies and their counters
« Reply #25 on: November 16, 2022, 11:54:30 am »
btw, you should not hardcode smoke as opaque for AI as some alines can clearly see though it, and another thing is that fire could blind some alines too.
So far nothing hard-coded about it. The logic is: "I should be in range (according to _save->getMod()->getMaxViewDistance()) but couldn't actually attack something. (as otherwise I wouldn't even have gotten to the movement-part) Conclusion: Either something is impairing my vision or my weapons have limited range."
From that point it doesn't matter what the reason is. The solution was: get closer.

And as I said, this worked pretty well unless I refined my tactical approach to instead of moving my whole team through the smoke a little bit at a time to: A few persons move as much as they can while everyone else stays where they are. This lead to a big shift from "the aliens and I have kinda equal chances to find someone on their respective turn" to "It is now much more likely that I find something from them but they will at most find my people who are running around but not bigger parts of my group".

I thought about whether actually "knowing" about smoke would help the AI in any way. But I couldn't really come up with a scenario where that would be the case. At least not one that could also be exploited. e.g.: "Blindly firing at random locations in the smoke" as a "counter" would immediately stop being useful and become easily exploitable by "throw smoke to deplete their TU's and ammunition".

And as I said: For knowing that you can't see, it doesn't matter why you can't see.

Offline Yankes

  • Global Moderator
  • Commander
  • *****
  • Posts: 3349
    • View Profile
Re: Looking for some advanced strategies and their counters
« Reply #26 on: November 16, 2022, 01:24:38 pm »

I thought about whether actually "knowing" about smoke would help the AI in any way. But I couldn't really come up with a scenario where that would be the case. At least not one that could also be exploited. e.g.: "Blindly firing at random locations in the smoke" as a "counter" would immediately stop being useful and become easily exploitable by "throw smoke to deplete their TU's and ammunition".
Some aliens should do this as its would be fun mechanic, but you need provoke it first by shooting at alien from that smoke or something like that and given alien have low intelligence stat.

Offline Leflair

  • Colonel
  • ****
  • Posts: 252
    • View Profile
Re: Looking for some advanced strategies and their counters
« Reply #27 on: November 16, 2022, 02:38:41 pm »
Speaking of AI units that can see through smoke, like with heatVision (%), I assume all the sniper-positioned aliens could use that unit as their spotter? Guess its similar to having a flying unit that see through most smoke relaying positions.

- One common player strat is to put primed smoke grenades on their units, so if one is killed the smoke grenade drops and pops´ but the AI should reasonably well know the location of the spotted soldiers (guess this falls under spotter-AI).

Dealing with "Hard Cover:" Similar to AI options for their own motion-detector, some AI units have things like psi-vision, but there´s also scenarios where a player can reasonably guess an alien is behind a "soft" wall (wooden planks for example) or inside a building and take (auto) shots to get through the wall and hit the enemy - but this falls under your "no blindfire" rule for the AI? It´s also a scenario where the player is using a lot of these LOS obstacles to step-out-and-shoot and be pretty impervious to the AI (thinking base defenses and "exploiting" the mutual-surprise rule in favor of the player).

- some weapons that can just vaporize walls and keep on going. Either to hit or create an alternative opening in a wall to get at the enemy. But again, blindfire/niche use cases for the AI. But for example, if all approaches are blocked by proxy-grenades.

Speaking of proxy-strats - if the AI has a unit with very good armor vs the proxy-grenade (be it damage type like HE, or just armor thickness) using your out-of-order unit movement to send that unit in first to trigger and soak all the proxy grenades for its buddies?
This could also be an AI strategy if they have a tought armored unit and a bunch of squishies, to send in the tough one to trigger reaction fire and then send in the squishies (especially if they are melee units).

- Been brought up in the thread, but defensive-vs-aggressive AI posturing, depending on mission (aggressive for attacking player bases, maybe more defensive/reaction focused for defending big crashed UFOs/bases)?
One issue with any fixed AI is that it will always behave the same, so once the player figures out its weak-points and behavior they can deal with it every time. I´m guessing you´re familiar with games that use various AI-profiles to sorta getta round this (could be tied to race or mission type).
Guess this could also cover things like certain aliens being flagged to use a specific counter-profile vs smoke (spray and pray vs sacrifice lemming to spot etc).

« Last Edit: November 16, 2022, 02:40:12 pm by Leflair »

Offline Xilmi

  • Moderator
  • Commander
  • ***
  • Posts: 642
    • View Profile
Re: Looking for some advanced strategies and their counters
« Reply #28 on: November 16, 2022, 07:55:10 pm »
Some aliens should do this as its would be fun mechanic, but you need provoke it first by shooting at alien from that smoke or something like that and given alien have low intelligence stat.
Well, theoretically, the following could be done:
When you see shots coming from inside the smoke, you can track them and count how many it were, make an assumption about the TUs they cost and how far the shooting unit could have moved at most after firing.
You could then fire at either the location the shot came from or a random location within the movement-radius according to the leftover TUs. And if you always auto-fire, chances aren't too bad you'd hit something.

Offline Xilmi

  • Moderator
  • Commander
  • ***
  • Posts: 642
    • View Profile
Re: Looking for some advanced strategies and their counters
« Reply #29 on: November 16, 2022, 09:33:39 pm »
- Been brought up in the thread, but defensive-vs-aggressive AI posturing, depending on mission (aggressive for attacking player bases, maybe more defensive/reaction focused for defending big crashed UFOs/bases)?
Instead of making it depend on the mission I was looking for more generalizeable ways to figure out when to do what.
I think I've come up with something quite decent. Staying defensive throughout an entire mission would be pretty bad, especially against someone who uses a lot of smoke. I must say that feature is a bit cursed. In the sense of: Now that I know how good it is, I can't keep myself from using it all the time. But I actually had more fun when I didn't know how to properly utilize it.

One issue with any fixed AI is that it will always behave the same, so once the player figures out its weak-points and behavior they can deal with it every time. I´m guessing you´re familiar with games that use various AI-profiles to sorta getta round this (could be tied to race or mission type).
Guess this could also cover things like certain aliens being flagged to use a specific counter-profile vs smoke (spray and pray vs sacrifice lemming to spot etc).
This depends very much on the mindset. In chess, for example, the best move is also kinda predictable. The catch is, that every move that isn't the best one is just worse and it's unpredictability doesn't make it any better. So I'm pretty much a fan of deterministic behavior. The randomness of the map-generation is where the variety should come from.
I'm all fine with different behaviors. But I then also need an algorithm to tell when which behavior is favorable.

A way to make a convincing spray&pray behavior that neither looks stupid nor like it's cheating while also being overall beneficial for the aliens is something that has become an increasingly attractive idea.