XComStrategyGame.UPK (EU2012)
XComStrategyGame.UPK is a Unreal Engine 3 file used to determine several functions of XCOM: Enemy Unknown related to the strategic layer of the game. XComStrategyGame.UPK is divided into several classes, each related to different aspects of the Geoscape/HQ view and described below.
A complete catalog of the file can be found here: Nexusmods wiki page on XComStrategyGame.UPK.
This page will focus on the practical aspects of the file and how they affect playing the game. For details on how to mod the game, you're advised to check the XCOM section at the Nexusmods wiki.
XGStrategyAI
XGStrategyAI contains most of the functions used to generate UFOs and missions, determine type and composition of alien squads, panic changes and so on. The class is further subdivided into Structures, Variables, Functions and and Default Values. The most important functions will be mentioned below.
AddAIEvent
AddAIEvent is used to add a game event (kEvent) to the array of events generated each month (THQEvent).
Each kEvent added to the array consists a mission, its target (country) and the number of hours it will be available:
- eMission
- eTarget
- iHours
GetEvents
GetEvents generates the array of events for each month (<THQEvent> arrEvents) and uses AddAIEvent to fill it.
It checks for several conditions:
- If iCouncilCounter > 0, it adds a Council mission to the array (11, m_iCouncilCounter / 2, 0)
- If the all the entries on the array of objectives (arrObjectives) are marked as completed it does nothing, otherwise for each uncompleted objective it adds a mission (eMission):
- If objective is 0 (Recon) it doesn't add a mission.
- If objective is 1 (Scout) then eMission = 3 (Crash)
- If objective is 3 (Flyby) and HQ doesn't have Facility 18 (Hyperwave Relay) then eMission = 0 (None), otherwise eMission = 12 (DLC)
- If objective is 4 (Hunt), eMission = 5 (HQAssault)
- If objective is 2 (Harvest), eMission = 4 (LandedUFO)
- If objective is 5 (Abduct), eMission = 2 (Abduction)
- If objective is 6 (Terrorize), eMission = 7 (TerrorSite)