Air Combat - XCOM:EU 2012

From Nexus Mods Wiki
Revision as of 04:01, 28 January 2014 by Dubiousintent (talk | contribs) (Update content)
Jump to: navigation, search


Overview

The following is derived from the Nexus Forums thread Editing ship-based weapons, and (with permission) material from the UFOpaedia wiki article 'Air Combat (EU2012)'. The primary difference between that article and this is a focus on information related to creating mods. There is additional material of interest to the player on UFOpaedia but not necessary to creating mods which has been omitted.

Air combat is a part of the Strategy Game in XCOM. Player participation is limited to outfitting and deploying aircraft to XCOM bases in countries with satellite coverage, selection of aircraft to launch for a particular sortie, and electing to break off contact before the aircraft is destroyed. This is detailed in the #Air Combat Mechanic sub-topic.

The functions which need to be modified to alter Aircraft Weapons are identified and described.

Programs and Tools

Details

Air Combat Mechanic

[This material is taken practically verbatim (with minor edits) from the UFOpaedia article. Used with permission.]

Detection

UFOs can only be engaged after they are detected by satellites and these will never detect UFOs on Abductions or Terror missions. There can be two UFOs each month, but the second UFO has a 50% chance of being generated, according to the values on the DefaultGameCore.INI file. Each UFO has a 66% chance of requiring an interception.

Dogfight Minigame

Once the Interceptor has been launched, you will watch it chase the UFO on the world map until it catches up, at which point you will enter the dogfight minigame interface.

[The UFOpaedia article has a screenshot: A Raven intercepts an Alien Supply Barge UFO. The Raven has taken about 20% damage and has Aim and Dodge modules active, indicated by the highlighting.]

Key: [Elements displayed on the UFOpaedia screenshot.]

  • Time to loss of contact. If this reaches 0, the UFO will escape the Interceptor and will have to be re-engaged with another Interceptor, if one is available.
  • The Interceptor craft.
  • The UFO. With practice you can learn to identify different UFO types in this interface.
  • Damage meter. When hit, this fills from the bottom. If this turns all red, the Interceptor is destroyed. You'll get a warning from the pilot at about 75% damage accumulated.
  • Abort Interception. Break off the interception and return to base. Useful if the Interception craft is getting pounded.
  • Engage UFO Tracking module, if one is available. Freezes Loss of Contact clock for five seconds, and decreases approach time for close range weapons.
  • Engage Uplink Targeting module, if one is available. Guarantees next two attacks from Interceptor hit UFO.
  • Engage Defensive Matrix module, if one is available. Allows Interceptor to dodge next two attacks from the UFO that would otherwise hit.

After Action Report

After the minigame ends, you will receive an Interception After Action Report. This will summarize the results of the interception. This is divided into three categories.

  • Result: This states whether the UFO escaped pursuit, was shot down, or the interception was aborted.
  • Crash: If the UFO was shot down, this will indicate that crew was seen moving at the crash site, allowing a Crash Recovery mission.
  • Interceptor: This indicates what happened to your Interceptor. It can receive NO damage, LIGHT damage (1-33%), HEAVY damage (33-66%), SEVERE damage(66-99%) or have been shot down altogether.

Multiple Craft Interception

Unlike the original XCOM, you cannot use multiple craft to simultaneously attack a single UFO. Instead, multiple craft serve as sequential opportunities to shoot down the UFO, with each aircraft being deployed one after another to attack the UFO.

Air Combat Results

The functions to calculate air combat results are found in:

XComStrategyGame.UPK, class XGInterceptionEngagement, functions:

  • UpdatePosition,
  • UpdateWeapons.

Modifying Ship Weapons

