NeoLemmix Level Format

AddressData
0x00Should always be 0x04.
A value of 0x00 identifies a 2KB level.
A value of 0x01, 0x02 or 0x03 identifies a 10KB level.
0x01Music track number to use
0, 253, 254 and 255 have special effects:
0 - Uses the standard music rotation (or random music in NeoCustLemmix)
253 - Uses the standard rotation but doesn't play special music on gimmick/frenzy levels
254 - Uses Frenzy music
255 - Uses Gimmick music
0x02
0x03
Number of lemmings
Maximum is 65535, but recommended maximum is ~500
0x04
0x05
Save requirement
0x06
0x07
Time limit in seconds
Setting this to more than 5999 (99:59) results in infinite time
0x08Release rate (1 to 99)
0x09Options flags. This is a bitwise value:
Bit 0 - Ignored, should generally be set to on
Bit 1 - Enable autosteel
Bit 2 - Ignore the level's steel
Bit 3 - Use simple autosteel formula
Bit 4 - Turns oddtabling on
Bit 5 - Ignored, should generally be set to on
Bit 6 - Ignored, should generally be set to on
Bit 7 - One-way inversion (see terrain section for info)
0x0AResolution. A value of 8 indicates standard (320x160 = 1 screen) resolution, a value of 16 indicates SuperLemmini-like resolution, etc. A value of zero should be treated as a value of 8.
Note that NeoLemmix currently is not coded to handle levels of one resolution combined with graphic sets of another. In general, resolutions other than standard (8) should not currently be used, although limited support for them does exist; this is primarily a futureproofing feature.
0x0BUnused. Leave it as zero.
0x0C
0x0D
Horizontal screen start position
0x0E
0x0F
Vertical screen start position
0x10 to 0x1FSkill counts, including skills not used in the level
The order is:
Walker, Climber, Swimmer, Floater, Glider, Mechanic, Bomber, Stoner,
Blocker, Platformer, Builder, Stacker, Basher, Miner, Digger, Cloner
0x20
0x21
0x22
0x23
Gimmick flags, see below for list
0x24
0x25
Skillset flags. This is read bitwise; the order is the same as skill counts but in reverse; ie Bit0 = Cloner, Bit1 = Digger, etc
If more than 8 skills are enabled, only the first 8 (in the order listed in skill counts) are used.
0x26
0x27
Referred level's rank (0x26) and level number (0x27), this is used for:
- Oddtabling: If oddtable is enabled in the options flags, level layout is copied from the target level
- Rickroll gimmick: Sets the target level to use for bait-and-switch
- Secret levels: If the level is a secret level, it sets the level which is proceeded to afterwards

These values are 0-based, ie: 00 03 would refer to Fun 4 in Orig
0x28
0x29
0x2A
0x2B
Level width. Unlike in the 10KB format, this is an absolute and unsigned value, not a relative one.
0x2C
0x2D
0x2E
0x2F
Level height. Same deal as with the width.
0x30
0x31
0x32
0x33
VGASPEC image X position. This is a signed value.
0x34
0x35
0x36
0x37
VGASPEC image Y position. This is a signed value.
0x38 ~ 0x3FUnused, leave them as zero.
0x40 ~ 0x4FLevel author name. This is plain text and should be padded with spaces (0x20).
0x50 ~ 0x6FLevel name. This is plain text and should be padded with spaces (0x20).
0x70 ~ 0x7FGraphic set name. This is plain text and should be padded with spaces (0x20), it is not case sensitive.
If "[name].dat" exists, it's used and treated as a new-format graphic set.
Otherwise, "g_[name].dat" and "v_[name].dat" are used instead, being treated as old-format graphic sets.
0x80 ~ 0x8FVGASPEC name. This works the same way as the graphic set name, except with the files checked for using an "x_[name].dat" pattern regardless of whether they're new or old format (it will be autodetected which one they are).
0x90 ~ 0xAFThese bytes are unused and are guaranteed to remain unused; you can use them for whatever purpose you like.


The remainder of the file is made up of various entries. These are interpreted by reading one byte, which defines the type of data that follows it; all possible subsections are documented here. A well-made LVL file should have these in order - ie: all the objects first, then all the terrains, then all the steels, then the window order data (if any), etc. This is not strictly a requirement, but as all official programs will stop reading if they encounter a section they don't understand, constructing files this way is likely to result in less issues when loading levels on older software.

A byte of 00 as a section marker identifies the end of the file.

01 - Object data
AddressData
0x00
0x01
0x02
0x03
X coordinate. This is a signed value.
0x04
0x05
0x06
0x07
Y coordinate. This is a signed value.
0x08
0x09
Piece ID
0x0AS Value. 0 to 15; the high 4 bits are ignored. The effect of this depends on the object type
0x0BL Value. 0 to 255. The effect of this depends on the object type
0x0CFlags. This is a bitwise value:
Bit0 - No overwrite
Bit1 - Only on terrain
Bit2 - Upside-down
Bit3 - Left-facing
Bit4 - Fake
Bit5 - Invisible
Bit6 - Flip horizontal
Bit7 - If this bit is off, the entry is ignored
0x0D ~ 0x13Unused, leave them as zero.

