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

Online psavola

  • Commander
  • *****
  • Posts: 836
    • View Profile
Re: Looking for some advanced strategies and their counters
« Reply #30 on: November 16, 2022, 09:53:44 pm »
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.

With vanilla behavior, smoke is indeed extremely useful if you want to avoid casualties. To the point that some avoid using it as an additional challenge or by not bothering with it. But mod authors may also force players to manage without it or use less of it, with features (such as heatvision) which decrease the effectiveness of smoke (even eliminate it completely). This can be nicely tuned based on aliens, armor types, etc.

Thus, as was already stated, I don't think the AI should have any hard and fast optimizations wrt. smoke (and if I understood correctly, your AI does not have them). I think it should be perfectly acceptable that in the vanilla game (even with better AI), humans can get an edge by using smoke, motion scanners, and several other techniques that the aliens do not have in the vanilla game. I doubt you can really design a generalized AI to deal with all of them to the max (while not breaking its applicability in mods). If you want more challenge, you can always play a modded version where the game mechanics have been balanced differently.

Offline Xilmi

  • Moderator
  • Commander
  • ***
  • Posts: 642
    • View Profile
Re: Looking for some advanced strategies and their counters
« Reply #31 on: November 16, 2022, 10:35:44 pm »
I think it should be perfectly acceptable that in the vanilla game (even with better AI), humans can get an edge by using smoke, motion scanners, and several other techniques that the aliens do not have in the vanilla game.
I guess that maybe this is the answer afterall. I didn't have 0 losses with smoke against my AI either. Just a lot less than without them. That's what they are there for. If the smoke was everywhere, the aliens wouldn't even be at a disadvantage. It's the fact that I can conceal my units and thus can create a zone that is more dangerous for them than it is for me.
Maybe I've been trying to find a solution to a puzzle that there simply is no solution for.
I've been trying to find an answer for:
"How do 8 Sectoids with plasma-pistols beat 14 Humans with plasma-pistols, smoke-grenades and actual grenades?"
They don't. Because they are outnumbered and outgunned.

I mean we're talking about the most basic alien in crash-landings of small UFOs. Against aliens that can fly, the smoke would be mostly useless. If they were more numerous or more resilient one of them might break past my own spotter and reveal my "core".

I made a small change that should increase their chance of flanking. But depending on the map there's no way to guarantee that'll be successful. I mean if I put myself into their position and think I would have to deal with an enemy that simply has better ods in the first place, I can't find a reliable solution either.

So I guess I'll just leave it like it is in that regard.

Offline Xilmi

  • Moderator
  • Commander
  • ***
  • Posts: 642
    • View Profile
Re: Looking for some advanced strategies and their counters
« Reply #32 on: November 17, 2022, 02:21:12 am »
I actually did end up implementing blindFire.

I think I found a way in which it is neither useless nor feels like the AI is cheating.

The BattleUnit-class got a new member: _tileLastSpotted

So far only when a unit was last seen was stored. Now it is stored where.

This is set in the same instances where it's also set when it happened. So when a unit gets seen, when a unit hits someone with an attack and when a unit kills someone with an attack.

Now after the AI tries to do it's regular attacks of visible units, it will do the blindFire()-method. The key here is that after one attack against such location has been chosen, it is reset. Basically the _tileLastSpotted is set to 0 again. This way they will not waste too much against these tiles.

So the counter-play is to make sure to move your units that have attacked something and ideally also anyone near them and of course in a direction of 90° from where the aliens will be shooting from. Scatter-shots might still hit something.

Online psavola

  • Commander
  • *****
  • Posts: 836
    • View Profile
Re: Looking for some advanced strategies and their counters
« Reply #33 on: November 17, 2022, 06:28:00 am »
"How do 8 Sectoids with plasma-pistols beat 14 Humans with plasma-pistols, smoke-grenades and actual grenades?"
They don't. Because they are outnumbered and outgunned.

I mean we're talking about the most basic alien in crash-landings of small UFOs. Against aliens that can fly, the smoke would be mostly useless. If they were more numerous or more resilient one of them might break past my own spotter and reveal my "core".
...

