Jump to content

Tactical AI: Difference between revisions

From UFOpaedia
first draft
 
No edit summary
Line 3: Line 3:
*Patrol - the alien will travel between the battlefield nodes defined on the ROUTES.DAT file.
*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.
*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.  
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.
*Combat - the alien will attack the human unit and/or try to find cover.
Line 12: Line 11:
* Evaluating Mode  
* Evaluating Mode  
* GoUfo
* GoUfo
* Guard
* Finding Route
* Finding Route
* Moving
* Moving
Line 20: Line 20:
* Partial Cover
* Partial Cover
* Final Facing
* Final Facing
* Set Patrol Point - ?????
* Set Patrol Point (???)
* Find Fire 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.  
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===
===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.
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.


Line 38: Line 39:
[[File:Ufo_170_2_flag.gif]]
[[File:Ufo_170_2_flag.gif]]


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.  
The ground and first level almost contains nodes with a 1 value, with a single exception - the 3 and 2 of the engine room.  


[[File:Ufo_140_0_flag.gif]]
[[File:Ufo_140_0_flag.gif]]
Line 52: Line 53:
[[File:Ufo_130_1_flag.gif]]
[[File:Ufo_130_1_flag.gif]]
[[File:Ufo_130_2_flag.gif]]
[[File:Ufo_130_2_flag.gif]]
Now, what ever all of those those refer to Fire or Patrol points or both is undetermined. However, Laser Squad (the predecessor of Enemy Unknown) used prefixed maps with predetermined regions (each with different threat levels) and the presence enemy units would provoke an AI response. Thus it should make sense that the game uses the values above to determine some of the alien actions, although all of these is speculation based on possibly biased observations.
==See Also==
[[ROUTES.DAT]] - the file that contains all route nodes on a saved tactical game.
[[UNITREF.DAT]] - Specially the discussion on the Talk page of Offset 0x4A.
[[Alien Inventory Use]] - what the AI does and does not use.
[[Alien movement patterns]]

Revision as of 05:55, 16 March 2012

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.

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
  • Guard
  • 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.

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.

Now, what ever all of those those refer to Fire or Patrol points or both is undetermined. However, Laser Squad (the predecessor of Enemy Unknown) used prefixed maps with predetermined regions (each with different threat levels) and the presence enemy units would provoke an AI response. Thus it should make sense that the game uses the values above to determine some of the alien actions, although all of these is speculation based on possibly biased observations.

See Also

ROUTES.DAT - the file that contains all route nodes on a saved tactical game. UNITREF.DAT - Specially the discussion on the Talk page of Offset 0x4A. Alien Inventory Use - what the AI does and does not use. Alien movement patterns