Contents Home NeoLemmix NeoLemmix Level Packs Official Lemmings Games NeoLemmix Editor Flexi Toolkit Format Information Lemmings Plus Lemmings Plus I Lemmings Plus II Lemmings Plus III Lemmings Plus IV Lemmings Plus V Lemmings Plus Omega Holiday Lemmings Plus Lemmings Plus Flashbacks Lemmings Plus Flashbacks II LP Packs Comparison My Other Levels Doomsday Lemmings NeoLemmix Introduction Pack Lemmix (Traditional) CustLemmix Flexi Lemmix Lemmix Players Tools Tools List NeoLemmix Graphic Set Tool Obsolete LemMain LemSet NeoLemEdit |
NeoLemmix Graphic Set Format
From NeoLemmix V1.31n onwards, an entirely new graphic set format is the standard, although the old format is still supported. This new format is not based on a fixed structure, but rather a variable one, which allows any amount of content. The graphic set file is a single DAT file, which contains two sections. The first section is the metadata section, the second section is the data section. The metadata section must be interpreted first, as it tells where in the data section to find each image or sound. There is only a single data section which contains both terrain and object graphics, unlike the old format which split those into two seperate sections. Additionally, it can also contain sound effects for custom objects. The NeoLemmix Graphic Set Tool always puts terrain images first, then objects, then sounds, but this is not a requirement of the format (it's simply how that specific program builds its output files). The metadata section can be thought of as further divided into sub-sections. Each section starts with a marker to define which kind of section it is. This marker is always a byte 0xFF followed by another byte; this second byte determines the type of section. The NeoLemmix Graphic Set Tool always starts with a comment, then the header, then the terrains, then the objects; but this too is not a requirement of the format; the sections may be in any order (though it is recommended that the header come before any other section that isn't a comment). A VGASPEC file can also be created by simply making a graphic set with no objects. In this case, the first terrain piece will be the graphic of the level, while the second and third pieces are masks, for steel and one-way-walls respectively (the latter is equivalent to marking a terrain piece as one-way-capable; it doesn't automatically apply a one way wall to it). 0xFF00 - End of file The combination 0xFF00 marks the end of the metadata file. Anything past this should be ignored; it may be data for use by other programs. 0xFF01 - Comment The combination 0xFF01 marks a comment. Generally this will be plaintext, but it could be anything as long as it doesn't contain another 0xFF. There is no fixed length for a comment, nor is there anything to indicate its length; just keep reading until the next 0xFF. 0xFF02 - Header 0xFF02 marks the header, which contains information about the graphic set. The header has a fixed structure and is always 48 bytes.
The header should be the first non-comment section in the graphic set; though NeoLemmix (and the NeoLemmix Graphic Set Tool) will handle graphic sets perfectly fine whether the header is the first non-comment section or not; just as long as there is a header somewhere in the file. 0xFF03 - Object 0xFF03 marks an object data entry. Object entries are 40 bytes and follow a specific format:
You may notice that the dimensions of the object are not specified here. They're specified in the image data instead. If different frames are of differing sizes, NeoLemmix pads them out with blank space to all match the size of the largest frame. 0xFF04 - Terrain Piece 0xFF04 marks a terrain piece data entry. Terrain entries are 16 bytes and follow a specific format:
0xFF05 - Sound Effect
The graphics format in the second section is a lot simpler than the planar bitmaps in the old format. Additionally, widths no longer have to be padded to multiples of 8. There is no specific marker that says "an image's data begins here", so you must get the addresses from the metadata section. An image's data starts with two four-byte values; the first is the width and the second the height of the image. After this is the actual image data. Each pixel is simply 32-bit (8 bit per channel) data, in ARGB order. However, there is one catch - if a pixel's alpha value is zero, then no RGB values for that pixel are present, and instead the next byte skips directly to the next pixel's alpha value. For example: 0xFF 60 40 20 00 80 FF FF FF The first byte is FF, so the first pixel has an alpha value of 255. The next three bytes are that pixel's red (0x60), green (0x40) and blue (0x20) components. The next byte after this, which is the next pixel's alpha value, is 00. Because the alpha is zero, there are no RGB values for this pixel. Thus, the following 80 is the following pixel's alpha value. This is not zero, so the next three bytes are it's R, G and B values, which are all FF. Sound data in the second section simply consists of a four-byte value which states the size of the sound effect data, followed by the sound effect data itself in WAV format (just an exact copy of the WAV file). |