aliens

Author Topic: Alien's dual weapon wielding? (AI question)  (Read 6126 times)

Offline Orz

  • Colonel
  • ****
  • Posts: 147
  • (aka Illamasqua)
    • View Profile
Alien's dual weapon wielding? (AI question)
« on: February 06, 2016, 04:30:06 pm »
I give Alien Commanders a Blaster Launcher and a Plasma Pistol. They hardly ever (don't think I've ever seen them yet, but I'm only now beginning to realize) use Blaster Launcher. They stick to Pistol, and I've tested several times on debug mode already. 

So what determines AI's choice of weapon? Do they just go for the "faster" one (lower TU cost) every time? I'd like some aliens to wield two weapons (Big Gun or Drill usually paired up with a Pistol so they are not limited to Blaster/DPL's "situational" application or Drill's close-range risk factor). I mean, they use grenades just fine.

I guess my question is this: am I hampering Ai's use of Blaster Launcher by pairing them up with Pistols (or any other secondary weapon)?

PS: Also, does AI ever draw/use weapons from "back pack" or is it limited to just right/left hand and belt?

Offline hellrazor

  • Commander
  • *****
  • Posts: 2013
  • Deep Ruleset Digger & Bughunter
    • View Profile
    • Github Account
Re: Alien's dual weapon wielding? (AI question)
« Reply #1 on: February 06, 2016, 06:03:31 pm »
The AI is to put it simply, to stupid to use 2 ranged weapons properly.

What you can do is give them different kind of weapons, like ranged weapon + melee weapon + grenade.
I gave the aliens with Blaster Launchers in my Hardmode Expansion Mod a Plasma Sword, so they can defend themself
in close combat, works very nicely.
« Last Edit: February 06, 2016, 11:12:54 pm by hellrazor »

Offline Dioxine

  • Commander
  • *****
  • Posts: 5412
  • punk not dead
    • View Profile
    • Nocturnal Productions
Re: Alien's dual weapon wielding? (AI question)
« Reply #2 on: February 06, 2016, 08:09:58 pm »
So what determines AI's choice of weapon? Do they just go for the "faster" one (lower TU cost) every time?
PS: Also, does AI ever draw/use weapons from "back pack" or is it limited to just right/left hand and belt?

It will always use the weapon with fastest Snap Shot, all else be damned. Disabling Snap Shot won't help.
The AI can only draw grenades from inventory as far as I know. It doesn't differentiate between belt and other parts of inventory. Uses the belt as priority because it's hardcoded to do so (due presumably lowest TU cost to draw from belt).
« Last Edit: February 06, 2016, 08:11:49 pm by Dioxine »

Offline Orz

  • Colonel
  • ****
  • Posts: 147
  • (aka Illamasqua)
    • View Profile
Re: Alien's dual weapon wielding? (AI question)
« Reply #3 on: February 07, 2016, 02:20:35 am »
It will always use the weapon with fastest Snap Shot, all else be damned.

Well, that sucks! So much for my attempt at giving the aliens more offensive versatility  :-\

It would also seem that they'd very much prefer to use Alien Grenades and even Psi-Attacks over Blaster Launchers, almost as if they are deliberately shying away from using the BMG! I guess this was the reason why those aliens in vanilla who *did* use Blaster Launcher were limited to just that one single weapon (no Grenades) and, in many cases, high-ranking aliens (who'd be Psi-Skilled) were given Rifles or Heavies instead.

It's really sad, so much potential wasted.

Offline Dioxine

  • Commander
  • *****
  • Posts: 5412
  • punk not dead
    • View Profile
    • Nocturnal Productions
Re: Alien's dual weapon wielding? (AI question)
« Reply #4 on: February 07, 2016, 12:26:54 pm »
This AI and vanilla AI are different. The devs tried to make it as similar as possible, but it cannot be helped, as the new one was written from scratch. Blaster has a very low usage priority in OXC, even if you don't give its operator any other weapons.

Offline Eddie

  • Commander
  • *****
  • Posts: 560
    • View Profile
Re: Alien's dual weapon wielding? (AI question)
« Reply #5 on: February 08, 2016, 12:05:32 am »
Blaster Launcher / DPL is a tricky weapon indeed. From what I remember of the vanilla game, when Aliens used Blaster/DPL a lot of the times they blew themselves up with it. I don't remember Blaster/DPL beeing a particularly fearful weapon in alien hands. But that could also be because by the time Blaster/DPL was a widespread weapon I was using MC on anything anyway.