This sounds very good. Let's consider two scenarios when going after an early-game small UFO. If it's sectoids, you can use smoke (but if you don't, you'll have to be very careful). If it's floaters, your ability to depend on smoke might be much reduced (unless you use 3D smoke option) and you might face heavy losses unless you're careful. This uncertainty forces the player to be on edge. Now, when going for medium+ ufos, sectoids are using PSI. And with your AI, being mind-controlled is so deadly (also for the nearby comrades) and without workarounds, that the only way to deal with it is to abort the mission until you've screened out your weak-minded soldiers. This shifts the game a lot and likely also affects mod design choices. So in general, sectoids are much more dangerous than in vanilla in any case (and you could think of small ufo sectoids only as a special case of an "easy enemy").

Offline Xilmi

  • Moderator
  • Commander
  • ***
  • Posts: 642
    • View Profile
Re: Looking for some advanced strategies and their counters
« Reply #34 on: November 17, 2022, 10:59:06 am »
My testing yesterday has shown that the difficulty against my AI increases kinda exponentially with the number of aliens on the map.

And in order to progress you eventually have to go for bigger UFOs and/or alien bases. So I guess that even the (otherwise)vanilla-run will eventually become a lot more challenging.

I mean 2 out of 3 of these ended more or less in an alien-retaliation against my main-base. Those have a lot more aliens.

There's something about the blind-fire which I don't like: When they shoot a vacant tile, the shot will always target the ground. This vastly reduces the chance of hitting anyone behind. I think it's handled in the same way for the player. It's a bit weird, that the soldier aims differently depending on whether there is someone on the tile or not despite not knowing it. Aiming for the ground is great with stun-launchers. But not with a plasma-rifle.

I also looked into stuff like: When they do the blind-firing, they might as well ignore obstacles and try to destroy potential cover. But that didn't work. If they don't get a line of sight, they don't get to take a shot. The place where that is handled is directly in the method that spawns the projectile. The only way to override it is: "Be the player, have the option enabled hand have the ctrl-key-pressed." I would have expected that kind of API on a higher-level. I'll have to modify that function to allow the AI to do that too.

Another interesting observation was that playing my test-missions on max-alien-tech-level (to increase the chance of grenades) usually made it easier, not harder. Against unarmored targets plasma-pistols with their super-cheap auto-shot are not really a disadvantage to heavy-plasma. The higher tech-level usually has several of them spawn with stun-bomb-launchers. Their high TU-cost means there's usually no more than 1 shot of these per turn. And if they take someone out with it, it doesn't cause morale-loss to the others as the person isn't dead.

Offline Juku121

  • Commander
  • *****
  • Posts: 1799
  • We're all mad here.
    • View Profile
Re: Looking for some advanced strategies and their counters
« Reply #35 on: November 17, 2022, 11:58:46 am »
Efficiency-wise, have you tried your AI on something like an 80x80 map with 60+ enemies? Not so much from an AI POV, but whether the turn times remain reasonable.

Yes, right now the small-blaster is still used like a direct-fire-weapon, which is not ideal but also not overly problematic. But I can totally see that in Mods where the enemies get stuff like rocket-launchers, you'd want to treat all that differently too. Shouldn't be that hard to adapt. I've seen the property of explosion-radius can be derived from the ammunition as that is already done with the blaster-launcher.
I didn't really mean direct-fire explosives, althought that's a consideration as well. What I was trying to get at is that a number of mods have whole families of arcing grenade launchers/mortars, which work pretty close to grenades, and are much more appropriate for 'blind-fire' or just random suppressive fire.

About the motion-scanners:
...
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.
As has already been brought up, aliens can have psi-vision that kinda emulates motion scanner functionality. It's actually better, since scanners leave the Z-coordinate open, which is a major disadvantage on multi-level maps (manors, looking at you >:( ).

...an alien-retaliation against my main-base.
Aren't bases considerably different for smoke usage, since an enemy (or three) can be right around a corner so no smoke will help you there? Potentially making smokes a sub-par tactic.

And if they take someone out with it, it doesn't cause morale-loss to the others as the person isn't dead.
'stunningImprovesMorale: true'?

Offline Xilmi

  • Moderator
  • Commander
  • ***
  • Posts: 642
    • View Profile
