Modding Guides

Image Unavailable
Most modding can be done with a simple text editor, like Notepad ++

How Modding Works:

  • BFG2 Draws it's resources from 2 main sources: the Content Folder and the PAK file.

Files in the content folder are easy to edit, you decrypt them, make your changes, re-encrypt are your good to go. The pak file however is quite a different beast and is only worth attempting if you have a lot of experience with Unreal.
Note that your Python and Cryptodome installations need to be matching versions.
The game uses AES-128-ECB encryption with the key: abcdefghijklmnopqrstuvwxyz123456 (Sourced by Piston Miner).

Resource Links

Requirements

Key Notes

  • After decrypting a file there will often be [null] squares at the end of the file. You will always want to delete these values before re-encrypting (they are a left-over from the decryption process)
  • Changing the layout of a csv or json file will often result in it becoming unreadable by the game, causing a crash or for ship stats/models not to be loaded. Stick to the same layout!
  • To prevent EAC (Easy Anti-Cheat) from annoying you during modded play, simply add -NoEAC to the steam launch options for BFG2. Ranked matches will not work when running mods.
  • A guide for installing Python and the Crypto can be found here: Python/Crypto Installation Guide

Edited for Toolkit-V8.2

Note: This guide assumes you are running a Windows OS
If you have any queries or need help refer to the Discord Server: or the wiki.
A huge thanks to Pistonminner whos scripts are used in this set up. His work has been key to making modding for BFG2 possible!
Other contributors: Caliger, Imperator, Skalgrim
—Last updated 21/6/2020

File locations:

  • BFG2 Has 2 main paths it draws from, the content (stats, ships, resources) and local folder (customfleets, saves files, settings).

The content folder can be found in your version of ….\steamapps\common\Battlefleet Gothic Armada II\BattlefleetGothic2\Content
You can also find it by right clicking bfg2 in steam, going to Local files then 'Browse Local Files' and following the path.
The local folder will be found in the AppData folder, and will have a similar path to C:\Users\user\AppData\Local
Inside the content folder you will find a bunch of sub-directories:

  • 'Splash' contains the pop-up image shown when the game is launched. You can replace this with a custom image, however it needs to have the same name and be a .bmp file.
  • 'Movies' contains the in-game cinematics and videos. You can replace these with your own provided they have the same name and file type.
  • 'Paks' contains the games main resource folder (images, blueprints, audio, models and all key parts of the game). Modding this requires coaching from one of the Mod team (Guides wip).
  • 'Data' contains ship stats, attributes, campaign layouts, weapons and other key data. These can all be edited once you know how to decrypt them.
  • 'Localization' contains the games language file. We can use this to add new ship/weapon names, change character's names and even add new dialogue.

Running BFG2 with mods:
Running BFG2 with mods: Got to your steam Libary, right click BFG2, go to properties, set launch options, then add: -NoEAC
This ensures that EAC won't interrupt and disables Ranked PVP (you can still invite friends for private 1v1s. If you are host it will be a modded pvp match).
It is recommended that you use the Mod Manager to run/install mods: BFG2 Mod Manager
To create mods it is always best to create them as a seperate file with the toolkit (rather than touching the base game files which can break your game).

Decrypting/Encrypting the Game files with the Toolpack:
Under the BFG2Mod_DevKit folder you will find 6 different command scripts. These are the only scripts you need for the tool-pack.
All of the files for you to edit are located in the following folders:

  • 1UnitSchema-Combine (Configuring ship layouts)
  • 2Localization-Combine (Adding/changing text in-game)
  • 3UnitData-Weapons (Changing weapon and Ship data)
  • 4CSV-Data (Changing campaign/upgrade/skill etc data)

Once you have edited the desired files run each !Package Script, then the !Create script, before running the !Move one after renaming the .pkg.
The files will be encrypted, packaged and added for you.

Modding Ship hulls:

  • The UnitSchemaOfficial.json file contains a section for each ship detailing what goes where and what each ship has. This can be edited, however requires some understanding. View the tutorials section for this.
  • In the 8.2 Toolkit the schema is broken up into individual ship files for easy editing. Your mod will draw from the 'Source-Beta1' folder.

Testing your mods with the Toolpack:
When you are happy with your changes it is now time to test them!
To assign details to show in the Mod Manager head to the 'BFG2ModBeta' folder and open up 'modinfo.ini' with a text editor.
You can replace the screenshot.png image with your own (update the screenshot name in the ini file afterwards to match)
An example could look like:
name=Custom Mod
version=v1.1
description=Custom changes +etc
screenshot=screenshot.png
author=Enter Name
installtype=invalidate

Run the !Scripts as detailed above to create your mod.
A .pkg file will be created which you can re-name. Running the move script will add it to your Mod Managers Mods list (if under the BFG2Mods folder).
The Mod Manager will load any mods located in the ….\ModManager\Games\BFG2\Mods folder, you can then enable/disable them.

If the game crashes you have disrupted the files layout, making it unreadable or entering in invalid data.
If the game loads but ships have no models or tooltips the game cannot read your UnitSchemaOfficial.json file (due to missing commas or incorrect ship setups).
At any time you can un-install mods with the Mod Manager to revert back to Vanilla and remove the -NoEAC from launch options. I am not responsible if you do something really dumb!

View the +|Tutorials| section for walk-throughs on how to mod individual files.

Note: This guide assumes you are running a Windows OS

Mod Toolpack v8.2
Updated: 27/4/2020
Dire_Venom

Features:

  • Command Scripts
  • Automated Mod Creator
  • Create PAK files
  • Create and package mods to load in the Mod Manager
  • Unpack PAK files
  • Combine multiple .txt files into Json,xml,txt,dec,csv

Installation:

-The Mod DevKit can be run from anywhere on your PC. Simply move the BFG2Mod_DevKit folder where you want and rename it.
-You can copy the devkit folder multiple times for additional mods as the folder is self-contained.
-The Mod Manager should also be installed under (*Drive*):\BFG2Mods\ModManager
-The only scripts you need to run when creating mods are the 6 directly in the Mod_DevKit folder.
-.dec files are the same as text files, open them with Notepad ++
-Please do not re-name files/folders inside the DevKit as that can break the scripts (except for the .pkg files)

Additionaly please ensure that you have followed the setup instructions for the Mod Manager, and the Encryption tutorial.
http://bfga2.wikidot.com/wiki:python-crypto-guide
Help can also be found in the Modding Discord:
https://discord.gg/UHRVwVf

Building your Mod:

-Double click to run each of the 4 !Package batch scripts (you don't need to run the Pak one if no pak files etc)
-Run the !CreateModPKG script and a .pkg file will be created. You can share and load this file into the Mod Manager.
-Rename the .pkg file to your mods title.
-Running the !MovePKGtoMM script will add your mod to the Mod Manager (provided that it is installed).
-If the mod manager is already running, simply refresh mods to see your new mod.

Adding Mod Infomation:

-In the BFG2ModBeta folder replace the screenshot.png with an image of your choosing (keep the name as screenshot.png though).
-In the folder you will also find a 'modinfo.ini' file. Right click and open with a text editor.
-Enter your mod details to be displayed on the Mod Manager. An example could look like:
name=My Epic Mod
version=v2.3
description=Custom changes +etc
screenshot=screenshot.png
author=SuperModder99
installtype=invalidate

Creating a PAK file :

-In the main folder you will find a number of 'Pakmod' folders.
-Paste your cooked unreal content under ..BFG2Mod_DevKit\(*6-8*)PakmodBeta\BattleFleetGothic2\Content
-When you build your mod use the !PackagePakFiles script and they will be created automatically.
A guide to creating PAK content can be found on the wiki:
http://bfga2.wikidot.com/wiki:custom-audio-images

Putting your Unreal content into a pak:

-When in unreal click save all, then click 'cook content for windows'. When it is done:
-Copy the 'Content' folder from: …\UnrealProjects\(Project Name)\Saved\Cooked\WindowsNoEditor\BattleFleetGothic2
-Paste it over the content folder into one of the pak folders (listed 1-3) in your interactive mod folder
-E.g paste content folder into ..\6PakmodBeta\BattleFleetGothic2
-All of the numbered folders are indentical, and are there to keep everything neat when working on multiple paks.
-Remove any files/folders from the content folder you've just pasted that you don't want in the pak.

Unpacking a PAK file:

-Under ..BFG2Mod_DevKit you will find 'UE4PakUnpacker.exe'
-Double click to run, then navigate to and select the desired Pak.
-Press unpack and it will extract it to your local drive (likely D: or C:)

Schema-combiner :

The schema-combiner works by combining all of the individual ship schemas into one larger one for the game to read,
which in this case will become our UnitSchemaOfficial.json file.
When using it for your mod:

-You can find the ship directories to edit in: \1UnitSchema-Combine\Source-Beta1
-This also folder also contains a Backup, Output and Source-Og folder. Do not modify any of these.
-The 'FactionStats' text file contains some useful infomation about ship entries.

-You can edit the induvidual ship schemas inside the source folders (do not touch the Start and End files).
-Make sure to keep the formatting the same, as incorrect ones will result in no ships being shown in-game.
-If you have added more ship entries into the faction BPs for your mod simply copy-paste any of the entries into
the A95-Custom folder and assign the relevant ship name to it.
-The entries are added in Alphabetical order, doing Folder A1 from top to bottom, A2 and so on.
-When building your mod it will compile and add your schema automatically.

Localization-combiner :

-This folder creates both the langEN.xml and DialogueCampaign.csv files.
-Like with the ship schmea, make changes to the Source-Dialogue and Source-Local files (don't modify the backup)
-For adding new ship names, descripts, text etc add your enteries in the C_Custom.txt file (keeping the same format.
-You can find an example entry already in the C_Custom file.
-The resources file contains backups as well as induvidual parts for you to use.
-..2Localization-Combine\!Resources\Source-Local contains everything you need to create custom entries

Enjoy!

Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License