Jump to content

Tactical AI

From UFOpaedia
Revision as of 23:29, 15 March 2012 by Hobbes (talk | contribs) (first draft)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

AI Modes

The game's AI consists of four modes

  • Patrol - the alien will travel between the battlefield nodes defined on the ROUTES.DAT file.
  • Sniper - the alien will not move and will make a 360º turn to look for possible hostiles.
  • Guard (unconfirmed)

If the alien detects an enemy unit (X-COM or civilian) the AI will assess the situation, based on the alien's aggressiveness stats and will trigger its intelligence stat (it will remember the position of the unit for X turns, X being its intelligence value). The AI will then switch the alien's mode to one of the following.

  • Combat - the alien will attack the human unit and/or try to find cover.
  • Escape - the alien will flee the human unit, usually when it is unharmed or it is a higher ranked (Leader, Commander, etc.) alien.

AI Actions

The AI will then order each unit to perform actions:

  • Evaluating Mode
  • GoUfo
  • Finding Route
  • Moving
  • Firing
  • Attack Attempt
  • Select Target
  • Find Cover
  • Partial Cover
  • Final Facing
  • Set Patrol Point - ?????
  • Find Fire Point - ?????

Most of the actions are self-explanatory, but there's no clear explanation of how the AI considers 'Patrol' and 'Fire' points, although an hypothesis can be made from certain clues found on the ROUTES.DAT file.

Route Nodes

As mentioned before, the AI uses patrol routes for each individual map which define the route nodes and the links between them. The record for each node also contains indications on if an unit can spawn there, its type/rank but there are 2 bytes on each node record are unexplained so far. Daishiva's map view calls the first record the 'flags' byte and from several observations aliens tend to be attracted to move/stay on those locations.

According to this theory the aliens will choose a node with the higher value 'flag' when their AI is set for patroling/guarding, unless it is already occupied. The Battleship schematics above show some proof of this, specially on the bridge area (the aliens that start on the bridge room usually never come out except to have a look outside the door). Now look at the plants for the Supply Ship:

The ground and first level almost contains nodes with a 1 value, with a single exception - the 3 and 2 of the engine room. This should explain the aliens' behaviour of only using 1 of the UFO's 2 doors - when an alien moves into the node outside the door, it chooses instead to go to the node with the 3 value, and then to the 2 value, diverting the aliens from the 2nd outside door.

Next one is the Abductor. Usually the aliens don't come out much and you find a large number of them on the main chamber on the ground, due to the concentration of 3/4s that acts as a bottleneck.