Giter Site home page Giter Site logo

reverse-engineering-dungeon-siege's Introduction

Reverse engineering GPG's Dungeon Siege

This repository contains tools and code to extract and convert game assets of the Dungeon Siege and Dungeon Siege: Legends of Aranna games, from developer Gas Powered Games (GPG).

UPDATE: See the OpenSiege project for other more recent work on Dungeon Siege.

This project aims at reverse engineering the main file formats used by Dungeon Siege to store its game assets (i.e.: textures, 3D models, sounds) and to provide tools for converting them to more standard formats that can be opened/viewed outside the game.

At the current stage, the following file formats are implemented:

  • Tank files (.dsres|.dsmap): Full support for opening and decompression (thanks to Scott Bilas).

  • Aspect models (.asp): Partial import and a tool that converts static geometry to Wavefront OBJ.

  • Siege Nodes (.sno): Partial import and a tool that converts the geometry to Wavefront OBJ.

  • RAW textures (.raw): Full support for importing and tools to convert to PNG and TGA formats.

  • Skrit and Gas files are plain text, so they can be easily viewed and edited once extracted from a Tank.

Hint: Check the misc/ directory for detailed descriptions of each format.

Disclaimer:

The goal of this project is to experiment, research, and educate on the topics of game development and game asset management. All information was obtained via reverse engineering of legally purchased copies of the games and information made public on the Internet.

Project structure / dependencies

Relevant source code for this project is located inside the source/ directory. The misc/ directory contains additional information such as more detailed description of the file formats, screenshots from extracted models, among other things not directly related to the code. build/ is just an empty dummy dir, but when compiling the source, that's where the binaries are outputted.

source/ is further divided into the following subdirectories:

  • siege/: Source code for LibSiege, the main static library containing code and data structures for interacting with Dungeon Siege game data.

  • utils/ Source code for LibUtils, a tiny static library with miscellaneous helper code and infrastructure. This library is referenced by LibSiege and all of the tools.

  • tools/: Source code for the command line tools, such as the ASP/SNO model converters and a tool to open and extract files from a Tank archive.

  • thirdparty/: Third party code and libraries. It also contains copies of a few source files made available by Scott Bilas in his website, for quick reference and safe-keeping. Those files are not directly compiled into this project and fall under a different license.

Dependencies

The only dependencies of the project, at the moment, are a few Unix system calls (namely stat and mkdir) which are all contained inside LibUtils. The libraries and tools are all written using the full feature set of C++11, plus its Standard Library, so compiling will require a recent compiler like Clang or GCC. It should also compile with Visual Studio 2015 or more recent.

Mini-Z is currently the only external code required, and it is included in the thirdparty/ dir.

Building

A premake4 script is included, which was only tested on Mac OSX with Clang and will probably not work out-of-the-box with GCC & Linux. Fixing eventual issues should be easy, nevertheless. This script is deprecated. We now have a CMakeLists.txt that should be used instead. It can generate the projects for Windows (VS) or Linux/OSX (GCC/Clang).

To generate the project files using CMake, you can use the command line or the CMake GUI for Windows.

To build using Premake on Linux/OSX, navigate to the source code root and run:

premake4 gmake

Then navigate into build/ and just run make.

Running the tools

The project is currently comprised of five command line tools, besides the static libraries.

  • tankdump: Tool for opening and displaying information about a Tank archive. It can also perform a full or partial decompression of a Tank into normal files in the file system.

  • raw2tga: Converts RAW textures to the Targa Truevision (TGA) format (uncompressed).

  • raw2png: Converts RAW textures to compressed PNGs.

  • tga2raw: Converts TGA images back into Dungeon Siege RAW format.

  • asp2obj: Converts ASP models to portable OBJ models. No animation support is available.

  • sno2obj: Converts SNO models to portable OBJ models. SNO models are always static geometry used for the terrain/buildings.

All the above tools can be called with the -h or --help flags to display more detailed usage information and the other available command line flags.