Code for ship weapons is in XComStrategyGame.UPK, class XGItemTree, BuildShipWeapons function. (See #Ship Weapons Codes section.)

The function takes the following parameters: BuildShipWeapon(eType, iAmmo, iRange, fFiringTime, iDamage, iArmorPen, iToHit)

To modify, change the appropriate value under the "case #" statement for the chosen difficulty. (See #Function BuildShipWeapon in the #Code Breakdown sub-topic for specifics.)

Separate Content

Craft & Armaments Stats

[This material is taken verbatim from the UFOpaedia article. Used with permission.]

Craft Stats
Craft Range Size Default Weapons Speed Engagement Speed HP Armor Armor Penetration
Interceptor 25 Small Avalanche 1500 10 2500 5 0
Skyranger 1 25 Small N/A 2000 10 8 0 0
Firestorm 25 Small Avalanche 3500 20/20/15/15 6500 25 34/34/16/16
Small Scout 25 Small UFO Plasma I 1500 20 800 0 7
Large Scout 25 Medium UFO Plasma I 1800 22 1600 0/0/0/2 7
Abductor 25 Large UFO Plasma II 2000 17 1800/1800/2200/200 5/5/10/13 3
Supply Barge 25 Large UFO Plasma II 2500 25 2000/2000/2400/2400 16/16/30/36 4
Battleship 25 Very Large UFO Fusion 3000 40 2400/2400/2900/2900 52/52/42/52 20
Overseer 25 Medium UFO Plasma I
UFO Plasma II
3500 60 2500 64/64/45/52 25
1Although the Skyranger isn't used for air combat, the game files have values for it.
Values in brackets display differences between difficulty levels (Easy/Normal/Classic/Impossible)
Source: XComStrategyGame.upk game file, XGItemTree class, Enemy Within DLC version.
Armament Stats
Weapon Range Firing Time Damage Armor Pen To Hit
Phoenix Cannon 85 1 350 11/11/6/6 95%
Avalanche 100 2 400 0 70%
Laser Cannon 85 0,75 400 25/25/25/28 85%
Plasma Cannon 100 1,25 800/800/700/700 48/48/33/33 85%
EMP Cannon 85 1,25 1200 44 100%
Fusion Lance 100 1,5 1400 44 90%
UFO Plasma I 101 1,25 300 0 75%
UFO Plasma II 101 1,25 400/400/400/500 20 75%
UFO Fusion 101 1,25 1200/1200/1250/1625 25 75%
Values in brackets display differences between difficulty levels (Easy/Normal/Classic/Impossible)
Source: XComStrategyGame.upk game file, XGItemTree class, Enemy Within DLC version.

Ship Weapons Codes

XCOM and alien ship weapons
Weapon Type Name Operator Codename
1 Phoenix Cannon XCOM Cannon
2 Stingray Missiles N/A Stingray
3 Avalanche Missiles XCOM Avalanche
4 Laser Cannon XCOM Laser
5 Plasma Cannon XCOM Plasma
6 EMP Cannon XCOM EMP
7 Fusion Lance XCOM Fusion
8 UFO Plasma Cannon I Aliens UFOPlasmaI
9 UFO Plasma Cannon II Aliens UFOPlasmaII
10 UFO Fusion Lance Aliens UFOFusionI

Damage Formula

[This material is taken verbatim from the UFOpaedia article. Used with permission.]

Damage from the shots is calculated according to the following formulas:

0.05 * (Target Ship Armor - (Weapon AP + Firing Ship AP) = Final Mitigation (value clamped between 0 and 0.95)
Target Ship Damage = Weapon Damage * (1 - Final Mitigation)

Damage Table

[This material is taken verbatim from the UFOpaedia article. Used with permission.]

Matchups proven winnable without the use of modules:

Difficulty Easy Normal Classic Impossible
Scout Interceptor w/Avalanche Missiles Interceptor w/Avalanche Missiles Interceptor w/Avalanche Missiles Interceptor w/Avalanche Missiles
Large Scout Interceptor w/Avalanche Missiles Interceptor w/Avalanche Missiles Interceptor w/Avalanche Missiles Interceptor w/Avalanche Missiles

(misses and timeout may require 2)

Abductor Interceptor w/Avalanche Missiles Interceptor w/Phoenix Cannon

or Interceptor w/Avalanche Missiles x2 (x1 possible)

Interceptor w/Phoenix Cannon x2 (x1 possible)

or Interceptor w/Avalanche Missiles x3 (x2 possible)

Interceptor w/Laser Cannon

or Interceptor w/Phoenix Cannon x2

Supply Barge Interceptor w/Phoenix Cannon Interceptor w/Phoenix Cannon x2 (x1 possible) Interceptor w/Laser Cannon Interceptor w/Laser Cannon x2
Battleship Interceptor w/Plasma Cannon Interceptor w/Plasma Cannon x2 (x1 possible) Firestorm w/Laser Cannon Firestorm w/Plasma or EMP Cannon
Overseer UFO Firestorm w/Laser Cannon Firestorm w/Laser Cannon x2 (x1 possible) Firestorm w/Laser Cannon x2 Firestorm w/EMP Cannon (1 w/Plasma Cannon possible)

In Enemy Within, UFO "hit points" seem to be slightly higher in Classic mode, and significantly so in Impossible. The listed matchups are still possible, but for regular success against Impossible Abductors, Barges, and Battleships, a module (or luck) may be needed on top of these matchups, or another Interceptor to make up the difference. The Battleship's Fusion Lance seems more potent, as well.

Code Breakdown

Function BuildShipWeapon

BuildShipWeapon(eType, iAmmo, iRange, fFiringTime, iDamage, iArmorPen, iToHit)

Case 0: Easy Case 1: Normal Case 2: Classic Case 3: Impossible

function BuildShipWeapons()
{
   m_arrShipWeapons.Add(11);
   switch(Game().GetDifficulty())
   {
       case 0:
           BuildShipWeapon(1, -1, 85, 1.0, 350, 11, 95);
           BuildShipWeapon(3, 3, 100, 2.0, 400, 0, 70);
           BuildShipWeapon(4, -1, 85, 0.750, 400, 25, 85);
           BuildShipWeapon(5, 10, 100, 1.250, 800, 48, 85);
           BuildShipWeapon(6, -1, 85, 1.250, 1200, 44, 100);
           BuildShipWeapon(7, 10, 100, 1.50, 1400, 44, 90);
           BuildShipWeapon(8, -1, 101, 1.250, 300, 0, 75);
           BuildShipWeapon(9, -1, 101, 1.250, 400, 20, 75);
           BuildShipWeapon(10, -1, 101, 1.250, 1200, 50, 75);
           break;
       case 1:
           BuildShipWeapon(1, -1, 85, 1.0, 350, 11, 95);
           BuildShipWeapon(3, 3, 100, 2.0, 400, 0, 70);
           BuildShipWeapon(4, -1, 85, 0.750, 400, 25, 85);
           BuildShipWeapon(5, 10, 100, 1.250, 800, 48, 85);
           BuildShipWeapon(6, -1, 85, 1.250, 1200, 44, 100);
           BuildShipWeapon(7, 10, 100, 1.50, 1400, 44, 90);
           BuildShipWeapon(8, -1, 101, 1.250, 300, 0, 75);
           BuildShipWeapon(9, -1, 101, 1.250, 400, 20, 75);
           BuildShipWeapon(10, -1, 101, 1.250, 1200, 50, 75);
           break;
       case 2:
           BuildShipWeapon(1, -1, 85, 1.0, 350, 6, 95);
           BuildShipWeapon(3, 3, 100, 2.0, 400, 0, 70);
           BuildShipWeapon(4, -1, 85, 0.750, 400, 25, 85);
           BuildShipWeapon(5, 10, 100, 1.250, 700, 33, 85);
           BuildShipWeapon(6, -1, 85, 1.250, 1200, 44, 100);
           BuildShipWeapon(7, 10, 100, 1.50, 1400, 44, 90);
           BuildShipWeapon(8, -1, 101, 1.250, 300, 0, 75);
           BuildShipWeapon(9, -1, 101, 1.250, 400, 20, 75);
           BuildShipWeapon(10, -1, 101, 1.250, 1250, 50, 75);
           break;
       case 3:
           BuildShipWeapon(1, -1, 85, 1.0, 350, 6, 95);
           BuildShipWeapon(3, 3, 100, 2.0, 400, 0, 70);
           BuildShipWeapon(4, -1, 85, 0.750, 400, 28, 85);
           BuildShipWeapon(5, 10, 100, 1.250, 700, 33, 85);
           BuildShipWeapon(6, -1, 85, 1.250, 1200, 44, 100);
           BuildShipWeapon(7, 10, 100, 1.50, 1400, 44, 90);
           BuildShipWeapon(8, -1, 101, 1.250, 300, 0, 75);
           BuildShipWeapon(9, -1, 101, 1.250, 500, 20, 75);
           BuildShipWeapon(10, -1, 101, 1.250, 1625, 50, 75);
           break;
       default:
   }
}

References

Referred to by this article:



That refer to this article:
None as yet