Re: Looking for some advanced strategies and their counters
« Reply #36 on: November 17, 2022, 12:47:08 pm »
Efficiency-wise, have you tried your AI on something like an 80x80 map with 60+ enemies? Not so much from an AI POV, but whether the turn times remain reasonable.
Not yet. I will eventually do this. Since the first (and so far only) feedback I've gotten on one of the already released versions was that it's way too slow.
So I've already done a rather drastic step and reduced the calls for line-of-fire-checks from roughly Tiles*n/2*(n/2)² to Tiles*n/2*n, with n being the amount of units on the map. Before that I could tell whether the aliens had fliers or not based on the turn times. After that it became unnoticeable at least with vanilla map-dimensions. I hope this problem is now solved and that a little larger maps and a little more enemies should scale in a more linear fashion, which hopefully makes this a non-issue. But I know I'll have to stay wary of that.

Whether the shot is arcing or not is irrelevant for the explosiveEfficacy-function. I have to make sure that indirect fire and blind-fire take everything into account that explodes. There's code that is similar enough to what I'll need, so it's just a point that eventually needs to get done.

Psi-vision will be very nice for the Aliens using my AI, no question about that. :)

Yes, the more hard-cover there is the less difference smoke-grenades shall make. The way I exploited it worked actually better when there was less real cover, so I could always keep a lot of dudes with line-of-fire to everywhere to then kill what my spotter saw. As soon as the spotter has to break los with his friends, the advantage is gone. And keeping people stacked in a mission where the aliens bring blasters is pretty insane anyways. So I probably won't see many opportunities for smoke to make sense at all. Maybe in a floor leading to a hangar.

'stunningImprovesMorale: true'?
I suppose that's some non-vanilla option that also works both ways in the sense of "gettingStunnedReducesMorale: true". It just was an observation. Not necessarily meaning that something should be done about it. In order to have hopes of ever getting a few soldiers to significantly improved stats high-end-armor is kinda mandatory. And at that point the difference between plasma-pistols and heavy-plasma will be very significant. I don't know whether armor protects against stun. If not, stun-launchers also are much more useful relatively spoken.
I think it's kinda realistic that getting stunned doesn't affect the other's morale.

Offline Rangerh

  • Colonel
  • ****
  • Posts: 126
    • View Profile
Re: Looking for some advanced strategies and their counters
« Reply #37 on: November 17, 2022, 11:52:56 pm »
Wouldn't be much use in default UFO and TFTD as the aliens have 20 tiles of vision at night, but for other mods with a wider variety of enemies , some being human-like and so affected by human-like night vision (9 tiles) , how about some more aggressive use of flares at night battles like the human players do.

This could help at night the not-view enhanced AI troops to spot your own hiding in the dark.
Something i always liked in Jagged Alliance 2, starting to see enemies throwing break lights around to spot your troops better (though sadly often a cheat as those break light were landing right on your soldiers).
Now the difficulty i imagine would be to make the AI flare usage more believable and landing sometime none is hiding (assuming the AI have yet no idea where your squaddies are), not automatically landing where your troops are hiding.
« Last Edit: November 17, 2022, 11:56:38 pm by Rangerh »

Offline Xilmi

  • Moderator
  • Commander
  • ***
  • Posts: 642
    • View Profile
Re: Looking for some advanced strategies and their counters
« Reply #38 on: November 18, 2022, 11:17:12 am »
Wouldn't be much use in default UFO and TFTD as the aliens have 20 tiles of vision at night, but for other mods with a wider variety of enemies , some being human-like and so affected by human-like night vision (9 tiles) , how about some more aggressive use of flares at night battles like the human players do.

This could help at night the not-view enhanced AI troops to spot your own hiding in the dark.
Something i always liked in Jagged Alliance 2, starting to see enemies throwing break lights around to spot your troops better (though sadly often a cheat as those break light were landing right on your soldiers).
Now the difficulty i imagine would be to make the AI flare usage more believable and landing sometime none is hiding (assuming the AI have yet no idea where your squaddies are), not automatically landing where your troops are hiding.
Using flares for AI-units that have impaired night-vision and happen to carry flares sounds like something very specific. Making it believable doesn't sound hard at all. I'd just make them use the same "algorithm" that I use: Throw it at places that they have good line of fire to but that are roughly twice the vision-range away from their each of their soldiers and already thrown flares. This would be completely decoupled of the consideration of enemy-locations. Priority-wise I'd put it between attacking and moving. The API for that is a bit lackluster but I'd just use the same tricks that are being used for the grenades. That means subtracting the 4 TUs it costs to take them from the belt within the AI-code itself.

