aliens

Author Topic: How to code the AI  (Read 26318 times)

Offline Amunak

  • Colonel
  • ****
  • Posts: 101
    • View Profile
    • My homepage (czech only)
Re: How to code the AI
« Reply #15 on: August 06, 2013, 02:13:18 pm »
You know... Some of us still like the fact that it plays like the original. It's nice to have deadly aliens, but I guess for most people it's not really fun when you play one mission for  four hours only because you have to repeat it over and over again ;)

Offline 54x

  • Colonel
  • ****
  • Posts: 208
    • View Profile
Re: How to code the AI
« Reply #16 on: August 06, 2013, 10:13:22 pm »
You know... Some of us still like the fact that it plays like the original. It's nice to have deadly aliens, but I guess for most people it's not really fun when you play one mission for  four hours only because you have to repeat it over and over again ;)

It doesn't play like the original. ;) If saves were portable you could see for yourself, but iirc, the AI is entirely new code?

Offline Warboy1982

  • Administrator
  • Commander
  • *****
  • Posts: 2333
  • Developer
    • View Profile
Re: How to code the AI
« Reply #17 on: August 07, 2013, 07:20:47 am »
the AI is similar but different, i'm currently working on making it MORE similar, by sifting through the decompiled original and taking notes where appropriate.
i have to say, for the most part what we're doing is very similar to what i'm seeing in the original, except we cheat LESS. in the original the aliens had eyes in the back of their heads, for example, and they know where you are even if they can't see you (not just for psi targetting).
and the cover assessment was MUCH more simple in the original, except they had 2 types of cover, full and partial. i've even found some unused code for melee attacking without a weapon (code that was probably actually put to use in TFTD) which gives me a nice insight into the melee damage calculations regarding melee accuracy and strength.

the AI was much more... squad based in the original. aliens would stop patrolling to seek out enemies they "know of" but can't see when in range, for example. i'll be working on this today ;)

Offline 54x

  • Colonel
  • ****
  • Posts: 208
    • View Profile
Re: How to code the AI
« Reply #18 on: August 07, 2013, 11:13:45 am »
the AI is similar but different, i'm currently working on making it MORE similar, by sifting through the decompiled original and taking notes where appropriate.
i have to say, for the most part what we're doing is very similar to what i'm seeing in the original, except we cheat LESS. in the original the aliens had eyes in the back of their heads, for example, and they know where you are even if they can't see you (not just for psi targetting).
and the cover assessment was MUCH more simple in the original, except they had 2 types of cover, full and partial. i've even found some unused code for melee attacking without a weapon (code that was probably actually put to use in TFTD) which gives me a nice insight into the melee damage calculations regarding melee accuracy and strength.

the AI was much more... squad based in the original. aliens would stop patrolling to seek out enemies they "know of" but can't see when in range, for example. i'll be working on this today ;)

Cheers for that clarification, I was aware we were making it more similar in a lot of individual ways and that it was currently original code, but this clarifies that a lot... :D

Offline mercy

  • Colonel
  • ****
  • Posts: 341
    • View Profile
Re: How to code the AI
« Reply #19 on: August 07, 2013, 11:22:02 am »
Just make it fun:
- which meant aliens cheat a lot
-  they have eyes in their back - they are clairvoyant / telepathic / superintelligent - that would mean aliens "smell" and sense the miasma of human thoughts so they most of the time know where soldiers are.   

Unless 20-30% of the time the soldiers mind is able to contain fear so his/hear thoughts doesn't "smell" as strong.

Offline Mr. Quiet

  • Commander
  • *****
  • Posts: 523
  • Likes: Quiet things. Dislikes: Loud things.
    • View Profile
    • =Open_X_Com= Mods
Re: How to code the AI
« Reply #20 on: August 07, 2013, 11:45:34 am »
Hahahaha mercy but I want the aliens to use real and badass squad tactics to strategically take you down once they spot you. I want to be shocked at what they can pull off. I'm waiting for Xenonauts to fulfill that promise hehehehe  8) they promised hardcore alien A.I. without boosting stats.
« Last Edit: August 07, 2013, 11:51:49 am by WeOwnTheNight »

Offline kevL

  • Colonel
  • ****
  • Posts: 482
  • pitchforks and torches
    • View Profile
Re: How to code the AI
« Reply #21 on: August 07, 2013, 03:47:41 pm »
sounds like there's two (strongly) divergent camps..

Personally I don't want oXc to become a purebred tactical shooter sim. i want it like the original.

