Modding Dune Legacy

What you can change today — and what still needs source work.

Custom Maps

The easiest way to mod Dune Legacy. Drop an .ini file into data/maps/singleplayer/ or data/maps/multiplayer/ and it appears in the map selection list. No rebuild required.

Map File Format

Maps are plain-text .ini files with the following sections:

[BASIC]
Author=Your Name
Name=Your Map Name
Size=64
NumPlayers=2
MapScale=0

[BRIEFING]
1=First player briefing text
2=Second player briefing text

[Player1]
Credits=5000
Quota=0

[CHOAM]
Carryall=2
Harvester=4
Launcher=5
MCV=2
'Thopter=3
Quad=5
Siege Tank=6
Tank=6
Trike=5

[STRUCTURES]
ID001=Player1,Const Yard,256,100
ID002=Player1,Windtrap,256,103

[MAP]
001=%%%%%%%---~~~~~~~~...
002=%%%%%%--~~~~~~~~...

Terrain Tile Characters

CharacterTerrain
%Solid rock — buildings and base structures go here
-Dune sand — impassable to most ground units
~Spice field
+Bloom (bonus spice yield on harvest)
OPlayer spawn / base start location
^Mountain — impassable to all units
_Water / lake

Map Sizes

SizeBest for
32×32Tiny skirmish, very fast games
64×64Standard multiplayer and campaign missions
128×128Large battles with room to manoeuvre
192×192 / 256×256Epic scale — long campaigns or city-sim style layouts
Tip: The bundled 2P - 192x192 - SimCity.ini map is a good starting template for large maps. Open it in any text editor to see how the sections fit together.

Graphics & PAK Files

Dune Legacy loads art from .PAK archives under the data/ directory. These are the original Dune II data files (or HD replacements). You can replace or extend them to change how the game looks.

PAK FileContents
ATRE.PAKAtreides-specific unit and building graphics
HARK.PAKHarkonnen-specific unit and building graphics
ORDOS.PAKOrdos-specific unit and building graphics
DUNE.PAKShared terrain, UI, and common sprites
GFXHD.PAKHD upscaled graphics (overrides standard PAKs when present)
SCENARIO.PAKCampaign mission data and cutscene assets

Dune Legacy supports loading alternative PAK files. Place replacement PAKs in the data/ directory and they will override the originals at startup. HD texture packs work the same way — GFXHD.PAK is loaded last and takes priority over lower-resolution assets.

Custom Graphics Modding

To replace sprites and textures you need to unpack the relevant PAK file, edit the art assets, and repack. Here's the general process:

Palette Considerations

Dune II graphics use an indexed 256-colour palette. When editing sprites, you must work within the original palette or house-specific palette entries — free colour painting will produce unexpected results at runtime. Many sprite editors (PCED, Grafx2) and general tools like GIMP support indexed-mode editing with a loaded palette.

The palette file is typically IBM.PAL inside DUNE.PAK. Each house also remaps a range of colour indices to its house colours (blue for Atreides, red for Harkonnen, green for Ordos) — keep this in mind when editing unit sprites shared across houses.

PAK Packing Tools

Several community tools exist for working with Dune II PAK files:

  • DunePAK — command-line tool for extracting and repacking .PAK archives
  • Dune Legacy's own PAK reader — the source (src/FileClasses/) shows the PAK format if you want to write your own tooling
  • OpenDUNE tools — the OpenDUNE project ships utilities compatible with Dune II asset formats
The HD texture pack path (GFXHD.PAK) is the cleanest way to distribute a graphics mod — users drop it into data/ and it takes priority without replacing the originals.

Unit & Building Stats

Cost, health, build time, weapon damage, firing rate, and movement speed are defined in the C++ source under src/. Changing these values requires editing source and rebuilding. See BUILD.md in the repository for compilation instructions.

  • Unit stats — unit type definitions, cost, speed, weapon tables
  • Building stats — structure type definitions, power consumption, build prerequisites
  • AI behaviour — computer player attack timing, unit composition, and base-build priorities
  • Mission scripting — campaign event triggers and win/loss conditions in SCENARIO.PAK

There is no data-driven config file for these values today — they live directly in C++ constants and would need a significant refactor to expose as moddable data without a rebuild.

What's NOT Moddable Yet

Custom Houses / Factions

Dune Legacy ships with three playable houses — Atreides, Harkonnen, and Ordos — plus campaign-only houses (Sardaukar, Mercenary, and Fremen). There is no modding interface to add a new house or swap one out. The house system is embedded in the Dune II engine's mission data, AI, and UI.

Adding a custom house would require forking the source, adding a new HouseType enum value, creating PAK entries with sprites and sounds, wiring it into AI decision trees and mission scripting, and providing house-specific briefing text, mentat portraits, and voice lines. It's a substantial engineering effort.

General Mod Loader

There is no general-purpose mod loader, mod directory scan, or mod conflict resolution system. Mods today are limited to custom maps (drop-in .ini files) and PAK replacements (drop-in asset files). Any logic change requires a source-level patch and a rebuilt binary.

Sound & Music Replacement

The audio assets (voice clips, sound effects) come from the original Dune II data files or replacements placed in data/. Music replacement follows the same PAK drop-in pattern, but full audio mod tooling is not documented and may require source-level changes for some formats.

Contributing

Made a custom map, improved a sprite, or written a useful patch? Contributions are welcome:

  • Maps — submit via pull request to data/maps/ in the dunecity repository
  • Bug reports & feature requestsopen a GitHub issue
  • Source patches — see BUILD.md and ARCHITECTURE.md for codebase layout and build instructions
  • Graphics mods — share work-in-progress on Discord for feedback before submitting a PR
Dune Legacy is open-source under the GPL-2.0+ licence. The Dune II data files (PAK assets) are copyright 1992 Westwood Studios / EA and are not redistributable — players must supply their own copy.