DC||ED Editor

Last modified: February 24 2014 12:53:20.        
For infos or suggestions, see the credits page        
  File System structure Editing Basics Hex/DC examples RevEngEd 2

Support Wikipedia

DC||ED it's an editor developed by Mafia fans. And it is, obviously, designed to open Mafia files. Luckily, H&D2 and Mafia had the same creators, so DC||ED can open and edit some of the H&D2 files, except for some bugs. Before using DC||ED, please take note of all the counter-indications written below.
A very huge quantity of the work made to understand the files structure, was made modifing the files with DC||ED and then looking for changes with the hex editor. Saving the modified file with a second name and then using the hex compare function is very useful!

With DC||ED you can open .bin files. Let's open actors.bin from Normandy2: image. On the left you have a tree browser which displays several categories and names (zone1, la_ammo_2, etc.). Every name is an object and on the right you can see (and edit) some of its properties. For example, the object "zone1" has a spatial position (identified by X, Y and Z coordinates), a rotation (which IS BUGGED in DC||ED!!*), a scale (how big the object is) and other additional values which rarely are used. Selecting the "la_ammo_6" object, properties on the right change a little. It has position, rotation, scale and additional as well, but looses the other unknown 6 values to gain 2 string properties: "model" and "sector".
You can change these values, save, and then start up a H&D2 game to see what happens. Trial and error is the best way to understand on your own how things work.

Presumably, you can change only the properties for objects in the "Object" macro category, and not those in the "Object Definitions" macro category.
Some of the properties are:

  • Object, expressed by a string: it's the name of the object. If changed, the new name must be equal in length to the old name, or the file will occasionally mess up, becoming unusable. It also won't modify a second part in the file for "Model Objects", called definition, so changing the name of "Model Objects" will make them uneffective (see the hex/dc examples for further details)!
  • Position, expressed by 3 floats: the location of the object, using the in-game coordinates.
  • Rotation, expressed by 3 floats: the rotation of the object, which is bugged*!
  • Scale, expressed by 3 floats: usually is 1.0, 1.0, 1.0 and tells how to make the object bigger or smaller.
  • Additional, expressed by 3 floats: no use yet found.
  • Long object properties, expressed by 6 (long?) floats: no use yet found.
  • Model, expressed by a string: refer to a .4ds file, which cointains the polygons of the object. If a .4ds file with this name is put into the "Models" folder, H&D2 uses this file to depict the object.
  • Sector, expressed by a string: is the light used to light up the object. Usually is "Primary Sector" which roughly means "Outside". For indoor objects, indicates the light used in the room where the object is.
You can also export, import and duplicate object, by using the menu "Edit > Export", "Edit > Import" or right-clicking and object and then chosing "Duplicate". You can rename objects or delete them. Etc.
Just remember a couple of things: save often and do a lot of different back up files! Even using DC||ED functionality, files get often corrupted and then unusable! Especially "renaming" leads to a lot of troubles. If you have to rename an object, be sure to enter an equally long name. In files there are several bytes indicating the length of the file or the length of part of it. Changing the length of a name, often makes these bytes incorrect and then the whole thing crash.

Some of the functionalities are:
  • Rename, right-clicking selected > "Rename": seems not to work. Instead, use the "Object" property on the top right.
  • Delete, pressing "Del" while selected: removes the object from file.
  • Duplicate, right-clicking selected > "Duplicate": create a copy of the object, asking for a new name. I think this is the only functionality which correctly renames objects with different length strings. Also, notice that duplicate won't work correctly on "Model Objects" because it does not copy the definition of the object (see the hex/dc examples for further details).
  • Export, "Edit > Export" menu while selected: creates a .dnc file containing all the information of the object. Again, this functionality won't consider the definition of "Model Objects" (see the hex/dc examples for further details).
  • Import, "Edit > Import" menu while selected: browses the filesystem for .dnc files, previously created with the "Export" functionality. When the .dnc is imported, a new object is created among the others, without asking for a name. So be sure not to have duplicate names!
A single feature of DC||ED is found by openening the scene2.bin file and then clicking the menu "File > General Properties". This will open a popup value editor, where you can set some parameters, like the "View Distance"

I won't expand up the usage of DC||ED: you can find plenty of guides on the web or learn by "trial and error" as I did.

* Simple rotations (i.e. around a single axis) usually work. But sometimes I went mad because I was not able to set a particular rotation, involving all of the 3 axis and unusual degrees. I later found out that rotation in files is stored by 4 floats (a quaternion) and not a 3 floats euler angle. DC||ED makes a conversion from 4-floats-quaternion inside file to a 3-float-eulerian in its interface. And then, it makes another conversion from eulerian to quaternion when you modify a rotation. Well, DC||ED has some problems doing this with H&D2 files! When I rewrote the functions for conversion in my editor, I was finally able to set those unusual rotations as I wished.