FANDOM


Below is a description to the .dlw file format as used by Dr. Lunatic and Supreme with Cheese, as well as Sleepless Hollow.

Please bear in mind a lot of this is still being figured out, so don't expect it to be complete, or accurate.


Header Edit

Comes right at the start of the file.

Start Byte Length Type Description
08String "SUPREME!" - Specifies that this is Supreme's format. Other formats have a different string here.
832String The builder's name, null-terminated (maximum length is 31, since the final byte must be null in that case).
4032String The world's name, null-terminated.
721Byte How many levels are in the world.
734Long Unknown
772Short The number of tiles the world has, stored Little Endian.

Tile Data Edit

Tile Graphics Edit

Tile graphics are partially run-length encoded. Each tile consists of a three-byte "method" value followed by the rows of data. Each bit of the method value specifies whether a certain row of pixels is run-length encoded or flat. Here's some pseudocode (repeat the method for each tile)

method = read 3 bytes from file (24 bits)

foreach bit in method
    if bit on use RLE
        total = 0
        while total < 32
            runlen = read 1 byte
            runbyte = read 1 byte
            set runlen bytes in image to runbyte
            total += runlen
        next
    else
        read 32 bytes into image
    end if
next

Palette Edit

Not actually stored in the world file, this is here for reference. As RGB tuples: (To be cleaned-up more nicely)

(0,0,0), (8,8,8), (16,16,16), (24,24,24), (32,32,32), (40,40,40), (48,48,48), (56,56,56), 
(64,64,64), (72,72,72), (80,80,80), (88,88,88), (96,96,96), (104,104,104), (112,112,112), (120,120,120), 
(128,128,128), (136,136,136), (144,144,144), (152,152,152), (160,160,160), (168,168,168), (176,176,176), (184,184,184), 
(192,192,192), (200,200,200), (208,208,208), (216,216,216), (228,228,228), (236,236,236), (244,244,244), (252,252,252), 
(0,0,0), (0,16,0), (0,32,0), (0,48,0), (0,64,0), (0,84,0), (0,100,0), (0,116,0), 
(0,132,0), (0,148,0), (0,168,0), (0,184,0), (0,200,0), (0,216,0), (0,232,0), (0,252,0), 
(16,252,16), (32,252,32), (44,252,44), (60,252,60), (76,252,76), (92,252,92), (108,252,108), (124,252,124), 
(140,252,140), (156,252,156), (172,252,172), (188,252,188), (204,252,204), (220,252,220), (236,252,236), (252,252,252), 
(0,0,0), (8,4,0), (16,12,4), (28,20,8), (36,24,12), (44,32,16), (56,40,16), (64,44,20), 
(72,52,24), (84,60,28), (92,64,32), (100,72,32), (112,80,36), (120,84,40), (128,92,44), (140,100,48), 
(144,108,60), (152,116,72), (160,128,84), (168,136,96), (172,148,112), (180,156,124), (188,164,136), (196,176,148), 
(200,184,160), (208,192,176), (216,204,188), (224,212,200), (228,224,212), (236,232,224), (244,240,236), (252,252,252), 
(0,0,0), (0,0,16), (0,0,32), (0,0,48), (0,0,68), (0,0,84), (0,0,100), (0,0,116), 
(0,0,136), (0,0,152), (0,0,168), (0,0,184), (0,0,204), (0,0,220), (0,0,236), (0,0,252), 
(16,16,252), (32,32,252), (44,44,252), (60,60,252), (76,76,252), (92,92,252), (108,108,252), (124,124,252), 
(140,140,252), (156,156,252), (172,172,252), (188,188,252), (204,204,252), (220,220,252), (236,236,252), (252,252,252), 
(0,0,0), (16,0,0), (32,0,0), (48,0,0), (64,0,0), (84,0,0), (100,0,0), (116,0,0), 
(132,0,0), (148,0,0), (168,0,0), (184,0,0), (200,0,0), (216,0,0), (232,0,0), (252,0,0), 
(252,16,16), (252,32,32), (252,44,44), (252,60,60), (252,76,76), (252,92,92), (252,108,108), (252,124,124), 
(252,140,140), (252,156,156), (252,172,172), (252,188,188), (252,204,204), (252,220,220), (252,236,236), (252,252,252), 
(0,0,0), (16,16,0), (32,32,0), (48,48,0), (68,68,0), (84,84,0), (100,100,0), (116,116,0), 
(136,136,0), (152,152,0), (168,168,0), (184,184,0), (204,204,0), (220,220,0), (236,236,0), (252,252,0), 
(252,252,16), (252,252,32), (252,252,44), (252,252,60), (252,252,76), (252,252,92), (252,252,108), (252,252,124), 
(252,252,140), (252,252,156), (252,252,172), (252,252,188), (252,252,204), (252,252,220), (252,252,236), (252,252,252), 
(0,0,0), (16,0,16), (32,0,32), (48,0,48), (68,0,68), (84,0,84), (100,0,100), (116,0,116), 
(136,0,136), (152,0,152), (168,0,168), (184,0,184), (204,0,204), (220,0,220), (236,0,236), (252,0,252), 
(252,16,252), (252,32,252), (252,44,252), (252,60,252), (252,76,252), (252,92,252), (252,108,252), (252,124,252), 
(252,140,252), (252,156,252), (252,172,252), (252,188,252), (252,204,252), (252,220,252), (252,236,252), (252,252,252), 
(0,0,0), (0,16,16), (0,32,32), (0,48,48), (0,68,68), (0,84,84), (0,100,100), (0,116,116), 
(0,136,136), (0,152,152), (0,168,168), (0,184,184), (0,204,204), (0,220,220), (0,236,236), (0,252,252), 
(16,252,252), (32,252,252), (44,252,252), (60,252,252), (76,252,252), (92,252,252), (108,252,252), (124,252,252), 
(140,252,252), (156,252,252), (172,252,252), (188,252,252), (204,252,252), (220,252,252), (236,252,252), (252,252,252)

