Age of Empires II - Visual Mods and Changing Sprites.

In this guide, I’ll walk you through the process of changing the sprites for Age of Empires II: Definitive Edition (AoE2 DE). We’ll be using a few tools to extract, edit, and reimplement custom sprites into the game.

Tools You’ll Need:

  • SLD Extractor: Download here.
  • SLX Studio: Download here.
  • AdvancedGenieEditor3: Located in the game’s directory (e.g., C:\Program Files (x86)\Steam\steamapps\common\AoE2DE\Tools_Builds)

Steps to Change Sprites:

  1. Extract the Sprite Files
    First, we use SLD Extractor to convert the in-game sprite files (.sld) into PNG images and CSV files, which we can then edit. These sprite files are found in:
    C:\Program Files (x86)\Steam\steamapps\common\AoE2DE\resources\_common\drs\graphics

  2. Edit the Sprites in SLX Studio
    Open SLX Studio and load the folder containing the PNG files you edited. Set the anchor values for all images. The values are in the csv files. Then, in the Tool menu, use the Generate Data Graphic option.

    • Turn off the Mask setting.
    • Turn on the Shadow setting, and adjust the shadow colors by modifying the alpha values.

SlX Studio

  1. Export the Sprite
    After making your changes, save the SLX file. Then export it to SMX format, keeping the shadow alphas intact.

  2. Place the File in the Correct Directory
    Place the exported SMX file in the following directory:
    C:\Users\User\Games\Age of Empires 2 DE\{PROFILE_NUMBER}\mods\local\EliteMangu\resources\_common\drs\graphics

  3. Rename the SLX File
    You’ll need to rename the SLX file based on the graphic ID of the unit. To find this ID, open AdvancedGenieEditor3, go to the Units tab, and search for the unit you’re editing. There, you’ll find the unit’s graphic ID. Next, move to the Graphics tab, search for that ID, and you’ll get the file name you need.

  4. Activate Your Custom Sprite in the Game
    If everything was done correctly, the new sprite should now appear in the Local Mods section of AoE2 DE. Simply activate the mod, and you should see your custom sprites in the game.


My Custom Project: Adding a Badge to Elite Mangudai

For my project, I decided to add a badge to the Elite Mangudai so it can be easily distinguished from the non-elite unit. This was tricky because both units share the same sprite.

To add the badge, I used a Python script to edit all the PNG files in batch, so I wouldn’t have to manually place the logo on every single image.

Here’s the Python code I used:

from PIL import Image
import os

def add_logo_to_image(image_path, logo_path, output_path, logo_position):
    try:
        img = Image.open(image_path)
        logo = Image.open(logo_path)

        # Ensure logo is RGBA for transparency
        logo = logo.convert("RGBA")

        # Resize the logo if needed
        logo = logo.resize((12, 12)) 

        img.paste(logo, logo_position, mask=logo)
        img.save(output_path)
        print(f"Processed: {image_path}")
    except FileNotFoundError:
        print(f"Error: File not found: {image_path} or {logo_path}")
    except Exception as e:
        print(f"Error processing {image_path}: {e}")

logo_path = "logo2.png"
logo_position = (80, 40) 

for filename in os.listdir("."): 
    if filename.lower().endswith((".png")) and filename.lower() != "logo2.png":
        image_path = filename
        output_path = f"{filename}"
        add_logo_to_image(image_path, logo_path, output_path, logo_position)

print("Finished")

Result

EliteMangudai

Adding the New Dat File in AdvancedGenieEditor3

Once the badges were added, I went to AdvancedGenieEditor3 to generate a new DAT file. There I needed to create a new graphic entry, and link it to the Elite Manguai unit. The new DAT file should be placed in:
C:\Users\Alan\Games\Age of Empires 2 DE\76561198153797281\mods\local\EliteMangu\resources\_common\dat

Important: Make sure the DAT file is placed in your user’s directory (as shown above), not the Steam directory, as putting it in the Steam folder will cause the game to crash.

Result

Everything worked great! The sprites now display in the game. However, the shadows are a bit off, so I’ll need to tweak the alpha values a little more to get them looking just right.

Output

Related Posts