Because this game is so much more easily moddable than the first game, I want to give a brief overview of the basics of modding this game, this is that. It'll presumably expand over time? We'll see if a modding community for this game forms.
The actual mods by the Veritatem Imperialis team are still in development at this time.
Restoring original game state
Before modding anything, a note on how to get back to an online-playable state: You can revert your game files back to their original state by using the "Verify Game Files" feature of Steam (Right-click the game in your Steam library, select Properties, select the "Local Files" tab, select "Verify Integrity Of Game Files"). Note that this will not remove additional files you may have added to the game folder. You will have to remove these manually.
-NoEAC launch option
In order to play mods, you must disable EasyAntiCheat, as EAC protects the game from modification in order to avoid cheaters online. Adding
-NoEAC to your Steam launch options will disable EAC (Right-click the game in your Steam library, select Properties, select Set Launch Options and add the text
-NoEAC). You can verify that this works by checking the top right corner on the main menu; it should say "Stormancer deactivated" and have a red icon to the left of it. This will disconnect you from the online matchmaking server and disable EAC. You can still play 1v1 by inviting a friend in Battle mode.
/BattlefleetGothic2/version.bfgver, it is responsible for making sure that people running different versions of the game don't match together in the matchmaker. Even though it is a somewhat moot point considering we're running disconnected from the matchmaker, I recommend you modify this file if running anything modded to mitigate potential risk of being flagged as a cheater for accidentally playing online with modified files as well as displaying what mod is currently installed in the top right corner of the main menu. Mod developers should probably distribute this file as part of their release package.
CSV & XML Data
The primary area of interest this time around is the
Data subdirectory at
/BattlefleetGothic2/Content/Data. These directories contain CSV and JSON files defining a lot of the raw data aspects of the game. All of these files can (and probably should) be edited using your favorite text editor after having been decrypted if necessary (see below). Preferably something better than Windows Notepad. Some points of interest include:
- The unit schema, located under
/UnitSchema/Official/UnitSchemaOfficial.jsondefines all units in the game (ships, titans, stations) and their body parts (hull, prow, weapons, etc.).
- The unit stats, located under
/UnitStats/Official/UnitStatsOfficial.csvdefine other properties of the ship (point cost, number of turrets, attributes).
These files refer to strings through their localization keys: the relevant translations can be found in the respective XML file for the language in
/BattlefleetGothic2/Content/Localization/; EN is for English. These files are also encrypted.
Most data files (some, like fleet names, are excepted) are encrypted with AES-128-ECB encryption with the key
abcdefghijklmnopqrstuvwxyz123456. A simple Python script for encryption and decryption is attached to this post here. This will add artifact null bytes at the end of the file; make sure to remove this before editing & reencrypting. The files are encoded in UTF-16.
I'll possibly expand this in the future, but the gist is that the game runs off of UnrealEngine version 4.18 and to extract the main Pak file, located at
/BattlefleetGothic2/Content/Paks/BattlefleetGothic2-WindowsNoEditor.pak, you may use UnrealPak from the UE 4.18 SDK.