FLC, FLT Format Intel byte order Information from File Format List 2.0 by Max Maischein. --------!-CONTACT_INFO---------------------- If you notice any mistakes or omissions, please let me know! It is only with YOUR help that the list can continue to grow. Please send all changes to me rather than distributing a modified version of the list. This file has been authored in the style of the INTERxxy.* file list by Ralf Brown, and uses almost the same format. Please read the file FILEFMTS.1ST before asking me any questions. You may find that they have already been addressed. Max Maischein Max Maischein, 2:244/1106.17 Max_Maischein@spam.fido.de corion@informatik.uni-frankfurt.de Corion on #coders@IRC --------!-DISCLAIMER------------------------ DISCLAIMER: THIS MATERIAL IS PROVIDED "AS IS". I verify the information contained in this list to the best of my ability, but I cannot be held responsible for any problems caused by use or misuse of the information, especially for those file formats foreign to the PC, like AMIGA or SUN file formats. If an information it is marked "guesswork" or undocumented, you should check it carefully to make sure your program will not break with an unexpected value (and please let me know whether or not it works the same way). Information marked with "???" is known to be incomplete or guesswork. Some file formats were not released by their creators, others are regarded as proprietary, which means that if your programs deal with them, you might be looking for trouble. I don't care about this. -------------------------------------------- The FLC files are files created by the Autodesk Animator Pro and contain animations. The FLC files are a superset of those created by the Autodesk Animator (FLIc files). In some cases, new data fields or compression methods were added. The FLC files use a hierarchical block oriented structure and blocks are a combination of control information and data. The file consists of one header followed by data blocks. It is possible that new types of blocks not described in this document will be added to animation files in the future. It is recommended that you quietly ignore unknown block types you encounter during animation playback. The size fields in the block headers make it easy to skip an entire unrecognized block. The FLC files consist of one 128-byte header block and one or more of the following blocks : The prefix block, if present, contains Animator Pro settings information, CEL placement information, and other auxiliary data. A frame block exists for each frame in the animation. In addition, a ring frame follows all the animation frames. Each frame block contains color palette information and/or pixel data. The ring frame contains delta-compressed information to loop from the last frame of the flic back to the first. It can be helpful to think of the ring frame as a copy of the first frame, compressed in a different way. All flic files will contain a ring frame, including a single-frame flic. The FLC file header OFFSET Count TYPE Description 0000h 1 dword The size of the whole animation file, including the size of this header. 0004h 1 word ID=0AF12h 0006h 1 word Number of frames in this animation, not including the ring frame. FLC files have a maximum length of 4000 frames. 0008h 1 word Screen width in pixels 000Ah 1 word Screen height in pixels 000Ch 1 word Bits per pixel (always 8) 000Eh 1 word Flags - bitmapped 0 - Ring frame not written / ring frame written 1 - Flic header not updated / updated 2-15 - reserved 0010h 1 dword Delay between frames in miliseconds. 0014h 1 word reserved 0016h 1 dword MS-DOS date and time of file creation (see table 0009) 001Ah 1 dword Serial number of the Animator Pro program used to create the file. If the file was created with the FlicLib development kit, this value equals 0464c4942h ("FLIB"). 001Eh 1 dword MS-DOS date and time of last modification (see table 0009) 0022h 1 dword Serial number of program that made the last modification. See Serial Number. 0026h 1 word X-axis aspect ratio of the file 0028h 1 word Y-axis aspect ratio of the file (320x200 = 6:5) 002Ah 38 byte reserved (0) 0050h 1 dword Offset from begin of file to the first animation frame block. 0054h 1 dword Offset from begin of file to the second animation frame block. This value is used when looping the animation. 0058h 40 byte reserved (0) Each subblock in the animation file has an identical header structure, which is formatted like this : 0000h 1 dword The size of the whole block and all subordinate blocks including the size of this header 0004h 1 word Block ID, varies depending on the block type. 0006h 1 word Number of subordinate blocks in this block. including the ring frame. FLC files have a maximum length of 4000 frames. 0008h 8 byte reserved(0) Immediately after the header there may be an optional prefix block, which is used to store additional data which is not directly involved in animation playback. The prefix block has the usual header with an ID of 0F100h. The prefix block should only be created by the Animator Pro programs and never by any other software, it is to be ignored by other software. The FLC frame blocks contain the information to convert the current frame into the next frame; they have an ID of 0F1FAh. Directly after the frame header, there are the subordinate data blocks - if the subblock count is 0 this means, that the current frame is identical to the previous frame, only the appropriate delay has to be made. The data blocks have a different header format : OFFSET Count TYPE Description 0000h 1 dword Size of this block, including header size 0004h 1 word Data type identifier : 4 - 256-level color palette info 7 - Word-oriented delta compression 11 - 64-level color palette info 12 - Byte-oriented delta compression 13 - Entire frame is color index 0 15 - Byte run length compression 16 - No compression 18 - Postage stamp sized image 0006h ? byte Color or pixel data The following sections describe each of these data encoding methods in detail. --- Block Type 4 (FLI_COLOR256) - 256-Level Color The data in this block is organized in packets. The first word following the block header is a count of the number of packets in the blocks. Each packet consists of a one-byte color index skip count, a one-byte color count and three bytes of color information for each color defined. At the start of the block, the color index is assumed to be zero. Before processing any colors in a packet, the color index skip count is added to the current color index. The number of colors defined in the packet is retrieved. A zero in this byte indicates 256 colors follow. The three bytes for each color define the red, green, and blue components of the color in that order. Each component can range from 0 (off) to 255 (full on). The data to change colors 2,7,8, and 9 would appear as follows: 2 ; two packets 2,1,r,g,b ; skip 2, change 1 4,3,r,g,b,r,g,b,r,g,b ; skip 4, change 3 --- Block Type 11 (FLI_COLOR) - 64-Level Color This block is identical to FLI_COLOR256 except that the values for the red, green and blue components are in the range of 0-63 instead of 0-255, i.e. in native VGA values which can be written to the VGA without modification. --- Block Type 13 (FLI_BLACK) - No Data This block has no data following the header. All pixels in the frame are set to color index 0. --- Block Type 16 (FLI_COPY) - No Compression This block contains an uncompressed raw image of the frame, from upper left to the lower right, storing each line sequentially. This type of block is created when the preferred compression method (SS2 or BRUN) generates more data than the uncompressed frame image; a relatively rare situation. --- Block Type 15 (FLI_BRUN) - Byte Run Length Compression This block contains the entire image in a compressed format. Usually this block is used in the first frame of an animation, or within a postage stamp image block. The data is organized in lines. Each line contains packets of compressed pixels. The first line is at the top of the animation, followed by subsequent lines moving downward. The number of lines in this block is given by the height of the animation. The first byte of each line is a count of packets in the line. This value is ignored, it is a holdover from the original Animator. It is possible to generate more than 255 packets on a line. The width of the animation is now used to drive the decoding of packets on a line; continue reading and processing packets until width pixels have been processed, then proceed to the next line. Each packet consist of a type/size byte, followed by one or more pixels. If the number is negative (the high bit of the packet type is set), the absolute value is the count of pixels to be copied from the packet to the animation image, otherwise the next byte contains a single pixel which is to be replicated; The lower 7 bits are the number of times the pixel is to be replicated. --- Block Type 12 (FLI_LC) - Byte Aligned Delta Compression This block contains the differences between the previous frame and this frame. This compression method was used by the original Animator, but is not created by Animator Pro. This type of block can appear in an Animator Pro file, however, if the file was originally created by Animator, then some (but not all) frames were modified using Animator Pro. The first word following the block header contains the position of the first line in the block. This is a count of lines (down from the top of the image) which are unchanged from the prior frame. The second word contains the number of lines in the block. The data for the lines follows these two words. Each line begins with two bytes. The first byte contains the starting x position of the data on the line, and the second byte the number of packets for the line. Unlike BRUN compression, the packet count is significant (because this compression method is only used on 320x200 flics). Each packet consists of a single byte column skip, followed by a packet type/ size byte, which has the reverse meaning of in the block type 15. --- Block Type 7 (FLI_SS2) - Word Aligned Delta Compression This format contains the differences between consecutive frames. This is the format most often used by Animator Pro for frames other than the first frame of an animation. It is similar to the line coded delta (LC) compression, but is word oriented instead of byte oriented. The data is organized into lines and each line is organized into packets. The first word in the data following the block header contains the number of lines in the block. Each line can begin with some optional words that are used to skip lines and set the last byte in the line for animations with odd widths. These optional words are followed by a count of the packets in the line. The line count does not include skipped lines. The high order two bits of the word is used to determine the contents of the word : Bit 15 Bit 14 Meaning 0 0 The word contains the packet count. The packets follow this word. The packet count can be zero; this occurs when only the last pixel on a line changes. 1 0 The low order byte is to be stored in the last byte of the current line. The packet count always follows this word. 1 1 The word contains a line skip count. The number of lines skipped is given by the absolute value of the word. This word can be followed by more skip counts, by a last byte word, or by the packet count. The packets in each line are similar to the packets for the line coded block. The first byte of each packet is a column skip count. The second byte is a packet type. If the packet type is positive, the packet type is a count of words to be copied from the packet to the animation image. If the packet type is negative, the packet contains one more word which is to be replicated. The absolute value of the packet type gives the number of times the word is to be replicated. The high and low order byte in the replicated word do not necessarily have the same value. --- Block Type 18 (FLI_PSTAMP) - Postage Stamp Image This block type holds a postage stamp - a reduced-size image - of the frame. It generally appears only in the first frame block within a flic file. When creating a postage stamp, Animator Pro considers the ideal size to be 100x63 pixels. The actual size will vary as needed to maintain the same aspect ratio as the original. The pixels in a postage stamp image are mapped into a six-cube color space, regardless of the color palette settings for the full frame image. A six-cube color space is formed as follows: start at palette entry 0 for red = 0 thru 5 for green = 0 thru 5 for blue = 0 thru 5 palette_red = (red * 256)/6 palette_green = (green * 256)/6 palette_blue = (blue * 256)/6 move to next palette entry end for blue end for green end for red Any arbitrary rgb value (where each component is in the range of 0-255) can be mapped into the six-cube space using the formula: ((6*red)/256)*36 + ((6*green)/256)*6 + ((6*blue)/256) The full postage stamp block header is defined as follows: Offset Length Name Description OFFSET Count TYPE Description 0000h 1 dword Size of this block, including header size 0004h 1 word ID=18 0006h 1 word Height of the postage stamp image 0008h 1 word Width of the image 000Ah 1 word Color translation type : 1 - six-cube color space Immediately following this header is the postage stamp data. The data is formatted as a block with standard size/type header. The type will be one of: 15 FPS_BRUN Byte run length compression 16 FPS_COPY No compression 18 FPS_XLAT256 Six-cube color xlate table The FPS_BRUN and FPS_COPY types are identical to the FLI_BRUN and FLI_COPY encoding methods described above. The FPS_XLAT256 type indicates that the block contains a 256-byte color translation table instead of pixel data. To process this type of postage stamp, read the pixel data for the full-sized frame image, and translate its pixels into six-cube space using a lookup in the 256-byte color translation table. This type of postage stamp appears when the size of the animation frames is smaller than the standard 100x63 postage stamp size. ************* TWE - Tween Data Files A TWE file holds information about a tweening operation set up via the Tween menus. The information includes the starting and ending shapes, and the optional userD specified links between the shapes. Animator Pro creates tween files. A TWE file begins with an 8-byte header defined as follows: Offset Length Name Description 0 2 magic File format identifier. Always hex 1995. 2 2 version The file format version; always zero. 4 4 tcount The number of tween shapes in the file; always 2. 8 8 reserved Unused space; set to zeroes. 16 4 linkcount The number of link entries in the file. Immediately following the file header are the link entries. If the linkcount value is zero there are no links. Each link entry is a pair of 32-bit integers. The first value in each pair is the index of the point in the first shape, and the second value is the index of the point in the ending shape. (IE, a link value of 2,7 says to link the second starting-shape point to the seventh ending-shape point.) Following the link entries is the data block that describes the starting shape, then the data block that describes the ending shape. The format of these blocks is identical to that of the polygon (PLY) file, including file header data. In other words, they appear as if a pair of polygon files are embedded in the tween file at this point. ********** OPT - Optics Menu Settings Files An OPT file holds information about an optics operation set up via the Optics menus. Both Animator Pro and the original Animator create OPT files. The file format is the same for both. An OPT file starts with a 4-byte header, as follows: Offset Length Name Description 0 2 magic File type identifier. Always hex 1A3F. 2 2 count Number of records in the file. Following the file header are optics records of 50 bytes each. A record is generated for each click on CONTINUE MOVE in the OPTICS menu. The move records are formatted as follows: Offset Length Name Description 0 4 link In the file, this field is always zero. In memory, it's a pointer to the next move record. 4 6 spincenter The x,y,z coordinates of the spin center point; three 16-bit values. 10 6 spinaxis The x,y,z coordinates of the spin axis; three 16-bit values. 16 6 spinturns The x,y,z coordinates of the spin turns; three 16-bit values. 22 4 spininter Intermediate turns. Two 16-bit values. These are values for a conjugation matrix that corresponds to spin axis. 26 6 sizecenter The x,y,z coordinates of the size center point; three 16-bit values. 32 2 xmultiplier Determines (along with xdivisor) how to scale along x dimension. 34 2 xdivisor Determines (along with xmultiplier) how to scale along x dimension. 36 2 ymultiplier Determines (along with ydivisor) how to scale along y dimension. 38 2 ydivisor Determines (along with ymultiplier) how to scale along y dimension. 40 2 bothmult Like xmultiplier, but applied to both dimensions. 42 2 bothdiv Like xdivisor, but applied to both dimensions. 44 6 linearmove The x,y,z offset for a linear move; three 16-bit values. EXTENSION:FLT OCCURENCES:PC PROGRAMS:Autodesk Animator Pro REFERENCE: SEE ALSO:FLIc VALIDATION: