-
Notifications
You must be signed in to change notification settings - Fork 32
Modifying 2DA tables via a DLC mod (ME1 LE1)
In the first game of the trilogy, a lot of information is stored in the 2DA tables that can be found towards the bottom of the Engine.u
or Engine.pcc
file.
Figuring out the organisation of the data in those tables might require a little bit of digging and poking around, as it is not always trivial. But we'll assume here that the reader knows exactly what they want to modify. For testing purposes, the values in the 2DA tables can be edited directly in Engine.pcc. But this is not a good option for distributing the mod. Fortunately, the game still has a system to incorporate updates of the 2DA tables (row replacements or additions) via DLC files. So we will see here how to take advantage of that system.
The three main steps consist in:
- Creating the necessary package files and exports in those files.
- Filling those files with the juicy modifications that we want to make.
- Properly informing the game that we wish our new files to be taken into account.
We'll detail and illustrate those steps by creating a simple mod that tells the player where Earth is, and where it isn't. This will hopefully make taking Earth back slightly easier when push will come to shove.
1a) We create a new DLC Starter Kit using Mod Manager.
1b) We create our new 2DA DLC package file.
There are multiple ways to do so, but one of the easiest way (at least afaik when writing this guide) is to start from an existing 2DA package file.
For ME1 (original game), all the 2DAs are duplicated in separate files in the CookedPC/Packages/2DAs
directory. So we can just copy the one we want to modify. In this case we copy BIOG_2DA_GalaxyMap_X.upk
, and we put it in our proper mod folder under a new name BIOG_2DA_MOD_EARTH_GalaxyMap_X.upk
.
For LE1 (legendary edition), the 2DA tables for the Bring Down the Sky DLC are still in separate files in the main CookedPCConsole folder. We will find BIOG_2DA_UNC_GalaxyMap_X.pcc
and copy it in the CookedPCConsole directory of our DLC mod, under a new name BIOG_2DA_MOD_EARTH_GalaxyMap_X.pcc
.
However, not all of the 2DA groups are edited by Bring Down the Sky. For example, if we wanted to edit the Equipment 2DA tables, we'd be very sorry to realize that there is no BIOG_2DA_UNC_Equipment_X.pcc
. No matter, we'd just copy BIOG_2DA_UNC_GalaxyMap_X.pcc
(for example), and rename it BIOG_2DA_MOD_EARTH_Equipment_X.pcc
(and have a bit more work later on, but that's ok).
1c) We pick the 2DA tables we want to modify.
We want to leave in our package file only the tables that we are modifying. Note that it may or may not be absolutely necessary, but is probably better to keep one file for each group of 2DA tables. In the figure below, we see that the GalaxyMap
group contains several tables (e.g. Cluster
, Planet
, etc). If we also wanted to modify tables in the Equipment
group, we'd make a separate file. Here we only want to modify GalaxyMap_PlotPlanet
, which defines the trackers on the galaxy map, so we'll get rid of the others.
More generally, depending on how we created the package, we may have:
- Additional tables: in that case, we use the right-click option to "Trash entry and children".
- Missing tables (for example, if we started from
BIOG_2DA_UNC_GalaxyMap_X.pcc
to createBIOG_2DA_MOD_EARTH_Equipment_X.pcc
): in that case, we can drag and drop the table export fromEngine.pcc
. We can either choose the option to "Add only" the table we want, or "Clone all references". In the latter case, theBio2DANumberedRows
class will be copied as well (as in the figure below). Either way, we do have to manually set the Class of our new 2DA table to the value of the importEngine.Bio2DANumberedRows
. Once that's done, we can trash the classBio2DANumberedRows
from our package.
1d) We get the names right, assuming people do not get too chummy.
Now we have something that looks like this.
There are two things that we must be careful to name correctly.
The export with a little folder icon (Exp 8) is supposed to have the same name as the package file. It's not the case in the example, so we go in the Names
tab, we find the name of that folder and we use the right-click option to Edit the name, and correct it as in the figure below.
The 2DA table (or tables) must also be named carefully. It consist in three parts.
- The first part should be exactly the same as the name of the 2DA table export in
Engine.pcc
, in our caseGalaxyMap_PlotPlanet
. - The second part is
_part
, which signifies that this is not a whole new 2DA table, but an addition to the base 2DA table that is in Engine. If this_part
is not there, we go in theNames
tab and edit the name (e.g. fromGalaxyMap_PlotPlanet
toGalaxyMap_PlotPlanet_part
). - The last part of the displayed export name is
_#
(where # is a number). This is the instance index of the object name, which can be defined underMetadata
(note the displayed number is 1 unit below the value, so if the index is 2, it will show as_1
). This value is not particularly important unless you have several objects with the same name in the same file (which you should not have for 2DA tables), so you may just leave it at1
or whatever. Two mods that modify the same 2DA table will work together even if they use the same instance index.
1e) We properly set up the object referencer (LE1 only).
In Legendary Edition, we need to make sure that the ReferencedObjects array in the ObjectReferencer export does contain our table(s), as well as itself. Other unnecessary remnants of our package editing adventures can be removed without too much hesitation.
We can start from the vanilla 2DA table in Engine.pcc, and export it to excel using the relevant button in the top right corner:
In Excel, we make the modifications we want. Here we have made some modifications to the row corresponding to Noveria (id=23), and added a new row (id=9001). I won't go into what the different columns and numbers correspond to, since this tutorial is about turning 2DA modifications into a DLC mod, assuming the author knows what to do in the 2DA table.
Once this is done, we go back to our 2DA DLC package, and we import the Excel file into the 2DA table.
The important points are:
- The overall structure of the table should be conserved. Let's not go and try to add new columns and stuff like that.
- Only the modified rows and the new ones should be left in our 2DA table. Those that are not modified should be deleted during the Excel stage.
- In case of a modified row, the 2DA index (value in the first column of the excel sheet) should obviously remain untouched, and be exactly the same as in vanilla.
- In case of a new row, the index must be a value that is not used in vanilla (including the DLC_UNC partial tables), nor in another mod.
The last point can become difficult once several mods start modifying the same tables. This is why I very highly recommend to keep a list of the indexes of modified rows, and new rows, for each modified table, and put it somewhere it can easily be accessed by other mod authors. I did this here for my ME1 mods. Maybe a database will be set up at some point in the future.
This is actually pretty easy.
We find the Autoload.ini
file (which was created by Mod Manager in our DLC Starter Kit) in our mod directory, and open it with any plain text editor.
And we simply add the line 2DA1=BIOG_2DA_MOD_EARTH_GalaxyMap_X
:
- The name used here is simply the name of the file that we created earlier (without the
.pcc
at the end). - If we modify multiple 2DA tables in the same group (e.g.
GalaxyMap_Planet
andGalaxyMap_PlotPlanet
), they will be in the same file. So that single line inAutoload.ini
will be sufficient. - If we modify 2DA tables in different groups, we will have several
BIOG_2DA_MOD_
package files, each of them should have its own line, like this:
Now we can install our DLC mod with mod manager, and we go check out the Galaxy Map, which is full of new exciting and extremely useful information.