SDF files

SDF files, Sector Definition Files, contain the map sector definitions.

File locations

/<datadir>/setX/scripts/ contains SET.sdf file.

Editing tools

SDF files are plain text files which can be edited using ordinary text editors such as WordPad or Notepad++ (recommended). Windows Notepad may show it badly due to non-Windows-style line separators so it's not a good choice.

SDF file format

SDF file consists of three sections that end with “>”. Semicolon (;) is a comment tag so everything after it is ignored.

First section defines sub-sector models, basically buildings.

Second section defines sub-sectors and their destruction sequences.

Third section defines the actual sectors.

First Section - sub-sector models



First section defines sub-sector models, basically buildings, and is the most complex section. Each line defines one building.

ST_CITY1.base  skeleton/ST_CITY1.sklt 0   3  50   0  49 -135 -135 130   81 0 -130 20     81 125 125 100    81 -30 0 80                     ; 3

ST_CITY1.base
skeleton/ST_CITY1.sklt

The first name defines the graphical model of the building.
The second name defines the collision box of the building. It must have a “skeleton/” prefix.
Both of these are loaded from SET.bas packages.

0 3 50 0

These four numbers define general parameters and every building has them.

First number is almost (?) always zero and its function is currently unknown.

Second number defines the map icon. These icons are loaded from LEGOx.ilb files and the icon coordinates are most likely calculated via hard-coded routines.

Third number affects the durability of the building. It acts like an armor variable - 0 means no armor and 100 makes the building indestructible.

Fourth number is usually zero but it can have values 1 and 2 at least. Its function is currently unknown but it might be related to the “energy” of the building which affects building durability.

The next numbers define destruction effects and not all buildings have them. The numbers are always in groups of four:

49 -135 -135 130

81 0 -130 20

81 125 125 100

81 -30 0 80

FIXME - confirmation needed…

First number of each group defines the effect model which is defined as a vehicle. BRUCH.scr script is usually used to store these models.

The other three numbers are coordinates of the effect model.

The building number which is needed in the second section starts from 0 and follows line order. The number is usually put into the comments which is a good practice.

Second Section - sub-sectors



The second section defines sub-sectors and their destruction sequences. Examples:

 3  4  5  6     1       ;  4  st_city1
31 31 31 31     0       ; 28  hukl2

The fifth number determines whether the building is destroyable or not.

If it is 1, the building can be destroyed. When a level is loaded, the game reads the first number of the line and places the corresponding model (see the first section) on the level. After taking certain amount of damage, the destruction effects are played and the model is replaced with the model that corresponds to the second number. This continues until the game places the fourth model, which is indestructible. For most buildings it's a small crater on the ground.

If the fifth number is 0, the building is indestructible (Stoudson bomb, for example) and the last model (4th number) of the sequence is placed as soon as the level starts.

Sub-sector numbering starts from 0 and follows line order. The number is usually put into the comments.

Third Section - sectors



The third section defines the actual sectors. The entry format is usually explained in the separator line:

> SektorNUmmer SektorTyp  BodenType Zeichen SubSects[]

There are two types of sectors - sectors with one sub-sector (e.g. power stations, first example) and sectors with 9 sub-sectors (second example).

15  1  1  24     50                                   ;ST POWERSTATION
210 0  5   1    36  141 19   37 170 130  123   2  2    ;GS STR ECKE    NO

The first number is sector number which starts from 0 and can be 255 at most.

The second number defines sector type. 1 means one sub-sector and 0 means 9 sub-sectors.

The third number defines the bottom ground texture which can be seen around the borders of the sector. It can have values from 0 to 5 but how the game picks a texture based on a number is currently unknown. The numbers may point to BODENx.ilbm files but this is unconfirmed.

The fourth number defines “Zeichen” which means “symbol” or “sign”. Its function is currently unknown but it may not have any function at all.

The next numbers define the sub-sectors that are picked from the secod section. Depending on the sector type, there are either one or nine sub-sectors.

Notes on sub-sectors

Putting a small sub-sector on a type 1 sector will result in a glitchy sector where there's a gap around the building that causes tanks to drop into the void and allows flying underground.

Putting more than one sub-sectors on a type 1 sector, or big sub-sectors on a type 0 sector will most likely result in glitches.

Talk about SDF Files

Visit the forum thread on finding good sectors and SDF related talks at http://forums.metropolisdawn.com/viewtopic.php?f=23&t=929&start=10

modding/sdf_file.txt · Last modified: 2014/06/30 22:42 by goldstar611
Back to top
CC Attribution-Noncommercial-Share Alike 4.0 International
chimeric.de = chi`s home Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0