Tile Metadata Edit

After all the tile image data comes the tile metadata. 4 bytes are used for each tile.

Start Byte Length Type Description
01Byte Flag set A (see below).
11Byte Flag set B (see below).
22Short The "next tile" ID, stored Little Endian.

Flags are represented in the order they appear in the editor:

First byte (A)
  • 1 - Impassable
  • 2 - Icy
  • 4 - Muddy
  • 8 - Water
  • 16 - Lava
  • 32 - Pushable
  • 64 - Can Push On
  • 128 - Animates To Next
Second byte (B)
  • 1 - Animates On Step
  • 2 - Animates When Hit
  • 4 - Transparent Roof
  • 8 - Mine Cart Path
  • 16 - Bunny Path
  • 32 - Ghost Proof
  • 64 - Enemy Proof
  • 128 - Bouncy

Level Chunks Edit

After the header, tile graphics, and metadata, there are several level chunks, one for each level.

Level Header Edit

Start Byte Length Type Description
01Byte The level's width.
11Byte The level's height.
232String The level's name, null-terminated.
3432String The song file for the level, null-terminated.

Monsters Edit

Start Byte Length Type Description
01Byte Number of monsters in the level.
For each monster:
— 01Byte The monster's X position.
— 11Byte The monster's Y position.
— 21Byte The monster type (1 is Bouapha).
— 31Byte The item type the monster is carrying (0 for none, 255 for random).

Specials Edit

Start Byte Length Type Description
01Byte Number of specials in the level.
For each special:
— 01Byte The special's X position.
— 11Byte The special's Y position.
— 21Byte The number of uses for the special (0 for unlimited).
— 31Byte Trigger/effect count. Stored as Triggers + (Effects * 8).
— For each trigger:
—— 01Byte Parameter: Combination boolean type and Exactly/Less/More mode (see below).
—— 11Byte Trigger type, corresponds to order in editor (see below).
—— 21Byte The trigger's primary X location, for triggers that use it.
—— 31Byte The trigger's primary Y location, for triggers that use it.
—— 44Various Index 1, codes specifying item, monster, and tile types. Varies by trigger (see below).
—— 84Various Index 2, codes specifying item, monster, and tile types. Varies by trigger (see below).
— For each effect:
—— 01Byte Parameter: Combination of a number of effect switches (see below).
—— 11Byte Effect type, corresponds to order in editor (see below).
—— 21Byte The effect's primary X location, for effects that use it.
—— 31Byte The effect's primary Y location, for effects that use it.
—— 44Various Index 1, codes specifying item, monster, and tile types. Varies by effect (see below).
—— 84Various Index 2, codes specifying item, monster, and tile types. Varies by effect (see below).
—— 1232String Message and variable math data (shared with trigger in same slot), null-terminated.

See also: Specials, the hex-editing way by Sokko (most of this information comes from there)