I only just started exploring the world of Mods yesterday. I fixed an endless-loop caused by turrets not being able to move. But so far nothing else that is based on particular Mod-content.

The exact thing happened that I've been warned about:
The mods scale their difficulty with higher amount of enemies and all sorts of restrictions to what you can do.
Activating Brutal-AI in XCF, for example, meant I got killed/had to abort every single mission after 2-3 turns so far.

Offline Xilmi

  • Moderator
  • Commander
  • ***
  • Posts: 642
    • View Profile
Re: Looking for some advanced strategies and their counters
« Reply #39 on: November 23, 2022, 11:22:39 am »
I'm getting a little frustrated here. The past two days I've basically made no progress.

Ever since I figured out the "trick" to use all those doors in a base-defense-mission to hide on the alien's turn and come out on mine, I couldn't come up with an effective counter for the aliens. At least not without breaking their approach for normal maps.

The issue is that they think a position is save because their enemy has no line of fire. But that's on their turn. One of my guys near them opens a door and sees them. Other guys further up the long corridor come out to shoot with no retaliation-fire possible.

I tried hiding 2 corners away. But that made them too passive, susceptible for AoE and opened them up for flanking. I tried making them brute-force it. Once again this increased AoE susceptibility but actually made them stronger on base-defense-maps as they start relatively spread out. But it's not suitable for normal maps.

The most complicated to program behavior was to make them peek out and hide again on their turn. It does not really counter me doing the same and is essentially dealt with in the exact same way then the 2-corners-away-hiding except they have a little fewer TUs on my turn. I can imagine this to be quite good on normal maps though... if there was no smoke that is. Smoke ruins basically all the advanced tactical approaches and the only semi-decent counter seems to be rushing it.

However, one problem with my tests was that I played the same savegame over and over, so I had a lot of knowledge about what to expect. So it's actually hard to compare to my first encounter there which I lost before discovering the hiding-trick.

One thing I haven't tried yet was blind-fire with blasters. I learned (from reading the code) that putting the last way-point twice makes the missile go down to the floor of the targeted tile. So that would prevent uncrontrollable behavior if there is no target at the blind-fire-position.

I would, however, prefer something safer and related to movement.

Offline Juku121

  • Commander
  • *****
  • Posts: 1799
  • We're all mad here.
    • View Profile
Re: Looking for some advanced strategies and their counters
« Reply #40 on: November 23, 2022, 08:52:16 pm »
What do you mean by "two corners away"? Something like this?

    |    |        |
    |    |        |* - lurking
----    --------     Alien
                 corner 2
     corner 1
----    --------
    |    |        |
    |    / * X-Commie
    |    |    behind
    |    |    door
----    ----

 more X-Com
 down here

Well, if the aliens did that to me, I'd do the following:
  • Camp the corners and reaction-kill any scout that comes around one. Possibly both the first and second corner.
  • Use my melee/assault units to investigate the doors and overwhelm anyone hiding behind those.
  • Use explosives to destroy the doors, and hopefully the door-campers as well. Preferably with direct-fire HE, but grenades and similar might also work.
I suppose vanilla's lack of alien explosives might be a bit troublesome, but Blaster Launchers are exactly the thing for such a situation.

That's also kind of how RL CQC looks like: lots of grenades, calling heavy fire onto enemy positions whevener possible, assaulting with as much surprise and overwhelming force one can muster. And lots of casualties.

Offline Xilmi

  • Moderator
  • Commander
  • ***
  • Posts: 642
    • View Profile
Re: Looking for some advanced strategies and their counters
« Reply #41 on: November 24, 2022, 12:27:03 am »
Yeah, of all the experiments I did to improve the situation the only one that made it in is using blasters.

But I think my mindset was more broken than the AI.

It was like: "I must make the aliens win this mission!"

But now when I actually played a normal game again and not just premade-missions or saves I had played several times before, I realized that when there's actually more at stake than a standalone mission, having the AI have too good chances to win all the time isn't that helpful afterall. :D