Lets face it, the way Blaster/DPL is right now is not easy to use for the AI and heavily favors the player. To remedy this, it would be easier to change the Blaster/DPL before trying to teach the AI how to effectively use it. Maybe change the firing type from the waypoint thingy to an arcing projectile. I imagine this would not favor the player so heavily, but I need to playtest this to see if it actually helps the aliens.

Offline Warboy1982

  • Administrator
  • Commander
  • *****
  • Posts: 2333
  • Developer
    • View Profile
Re: Alien's dual weapon wielding? (AI question)
« Reply #6 on: February 14, 2016, 08:19:17 am »
Well, that sucks! So much for my attempt at giving the aliens more offensive versatility  :-\

It would also seem that they'd very much prefer to use Alien Grenades and even Psi-Attacks over Blaster Launchers, almost as if they are deliberately shying away from using the BMG! I guess this was the reason why those aliens in vanilla who *did* use Blaster Launcher were limited to just that one single weapon (no Grenades) and, in many cases, high-ranking aliens (who'd be Psi-Skilled) were given Rifles or Heavies instead.

It's really sad, so much potential wasted.

don't take dioxine's word as gospel, that part about the belt in particular is nonsense, and the whole faster snapshot thing only pertains to reaction fire.

the main reason they weren't using the blaster launcher effectively (if at all) was due to a pathfinding bug, which has been fixed.
« Last Edit: February 14, 2016, 08:32:57 am by Warboy1982 »

Offline Dioxine

  • Commander
  • *****
  • Posts: 5412
  • punk not dead
    • View Profile
    • Nocturnal Productions
Re: Alien's dual weapon wielding? (AI question)
« Reply #7 on: February 14, 2016, 02:54:30 pm »
don't take dioxine's word as gospel, that part about the belt in particular is nonsense, and the whole faster snapshot thing only pertains to reaction fire.

I'm mostly repeating what you've once told me, Warboy :) (except the inventory issues, that's solely from my own experience). Good stuff you've fixed these bugs. So how does it all work now?
« Last Edit: February 14, 2016, 03:01:25 pm by Dioxine »

Offline Orz

  • Colonel
  • ****
  • Posts: 147
  • (aka Illamasqua)
    • View Profile
Re: Alien's dual weapon wielding? (AI question)
« Reply #8 on: February 14, 2016, 10:04:44 pm »
don't take dioxine's word as gospel, that part about the belt in particular is nonsense, and the whole faster snapshot thing only pertains to reaction fire.

the main reason they weren't using the blaster launcher effectively (if at all) was due to a pathfinding bug, which has been fixed.

Wonderful. Just last night I was doing Sigsbee (T'leth pt. 1) and was surprised to see a couple good uses of DPL already! How they managed to make all those sharp turns (like zing, zing, zing, zing, zing!) in such a tight and narrow environment made my day. Granted, a Tasoth blasted itself with DPL in the following mission, but at least he took 2 aquanauts with him in the process. I'd like to think that the AI did that on purpose :P

Offline Yankes

  • Commander
  • *****
  • Posts: 3194
    • View Profile
Re: Alien's dual weapon wielding? (AI question)
« Reply #9 on: February 15, 2016, 12:02:31 am »
I'm mostly repeating what you've once told me, Warboy :) (except the inventory issues, that's solely from my own experience). Good stuff you've fixed these bugs. So how does it all work now?
Probably its caused partially by my lagging behind nightly with my version.

Offline Warboy1982

  • Administrator
  • Commander
  • *****
  • Posts: 2333
  • Developer
    • View Profile
Re: Alien's dual weapon wielding? (AI question)
« Reply #10 on: February 15, 2016, 12:44:43 am »
https://github.com/SupSuper/OpenXcom/commit/abf8bbf0fe18b801c8e2186e1b8f7497c38a0332

that's the guts of it. the main problem was that blaster launcher pathfinding wasn't following blaster launcher rules, because i had a -1 where i should have put 10000. adjusting this made the missiles work the way they should have in the first place. secondary to that, the blaster bomb pathfinding didn't avoid friendly fire. finally in some cases it was pathing up and down through elevators when it shouldn't have.
« Last Edit: February 15, 2016, 01:22:10 am by Warboy1982 »