"Parameter" byte values Edit

Triggers:

Boolean mode:

  • 0 - OR with next trigger
  • 1 - NOT this trigger
  • 2 - AND with next trigger
  • 3 - NOT this trigger and AND with next trigger

Exactly/Others mode:

  • 0 - Exactly
  • 4 - Or Less or No Monsters
  • 8 - Or More

Any/Good/Evil mode:

  • 0 - Any
  • 4 - Good
  • 8 - Evil

Awake/Asleep mode:

  • 0 - Some Awake
  • 4 - All Awake
  • 8 - All Asleep

Keypress mode:

  • 0 - Is Holding
  • 4 - Taps
  • 8 - Releases

Effects:

Temporary/Permanent mode:

  • 0 - Temporary
  • 1 - Permanent

Current/Max Life

  • 0 - Current Life
  • 1 - Max Life

Single/Touching/All Same mode:

  • 0 - Single Tile/Item
  • 1 - Touching Tiles/Items
  • 2 - All Same Tiles/Items

Target/Player/Tagged

  • 0 - Target
  • 1 - Player
  • 2 - Tagged

Change/Toggle, Copy/Swap

  • 0 - Change or Copy
  • 4 - Toggle or Swap

Play effects mode:

  • 0 - Play FX or Play Snd
  • 8 - No FX or No Snd


Monster IDs Edit

  •  ??000000 - Normal monster ID
  • FFFFFFFF - Goodguy
  • FEFFFFFF - Badguy
  • FDFFFFFF - Anybody
  • FCFFFFFF - Non-player
  • FBFFFFFF - Tagged
  • FAFFFFFF - Player


Variable IDs Edit

  • 0 - G0
  • 1 - G1
  • 2 - G2
  • 3 - G3
  • 4 - G4
  • 5 - G5
  • 6 - G6
  • 7 - G7
  • 8 - V0
  • 9 - V1
  • 10 - V2
  • 11 - V3
  • 12 - V4
  • 13 - V5
  • 14 - V6
  • 15 - V7


Location As Index Edit

Four bytes:

  • Bottom-right X
  • Bottom-right Y
  • Zero
  • Zero

Trigger types and data Edit

0. Unused

1. Step On/Near

  • Location: center point
  • Index 1: monster type (see left)
  • Index 2: radius

2. Step In Rect

  • Location: top-left
  • Index 1: monster type (see left)
  • Index 2: bottom-right (see left)

3. Have Item

  • Index 1: item type
  • Index 2: item count (Little Endian)
  • Parameter: Exactly/Or Less/Or More

4. Shoot Item/Wall

  • Location: center point
  • Parameter: Any/Good/Evil

5. Monsters Alive

  • Index 1: monster type (see left)
  • Index 2: monster count (Little Endian)
  • Parameter: Exactly/Or Less/Or More

6. Kill Monster

  • Index 1: monster type (see left)

7. Floor Is Tile

  • Location: tile location
  • Index 1: tile type

8. Passed Levels

  • Index 1: number of levels (Little Endian)
  • Parameter: Exactly/Or Less/Or More

9. Passed Level

  • Index 1: level ID

10. Variable

  • Index 1: variable ID (see left)
  • Parameter: Exactly/Or Less/Or More

11. Timed

  • Index 1: every X frames (30/sec)
  • Index 2: after X frames (30/sec)

12. Delayed

  • Index 1: after X frames (30/sec)

13. Random

  • Index 1: percentage (first byte is fractional part so that 256 = 1, second byte is whole part)

14. Chain Off Other

  • Location: location of special (255,255 for "any adjacent")

15. Tiles In Rect

  • Location: top-left
  • Index 1: tile type
  • Index 2: bottom-right (see left)

16. Monster Life

  • Location: location (255,y for "Anywhere")
  • Index 1: monster type (see left)
  • Index 2: life amount
  • Parameter: Exactly/Or Less/Or More

17. Step On Tile

  • Index 1: monster type (see left)
  • Index 2: tile type

18. Get Item At

  • Location: location

19. Item On Map

  • Location: location
  • Index 1: item type

20. Monster Awake

  • Location: location (255,y for "Anywhere")
  • Index 1: monster type (see left)
  • Parameter: Awake/Asleep

21. Item In Level

  • Index 1: item type
  • Index 2: count (Little Endian)
  • Parameter: Exactly/Or Less/Or More

22. Compare Areas

  • Location: top-left
  • Index 1: second top-left (see left)
  • Index 2: bottom-right (see left)
  • Parameter: Exactly/No Monsters

23. Compare Vars

  • Index 1: first variable ID (see left)
  • Index 2: second variable ID (see left)
  • Parameter: Exactly/Or Less/Or More

24. Monster In Rect

  • Location: top-left
  • Index 1: monster type (see left)
  • Index 2: bottom-right (see left)

25. Item In Rect

  • Location: top-left
  • Index 1: item type
  • Index 2: bottom-right (see left)

26. Difficulty

  • Index 1: 0 for Normal, 1 for Hard, 2 for Lunatic
  • Parameter: Exactly/Or Less/Or More

27. Keypress

  • Index 1: 1-6: Up, Down, Left, Right, Fire, Special
  • Parameter: Is Holding/Taps/Releases

28. Playing As

  • Index 1: 0-4: Bouapha, HSM, Dr. L, Shtupid Shroom, Lunachick

29. Monster Color

  • Location: location (255, y for "Anywhere")
  • Index 1: monster type (see left)
  • Index 2: color, 0-7: gray, green, brown, blue, red, yellow, pink, aqua

30. Equation

  • Index 1: value
  • Parameter: Exactly/Or Less/Or More
  • Uses effect String

31. Var Equation

  • Index 1: variable ID (see left)
  • Parameter: Exactly/Or Less/Or More
  • Uses effect String

Effect types and data Edit

0. Unused (needed for the Equation triggers)

1. Message

  • String: message to display
  • Parameter: Play Snd/No Snd

2. Play Sound

  • Index 1: sound ID

3. Play Song

  • String: song filename

4. Win Level

  • Location: destination (255,y for "AUTO")
  • Index 1: level ID

5. Goto Level

  • Location: destination (255,y for "AUTO")
  • Index 1: level ID

6. Teleport

  • Location: destination
  • Parameter: Target/Player/Tagged
  • Parameter: Play FX/No FX

7. Change Tiles

  • Location: destination
  • Index 1: tile type
  • Parameter: Change/Toggle
  • Parameter: Single/Touching/All Same
  • Parameter: Play FX/No FX

8. Summon Monster

  • Location: destination
  • Index 1: monster type (see left)
  • Index 2: item type (0 for None, 255 for Random)
  • Parameter: Play FX/No FX

9. Make Light

  • Location: destination
  • Index 1: brightness (Little Endian)
  • Index 2: radius (Little Endian)
  • Parameter: Temporary/Permanent
  • Parameter: Play FX/No FX

10. Show Pic/Movie

  • Index 1: mode (0 for Standard, 1 for Yerfdog, 2 for Computer)
  • String: filename to display
  • Parameter: Play FX/No FX

11. Change Item

  • Index 1: item type
  • Parameter: Change/Toggle
  • Parameter: Single/Touching/All Same
  • Parameter: Play FX/No FX

12. Copy Map

  • Location: top-left
  • Index 1: bottom-right (see left)
  • Index 2: destination top/left
  • Parameter: Copy/Swap

13. Kill Monsters

  • Location: location (255,y for "Anywhere")
  • Index 1: monster type (see left)
  • Parameter: Play FX/No FX

14. Change Monsters

  • Location: location (255,y for "Anywhere")
  • Index 1: "From" monster type (see left)
  • Index 2: "To" monster type
  • Parameter: Play FX/No FX

15. Change Teams

  • Location: location (255,y for "Anywhere")
  • Index 1: monster type (see left)
  • Index 2: destination team (0 for Good, 1 for Evil, 2 for Toggle)
  • Parameter: Play FX/No FX

16. Delete Special

  • Location: location of special

17. Set Variable

  • Index 1: variable ID (see left)
  • String: equation

18. Light Rect

  • Location: top-left
  • Index 1: bottom-right (see left)
  • Index 2: brightness (Little Endian)
  • Parameter: Temporary/Permanent
  • Parameter: Play FX/No FX

19. Level Flags

  • Index 1: flag (0-9, same order as editor)
  • Index 2: value (0 for "On", 1 for "Off")

20. Old Toggle

  • Document me!

21. Set Life

  • Location: monster location (255,y for "Anywhere")
  • Index 1: monster type (see left)
  • Index 2: life amount (Little Endian)
  • Parameter: Current/Max Life
  • Parameter: Play FX/No FX

22. Force Weapon

  • Index 1: weapon type (see left)
  • Index 2: reload if same (0 for "don't", 1 for "do")

23. Tag Target

24. Tag Monster

  • Location: monster location (255,y for "Anywhere")
  • Index 1: monster type (see left)

25. Monster Item

  • Location: monster location (255,y for "Anywhere")
  • Index 1: monster type (see left)
  • Index 2: item type
  • Parameter: Play FX/No FX

26. Tile Var

  • Location: tile location
  • Index 1: variable ID (see left)
  • Parameter: Single/Touching/All Same
  • Parameter: Play FX/No FX

27. Change Life

  • Location: monster location (255,y for "Anywhere")
  • Index 1: monster type (see left)
  • Index 2: life change amount (Little Endian)
  • Parameter: Play FX/No FX

28. Monster AI

  • Location: monster location (255,y for "Anywhere")
  • Index 1: monster type (see left)
  • Index 2: monster type to use AI of
  • Parameter: Play FX/No FX

29. Monster Name

  • Location: monster location (255,y for "Anywhere")
  • Index 1: monster type (see left)
  • String: new name for monster

30. Monster Color

  • Location: monster location (255,y for "Anywhere")
  • Index 1: monster type (see left)
  • Index 2: One byte From color, one byte To color, two null bytes

31. Monster Bright

  • Location: monster location (255,y for "Anywhere")
  • Index 1: monster type (see left)
  • Index 2: brightness (Little Endian)

32. Play As

  • Index 1: playable character (see Playing As under Triggers)


Level Metadata Edit

Start Byte Length Type Description
01Byte Flag set A (see below).
11Byte Flag set B (see below).
22Short Brain count, stored Little Endian.
42Short Candle count, stored Little Endian.
61Byte Fractional part of item-drop percentage, scaled so that 256 equals 1 (ex: N.50% means a value of 128)
71Byte Whole part of item-drop percentage.

Flags are stored in the order they appear in the editor:

First byte (A)
  • 1 - Snowing
  • 2 - Raining
  • 4 - Hub Level
  • 8 - Secret Level
  • 16 - Torch Lit
  • 32 - Lantern Lit
  • 64 - Star Background
  • 128 - Underwater
Second byte (B)
  • 1 - Underlava
  • 2 - Stealth

Map Data Edit

The map data appears to be RLE-encoded, but not as complex as the tile graphics are. The following block is repeated as many times as necessary to fill the entire level:

Start Byte Length Type Description
01Byte Run-length for this chunk. If the value is less than 128, there is no encoding for the next N tiles. Otherwise, repeat the next tile 256 - N times.
12Short The floor tile type for this tile.
32Short The wall tile type for this tile (0 for no wall).
51Byte The item type for this tile (0 for no item).
61Byte The lighting on this tile. If the value is greater than or equal to 128, take 256 - N to get the actual value.

Custom Item Data Edit

Items are stored second-last in the file, before custom sounds.

Start Byte Length Type Description
01Byte The number of custom items in the world.


Then, for each custom item:

Start Byte Length Type Description
01Byte Unknown. Always 0?
11Byte Item ID of existing item that this custom item replaces; 255 for a completely new item (Extras menu).
232String Item name, null-terminated.
341SByte Item X offset.
351SByte Item Y offset.
362Short Sprite/tile ID. For items with Use Tile Image, this is the tile number. Otherwise, this is the sprite number (Little Endian).
381Byte Recolor "From" color. See above for details.
391Byte Recolor "To" color. See above for details.
401SByte Light for the tile.
411Byte Item rarity.
421Byte Item flags (see below).
433 Unknown.
461 Could be 1 for replacement item, 0 for extra item.
471 Could be 16 for replacement item, 0 for extra item.
481 Could be 0 for replacement item, 1 for extra item.
491 Unknown.
501Byte Trigger flags (see below).
511Byte Unknown.
521Byte Effect type.
531Byte Unknown.
542Short Effect value.
562 Unknown.
5832String Message.
9032 Unknown.
1222Short Sound ID.
124 More bytes?


Custom Sound Data Edit

Custom sound data is last in the file.

Start Byte Length Type Description
01Byte The number of custom sounds in the world.
13 Unknown. Always 00 00 00?


Then, for each sound:

Start Byte Length Type Description
02 Unknown.
232String Sound name, null-terminated.
342 Unknown.
364Integer Length of the sound data, in .WAV format.
40VariesByte Array Sound data, in .WAV format.

Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.