DO/LIT

From Dark Omen Wiki

< DO
Jump to: navigation, search

Contents


Structure

The LIT file seems to contain information about the lighting of the map. A quick attempt at breaking this file down follows:

 struct Header
 {
     int version;  // 0x01000000
     int numberOfLightsInFile;
 };
 
 struct Light
 {
     signed int X, Y, Z;
     int unknown1,    // "L-falloff"
         unknown2;    // "E-falloff"
     int color1, 
         color2, 
         color3;
 };


Values

The LIT file consists of a number of light entries. The first four bytes is the file version. The next four bytes is the number of light records.

Each light record has 32 bytes. The first 12 bytes stand for the positional datas. The next two DWORD (a DWORD == four bytes) are the unknown values(called unknown1 and unknown2 in the following). Then there is an additional 12 bytes (4x3) that seems to be colour info (Red, Green, Blue). So now we need to compare the maps against the text output to determine what the "unknown1" and "unknown2" values really represent. Perhaps unknown1 is an ID to start any light effects in the game (not sure).

Note 1: Positions are encoded in Dark Omen standard, that is, you have to divide each value by 1024.0 to get the actual position.
Note 2: Colour values are a bit strange. They range up to 1280, though they usually stay below 1024. Currently in the editor these are divided by 1024.0 to get the colour value used. This results in some colours having an intensity > 1.0, which could be intentional since Direct3D supports super-intensity (which tends to wash everything towards bright white).


Examining B1_01.LIT

This shows B1_01.LIT in WinHex to show all data values

b101zk6.jpg

The same data colour-highlighted:

01 00 00 00 03 00 00 00 D9 EF FF FF 00 2C 00 00
43 D8 FF FF 26 00 00 00 00 00 00 00 00 01 00 00
00 01 00 00 00 01 00 00
4C 6E 00 00 00 F0 00 00
DA 58 00 00 21 00 00 00 22 00 00 00 00 05 00 00
00 05 00 00 00 05 00 00
5F E6 FF FF 00 8C 00 00
91 D8 FF FF 16 00 00 00 00 00 00 00 A6 00 00 00
A6 00 00 00 A6 00 00 00

The most interesting data are those emphasised with outlines: these seem to control the behaviour of the lights, but we do not know the systematics behind them.

Offset HEX Value Information
0 01 00 00 00 Fileversion = 1;
4 03 00 00 00 Number of light records = 3
First Light Record
8 D9 EF FF FF 00 2C 00 00 43 D8 FF FF 3D pos = [-4.04,11.00,-9.93]
20 26 00 00 00 unknown1 = 38
24 00 00 00 00 unknown2 = 0
28 00 01 00 00 00 01 00 00 00 01 00 00 colour = (256,256,256)
Second Light Record
40 4C 6E 00 00 00 F0 00 00 DA 58 00 00 3D pos = [27.57,60.00,22.21]
52 21 00 00 00 unknown1 = 33
56 22 00 00 00 unknown2 = 34
60 00 05 00 00 00 05 00 00 00 05 00 00 colour = (256,256,256)
Third Light Record
72 5F E6 FF FF 00 8C 00 00 91 D8 FF FF 3D pos = [-6.41,35.00,-9.86]
84 16 00 00 00 unknown1 = 22
88 00 00 00 00 unknown2 = 0
92 A6 00 00 00 A6 00 00 00 A6 00 00 00 colour = (166,166,166)

Additional Information

Dialogue in engrel.exe

lightos1.jpg Indicates that lights at the very least have two falloff values, colour and position. Omnilights have one falloff value, spotlights have two. So theoretically spotlights are supported (though it could just be completeness for byte-compatibility with Direct3D).

light2mz7.jpg Another screenshot from the strings section engrel.exe indicates that there are directinal, point, and "truepoint" (presumably spotlight?) light types.

Misc

Every map has one light with unknown1 set to 38 and unknown2 set to 0. It is always the first light in the LIT file (light #0) EXCEPT for B4_10, B5_01, B5_01B and SPARE9. All maps have at least 2 lights, there is none with only one. Some maps have lights of unknown1==38 with unknown2 != 0

Altering Data Value 26 to 00, 02, 59, FF had the result of making Mission 1 dark

b101data100is2.jpg

and for Comparison, the Original

b101data126origvz0.jpg

Further Actions

I have been working under the assumption that there will be direcitonal light in Dark Omen, and that one light entry will be the source and one the target (==direction), but perhaps there are only omnilights?


Further testing suggests that this could be a kind of ID. So the game looks for the first value and loads a grafical light effect with the id 26. The next check would be, what happens in a dark game if we change the original id to 26.

Personal tools
communication