Skip to content
Jakob Klein edited this page Aug 19, 2012 · 11 revisions

File Formats

The file formats used by FS Tools shall be described here in short to help you understand what you are supposed to put where, in which format and most importantly to help you track down why something doesn't work as expected.

Input Files

Model's Assembly Files

As primary Input files we use Microsoft Assembly Files (MASM format) with BGLC9 macro extensions (see accompanying BGLC_9_source.html/txt) as exported by MakeMDL and understood by BGLC_9. A bit of formalities: These are usually Microsoft Windows Codepage 1252 (Latin Western) encoded files with CRLF <U+000d,U+000a> line terminators. But interpretation as ASCII (ISO 646-US) should work as well, as in the lower half cp1252 is equivalent with ASCII (as is ISO 8859-1 Latin-1) and I haven't yet seen a character above U+007F.

Please take some time to review documents about the MASM file format, especially be warned about indentation if you want to modify things by hand!

For modification we copy the files you specified (and all the subfiles which are included by the "motherfile" you named) to a working directory and translate it to UNIX-format line endings (LF U+000a).

Suppoting Files

An optional input file is the file "brightmaterials.csv", which contains a table of specularity codes and RGB floating point values [0.0-1.0] separated by tabs (HT U+0009) for the red, blue and green channels and lines ended by a line feed (LF U+000a). While this is not exactly a true comma-seperated-file we still call it a .csv as this makes association with tabulation calculation programs easy which usually hanle such files well, and there isn't a official csv-file standard so no one can blame us.

Sidenote: Maybe we will substitute this in the future with a strictly typed xml-based format to get all confusion out of the way.

For example:

901     1.000000        1.000000        1.000000  
902     0.000000        1.000000        0.000000  
903     1.000000        0.000000        0.000000

Where 901 is the specularity level to be recognized, 1.000000 is a full bright red, green, and blue channel respectively, giving pure white (#FFFFFF in web-hex notation).

The special specularity level value of 999 in the .asm-File is reserved for special handling and thus can not be used in this list. The mechanism triggers in the case that diffuse is pure white (#FFFFFF) and specularity level is set to 999: then the RGB values of the specularity color channel in the .asm-File are copied to the bright material settings.

There is a Perl script available, which helps you convert "ColorSet.ini" files from the old "Light Material Editor" (released only to a very few people) to the newer format described here and required by the new fstools.sh - please see the short documentation in the file "colini2csv.pl".

Working Files

In the working directory we create a "filename.asm_statelabellist.csv" for each file worked on, which is similarly to the "brightmaterials.csv" a tab separated (HT U+0009) and normally unquoted table of all textures and associated types found in a model (in collumns) and all the light states as rows giving the texture name and type at the intersecting cells for editing. The first line contains headers (with default names as reminders, not shown in the example below) and is ignored. Line ends are UNIX-format (LF U+000a). Possible Texture Types are listed in BGLC_9_source.txt, but as a tip most useful are: TEXTURE_AIRCRAFT, TEXTURE2_LIGHTMAP, TEXTURE2_LIGHTMAP_A, TEXTURE2_NONE, TEXTURE2_REFLECT - but be aware which can be placed in which slot (more on that in the Article Texture Modifications).

For example:

#State Tag (DEFAULT)   Texturename        Texturetype        Texturename        Texturetype
lights_on              FUSELAGE_T.BMP     TEXTURE_AIRCRAFT   FUSELAGE_L.BMP     TEXTURE2_LIGHTMAP
lights_on_land_off     FUSELAGE_T.BMP     TEXTURE_AIRCRAFT   FUSELAGE_L.BMP     TEXTURE2_LIGHTMAP_A
lights_off             FUSELAGE_T.BMP     TEXTURE_AIRCRAFT   FUSELAGE_L.BMP     TEXTURE2_NONE

Please note that the total field length of any texture name field shall be 63 characters maximum (thus leaving byte 64 as NUL U+0000 or \0 in C escape notation in the .asm and .mdl).

Output Files

After the edit the .asm files are translated to CRLF again and copied to the output folder you specified. Usually the "filename.asm_statelabellist.csv" are copied along in the same directory for further reference (or using the same file again in the future) without any translation.