Yu-Gi-Oh Master Duel

Software for creating Master Duel mods:


Guide:

First you'll have to find the game files with the graphics you want to edit, which are located in these two directories:

C:\Program Files (x86)\Steam\SteamApps\common\Yu-Gi-Oh!  Master Duel\LocalData\0000
C:\Program Files (x86)\Steam\SteamApps\common\Yu-Gi-Oh!  Master Duel\masterduel_Data

The C:\Program Files (x86)\Steam part can differ if you changed the path manually. The first folder contains most of the game files. The second one contains basic game files and the ones from the tutorial. You can find the exact Unity file name of every card artwork, sleeve/protector image, wallpaper and more in this spreadsheet (last updated for game version 2022-08-05).

If you want to edit other graphics, you can find them with the app AssetStudio which can load whole folders at once. You can do that by clicking on File and Load Folder in the menu bar. Please note that this can take a few minutes due to the large number of files, and it initially eats up more than 17 GB of RAM for the first folder on my PC, so if you have less RAM, the rest will likely be automatically loaded into the page file on your PC which takes even longer.

When AssetStudio has loaded the files, click on Filter Type and Texture2D in the menu bar, then switch to the Asset List tab.

The card artworks are in one of these containers:
assets/ressources/card/images/illust/common/
assets/ressources/card/images/illust/ocg/
assets/ressources/card/images/illust/tcg/

  • common: contains card artworks that are the same in all language versions
  • ocg: contains card artworks for the mostly uncensored Japanese version
  • tcg: contains altered card artworks for all other language versions.

To find a specific card artwork, enter its card ID in the Filter bar and press [Enter]. To find the ID for the card you're looking for, you can look in the spreadsheet linked above or on this website. There you can enter the card name in the Enter Keyword field, press [Enter] and click on a card. The card ID is then displayed in the URL bar after "cid=".

In the Asset List tab of AssetStudio you can right-click on a file and select Show original file which shows the file in Windows Explorer.


If you found the right file and use UABEA:

  1. In Windows Explorer, make a backup of the file in a different folder. This step is optional, but better safe than sorry.
  2. Make a copy of the original file in the same folder by selecting it and pressing [Ctrl] + [C] and then [Ctrl] + [V] on your keyboard, or use the right-click context menu for that.
  3. Open the app UABEA.
  4. Click FileOpen and open the copy of the file you want to edit.
  5. If the file is compressed, UABEA will ask you to decompress the file, in this case click the Memory button.
  6. If you opened a copy of the file data.unity3d in step 4, click on the drop-down menu that initially says globalgamemanagers and select resources.assets.
  7. Click the Info button to open the Assets info window.
  8. Select the row with the Texture2D type.
  9. Click Plugins, select Edit texture and click OK.
  10. Optional step for best quality but larger file size: Change the Texture format to RGB24 for graphics without transparency (e. g. card illustrations or sleeves/protectors) or to RGBA32 for graphics with transparency (e. g. wallpapers).
  11. Click Load, open the image file you want to replace the original image with and click Save.
  12. Optional steps if you want to change the brightness (light power) of protectors/sleeves:
  13. Select the row with the Material type. (Note: It only exists in one of the two sleeve files.)
  14. Click the Export Dump button and save the text file
  15. Open the text file with a text editor and search for LightPower.
  16. One line below you can change its value after float second =. You should set the value between 0 and 0,1. Any higher value may look too bright in game. You can find all default LightPower values in the spreadsheet linked above.
  17. Save the text file and switch back to UABEA.
  18. Make sure the row with the Material type is still selected, click the Import Dump button and open the text file you just edited.
  19. End of optional steps
  20. Back in the Assets info window click File and Save. After that close this window.
  21. In the UABEA main window click File and Save.
  22. Select the file with the original name and click Yes when the app asks you to overwrite.
  23. Optional steps if you want to compress the file to save disk space (doesn't work for the data.unity3d file):
  24. In the UABEA main window click FileClose →  File →  Open and open the file with the original name.
  25. Click FileCompress.
  26. Enter a different file name for the output file and click Save.
  27. Choose your desired compression method.
  28. Copy the name of the original file to the clipboard and delete the file.
  29. Rename the output file from step 26 to the original file name from the clipboard.


If you found the right file and use UnityEx:

  1. Make a backup of the file.
  2. Open the app UnityEx.
  3. Drag and drop the file into UnityEx.
  4. Right-click any of the files and chose ExportExport all textures.
  5. In Windows Explorer, open the folder Unity_Assets_Files in the same directory and all subsequent folders until you're in the Textures folder.
  6. Open the DDS file with Adobe Photoshop (DDS plugin needed, see links above), edit it to your liking and save it.
  7. In the NVIDIA Texture Tools Exporter window, you can use these options for the highest quality. For non-transparent textures like card artworks and sleeves/protectors you can set the Format to 8.8.8 BGR 24 bpp | unsigned to save disk space.
  8. After choosing the options, click the Save button in the bottom right. The NVIDIA Texture Tools Exporter remembers its settings so you don't have to check them every time.
  9. Switch back to UnityEx.
  10. Optional steps if you want to change the brightness (light power) of protectors/sleeves:
  11. Select the row with the name PMat.mat. It should be highlighted now.
  12. Click the button RawToDumpXML.
  13. In the Windows Explorer window from step 5, go up one folder. You should be in a folder that starts with CAB-. Now open the Dump folder.
  14. Open the file PMat.mat.xml with a text editor and search for LightPower.
  15. One line below you can change its value after value=". You should set the value between 0 and 0,1. Any higher value may look too bright in game. You can find all default LightPower values in the spreadsheet linked above.
  16. Save the file and switch back to UnityEx.
  17. Make sure the row with the Material type is still selected and click the button DumpXMLToRaw.
  18. End of optional steps
  19. Import the edited file(s) by clicking on the Import files button. This should only take a few seconds. After that you'll be able to see the edited graphic in game if you did everything correctly.


Batch exporting/importing files with UnityEx:

  1. Download the archive from the third link with "bat" in it from the UnityEx thread and extract it.
  2. In the batch files you want to use for Master Duel you need to insert the three characters ;*. after *.unity3d because most of the Unity files of Master Duel don't have a file extension.
  3. Also, you need to add the UnityEx directory to your PATH Environment Variables for the batch files to work.
  4. Copy the batch files you need to the directory with the game files you want to edit.
  5. Run the respective bat file to do a batch import/export. For the card illustrations, sleeves (protectors) and any other graphics you need the textures batch files.


Replacing Duel Fields, Field Parts (graveyards) and Mate's Bases:


To do this, you just need to rename files. I listed them all in the spreadsheet linked above. The Qliphort duel field is called "Spellbook Star Hall" and the Lightsworn/Duelist Cup one "Colosseum" in game and in my spreadsheet.

For example, if you want to change the duel field "World Legacy Ruins" to the "Spellbook Star Hall" one, do the following:

  1. Make a copy of the Spellbook Star Hall files 61140db1 and 9e59c7e8 in the directory \Yu-Gi-Oh!  Master Duel\LocalData\????????\0000\.
  2. Rename the copy of the file 61140db1 to b57af26f.
  3. Rename the copy of the file 9e59c7e8 to 4b96fb8b.
  4. Make a backup of the original World Legacy Ruins files b57af26f and 4b96fb8b.
  5. Copy the renamed Spellbook Star Hall files to the locations of the original World Legacy Ruins files and overwrite them.


Python scripts for processing CARD_* TextAssets from the data.unity3d file:

CARD_decrypt.py / Credits: akintos from GitHub (exe file is available there), timelic for the new crypto key.
import sys
import zlib

file_name = sys.argv[1]
m_iCryptoKey = 0x131

with open(file_name, "rb") as f:
    data = bytearray(f.read())

for i in range(len(data)):
    v = i + m_iCryptoKey + 0x23D
    v *= m_iCryptoKey
    v ^= i % 7
    data[i] ^= v & 0xFF

with open(file_name + ".dec", "wb") as f:
    f.write(zlib.decompress(data))

CARD_encrypt.py
/ Credit goes to crazydoomy#4471 for editing the above script for encrypting
import sys
import zlib

file_name = sys.argv[1]
m_iCryptoKey = 0x131

with open(file_name, "rb") as f:
    data = bytearray(zlib.compress(f.read()))

for i in range(len(data)):
    v = i + m_iCryptoKey + 0x23D
    v *= m_iCryptoKey
    v ^= i % 7
    data[i] ^= v & 0xFF

with open(file_name + ".enc", "wb") as f:
    f.write((data))

CARD_decrypt_Desc+Indx+Name.py / Credits: same as above
  • Decrypts the CARD_Name, CARD_Desc and CARD_Indx files in one go.

CARD_Name+Desc_split.py
/ Credit: timelic
  • Splits the CARD_Name and CARD_Desc files, so that every name and description is in one line, and converts them to JSON.

CARD_merge+calc_index.py / Credit: timelic
  • Merges the CARD_Name and CARD_Desc JSON files and calculates the CARD_Indx file. The original files will be overwritten by this, so make a backup beforehand.

Additional info:
  • The CARD_Name files contain all card names in a specific language.
  • The CARD_Desc files contain all card descriptions like effects and flavor text in a specific language.
  • The CARD_Indx files contain the 4-byte hexadecimal offsets of the card names and descriptions in their respective files in little-endian byte order. The offset of the the first card name "Insect Monster Token" (ID: 3900) in the CARD_Name file is at the offset 0x08 and the first card description in the CARD_Desc file is at offset 0x0C. The offset of the the second card name "Kuriboh Token" (ID: 3901) is at offset 0x10 and so on.
  • All 3 files mentioned above are sorted by card ID.
  • To export/import these files with UABEA, select the row with the TextAsset type in the Assets info window, click Plugins, select Export/Import .txt and click OK.

Decrypting IDS_* TextAssets

This can be done with QuickBMS and the Yugioh Ydlz script.

Related links:

Article information

Added on

Edited on

Written by

RndUser

115 comments

  1. RaulBataka
    RaulBataka
    • member
    • 7 posts
    • 2 kudos
    When I find a texture I want to modify I open it with UABEA but what I want is to extract the image so I can modify it, so I go to plugin but  instead of modify I click export  .png which lets me save the image BUT the issue i've been encountering is that this images have some noise/artifacts that ruin the image D:
    is there any way to get the image out without that happening? example of artifacts
    1. RndUser
      RndUser
      • member
      • 169 posts
      • 9 kudos
      I think I've seen this issue before and that it's a bug of UABEA. Asset Studio can extract Master Duel images properly.
    2. RaulBataka
      RaulBataka
      • member
      • 7 posts
      • 2 kudos
      ohh ty! I didnt realized assets studio could do that too
  2. oloolo7
    oloolo7
    • member
    • 1 posts
    • 1 kudos
    this maybe sounds dumb but what do you mean by clicking memory?
    1. RndUser
      RndUser
      • member
      • 169 posts
      • 9 kudos
      I'm referring to the button that says "Memory", I've just changed that sentence to clarify.
  3. RndUser
    RndUser
    • member
    • 169 posts
    • 9 kudos


    hello, do you know how to modify the audios of the DL characters?



    Hi, I assume that DL means Duel Links. I don't know how to mod audio in Duel Links or Master Duel, but I've seen BGM mods for both games and voice files use the same FSB format, so that should be possible. Maybe Heromonics knows because he did several DL BGM mods.
  4. AgusKarma
    AgusKarma
    • member
    • 7 posts
    • 3 kudos
    hello, do you know how to modify the audios of the DL characters?
  5. RndUser
    RndUser
    • member
    • 169 posts
    • 9 kudos


    Hello. Is it possible to mod a duel field that forces upon you in the duelist cup back to any of the standard ones (like forest or world legacy)?



    Yes, you just need to replace the Colosseum duel field files with the ones from other duel fields, but you can't replace other duel fields with the Forest duel field because that one isn't in a separate file. I described the renaming process in this guide in the paragraph "Replacing Duel Fields, Field Parts (graveyards) and Mate's Bases".
  6. TheHaou
    TheHaou
    • member
    • 1 posts
    • 0 kudos
    Hello. Is it possible to mod a duel field that forces upon you in the duelist cup back to any of the standard ones (like forest or world legacy)?
  7. RndUser
    RndUser
    • member
    • 169 posts
    • 9 kudos


    The latest update changed some files name so be careful when referring to the spreadsheet. You may want to do your own full scan of Master Duel install folder in AssetStudio and then find the ID of the stuff you want to edit. For example, Crusadia Maximus sleeve file is now 08eb7bc9 & 32a1bba0 instead of c8b40cbf & 4fcacdcc on the spreadsheet



    Thanks for pointing this out. I'll update the spreadsheet when I have the time for that.
  8. codex28
    codex28
    • member
    • 27 posts
    • 9 kudos
    The latest update changed some files name so be careful when referring to the spreadsheet. You may want to do your own full scan of Master Duel install folder in AssetStudio and then find the ID of the stuff you want to edit. For example, Crusadia Maximus sleeve file is now 08eb7bc9 & 32a1bba0 instead of c8b40cbf & 4fcacdcc on the spreadsheet
  9. RndUser
    RndUser
    • member
    • 169 posts
    • 9 kudos


    How can I change the game font. Exp: I wanna change default font of CARD_Desc to VNI font



    I tried this by replacing the Font "FOT-RodinPro DB" which is used for the card descriptions inside the files \masterduel_Data\data.unity3d\resources.assets and \LocalData\????????\0000\f6\f61f6436 with UnityEx, but only the punctuation marks in the card descriptions changed. This font isn't in my Windows Fonts folder, so I don't know where there might be another copy of this font which would need to be replaced.
  10. JulianV22
    JulianV22
    • member
    • 6 posts
    • 0 kudos
    How can I change the game font. Exp: I wanna change default font of CARD_Desc to VNI font