Commandos/SEC file

SEC files contain the navigation mesh of a map. It is used for pathfinding an for calculating the field of view (view cone).



Vertices
XY coordinates on the map, e.g: 415.685 625.946

Hint for programmers: In Commandos the player looks down at the map from an angle of 40 degrees. That means that the y-coordinates have to be multiplied by sin(40) to get the correct screen coordinates.

Sectors
A Sector is a convex polygon defined by multiple vertices.

kx, ky, bz
kx = the tangent of the angle to the X-axis ky = the tangent of the angle to the Y-axis bz = the intercept for Z-axis

equation for the plane of a sector: z = kx * x + ky *y + bz

Type
Defines the terrain type of a sector

Height and Offset
Height = height of the sector

Offset = final height of a stair or a ramp.

Flags
Normal sectors have the flag 384.

Blocked sectors have the flag 276.

Sectors that cannot be walked on (but can be looked through) have either the flag 260 (view cone is not visible) or flag 4 (view cone is visible on this sector).

Bridge Sectors
These special sectors lead over the normal sectors, you can walk on and under them. They have the same structure like ordinary sectors, except for the additional flag set (see Flags).

Areas
Areas are used for the enemy AI. When the same soldier reacts in another way after he spotted you (for example inside or outside a base), this happens due to the different areas. How the enemy reacts is actually defined in the mission file MIS.

Sector Type

0 = regular sector 1 = bridge sector

Connected Sectors
This information is used to tell the Green Beret which walls he can climb, e.g. the huge wall to the east in the mission 'Blind Justice' has been declared this way. Nearly all walls already are defined in the sector information with the flag 448.

Differences between BEL and BCD
SEC files in BCD have a different file format but they contain nearly the same information. BCD can read both formats, BEL can't read the BCD format.

Additional information in the SEC files from BCD: Most sectors don't have a Token so the TokenLength is 0. If the TokenLength is not zero, there will be an entry in MIS file with the Token.
 * 1) Vertices kx ky bz Type Height Offset Flags TokenLength Token

For more information see: BCD File Format