02 - Terrain data
AddressData
0x00
0x01
0x02
0x03
X coordinate. This is a signed value
0x04
0x05
0x06
0x07
Y coordinate. This is a signed value
0x08
0x09
Piece ID
0x0AFlags. This is a bitwise value:
Bit0 - No overwrite
Bit1 - Eraser
Bit2 - Upside-down
Bit3 - Flip horizontal
Bit4 - Don't Apply One-Ways - see below
Bit5 - Unused; should be left off
Bit6 - Unused; should be left off
Bit7 - If this bit is off, the entry is ignored
0x0B ~ 0x0FUnused, leave them as zero.
About the "Don't Apply One-Ways" flag; if this is on, one-way walls will not be applied to the terrain piece. If (in the header's options flags byte) the "One Way Inversion" bit is set, then this bit acts in reverse - one-way walls will only be applied to terrain pieces with Bit4 of the flags set. Note that this is inverted compared to how the NeoLemmix Editor describes them, for backwards compatibility reasons (in the format) against user-friendly explanations (in the editor).

03 - Steel data
AddressData
0x00
0x01
0x02
0x03
X coordinate. This is a signed value
0x04
0x05
0x06
0x07
Y coordinate. This is a signed value
0x08
0x09
0x0A
0x0B
Width. The value stored here is 1 less than the actual width; eg: a value of 255 equates to a width of 256 pixels
0x0C
0x0D
0x0E
0x0F
Height. The same offset by 1 applies here as with the width
0x10Bit7 - If this bit is off, the entry is ignored
The remainder of the byte is the type of area; which actually does not always represent steel.
    0 - Steel
    1 - Negative steel (cancels steel areas)
    2 - One-way left
    3 - One-way right
    4 - One-way down
    5 - Nothing (exists for technical reasons)
Note that it is recommended to use the proper objects for one-ways rather than these areas; the option exists for Cheapo importing purposes. They also will not function in graphic sets that don't include the respective type of one-way wall object. Generally, the only ones that should be used in most cases are Steel and Negative Steel.
0x011 ~ 0x13Unused, leave them as zero.

04 - Window order data
The window order data section is simply a list of object IDs (as two-byte values), with 0xFFFF used as a terminator.

05 - Subheader
The subheader is an optional supplement to the header. Current versions of the editor (and levels dumped from the player) do not save this, but the player supports it as of V1.34n-B. Saving support will be introduced in a future update, the primary intention of this delayed release is so that by the time levels exist that use it, everyone should be on a new enough player version to support it.
AddressData
0x00
0x01
0x02
0x03
Screen start X position. Overrides the one in the main header; the purpose of this is that the original header's one was mistakenly left as a 2-byte value when all other positions / sizes were increased to 4-byte.
If there is no secondary header, the position from the main header is used.
0x04
0x05
0x06
0x07
Screen start Y position. Same deal as above.
0x08
0x09
0x0A
0x0B
Second set of gimmick flags. These are all currently unused. If there is no secondary header, all of these are assumed to be turned off.
0x0C
0x0D
0x0E
0x0F
Third set of gimmick flags. These are all currently unused. If there is no secondary header, all of these are assumed to be turned off.
0x10 ~ 0x1FMusic file name. This overrides the music number set in the main header, even if blank. It should be padded with spaces, not 00s. It is not case-sensitive.
Leaving this blank will give the same effect as a music number of 0.
Setting this to * will give the same effect as a music number of 253.
Otherwise, the level will use the music with the matching filename. (To get the same effect as 254 or 255, use the default filenames for these musics, which are GIMMICK and FRENZY).
If there is no secondary header, the name will be set to [blank] if the main header's music number is 0, * if the main header's music number is 253, FRENZY if the main header's music number is 254, GIMMICK if the main header's music number is 255. Otherwise, it will be set to TRACK_XX, where XX is the main header's music number (as at least two digits).
0x20
0x21
Post-secret level redirect rank and level number (one byte each, in that order). If the level is a secret level, the player will be redirected to the level specified here upon completing it. If the secondary header is absent, these are copied from the oddtable level rank/number.
0x22
0x23
Same as above, but for the level used for Bait & Switch gimmick.
0x24
0x25
The start time for the clock gimmick. A value of zero refers to midnight. From there, each increase of the value by 1 is equal to one minute. In the absence of this secondary header, the value is copied from the Vgaspec X position multiplied by 15.
0x26
0x27
Same as above, but for the end time, and copied from the Vgaspec Y position.
0x28
0x29
The number of terrain pieces to be affected by the clock gimmick. In the absence of this secondary header, the value is copied from the first object's L value.



Gimmick Flags Values
BitGimmick(s)
Bit0SuperLemming
Bit1Frenzy
Bit2Reverse Skill Counts
Bit3Karoshi
Bit4Unalterable Terrain
Bit5Skill Count Overflow
Bit6No Gravity
Bit7Hardworkers
Bit8Backwards Walkers
Bit9Lazy Lemmings
Bit10Exhaustion
Bit11Non-Fatal Bombers
Bit12Invincible Lemmings
Bit13One Skill Per Lemming
Bit14Steel Inversion
Bit15Solid Bottom Of Level
Bit16Non-Permanent Skills
Bit17Disobedience
Bit18Nuclear Bombers
Bit19Turnaround On Skill Assignment
Bit20Countdown Other Skills
Bit21Assign To All Lemmings
Bit22Horizontal Wrap
Bit23Vertical Wrap
Bit24Rising Water*
Bit25Clock Gimmick*
Bit26Zombies*
Bit27Classic Zombies (reverts some behaviours of zombies to how they initially worked)
Bit28Deadly Level Sides
Bit29(unused)
Bit30Cheapo mode (changes some mechanics to be more Cheapo-like)
Bit31Bait-and-Switch*

 * Those marked with a * also require setting things elsewhere.