Quick(ish) Art-Asset Modding Guide
Posted: Sun Jan 07, 2024 1:34 am
Hey friends! I'm the guy who is making the Distant Worlds 2 Refreshed mod series, available on Steam Workshop. Over on Discord some folks were asking how I add new art assets to DW2. I promised to write up a guide outlining the steps (as of the publishing of this post).
Until things change, most DW2 modding is still a bit--well...difficult. The DW2 team have future plans for modding tools and opening up various parts of the game for more types of modding (code mods), and for letting modders change certain things they can't as-of-now. However, due to the barriers to entry for DW2 modding, most folks stick with just changing the .xml files you can find in your Distant Worlds 2/data folder (since you can just have loose .xml files in a new mod folder and the game will overwrite things (kinda like modding in Distant Worlds 1)).
For anything art-related, though, it takes a bunch of extra steps. So let's get started.
For the purposes of this guide, we will be replacing a vanilla player flag graphic with a new one. Adding/replacing other art assets will follow the same basic steps. Adding new assets will typically also involve editing a game .xml somewhere so DW2 knows where an asset is and when to use it.
I'm NOT a code guy, I'm a 2D art asset guy. So please excuse the clumsy descriptions and brute-force methods of getting through some things.
Background info:
DW2 uses bundles for its art assets, not loose files.
These bundles are listed in your Distant Worlds 2/data/db/bundles folder. There are a lot of bundles in that folder, but the one that holds the most stuff we will probably utilize is the CoreContent.bundle. Ultimately we will need to build our own bundle for our mods, using the folder structure found within the various game bundles.
When working to replace old art assets or place new art assets, you'll need to know where assets live in DW2 bundles (there are directory structures embedded within bundles...the game data files (.xmls) usually reference art assets living within these directories). In DW1, you could just have loose files with the same directory structure, but for now DW2 requires us to dance in and out of these "bundles". So...here we go.
To look inside a bundle, you'll need to use the DW2 Bundle Tool available in a pinned message in the #mod channel on the DW2 discord.
In addition to just browsing inside the bundle, you'll also need to use that tool to "extract" the various files within. You'll ALSO ALSO then need to use that tool to "convert" the various art assets into readable files. Extracting files by themselves brings out extension-less files. The tool is used to convert them. Be aware is a command-line thing, so you'll need to use proper syntax when doing all that.
Install the Bundle Tool via the instructions in the #mods channel on Discord. There's a "help" command you can run via command prompt that describes the ways you can use the tool.
For example, to "list" all files within a bundle, you'd run this command via the command prompt from within the directory you have your Bundle Tool installed:
dw2bt.exe list "<<YOUR DW2 GAME DIRECTORY HERE>>\data\db\bundles\CoreContent.bundle".
Use quotes and put where you have DW2 installed at the front and you should get a huge list of files within that bundle. For art assets we're typically interested in files that have the "texture" descriptor in the list.
For flags, you could then "extract" all flags by using this command:
dw2bt.exe extract "<<YOUR DW2 GAME DIRECTORY HERE>>\data\db\bundles\CoreContent.bundle" UserInterface/Flags/*.*
In the above extract example, it would place all the extracted files in a directory UserInterface/Flags within the location you've installed the Bundle Tool.
You would then need to convert each one to a .png. You'd do that this way:
dw2bt convert "UserInterface\Flags\Human_1" "UserInterface\Flags\Human_1.dds"
Adding a new file
It can be daunting to get things listed, extracted and converted, but I've done that for you, so for this guide I'll just help you skip all of that.
Remember, DW2 Player Flags live in the CoreContent bundle in the following directory:
UserInterface/Flags
They are .png textures. They are 400px by 250px.
There, done! NOW we can get started.
/========== ADDING A SINGLE PLAYER FLAG (a modding guide to DW2) ==========\
/// Step 1 -- Create your player flag
Here's one. Poof! That was easy.
/// Step 2 -- Install Stride Game Engine and .Net 6.0 SDK
(yes, really). You'll need .Net to let Stride load things properly. And you'll need Stride to create bundles. DW2 was built in Stride. That's the process for now.
https://www.stride3d.net/download/
You can install the most current version of Stride. Old DW2 modding instructions mention a very old Stride version called Xenko, but Xenko became Stride...so it's just the newest version of that.
/// Step 3 -- Create a new project in Stride
Start Stride.
Pick "New project" and "New game". Then name your project.
Then just accept the defaults for the next screen. Click OK.
### CONTINUED IN NEXT POST ###
Until things change, most DW2 modding is still a bit--well...difficult. The DW2 team have future plans for modding tools and opening up various parts of the game for more types of modding (code mods), and for letting modders change certain things they can't as-of-now. However, due to the barriers to entry for DW2 modding, most folks stick with just changing the .xml files you can find in your Distant Worlds 2/data folder (since you can just have loose .xml files in a new mod folder and the game will overwrite things (kinda like modding in Distant Worlds 1)).
For anything art-related, though, it takes a bunch of extra steps. So let's get started.
For the purposes of this guide, we will be replacing a vanilla player flag graphic with a new one. Adding/replacing other art assets will follow the same basic steps. Adding new assets will typically also involve editing a game .xml somewhere so DW2 knows where an asset is and when to use it.
I'm NOT a code guy, I'm a 2D art asset guy. So please excuse the clumsy descriptions and brute-force methods of getting through some things.
Background info:
DW2 uses bundles for its art assets, not loose files.
These bundles are listed in your Distant Worlds 2/data/db/bundles folder. There are a lot of bundles in that folder, but the one that holds the most stuff we will probably utilize is the CoreContent.bundle. Ultimately we will need to build our own bundle for our mods, using the folder structure found within the various game bundles.
When working to replace old art assets or place new art assets, you'll need to know where assets live in DW2 bundles (there are directory structures embedded within bundles...the game data files (.xmls) usually reference art assets living within these directories). In DW1, you could just have loose files with the same directory structure, but for now DW2 requires us to dance in and out of these "bundles". So...here we go.
To look inside a bundle, you'll need to use the DW2 Bundle Tool available in a pinned message in the #mod channel on the DW2 discord.
In addition to just browsing inside the bundle, you'll also need to use that tool to "extract" the various files within. You'll ALSO ALSO then need to use that tool to "convert" the various art assets into readable files. Extracting files by themselves brings out extension-less files. The tool is used to convert them. Be aware is a command-line thing, so you'll need to use proper syntax when doing all that.
Install the Bundle Tool via the instructions in the #mods channel on Discord. There's a "help" command you can run via command prompt that describes the ways you can use the tool.
For example, to "list" all files within a bundle, you'd run this command via the command prompt from within the directory you have your Bundle Tool installed:
dw2bt.exe list "<<YOUR DW2 GAME DIRECTORY HERE>>\data\db\bundles\CoreContent.bundle".
Use quotes and put where you have DW2 installed at the front and you should get a huge list of files within that bundle. For art assets we're typically interested in files that have the "texture" descriptor in the list.
For flags, you could then "extract" all flags by using this command:
dw2bt.exe extract "<<YOUR DW2 GAME DIRECTORY HERE>>\data\db\bundles\CoreContent.bundle" UserInterface/Flags/*.*
In the above extract example, it would place all the extracted files in a directory UserInterface/Flags within the location you've installed the Bundle Tool.
You would then need to convert each one to a .png. You'd do that this way:
dw2bt convert "UserInterface\Flags\Human_1" "UserInterface\Flags\Human_1.dds"
Adding a new file
It can be daunting to get things listed, extracted and converted, but I've done that for you, so for this guide I'll just help you skip all of that.
Remember, DW2 Player Flags live in the CoreContent bundle in the following directory:
UserInterface/Flags
They are .png textures. They are 400px by 250px.
There, done! NOW we can get started.
/========== ADDING A SINGLE PLAYER FLAG (a modding guide to DW2) ==========\
/// Step 1 -- Create your player flag
Here's one. Poof! That was easy.
/// Step 2 -- Install Stride Game Engine and .Net 6.0 SDK
(yes, really). You'll need .Net to let Stride load things properly. And you'll need Stride to create bundles. DW2 was built in Stride. That's the process for now.
https://www.stride3d.net/download/
You can install the most current version of Stride. Old DW2 modding instructions mention a very old Stride version called Xenko, but Xenko became Stride...so it's just the newest version of that.
/// Step 3 -- Create a new project in Stride
Start Stride.
Pick "New project" and "New game". Then name your project.
Then just accept the defaults for the next screen. Click OK.
### CONTINUED IN NEXT POST ###