"Oh, wow--that totally rocks!
Thanks a million. You've saved me an incredible amount of work."

Mon Ful Ir, Aug 29 2008

"So I checked out the XSLT converter and my goodness: this is an amazing piece of work!
It's fantastic that you can convert DUNGEON.DAT into XML because this info can be used by anyone now (well, anyone who knows how to use XML files).
Excellent work!"

Gambit, Feb 13 2008

"Greatstone's work looks interesting."
Paul Stevens, Feb 14, 2008

i'm gathering info enough to render complete dungeon viewport (DM snes style) in some ways: (i) using sck (swoosh construction kit) to extract viewport information. it includes decoder for "558 item", very excellent!
Kentaro, Mar 11 2007


Data extraction from DM games
Overview

A game available for the public is a set of different data types: sounds, images, texts, maps, animations, code, etc. These data are stored in the final games using proprietary format, can be compressed and obfuscated. The files available for the final customer are very different from the data sources and consequently must be translated into more common format to be readable by everyone. Data extraction is based on reverse engineering and translation of the final published code and other available files. The main goal is to convert proprietary files format into well-known formats, like bmp, wav, txt, etc.

The secondary goal is to offer a viewer for all animations stored in FTL proprietary format.

Games: what can be extracted?

The target here is to extract data from all the DM games, on all platforms: Dungeon Master (DM) itself, Chaos Strikes Back (CSB), Dungeon Master 2 (DMII), Theron's Quest (TQ) and custom dungeons made by fans (for original game or CSBWin clone).

And Dungeon Master games use a lot of different original formats. Some of them are repositories of single data and we must understand the format of this repository and the format of each single data inside. Repository can be compressed and obfuscated and we must find the decompression and the encryption algorithms.

Example of DM files:

  • graphics.dat: specific repository of sounds, images, texts, palettes, etc.
  • dungeon.dat: dungeon maps (original one and CSBWin clone).
  • mini.dat: csb initial maps.
  • *.ftl: specific format containing code and single data (sounds, images, texts, palettes, etc.).
  • *.cmp: champion portraits and information.
  • *.amg: single sound.
  • swoosh: specific format containing code and single data (sounds, images, texts, palettes, etc.
  • *.smc: SNESwiki rom format containing all the game.
  • hcsb.htc: specific format containing Oracle hints
  • csbgraphics.dat: specific repository of sounds, images, texts, palettes, etc for CSBWin clone.
  • *.anm, end, swoosh, title, *.dat: animation.

Games: what can be viewed?

The target here is to view animation files from all the DM games, on all platforms: Dungeon Master (DM) itself, Chaos Strikes Back (CSB) and Dungeon Master 2 (DMII).

  • *.anm, end, swoosh, title, *.dat: animation.

Repositories and single data formats in DM games

Single data in the different repositories are encoded in multiple other custom formats. There are more than 12 different formats from the images, 14 formats for the sounds, 3 formats for the texts, 8 formats for the palettes, and multiple other format for unique data. Repositories use different single data formats depending on the game (DM, CSB, DMII, TQ), the platform ( Atariwiki , Amigawiki , SNESwiki , etc.), the game version (1.1, 1.2, 2.1, 3.6, etc.), the language (english, french, german, japanese), the packaging (original or hacked).

Technical documentation: formats description

In order to convert all these differents formats, a tool can:

  • identify the file to convert, using its signature.
  • associate a description of the file (what are the different formats used for each part of this file) if the file doesn't describe itself the data inside it.
  • read the file using a specific algorithm for each formats.
  • split the file into single data if needed.
  • convert the file and single data into well-known formats.
Consequently, a tool used for data extraction can contains:
  • a signature databases.
  • algorithms for each different format to be able to decode them.
  • a files descriptions database.
To be independant of the tool, the files descriptions must be based on a well defined format itself. That's why each file description uses the "mapfile" format initially created by C.Fontanel, the "DM/CSB encyclopaedia" webmaster. The specification of this "mapfile" format has been improved and maintained by P.Monnot, the "swoosh construction kit" webmaster, to describe all the new data found. This "mapfile" format allows to describe any file in term of file format identifier, location and format identifier of single data inside this file. The description of the formats themselves (i.e. algorithms to read each format) are outside the scope of the "mapfile" specification. A lot have been already described in the "DM/CSB encyclopaedia" website and some other DM related sites.

Tool: sck

The "swoosh construction kit" (sck) website is devoted to:

  • a specific tool, names sck also, able to deal with the data extraction from DM games.
  • the specification and evolution of the "mapfile" format.
  • the availability of the extracted data themselves in well-known formats, for every DM games, versions, platforms, languages and packages.
The goal is to provide the well-known data and a tool to do it yourself.

Bonus

As the "mapfile" format is not restricted to DM games, if a tool implements other decoding algorithms, it is possible to extract data from other games. An example is provided using the R-Type III rom on Gameboy Advance.