Take chyrssalids... remember how they would stagger and strut back and forth in front of your front line soldiers? I haven't met any yet in the new AI, but in the old I'd freak out whenever they started pacing toward my dudes, then sigh of relief when they turn away, then freak out as they turn back and come a few paces closer....

i Mean, if we really want it hardcore: they turn a corner, see your guys, make a beeline and that's that.


+1 for original, "alien" AI here

Offline mercy

  • Colonel
  • ****
  • Posts: 341
    • View Profile
Re: How to code the AI
« Reply #22 on: August 12, 2013, 02:25:17 pm »
Regarding fun gameplay the only serious feature OpenXCOM needs now is a better AI than XCOMUTIL+UFO Extender.

Offline Surrealistik

  • Colonel
  • ****
  • Posts: 486
    • View Profile
Re: How to code the AI
« Reply #23 on: August 13, 2013, 12:05:04 am »
I want smart, tactical AI, not the retardation of the original.

Offline kevL

  • Colonel
  • ****
  • Posts: 482
  • pitchforks and torches
    • View Profile
Re: How to code the AI
« Reply #24 on: August 13, 2013, 12:54:36 am »
well, the thing is there's 4 battlemodes in the original: patrol, attack, ambush, flee...

if those get implemented tightly I'd be hap.

Offline Warboy1982

  • Administrator
  • Commander
  • *****
  • Posts: 2333
  • Developer
    • View Profile
Re: How to code the AI
« Reply #25 on: August 13, 2013, 02:02:12 am »
i'm working on it, but i need help, i can't handle this on my own.
i'm pretty sure i have the decision making figured out, but some of the functions are a little obscure.
mostly it's to do with the nodes.
the original stored info on node links, specifically, what movement type was valid between one node and another.
it also did a lot of target calculation based on these nodes. i can assume that the nodes were used as a way of cutting down on calculations, as they could be placed by hand in logical positions, rather than forcing the AI to evaluate every single tile.
i've managed to identify what triggers each type of behaviour, and how it flows, but the devil is in the details, as they say. there's a LOT of alteration required.

if anyone is interested in helping me out, i'm almost always available on IRC.

Offline Mr. Quiet

  • Commander
  • *****
  • Posts: 523
  • Likes: Quiet things. Dislikes: Loud things.
    • View Profile
    • =Open_X_Com= Mods
Re: How to code the AI
« Reply #26 on: August 13, 2013, 07:06:32 am »
I like original aliens too. I just want them to do more than the usual. This will be fun for Warboy :)
Each time I get into the battlescape, I want the aliens to be ready for me and they'll always have different setups. Some will be ambushes waiting for you to come to them if they're weak and low in numbers. Others will be immediate assaults on your Skyranger if you don't move out quick enough. Scattered aliens is fine, I just want them to regroup or plan well when they see you showing up. They'll always know oyur position unless it's a Crash Site mission, where they might be injured and dizzy ::)

In midgame, when the aliens are reaching full strength with Mutons and large ships, they'll work in small squads of 2 to 4, each with a different strategy and some working together like an assault team that will attempt flanking maneuvers while your operatives are busy in a firefight, taking plasma shots from a short distance away. Others will wait patiently for your appearance so they can snipe you from the high ground. Another team will attempt to go the long way, away from the battles and toward your Skyranger if you're not careful enough. If you left Ops inside your trans, they'll probably throw a grenade inside before going in. I'd say it's smart to run into the nearest two to three story and set up shop.

Good luck Warboy, we appreciate all your work. We just want the best and the most evil alien A.I.

Offline kevL

  • Colonel
  • ****
  • Posts: 482
  • pitchforks and torches
    • View Profile
Re: How to code the AI
« Reply #27 on: August 13, 2013, 11:46:17 am »
dammit i'm just trying to get them to do a death pirouette, Jim!

/ McCoy


[edit] woohoo!
good luck, Wb. I hope someone else w/ chops dives in...
« Last Edit: August 13, 2013, 05:57:59 pm by kevL »

Offline Warboy1982

  • Administrator
  • Commander
  • *****
  • Posts: 2333
  • Developer
    • View Profile
Re: How to code the AI
« Reply #28 on: August 13, 2013, 07:39:13 pm »
starting to make some real progress, though nothing compilable yet.

Offline mercy

  • Colonel
  • ****
  • Posts: 341
    • View Profile
Re: How to code the AI
« Reply #29 on: August 14, 2013, 10:11:04 am »
i'm working on it, but i need help, i can't handle this on my own.
[..]

You mean you need help in looking at the vanilla code in the debugger and figure out how their ASM works regarding AI?  What functions go where do what?