Prebuild Windows binaries are provided in the build folder.

Special thanks

A big thanks to the folks at GPG for making this awesome game, one of the best RPGs of all times, no doubt, and for making a huge amount of technical information about it available. If only the bulk of the games industry was like that, we'd have a lot better and more game developers today...

Another big thanks to Scott Bilas for providing detailed documentation and source code samples on the Tank format and other details about the inner workings of Dungeon Siege.

Sam Brkopac (sbrkopac) for the CMake script for Windows!

And lastly, the SiegeTheDay community and forums for making the 3DMax import/export scripts available. It would have taken many more months to reverse the 3D model formats if it wasn't for them!

License

This project's source code is released under the MIT License.

Eye candy

ASP models extracted from the game


The blessings of Azunai The Defender upon you! Travel safely!

reverse-engineering-dungeon-siege's People

Contributors

glampert avatar sbrkopac avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

reverse-engineering-dungeon-siege's Issues

Errors when trying to use tankdump

Hey! I was so happy when I found this project. Dungeons Siege is such a great game and I'm glad there still is interest in it!

However, running the tankdump gives me errors, and nothing can be dumped. I feel like I'm missing something basic, but I can't get it work. Using admin command prompt in windows 10, also tried different directories.

tankdump.exe "D:\Spel\Dungeon Siege\Resources\Objects.dsres" "D:\Dev\Sources\Dungeon Siege\Objects" -D -P
Gives me a wall of:

ERROR.: Unable to open file "D:\Dev\Sources\Dungeon Siege\Objects/art/bitmaps/armor/gauntlets/b_a_gntl_014.png" for writing! No such file or directory
ERROR.: Unable to open file "D:\Dev\Sources\Dungeon Siege\Objects/art/bitmaps/armor/gauntlets/b_a_gntl_016.png" for writing! No such file or directory
ERROR.: Unable to open file "D:\Dev\Sources\Dungeon Siege\Objects/art/bitmaps/armor/gauntlets/b_a_gntl_018.png" for writing! No such file or directory
ERROR.: Unable to open file "D:\Dev\Sources\Dungeon Siege\Objects/art/bitmaps/armor/gauntlets/b_a_gntl_020.png" for writing! No such file or directory
ERROR.: Unable to open file "D:\Dev\Sources\Dungeon Siege\Objects/art/bitmaps/armor/gauntlets/b_a_gntl_022.png" for writing! No such file or directory
....

And skipping the TGA tag and running :

tankdump.exe "D:\Spel\Dungeon Siege\Resources\Objects.dsres" "D:\Dev\Sources\Dungeon `Siege\Objects" -D

Gives me:
ERROR.: Failed to extract 15744 resource files!

However, running the single -e command does successfully extract a file, and I can use the other commands to view files and info.

Invalid Links

Hello, I noticed that the links to the Skrit manual are non-functional.
Could you please replace them?

They are found in the misc/other-formats.txt file on line 36 and onward.
For example, the Skrit technical manual link: http://scottbilas.com/files/dungeon_siege/Skrit.html

Many thanks for all the work you did on this project.

Continue your work pls

Can you please reverse engineer the game? There's another project named OpenSiege, valeu é nóis hue br no mundo

tankdump cant open LOA dsres

LOA dsres is unopenable...

tankdump.exe Expansion.dsres -H

-------- TANK HEADER --------
Product id.........: DSig
Tank id............: Tank
Header version.....: 1.0.2
DirSet offset......: 0x16432BD0 (356.2 Megabytes)
FileSet offset.....: 0x1643C288 (356.23 Megabytes)
Index size.........: 742.89 Kilobytes
Data offset........: 0x00000324 (804 Bytes)
Product version....: 5.0.0  10.0.3  1.0.16
Minimum version....: 5.0.0  3.7.210  1.0.8
ERROR.: Invalid TankFile::Priority flag!

Same happens with ExpVoices.dsres...

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.