Difference between revisions of "Modding Tools - XCOM:EU 2012"

From Nexus Mods Wiki
Jump to: navigation, search
 
Line 20: Line 20:
 
* [http://www.unrealengine.com/udk/ Unreal Development Kit (UDK)] is the official game developer tool site.  Free for educational and non-commercial use.
 
* [http://www.unrealengine.com/udk/ Unreal Development Kit (UDK)] is the official game developer tool site.  Free for educational and non-commercial use.
 
: See [http://udn.epicgames.com/Three/WebHome.html Unreal Developer Network (UDN) UE3 Home] for many UDK articles and resources.
 
: See [http://udn.epicgames.com/Three/WebHome.html Unreal Developer Network (UDN) UE3 Home] for many UDK articles and resources.
 +
  
 
==== UE Explorer ====
 
==== UE Explorer ====
* [http://eliotvu.com/portfolio/view/21/ue-explorer UE Explorer]: an UnrealScript decompiler to look through the uncompressed UPK files.
 
:: '''Description:'''
 
:: An Unreal Engine decompiler. For more information on decompilers in general, see this [http://en.wikipedia.org/wiki/Decompiler Decompiler] Wikipedia article. This program lets you see the code almost as their creators wrote it, providing key information you will need to change UPK files, such as getting its hex representation, etc.<br>
 
:: [http://eliotvu.com/forum/forumdisplay.php?fid=15 UE Explorer Documentation]
 
:: '''Installation:'''
 
:: Install it anywhere you want.
 
  
: Eliot van Uytfanghe is the author of '''UE Explorer''', the principle generic Unreal Engine investigative tool on the XCOM forums. His [http://eliotvu.com/forum/index.php web site] has much useful information, such as:
+
:* [http://eliotvu.com/forum/showthread.php?tid=41&pid=246#pid246 How to decompress packages]
+
 
:* [http://eliotvu.com/portfolio/view/21/ue-explorer Description of UE Explorer]
+
:* [http://eliotvu.com/forum/forumdisplay.php?fid=14 Discussion of UPK file formats]
+
 +
 +
 +
 +
 +
 
 +
:Eliot van Uytfanghe is the author of '''UE Explorer''', the principle generic Unreal Engine investigative tool on the XCOM forums. His [http://eliotvu.com/forum/index.php web site] has much useful information, such as:  
 +
:*[http://eliotvu.com/forum/showthread.php?tid=41&pid=246#pid246 How to decompress packages]  
 +
:*[http://eliotvu.com/portfolio/view/21/ue-explorer Description of UE Explorer]  
 +
:*[http://eliotvu.com/forum/forumdisplay.php?fid=14 Discussion of UPK file formats]  
 +
  
: Eliot has released the source code of his '''Unreal Library''' that is part of '''UE Explorer''' and is what makes up the whole '''UnrealScript''' part of the program (basically anything but its interface). This enables other developers to:
+
:Eliot has released the source code of his '''Unreal Library''' that is part of '''UE Explorer''' and is what makes up the whole '''UnrealScript''' part of the program (basically anything but its interface). This enables other developers to:  
:* Add custom games support for '''UE Explorer''' and other tools.
+
:*Add custom games support for '''UE Explorer''' and other tools.  
:* Build your own tools for '''.UPK''' files.
+
:*Build your own tools for '''.UPK''' files.  
:* Enhance the code output in the way that you may like it.
+
:*Enhance the code output in the way that you may like it.  
:* The '''Eliot.UELib.dll''' can be replaced by your custom one, so long as it doesn't break compatibility.
+
:*The '''Eliot.UELib.dll''' can be replaced by your custom one, so long as it doesn't break compatibility.
  
: You can fork the source code, and find instructions for use, under the '''EliotVU/Unreal-Library''' repository at [https://github.com/EliotVU/Unreal-Library GitHub]. The source code is released under the terms of the [https://tldrlegal.com/license/mit-license MIT license].
+
:You can fork the source code, and find instructions for use, under the '''EliotVU/Unreal-Library''' repository at [https://github.com/EliotVU/Unreal-Library GitHub]. The source code is released under the terms of the [https://tldrlegal.com/license/mit-license MIT license].  
: Files of interest:
+
:Files of interest:  
  
:* [https://github.com/EliotVU/Unreal-Library/blob/master/Core/Decompilers/UnDecompiler.cs UnDecompiler.cs] This is the file that outputs most of the code you see in function blocks.
+
:* [https://github.com/EliotVU/Unreal-Library/blob/master/UnrealPackage.cs UnrealPackage.cs] Deserializes the package summary and holds references to all objects within the package.
+
:*[https://github.com/EliotVU/Unreal-Library/blob/master/Core/Decompilers/UnDecompiler.cs UnDecompiler.cs] This is the file that outputs most of the code you see in function blocks.  
:* [https://github.com/EliotVU/Unreal-Library/blob/master/UnrealTables.cs UnrealTables.cs] Deserializes all table structures: Names, Exports, Imports, and so on.
+
:*[https://github.com/EliotVU/Unreal-Library/blob/master/UnrealPackage.cs UnrealPackage.cs] Deserializes the package summary and holds references to all objects within the package.  
:* [https://github.com/EliotVU/Unreal-Library/blob/master/UnrealStream.cs UnrealStream.cs] Provides an interface of methods to read common unreal data types. Warning: Really messy and hacked together mostly due the wide support of UE1, UE2, UE3, and multiple games all in one
+
:*[https://github.com/EliotVU/Unreal-Library/blob/master/UnrealTables.cs UnrealTables.cs] Deserializes all table structures: Names, Exports, Imports, and so on.  
:* [https://github.com/EliotVU/Unreal-Library/blob/master/UnrealTokens.cs UnrealTokens.cs] All recognized unreal bytecode tokens, the numbers may be off and changed at runtime to adjust for UE3 packages!
+
:*[https://github.com/EliotVU/Unreal-Library/blob/master/UnrealStream.cs UnrealStream.cs] Provides an interface of methods to read common unreal data types. Warning: Really messy and hacked together mostly due the wide support of UE1, UE2, UE3, and multiple games all in one  
 +
:*[https://github.com/EliotVU/Unreal-Library/blob/master/UnrealTokens.cs UnrealTokens.cs] All recognized unreal bytecode tokens, the numbers may be off and changed at runtime to adjust for UE3 packages!
  
: If you've got a question or suggestion for Eliot, please post in the official '''Nexus ''Mod Talk'' Forum''' release thread [http://forums.nexusmods.com/index.php?/topic/2267079-ue-explorer-open-sourced-well-actually-partially/ UE Explorer Open sourced].
+
:If you've got a question or suggestion for Eliot, please post in the official '''Nexus ''Mod Talk'' Forum''' release thread [http://forums.nexusmods.com/index.php?/topic/2267079-ue-explorer-open-sourced-well-actually-partially/ UE Explorer Open sourced].
  
 
==== Unreal X-Editor ====
 
==== Unreal X-Editor ====

Latest revision as of 05:47, 1 July 2024

Overview

While XCOM:EU 2012 installs a number of 'configuration' files (i.e. with file extensions of INI, INT, UPK, BIK, BIN, BMP, HTML, CSS, and CONFIG), the only ones of concern to Mods at this point in time are INI, INT, and UPK extensions; and in the <Steam install path> of .\Steam\steamapps\common\XCom-Enemy-Unknown under the sub-folder \Binaries\Win32, the game executable: XComGame.exe. These are in a mixture of text and hex code. Despite appearances, when modding it is necessary to extract the UPK and SWF files from the 'cooked' executable and make changes to the extracted versions. Then the altered extract files must be re-compressed into a replacement executable, with a hash code that is used by the Steam game launcher to ensure a correct file structure. (Note this is different than verifying', which is comparing certain files on your computer against the distributed files on the Steam servers.)

XCOM EU 2012 is built on version 3 of the Unreal Game Engine. This page is primarily a collection of tools that are known to be useful when examining or modifying associated game files.

The term mods can be used in both a broad generic sense, and also to refer to a complete package of changes to the original play of the game. The term modlets has been created to refer to small mods that alter only a very specific portion of the game, and several are frequently required to be applied in combination to produce the overall mod effect. While they might be included in an archive package, each modlet file will need to be installed individually. Sequence of installation may be significant, so read the accompanying documentation carefully beforehand.

Modding Tools

The tools listed here are not the only ones that can be used for either purpose. They are, however, all free of cost for personal use or open source.

XCOM:EU 2012 is build upon the free-for-personal-use Unreal Game Engine, version 3. General tools and references to that engine are applicable to modding XCOM, though as always specific games do not always utilize the same capabilities of the engine. UPK files are used to load on-demand content while playing a game. They can be created and edited using the Unreal Development Kit (UDK). They come in compressed and uncompressed form. A UPK serves as a file container (similar to an archive like a ZIP file) which includes various types of game files, and may contain 3D models, textures, maps, music files, game settings, SWF sprites & actionscripts, and other files.

Unreal Game Tools

A collection of tools that are known to be useful when examining or modifying associated game files.

Unreal Development Kit (UDK)

  • September 2011 UDK is the build and engine version compatible with the Firaxis "cooked" files for XCOM EU and EW. Newer versions available on the official site are NOT compatible.
  • Unreal Development Kit (UDK) is the official game developer tool site. Free for educational and non-commercial use.
See Unreal Developer Network (UDN) UE3 Home for many UDK articles and resources.


UE Explorer

  • UE Explorer: an UnrealScript decompiler to look through the uncompressed UPK files.
Description:
An Unreal Engine decompiler. For more information on decompilers in general, see this Decompiler Wikipedia article. This program lets you see the code almost as their creators wrote it, providing key information you will need to change UPK files, such as getting its hex representation, etc.
UE Explorer Documentation
Installation:
Install it anywhere you want.
Eliot van Uytfanghe is the author of UE Explorer, the principle generic Unreal Engine investigative tool on the XCOM forums. His web site has much useful information, such as:
Eliot has released the source code of his Unreal Library that is part of UE Explorer and is what makes up the whole UnrealScript part of the program (basically anything but its interface). This enables other developers to:
  • Add custom games support for UE Explorer and other tools.
  • Build your own tools for .UPK files.
  • Enhance the code output in the way that you may like it.
  • The Eliot.UELib.dll can be replaced by your custom one, so long as it doesn't break compatibility.
You can fork the source code, and find instructions for use, under the EliotVU/Unreal-Library repository at GitHub. The source code is released under the terms of the MIT license.
Files of interest:
  • UnDecompiler.cs This is the file that outputs most of the code you see in function blocks.
  • UnrealPackage.cs Deserializes the package summary and holds references to all objects within the package.
  • UnrealTables.cs Deserializes all table structures: Names, Exports, Imports, and so on.
  • UnrealStream.cs Provides an interface of methods to read common unreal data types. Warning: Really messy and hacked together mostly due the wide support of UE1, UE2, UE3, and multiple games all in one
  • UnrealTokens.cs All recognized unreal bytecode tokens, the numbers may be off and changed at runtime to adjust for UE3 packages!
If you've got a question or suggestion for Eliot, please post in the official Nexus Mod Talk Forum release thread UE Explorer Open sourced.

Unreal X-Editor

  • Unreal X-Editor Editor for creating/editing Unreal Script files. Integrates some functionality with the UDK.
Description:
  • Class Tree Viewer
  • QuickLoad
  • Code Explorer
  • Class Finder
  • Class Usage Finder
  • Class Reference Finder
  • Autocomplete
  • Autocomplete Editor
  • Declaration Autocomplete
  • Code Folding
  • C# Style Commenting
  • Syntax Highlighting
  • Line Numbers
  • Auto Indent
  • Embed Selection
  • Basic Preset Scripts
  • Run UDK Editor from Unreal X-Editor
  • Run UDK Game from Unreal X-Editor
  • Compile/Full Compile Scripts from Unreal X-Editor
  • Various Skins to change the Look And Feel of Unreal X-Editor

UE Viewer/Umodel

  • UE Viewer/Umodel (also known as, or 'aka': Umodel) directly supports an extensive number games, and indirectly a number of other Unreal Engine games such as XCOM:EU 2012.
Description:
For viewing and extracting resources from various games made with the Unreal Game Engine 3.
See also Description of UE Viewer/Umodel.
Installation:
Install it anywhere you want. You'll have to move the UPK files to uncompress to it's installation folder, but just once.

UPK Decompressor

  • UPK Decompressor: Unpacks (in the same sense as an archive tool like ZIP compresses files) UPK files, once they have been extracted from the XComGame.exe executable file. It does not perform the extraction from the EXE.
Description:
We need it to de-compress UPK files so we can edit them.
Installation:
Install it anywhere you want. You'll have to move the compressed UPK files to uncompress to it's installation folder, but just once.

UPK Extractor

Description:
This program lets you extract the individual UPK file sections from uncompressed UPK files.
Installation:
Install it anywhere you want. You'll have to move the uncompressed UPK files to it's installation folder in order to extract the files, but just once.

Gildor's ActorX Tools

Description:
This pair of programs let you export PSK and PSA files from 3DS Max (ActorX All) and import those PSK/PSA files into 3DS Max (ActorX plug-in for 3DS Max). ActorX All is Gildor's compilation of the last version of Epic Games ActorX Exporter after they moved on to another format, but it only supports 3DS Max/Maya.
Installation:
Unzip distribution to your 3DS Max/Scripts folder. Execute this script from Max menu. Importer dialog window will appear.

UPK-Modder

  • UPK-Modder: Java tool for creating hex mods and identifying differences to UnrealScript for .UPK files.
Description:
In development and used by the XCOM:EU 2012 "Long War" mod team, it is still in 'beta' but stable enough to be used for that mod's extensive conversion to Enemy Within compatibility. See the Nexus Mod Talk Forum thread R&D - New Modding Tools for details and progress.
Installation:
Install anywhere.
Adjust the UPKmodder v0.65\Config\upk_config.ini to reflect location and GUID of some local UPK's.
Run UPKmodder.jar and start a new Project.
Features:
Projects that map to disc folders, and multiple projects can be open at once (i.e. for comparing differences).
Each open modfile has a separate tab and is divided into 2 sub-panes
The main editor on the left hand side, which is open by default
The main editor provides highlighting of parseable unreal bytecode and is otherwise a general-purpose text editor
The tree view on the right-hand side, which is closed by default
Does not provide editing capability
Allows viewing of parsed unreal bytecode in a hierarchical fashion
Shows memory / file positions for each line
Shows memory sizes of each unreal token when line is expanded
Shows operand name and reference names when target UPK is selected
Edit actions:
Update References (including location offsets and header table indexes)
Apply Hex Changes
Revert Hex Changes

UPK Utils

  • UPK Utils/Nexus link: UPK Utils is a collection of simple command line applications for analyzing and patching uncompressed UPK files. PatcherGUI is a separate download (from the same UPK Utils Nexus "Files" page) that provides a Windows "Graphical User Interface" (aka "GUI") front-end to the PatchUPK command line tool. The PatcherGUI download includes all of the essential UPKUtils command line files as well, so only one download is required for players. Primary documentation for players is the ReadMe.txt file on the download page for PatcherGUI.
Mod developers may want both sets of files, as well as the UPK Format Document.pdf file at the bottom of the "Files" page. Their primary documentation is the PatchUPK_Readme.txt file.
PatcherGUI (as of v5.2) includes options to "Enable INI loading" and "disable phoning home" for you. It can also find and open the correct config folder for you. So, to install INI modifications, one needs to select the correct game path (XCom or XCom/XEW), "enable INI loading" and "disable phoning home", and it will open the config folder and replace the vanilla file with the modified one.
Installation:
As stand-alone applications, these are not 'installed' in the traditional sense. Rather they are placed anywhere, with fully qualified paths in the arguments pointing to the UPK files to be processed (see the examples below).
Description:
If you run a UPKUtils command without any arguments, you will receive a "help" line like this:

ExtractNameLists
Usage: ExtractNameLists UnpackedResourceFile.upk

So, in this case you need to type ExtractNameLists <Path\to\>XComGame.upk, for example, and see a wall of text on the screen. You may redirect program output with the ">filename" pipe, as in:

ExtractNameLists Path\to\XComGame.upk > list.txt

Other programs work the same way. PatchUPK is a fully functional UPK patcher and can be used to install/distribute mods. A GUI wrapper for PatchUPK to make it more user-friendly is included as PatcherGUI.
Main "library" consists of two files: UPKUtils.h and UPKUtils.cpp. Other files are using this library to perform actual operations on UPKs:
ExtractNameLists — extract all header info (package info and name/object lists) and echo it into console. Use redirection to put it into some text file.
PatcherGUI — Graphical User Interface front to PatchUPK.
FindObjectEntry — find object entry by object name and extract its data into binary file (optional).
MoveExpandFunction — move and/or expand function by its name.
PatchUPK — patch UPK file using modfile.
RepairFunction — discontinued, waiting for Amineri to finish her work. :smile:
Helper library to parse modfiles: ModParser.h, ModParser.cpp.
UPKUtils compiled and ready to use with some examples on nexus at UPK Utils. The C++ source is available from the above GITHUB link for compilation on other platforms. The GUIPatcher tool is build using wxWidgets library, which is available on other platforms as well.
Detailed description of the modfile format used with these Utilities in the Nexus Forums thread UPK Utils
Supports both ToolBoks & C-style comments:
{ Curly brackets are used for ToolBoks style comments.
Comments may be multi-line.
Try not to forget the close bracket. }

// Alternatively, you can use C-style "//" comments instead.

/* Multi-line
C-style
comment */

WARNING: { Do not use curly brackets inside comments!!! (No nested or mixed comment styles!) }

Pick one comment style and stick with it throughout that mod.

XComAndroidTools

  • XComAndroidTools is a port of the UPKUtils package to the Android OS (ARM device). The release thread is found here. Android games are in an "obb" distribution package (much like a ZIP file). This tool set has been adapted to unpack the UPK files from "obb" files, though the UPK files included have different file extensions to match Android file associations.

Custom XCOM Mod Tools

Some tools have been developed by the XCOM modding community that assist with narrowly focused mod changes.

Custom Checkpoint

  • CustomCheckpoint: Allows mods defining custom classes to save and load data to the XCOM saved game file. It is not intended as a useful mod for individual users, but as a utility for other mod authors.

With this mod installed, you can get your custom classes to be saved and loaded by ensuring they are a subclass of Actor and by defining a CheckpointRecord structure containing the variables to save and adding the package and name of the class to the DefaultCheckpoint.ini file introduced by this mod. Any instance of this class you spawn will be recorded in the saved game and re-loaded on game load. To find the instances on load, you probably need to iterate the actorlist with "foreach AllActors" using your class type.

Online Enum Reverse Lookup Tool

  • Online Enum Reverse Lookup Tool: Lets you enter a decimal or hex value while filtering to determine either all or a focused set of the value names, enums, and classes that use that value, and which file they are located within.

Online Visual Perk Editor

  • Online Visual Perk Editor: The first perk editor tool, it never moved out of 'beta' status. Online only. Original release thread and documentation notice 'here'.

Online XCOM Base Planner for Long War beta 13+

  • Online XCOM Base Planner for Long War (w/EW only) beta 13+: You can plan your base and the tool shows you the power state, your research boost, your workshop rebate and how many satellites the base can support. Since there is no known way to let the tool calculate this automatically, you have to tell it how many satellite/power etc. buildings are connected, otherwise it will show you the wrong result.

Online XCOM Perk tree mod generator

Online XCOM Extended Perk tree mod generator

  • XCOM Extended Perk Tree Editor: A rewrite of Bertilsson's original for EU by ChrisK099, this generates two different sets of code: vanilla EW, and EW with Long War mod installed. Use "copy-and-paste" into the DGC.INI file. (No offsets needed for EW.)

XCOM Extended Perk tree mod generator

  • XCOM Extended Perk tree mod generator: A Perk Tree Editor tool designed to produce the specific hex code for a ToolBoks Custom Mod (required; use version prior to v1.6.4 or change the comment delimiters; or use one of the PatchUPK/GUIPatcher tools from the UPK Utils collection) to work with Amineri's (required) Enhanced Perk Tree Mod - XCOM:EU 2012. Note the site URL provides a seed code, which can be obtained for each custom tree and shared with others to produce the exact same Perk Tree instead using the distributed mod. This enables sharing starting points for minor tweaks to produce new mod variations. (Sounds like a good thing to include with your distributed versions.)

XCom Jump offset mod assistant

  • XCom Jump offset mod assistant: Provided original and modified hex code containing unmodified jump token addresses, this tool will automatically generate updated hex code with the new jump addresses for you.
    Instructions:
    Get UE Explorer 1.2.3.0 beta or later (older versions are not compatible).
    Copy original Hex code and View Tokens data from UE Explorer to the original Hex code section of the tool.
    Modify the UPK file with your changes using HxD or any other hex editor.
    Copy modified Hex code and View Tokens data from UE Explorer to the modified Hex code section of the tool.
    Press Generate New Hex code button on the tool to receive a new set of modified Hex code with recalculated memory jump offsets for 06, 07, 0A, 2F, 58 tokens and the header reference to the end of script.
    Insert new Hex code from the tool into the UPK file using HxD or any other hex editor.
Limitations and how it works
The tool is basically a data miner that looks at the world as a bunch of view token lines with (MemoryLocation/...) [DataStrings] and some modded Hex code with jump tokens in need of recalculation. The old hex code is pretty much ignored for anything else than storage size verification.
If it discovers that there is modified Hex code pointing to a valid old MemoryLocation it then tries to find a modded MemoryLocation by comparing [DataStrings]. (This is where the 0A 00 00 bug is born, as it looks like a jump token to a valid memory offset 000.)
For the few situations where multiple possible matches were found it tries to figure out which one is correct by looking at known move distances for other more successful matches.
If it fails to find 1:1 pairs you will be informed about it.
The tool is intended to save you the trouble of recalculating the jump offsets for things you didn't change.
The tool is not intended to fix the things you changed.
Example: If there was a jump token reference to (MemoryLocation/...) [DataString] and you changed the [DataString] then tool will not find it.
See New tool available ... for the discussion regarding this tool.

XCOM-Mutators

A project to create UT-like mutators for XCOM: EU/EW by Firaxis.

Since XCOM is Unreal Engine based, it has basic Unreal Mutators support. But XCOM is very different from FPS games and basic Mutator class functions are not enough to handle XCOM modding tasks. This project aims to create [a new] XComMutator class, which will allow to relatively easily write XCOM Mutators using UDK. Since there is no built-in support for [a] new class and its functions, "mutating" XCOM also requires patching main packages (Engine, XComGame, XComStrategyGame) to insert Mutator calls in appropriate places.

So far the project includes code for a "Mutator Enabler" (essential for the use of all Mutators), and several examples of implementation. It has been successfully used to add new Landing Zones (LZs) to existing maps and add new sound files, among others.

She (wghost81) has also created a XCOM-Mutators Wiki to help budding Mutator authors get started and discuss issues they encounter. Since it's a GitHub site and it's open-source, anyone can contribute. By code, wiki articles, issues or questions in the Nexus Mod Talk thread or on GitHub.

XComModHelper

  • XComModHelper: Allows for patching of XCOM: Enemy Unknown and Enemy Within files to help with installing other mods. For example, the tool can patch the game to allow for changes to be made to DefaultGameCore.ini, and force the game to read it from the configuration directory; without the need of using ModPatcher. The functionality of this tool is entirely dependent on the hex patches specified in the XML configuration files, which also make it extensible. Full source code and documentation on the download site.

XSHAPE

  • XSHAPE: Modifies the hash that the executable expects, so that you can load your modified UPK files.
Description:
Used to update the XComGame.exe hash to run with modified UPK files.
Installation:
Extract the files to your game root folder. XSHAPE will update the executable's checksum (hash) value for any modified UPK files. You'll need to run XSHAPE.bat after making any change to files. Failure to do so will cause the game to crash immediately upon launch.

XCOM Mod Installers

Mod Installers have evolved to apply the various changes created by the XCOM Modding community to the game executable. They can be packaged as part of the mod, or standalone for use with mods designed to be installed by them.

Different install tools are used to apply mods to different parts of the game, which correspond to different types of configuration files. Those installers that are used with current mods are for UPK, INI, INT, and texture files.

Custom Mod Builder and Manager

  • Custom Mod Builder and Manager: Handles changing settings to INI and INT files. Recommended for players comfortable with editing text files according to general instructions.

Long War Mod Manager

  • Long War Mod Manager: Simplifies the installation and removal of Long War mods and can be used as a replacement for PatcherGUI. It also supports some new mod file extensions that allow for the automatic updating of configuration files. This can be used to automatically define keyboard commands, add second wave options, or anything else that involves adding lines to a config file. NOTE this works with EW only, not EU, as you have to point it to the "SteamApps\common\XCom-Enemy-Unknown\XEW" folder.

ModPatcher

  • ModPatcher: The first tool for directly editing the game executable, and still maintains a healthy following. This tool only makes changes to the embedded DGC.INI file within the EXE.

Recommended only for mod makers or those comfortable with hex editing.

TexMod

  • TexMod: Utility to find, save, and modify textures in Direct3D 9 applications (such as XCOM:EU 2012). Requires launching TexMod which then launches XCOM and replaces call to vanilla textures with the texture files in the mod package. Recommended for players who can create shortcuts and navigate the folder trees. TexMod Tutorial Video

ToolBoks

  • ToolBoks: (Link is dead. File no longer available.) Toggles many gameplay features and has the ability to install 'Custom Mods' that make patches to one section of UPK hex code at a time in a sequence. Many mods only found in threads or on this Wiki are published specifically for implementation with this tool. Recommended for all players. Due to it's popularity, here are some FAQ answers:
    • Versions 1.6.x and later only work with XCOM "Enemy Within" (EW). In order to use ToolBoks with "Enemy Unknown" (EU), you have to use version 1.5.2. (See the mod Downgrade EU to patch 4 Changelist 356266.) Currently none of the versions work with EU after patch 4. (See Patches to determine your patch level.)
    • If a tab or option is grayed out: it was present in earlier versions, but has not yet been updated for the current patch level of the game.
    • ToolBoks SHOULD be compatible with most other mods, but as always the last mod to change any specific element of the game "wins". As ToolBoks only changes very specific things and most mods change numerous other elements, it is recommended you run ToolBoks last.
    • ToolBoks will automatically disable file hash checking and enable INI file loading when first run, so you want to just open and close it once if you plan to test other mods before applying ToolBoks changes.
    • ToolBoks only makes backups of the files it potentially modifies, although it won't check to see if an option you've selected will modify a specific file on the list; it will just backup all of them. It doesn't modify any of the \MyGames\Config\ files with any of the settings and so will not make backups of them. (DLCs won't recognize some changes if the \MyGames\Config\ files are not also modified as well.)
    • ToolBoks will automatically decompress any files modified by Custom Mods. The game will load decompressed 'loose' files right alongside compressed ones if they are different than the embedded versions, and the Enabling INI loading entry (in the section #Recent Discoveries, below) doesn't prevent it.
    • None of the ToolBoks settings are saved in the save file. All the changes are made to the decompressed versions of game files, so it's the current settings in those files that take effect each time the game is loaded, regardless if it's a new or a saved game.
    • As of version 1.2.0, has a built in Perks tree editor, that will work with the UI Mod Enhanced_Perk_Tree_mod_-_XCOMEU:_2012, which expands the number of perk choices per rank. This is only available in version 1.5.2 at this time.
    • The perks have to follow the default layout (1, 2, 2, 2, 2, 1, 2), unless you have the Enhanced Perk Tree mod - XCOMEU: 2012 installed. In that case you should be able to use a 3, 3, 3, 3, 2, 1, 2 layout.
    • It's currently not possible to change Rank abbreviations via ToolBoks, but you can manually edit them in:
<Steam install path>\XComGame\Localization\INT\XComGame.INT
Search for: m_aRankAbbr[0]=Rk.
    • There is no Developer Console feature in ToolBoks; only the Developer Shell. The Console was intentionally not included to avoid abuse of it in multi-player games. See the article Developer Console - XCOM:EU 2012.

uMod

  • uMod: Utility forked from TexMod after development stopped with it's release. Project is an approach to create an open source port of TexMod while integrating new features and hopefully extend future compliance (regarding DirectX 10 and 11). (Currently no one has been able to get it to work with XCOM:EU 2012.)

XCOM INI Patcher

  • XCOM INI Patcher A tool that can create or apply modification patches to the DefaultGameCore.INI embedded in the game executable. It can multiple such edits at a time.
  • XCOM Meddler: Provides a user interface for editing DefaultGameCore.ini. However, currently (v1.1.1) it does not work with versions of the DGC.INI that change the vanilla layout, such as mods that expand the number of items. But for vanilla tweaks to settings, it has a very nice intuitive layout. (See the screenshot on the link.)



Other similar tools exist, but these are the most popular of the currently up-to-date ones.

Generic Tools

Other more generic tools include:

Hexadecimal table of ASCII codes

  • Hexadecimal table of ASCII codes
    Image by Yuriy Arabskyy. Used under the Creative Commons Attribution-Share Alike 3.0 Unported license as stated on image page.

bsdiff/bspatch

  • bsdiff/bspatch: Open Source bsdiff and bspatch are tools for building and applying patches to binary files.
Description:
This enables hex patching of the game executable by modders. It is released under a BSD Protection License (BSDPL), an early attempt at an Open Source license, which makes a verbatim copy of the program freely distributable, but requires inclusion of a copy of the license, the text of which is available online here. See BSD licenses for information about BSD Licenses in general.
Installation:
Install it anywhere you want.

ExamDiff

  • ExamDiff: free alternative visual file comparison tool to WinMerge. Both have their own strengths.
Description:
ExamDiff lets you compare text for differences and such in a two-paned side by side view.
Installation:
Install it anywhere you want.

HxD HEX Editor

  • HxD HEX Editor: freeware to search for HEX values and edit the UPK files.
Description:
A general purpose hex editor. This is the program used to manually change the EXE and UPK files. (See HxD Feature List.)
Installation:
Install it anywhere you want.
NOTE: The default mode for the search function is for text, not hex. Don't forget to change this when searching for hex patterns.

Notepad++

  • Notepad++: Text Editor to more easily manipulate/see text data.
Description:
Light-weight text editor with good search functionality and other cool stuff that is pretty useful when hex editing.
Installation:
Install it anywhere you want.

Resource Hacker

  • Resource Hacker Capable of modifying the resources in the game executable, such as the XComGame.EXE file.
Description:
View resources in Windows 32bit and 64bit executable files (*.exe, *.dll, *.cpl, *.ocx, *.msstyles etc) and in Windows resource files (*.res) in both their compiled and decompiled formats. It incorporates an internal resource script compiler and decompiler and works on all (Win95 - Win7) Windows operating systems. Resource Hacker Home Page
Extract (save) resources to file in (*.res) format, as a binary, or as decompiled resource scripts or images.
Icons, bitmaps, cursors, menus, dialogs, string tables, message tables, accelerators, Borland forms and version info resources can be fully decompiled into their respective formats, whether as image files or *.rc text files.
Modify (rename or replace) resources in executables or resource files.
Image resources (icons, cursors and bitmaps) can be replaced with an image from a corresponding image file (*.ico, *.cur, *.bmp), a *.res file or even another *.exe file.
Dialogs, menus, string-tables, accelerators and message-table resource scripts (and also Borland forms) can be edited and recompiled using the internal resource script editor.
Resources can also be replaced with resources from a *.res file as long as the replacement resource is of the same type and has the same name.
Add new resources to executables or resource files.
Enable a program to support multiple languages, or add a custom icon or bitmap (company logo etc) to a program’s dialog.
Delete resources. Most compilers add resources into applications which are never used by the application. Removing these unused resources can reduce an application’s size.

WinMerge

  • WinMerge: an Open Source differencing and merging tool for Windows, to compare text files.
Description:
WinMerge lets you compare text for differences and such.
Installation:
Install it anywhere you want.

Flash File Tools

There are a number of Flash ActionScripts (extensions of ".SWF" and ".SWC") which control the User Interface (UI) and contain graphic sprites and icons. These are embedded in various UPK files, but primarily in files Command1.upk and GlobalPersistentCookerData.upk, and are called Native Functions and sometimes are called in code as native simulated function.

JPEXS Flash Decompiler

Description:
JPEXS is a useful tool for decompiling actionscript files, once they have been extracted from the UPK.
Installation:
Install it anywhere you want.

Sound File Tools

For information regarding XCOM Sound Files, see Sound Files - XCOM:EU 2012. The following tools are referred to in that article.

Audacity

  • Audacity: Convert ".OGG" sound files into a different format (".WAV", ".MP3").
Description:
An editor/conversion program for the open source OGG format sound files used in XCOM:EU 2012. This program can be used to edit/play/convert the sound files embedded in the UPK files.
Installation:
Install it anywhere you want.

Oggextract

  • Oggextract: freeware to extract OGG format sound files from UPK files.
Description:
An extractor program for the open source OGG format sound files used in XCOM:EU 2012. This program can be used to retrieve the sound files embedded in the UPK files.
Installation:
Install it anywhere you want.

VLC

  • VLC: Free player of most sound and video file formats, including those used in XCOM:EU 2012.
Description:
An video & music player that recognizes the open source OGG format sound files used in XCOM:EU 2012. This program can be used to play the sound files embedded in the UPK files.
Installation:
Install it anywhere you want.

Recent Discoveries

There have been a couple of recent (April-May 2013) discoveries that affect the need for or use of some of XCOM Modding tools. They are summarized here for reference.

Phoning Home

When using mods, it is necessary to prevent each game from connecting to it's update servers behind your back. However, the DNS entry is clearly for a vendor specific address. This appears to be a vendor verifier (i.e. "Firaxis Verifier", in this case) independent of those patches distributed via Steam. They may not be 'patches' per se, but merely replacements of certain files to ensure consistency. This is informally called 'phoning home' and initially was believed to be intended to be a Steam mechanism to prevent cheating in Multi-Player games. However, it has now been determined to affect single-player games as well.

PatcherGUI (as of v5.2) includes options to "Enable INI loading" and "Disable phoning home" for you. This is the easiest and recommended method.

If you use PatcherGUI, you can skip the rest of this sub-section. It's intended for those who have to deal with this manually.


Those interested in the mechanism involved in this 'phone home' process are referred to the Class: IniLocPatcher - XCOM:EU 2012 article.

This edit to the hosts file is not affected by Steam delivered patches or re-installing Steam and does not affect your ability to get updated when you go back to 'Online' mode for ANY reason (such as connecting to the Steam Store). Note this should be used in conjunction with disabling 'auto-updates' for your XCOM game in the Steam Library. Be aware, however, that since November of 2013 XCOM patches seem to disregard this Steam 'auto-updates' setting and have been known to apply regardless. Having a backup copy of your complete modded XCOM game tree current and available elsewhere is recommended as well.

At present, the EU 'phone home' process is known to overwrite Armors, Characters, and Weapons arrays of the EXE internal resource cache version of the DefaultGameCore.INI file, and the ...\My Documents\My Games\XCOM - Enemy Unknown\ file XComGameCore.INI file which is a merged copy from the DGC.INI and DLC content.

  • My Games\XCOM - Enemy Unknown\XComGame\Logs\EMS\
  • XComDLC.ini (XComGame.XComDLCManager)
  • XComGame.int (XComGame.XComDLCManager)
  • XComGameCore.ini (overwriting Armors, Characters and Weapons arrays)
  • XComMPGame.ini (overwriting a lot of MP related arrays)

These may be in My Games (if you have DLCs installed) or the <Steam install path> equivalent path, or both. If you are having problems with mods that alter one of these files not seeming to 'stick', check that your hosts file has the correct servers disabled according to the Launch.log as described below.

To determine where your game attempts to communicate, you want to examine your \My Games\<Steam Game folder>\Logs\Launch.log file. You are looking for lines similar to these:

The entries marked like so are:

  1. The Server IP address: 65.118.245.165
  2. The Server DNS Name: prod.xcom.firaxis.com

These are what you will place into the hosts file to block attempts to connect.

  • Start Menu > Right click on 'Notepad' (or any text editor), select "Run as Administrator"
    • File > Open > %systemroot%\system32\drivers\etc\hosts. The hosts file has no '.' suffix, so make sure you don't add .txt or anything else. Also, %systemroot% on most systems is C:\Windows, but the exact folder name may vary by OS version. The value of the global environmental variable %systemroot% on your system can be determined by entering 'set' on the Windows command line, or as it's shortcut is called, the Command Prompt. But the variable %systemroot% (including the percent "%" signs) can safely be used without knowing it's actual value.
    • Add these three lines to the hosts file:
      (The first line is a comment. The next two lines do the actual work, but are specific to XCOM:Enemy Unknown 2012. Other games may have their own DNS names [i.e. prod.xcom.firaxis.com] and IP addresses [i.e. 65.118.245.165]. The '127.0.0.1' IP address is a local loopback address the prevents attempts to connect to either of the other addresses from ever leaving your computer.)

# Prevent XCOM:EU from Phoning Home
127.0.0.1 prod.xcom.firaxis.com
127.0.0.1 65.118.245.165

  • Save the file.

NOTE: The "Enemy Within" (EW) expansion to XCOM:EU 2012 uses it's own DNS and IP address entries:

# Prevent XCOM:EW from Phoning Home
127.0.0.1 prod.xcom-ew.firaxis.com
127.0.0.1 65.118.245.139

However, early reports (13 Nov 2013) that disabling these addresses in hosts will prevent EW from launching have been attributed to other factors, such as failing to also disable 'auto-updates'. Save game synching with Cloud Storage still functions correctly, even with these addresses disabled.

The XCOM-EW expansion is proof that other DNS and IP addresses can be utilized by the same or different games. Care should be taken to check the Launch.log file as outlined above for changes with each patch or major release.

Disabling Hash checks

Enabling INI loading

PatcherGUI (as of v5.2) includes options to "Enable INI loading" and "Disable phoning home" for you. This is the easiest and recommended method. See also the INI Loading Test entry.

The following is provided for background and those interested in the manual method.

Most likely reason for any failure to load the DGC.INI is that (assuming you have the EW version of the game) you modified the DGC.INI in the wrong folder tree. EU is under "XCom-Enemy-Unknown", while EW is under "XCom-Enemy-Unknown\XEW".

INI Loading Test

Try this to test that the loose DGC.INI file is loading:

  • Edit the DGC.INI as follows:
  • Replace the Original 'eItem_Shotgun' line 'Properties[1]=eWPAssault' entry with '=eWP_Anyclass' as shown below. You can just copy and paste this SINGLE line with any text editor. (Save your '.BAK' file to restore the original DGC.INI.)
  • Load any previous save where you are in the XCOM base (the Strategy game phase) or play a new game to that point, go into the Barracks, View Soldiers, and change the Loadout of a Support class (which couldn't without this change and doesn't have any other class restrictions that might prevent it, as is the case with a Heavy). The 'vanilla' DGC.INI that's in the embedded 'Resource cache' only permits an Assault to equip a Shotgun. With this change, any class can that doesn't have other built-in restrictions.
  • Anyone other than an Assault class equipping a Shotgun proves you are loading the DGC from the correct '\config' folder.

INI file size limitations

Increased Load Times

Enemy Within

Extending/Replacing Functions

In early Dec 2013, wghost81 discovered it was possible to alter the UPK Package information so the game would utilize an expanded or replacement function of any size. This frees the mod creator from the constraint of keeping their code changes to within the original byte size limitations of the vanilla function, as well as providing the possibility to add new functions exclusive to your own mods. See the Hex editing UPK files article entry Hex editing III: Extending/Replacing Functions for details.


References

Referred to by this article:

  • XCOM Mod Installers

 

That refer to this article: