Difference between revisions of "BLIGHT (File Format)"

From Custom Mario Kart
Jump to navigation Jump to search
m
m
Line 1: Line 1:
The '''BLIGHT''' ('''B'''inary '''light''' controller) filetype controls lighting effects on characters, karts, items and objects in a track. It is always seen in the '''"./posteffect"''' folder inside an SZS. This file is not required for a track to load, as there is a ''default.blight'' file inside [[Filesystem/Race/Common.szs|Common.szs]].
+
The '''BLIGHT''' ('''B'''inary '''light''' controller) filetype controls lighting effects on characters, karts, items and objects in a track. It is always seen in the '''"./posteffect"''' folder inside an [[SZS]]. This file is not required for a track to load, as there is a ''default.blight'' file inside [[Filesystem/Race/Common.szs|Common.szs]].
  
 
== File Header ==
 
== File Header ==
Line 23: Line 23:
 
|}
 
|}
  
However, one thing to note is that although 16 lights are stored in this file, only 8 can be referenced by the KCL
+
However, one thing to note is that although 16 lights are stored in this file, only 8 can be referenced by the [[KCL]]
 
(IDs 00 to 07). This is because the KCL only has three binary digits to reference lights (and ''111'' in binary = 7).
 
(IDs 00 to 07). This is because the KCL only has three binary digits to reference lights (and ''111'' in binary = 7).
  
Line 91: Line 91:
  
 
* ''default.blight'' (in Common.szs)
 
* ''default.blight'' (in Common.szs)
* ''posteffect.blight'' (in every course [[SZS (File Format)|SZS file]])
+
* ''posteffect.blight'' (in every course SZS)
  
 
==Tools==
 
==Tools==

Revision as of 20:14, 13 July 2016

The BLIGHT (Binary light controller) filetype controls lighting effects on characters, karts, items and objects in a track. It is always seen in the "./posteffect" folder inside an SZS. This file is not required for a track to load, as there is a default.blight file inside Common.szs.

File Header

Offset Size Description Extra Information
0x00 0x04 "LGHT" magic
0x04 0x04 File size (always 00 00 05 A8)
0x08 0x04 Unknown value (seen as 02 00 00 00 in Bowser's Castle)
0x0C 0x04 or [2x]0x02 Unknown values (always 00 00 00 00?)
0x10 0x02 Number of LOBJs Always 00 10 in MKW
0x12 0x02 Number of Ambient Lights Always 00 10 in MKW
0x14 0x04 Unknown value (always 00 00 00 FF?)
0x18 0x10 Padding

However, one thing to note is that although 16 lights are stored in this file, only 8 can be referenced by the KCL (IDs 00 to 07). This is because the KCL only has three binary digits to reference lights (and 111 in binary = 7).

Light Object data (LOBJ)

LOBJ file inside the BLIGHT file

The first object starts at 0x28. These addresses are relative to the start of the object.

Offset Size Description Extra Information
0x00 0x04 "LOBJ" magic (always 4C 4F 42 4A, LOBJ in ASCII)
0x04 0x04 File size (always 00 00 00 50)
0x08 0x08 Unknown value (always 02 00 00 00 00 00 00 00)
0x10 0x02 Unknown value (always 00 00?)
0x12 0x01 Unknown Always 00 on unused/undefined lights, 02 most common, 01 (CCW) and 04 (RR, TD) seen.
0x13 0x01 Unknown value Always 01
0x14 0x02 Light ID The ID used here is referenced in KCL files, and also matches the ambient lights at the end of the BLIGHT.
0x16 0x02 Unknown value (always 06 41 or 06 21)
0x18 0x04x3 (0x0C) 3D origin vector X = 80566.406 Y = 55000.0 Z = 100000.0 in Luigi Circuit
0x24 0x04x3 (0x0C) 3D destination vector X = 51367.188 Y = 41015.625 Z = 11865.234 in Luigi Circuit
0x30 0x04 (Float) Scale? (always 3F 80 00 00, 1 in float)
0x34 0x04 RGBA Light Color (RR GG BB AA)
0x38 0x04 Unknown Value (always 00 00 00 FF)
0x3C 0x04 (Float) Unknown value (Part of another vector? Always 42 B4 00 00, 90 in float point)
0x40 0x04 (Float) Unknown value (Always 3F 00 00 00?) (0.5 in float point)
0x44 0x04 (Float) Unknown value (Always 3F 00 00 00?) (0.5 in float point)
0x48 0x08 Padding? (always 00 00 00 00 00 00 00 00, unless it is the last light. In that case, it's 00 00 00 FF 00 00 00 00)
0x50 End of object, start of next

Ambient Light data

At 0x0528 in the file, a list of colors starts, separated by four 00's. These are the ambient colors used by each light. They're in order, and their IDs are from 00 to 0F (matches the main lights above).

Offset Size Information
0x00 0x04 RGBA Ambient Light Color
0x04 0x04 Padding
0x08 End of color, start of next

Just like light objects, there are 16 ambient colors. All unused ones are 64 64 64 FF (a neutral gray).

Known BLIGHT files

  • default.blight (in Common.szs)
  • posteffect.blight (in every course SZS)

Tools

The following tools can handle BLIGHT files: