About the resources and database folders

I have followed the instructions on the official Grim Dawn modding tutorial, where I opened up Asset Manager, set these as the options:

Working directory:

C:\Program Files (x86)\Steam\steamapps\common\Grim Dawn\

Build directory:

C:\Program Files (x86)\Steam\steamapps\common\Grim Dawn\

Tools directory:

C:\Program Files (x86)\Steam\steamapps\common\Grim Dawn\

Additional browse directories:

C:\Program Files (x86)\Steam\steamapps\common\Grim Dawn\gdx1\

Additional source directories:

 C:\Program Files (x86)\Steam\steamapps\common\Grim Dawn\mods\gdx1\

I ran Tools > Extract Game Files, and selected my Grim Dawn directory.

So now I am trying to figure out what exactly happened in these few steps:

  1. Regarding the folders “Grim Dawn\database” and “Grim Dawn\resources”, are these the base game database and resources, or a copy of them? If they are a copy, where did they get extracted from?
  2. Regarding the folders “Grim Dawn\mods\gdx1\database” and “Grim Dawn\mods\gdx1\resources”, what are these and where did they come from?

Also, what files/folders can I safely delete that were not originally already there in the base installation?

The database is stored in arz (binary) format, so the file database/database.arz was extracted into your destination as text files (suffix dbr).

Likewise, resources are stored in an archive format called arc, and when extracted you get whatever the source was, which can vary between image and sound files as well as text and lua scripts.

In true bailing wire and duct tape fashion, the xpac and the base game come out in different folders and while the game will override any base record with the xpac version, modders are left with two semi overlapping sources.

You can just drag and drop with overwrite the xpac folders into the base folders after extraction to work with a complete set of game files to start modding.

You probably need more help, but I stop there to see what you ask next.

Thanks for your attention. Before proceeding further, I would like to have a thorough understanding of the above steps and settings I have selected.

So, for the working directory I chose, the result of extracting does:

  1. Extract the contents of “…\Grim Dawn\database\database.arz” to the subfolder “…\Grim Dawn\database” of my working directory.
  2. Extract the contents of files with extension .arc from “…\Grim Dawn\resources” to the subfolder “…\Grim Dawn\resources” of my working directory.

What is the significance of the tools directory, the additional browse directories, and the additional source directories then?

Well, tools are the modding tools, there are a bunch of programs available to edit a mod, dbrs, fx, and editor.exe or skmilar to make maps.

But I am not really sure if I have ever used the additional directories for anything, so not able to tell you much about that.

Okay, after extraction, I created a new mod. I then click Database > Import Record and imported the “gameengine.dbr”. After editing the PlayerRunSpeedCapMax value using a text editor, I pressed build, which builds the mod content in “…GrimDawn\mods\ModName”. I opened the game and ran custom campaign, selecting my mod. I looked at the movement speed tab of my character and sure enough, my movespeed is capped at the value I changed it to.

Is that all? Am I missing something? What about gdx1?

I would assume that gd1 has a gameengine.dbr too, but really no idea what “import dbr” actually does. If it gave you the gdx1 version and you modded that then should be fine. I typically make the folders and manually copy source dbrs into my mod as I thought (possibly, wrongly assumed) that the import function was borked and would not create subfolders. But if it worked, and you imported the gdx1 dbr, then it sounds right.

Was that your main thing to mod or do you have bigger plans?

No, the player movement speed change was just a “hello world” test so to speak. To check if a change (any change) I made made it to the modded game.

If your method works, I’d rather use it.

So the way you would do it, would be:

  1. Search for a .dbr file I am interested in modifying.
  2. If it exists in gdx1, copy that .dbr file over (to the working directory), otherwise copy it from the base game.
  3. Edit as necessary.

Build when ready.

Is that correct?

My plan is to make a mod that prevents items with prefixes and suffixes from ever appearing in drops, merchants, and crafting. I have my reasons, and I will justify why if I do publish the mod.

I see Ceno is helping you in the other thread, you might only need 1 dbr to pull that off. Sadky, I have no info to add to the zero not working aspect.

Basically, I would drag and drop gdx1 into vanillla records, with overwrite, to have a single source folder to deal with.

You can have 2 instances of AM open at once, one to browse gdx1/vanilla and the other to manage your mod,

The rest of your post is correct.

Yeah, hadn’t seen this post originally or I probably would have given the long explanation here. Oh well.

In any event, yes, the file priority for modding stuff is

  1. The Mod
  2. gdx1
  3. Base Game

So a mod will take precedence over all else, but gdx1 files essentially overwrite base game files in the case of a conflict. So if there is a conflict, generally better to pull from gdx1. This usually doesn’t matter when it comes to dbr editing though; most of the time, it’s when you’d want to edit a quest or script or something and gdx1 changes something about that quest/script as compared to the base game.

I actually made a tool (with an executable) to do exactly that at the push of a button. Also handles the extracted resources, too. Here’s the source code (in python) for anyone that wants it:

import os
import shutil

root_dst_dbr = r"C:\Program Files (x86)\Steam\steamapps\common\Grim Dawn\database\records"
root_dst_rsc = r"C:\Program Files (x86)\Steam\steamapps\common\Grim Dawn\resources"

root_src_dbr = r"C:\Program Files (x86)\Steam\steamapps\common\Grim Dawn\mods\gdx1\database\records"
root_src_rsc = r"C:\Program Files (x86)\Steam\steamapps\common\Grim Dawn\mods\gdx1\resources"

for src_dir, dirs, files in os.walk(root_src_dbr):
    dst_dir = src_dir.replace(root_src_dbr, root_dst_dbr, 1)
    if not os.path.exists(dst_dir):
        os.makedirs(dst_dir)
    for file_ in files:
        src_file = os.path.join(src_dir, file_)
        dst_file = os.path.join(dst_dir, file_)
        if os.path.exists(dst_file):
            os.remove(dst_file)
        shutil.copy(src_file, dst_file)    
        
for src_dir, dirs, files in os.walk(root_src_rsc):
    dst_dir = src_dir.replace(root_src_rsc, root_dst_rsc, 1)
    if not os.path.exists(dst_dir):
        os.makedirs(dst_dir)
    for file_ in files:
        src_file = os.path.join(src_dir, file_)
        dst_file = os.path.join(dst_dir, file_)
        if os.path.exists(dst_file):
            os.remove(dst_file)
        shutil.copy(src_file, dst_file)

ANYWAYS, Qladstone, as to your mod, I think doing things the way RarePlus does it should work. I’m not entirely certain about whether it will affect Merchant wares, but it will definitely work on crafting and actual drops from enemies or chests. You’ll want to heighten the ‘noPrefixNoSuffixModifierCommon’ field in the file, as opposed to the ‘rareBothPrefixSuffixModifierCommon’ field.

Thanks jiaco and Ceno for your help. I think I understand the workflow now.

@Ceno I have replied you separately in your thread.