Worms DC File Formats

Back to asset tool

DRAFT

General

Summary

Ext.WhatSummary
.WRM16 Custom level FORM ILBM WRM2 [QUOT] [MNT1 MNT2] BMHD CMAP BODY [BACK]
.WRM16 Custom level
(alternative format)
FORM ILBM WORM [WORM] BMHD CMAP BODY [BACK]
.DIY Landscape WRM2LAND* CMAP [MNT1 MNT2] DATA*
* not really a chunk
.MNT Mountains WRM2MNTS* MNT1 MNT2 DATA*
* not really a chunk

.WRM16 – custom level


Reverse engineering notes

WRM2 chunk

WRM2 block custom gravity max

00 00 05 03 41 4c 50 53 00 01 01 ff 80 80 ff 80 | ....ALPS...ÿ..ÿ.
80 01 00 01 ff 80 80 ff 00 00 00 00 00 00 00 00 | ....ÿ..ÿ........
00 00 00 00 00 00 00 00 | ........

WRM2 block custom gravity min

00 00 01 03 41 4c 50 53 00 01 01 ff 80 80 ff 80 | ....ALPS...ÿ..ÿ.
80 01 00 01 ff 80 80 ff 00 00 00 00 00 00 00 00 | ....ÿ..ÿ........
00 00 00 00 00 00 00 00 | ........

WRM2 block custom friction max

00 00 03 05 41 4c 50 53 00 01 01 ff 80 80 ff 80 | ....ALPS...ÿ..ÿ.
80 01 00 01 ff 80 80 ff 00 00 00 00 00 00 00 00 | ....ÿ..ÿ........
00 00 00 00 00 00 00 00 | ........

WRM2 block custom friction min

00 00 03 01 41 4c 50 53 00 01 01 ff 80 80 ff 80 | ....ALPS...ÿ..ÿ.
80 01 00 01 ff 80 80 ff 00 00 00 00 00 00 00 00 | ....ÿ..ÿ........
00 00 00 00 00 00 00 00 | ........

WRM2 block custom destroy bg yes

00 01 03 03 41 4c 50 53 00 01 01 ff 80 80 ff 80 | ....ALPS...ÿ..ÿ.
80 01 00 01 ff 80 80 ff 00 00 00 00 00 00 00 00 | ....ÿ..ÿ........
00 00 00 00 00 00 00 00 | ........

WRM2 block custom destroy bg no

00 00 03 03 41 4c 50 53 00 01 01 ff 80 80 ff 80 | ....ALPS...ÿ..ÿ.
80 01 00 01 ff 80 80 ff 00 00 00 00 00 00 00 00 | ....ÿ..ÿ........
00 00 00 00 00 00 00 00 | ........

WRM2 block custom destroy custom sky zen 4 8 15 hor 16 23 42 (hex: 4 8 f, 10 17 2a) HSV yes

00 01 03 03 41 4c 50 53 00 01 00 04 08 0f 10 17 | ....ALPS........
2a 01 00 01 ff 80 80 ff 00 00 00 00 00 00 00 00 | *...ÿ..ÿ........
00 00 00 00 00 00 00 00 | ........

WRM2 block custom destroy custom sky zen 4 8 15 hor 16 23 42 (hex: 4 8 f, 10 17 2a) HSV no

00 01 03 03 41 4c 50 53 00 01 00 04 08 0f 10 17 | ....ALPS........
2a 00 00 01 ff 80 80 ff 00 00 00 00 00 00 00 00 | *...ÿ..ÿ........
00 00 00 00 00 00 00 00 | ........

WRM2 block custom destroy custom sky off

00 01 03 03 41 4c 50 53 00 01 01 04 08 0f 10 17 | ....ALPS........
2a 00 00 01 ff 80 80 ff 00 00 00 00 00 00 00 00 | *...ÿ..ÿ........
00 00 00 00 00 00 00 00 | ........

WRM2 block custom destroy custom sky on

00 01 03 03 41 4c 50 53 00 01 00 04 08 0f 10 17 | ....ALPS........
2a 01 00 01 ff 80 80 ff 00 00 00 00 00 00 00 00 | *...ÿ..ÿ........
00 00 00 00 00 00 00 00 | ........

WRM2 block custom: offsets with longer mountain set name - ALPS

W  R  M  2  .  .  .  (  .  .  .  .  A  L  P  S  .             .  .  .  .  .  .  .  *  .  .  .  ÿ  .  .  ÿ  .  .  .  .  .  .  .  .
57 52 4d 32 00 00 00 28 00 01 03 03 41 4c 50 53 00            01 01 04 08 0f 10 17 2a 01 00 01 ff 80 80 ff 00 00 00 00 00 00 00 00

WRM2 block custom: offsets with longer mountain set name - DEFAULT

W  R  M  2  .  .  .  ,  .  .  .  .  D  E  F  A  U  L  T  .    .  .  .  .  .  .  .  *  .  .  .  ÿ  .  .  ÿ  .  .  .  .  .  .  .  .  .
57 52 4d 32 00 00 00 2c 00 01 03 03 44 45 46 41 55 4c 54 00   01 01 04 08 0f 10 17 2a 01 00 01 ff 80 80 ff 00 00 00 00 00 00 00 00 00

A-ha! Flags continue byte-wise immediately after string terminator, even or odd, possible pad byte at the end

WRM2 custom water normal

 W  R  M  2  .  .  .  (  .  .  .  .  A  L  P  S  .  .  .  .  .  .  .  .  *  .  .  .  ÿ  .  .  ÿ  .  .  .  .  .  .  .  .
 57 52 4d 32 00 00 00 28 00 01 03 03 41 4c 50 53 00 01 01 04 08 0f 10 17 2a 01 00 01 ff 80 80 ff 00 00 00 00 00 00 00 00
...................................................  0  1  2  3  4  5  6  7  8  9 10 11 12 13 14 15 16 17 18 19 20 21 22

WRM2 custom water gloop

 W  R  M  2  .  .  .  (  .  .  .  .  A  L  P  S  .  .  .  .  .  .  .  .  *  .  .  .  ÿ  .  .  ÿ  .  .  .  .  .  .  .  .
 57 52 4d 32 00 00 00 28 00 01 03 03 41 4c 50 53 00 01 01 04 08 0f 10 17 2a 01 01 01 ff 80 80 ff 00 00 00 00 00 00 00 00
...................................................  0  1  2  3  4  5  6  7  8  9 10 11 12 13 14 15 16 17 18 19 20 21 22

WRM2 custom water fire

 W  R  M  2  .  .  .  (  .  .  .  .  A  L  P  S  .  .  .  .  .  .  .  .  *  .  .  .  ÿ  .  .  ÿ  .  .  .  .  .  .  .  .
 57 52 4d 32 00 00 00 28 00 01 03 03 41 4c 50 53 00 01 01 04 08 0f 10 17 2a 01 02 01 ff 80 80 ff 00 00 00 00 00 00 00 00
...................................................  0  1  2  3  4  5  6  7  8  9 10 11 12 13 14 15 16 17 18 19 20 21 22

WRM2 custom water fire with custom color 34 35 36

 W  R  M  2  .  .  .  (  .  .  .  .  A  L  P  S  .  .  .  .  .  .  .  .  *  .  .  .  "  #  $  ÿ  .  .  .  .  .  .  .  .
 57 52 4d 32 00 00 00 28 00 01 03 03 41 4c 50 53 00 01 01 04 08 0f 10 17 2a 01 02 00 22 23 24 ff 00 00 00 00 00 00 00 00
...................................................  0  1  2  3  4  5  6  7  8  9 10 11 12 13 14 15 16 17 18 19 20 21 22

WRM2 custom: no mountain palettes

 W  R  M  2  .  .  .  (  .  .  .  .  A  L  P  S  .  .  .  .  .  .  .  .  *  .  .  .  ÿ  .  .  ÿ  .  .  .  .  .  .  .  .
 57 52 4d 32 00 00 00 28 00 01 03 03 41 4c 50 53 00 01 01 04 08 0f 10 17 2a 01 00 01 ff 80 80 ff 00 00 00 00 00 00 00 00
...................................................  0  1  2  3  4  5  6  7  8  9 10 11 12 13 14 15 16 17 18 19 20 21 22

WRM2 custom: mountain palettes from IFF present

 W  R  M  2  .  .  .  (  .  .  .  .  A  L  P  S  .  .  .  .  .  .  .  .  *  .  .  .  ÿ  .  .  ÿ  .  .  .  .  .  .  .  .
 57 52 4d 32 00 00 00 28 00 01 03 03 41 4c 50 53 00 00 01 04 08 0f 10 17 2a 01 00 01 ff 80 80 ff 00 00 00 00 00 00 00 00
...................................................  0  1  2  3  4  5  6  7  8  9 10 11 12 13 14 15 16 17 18 19 20 21 22

^ Also, MNT1 and MNT2 chunks present here

Long quote

...gets ignored? at what length? 34 is fine at least

WRM2 block custom destroy bg yes

 W  R  M  2  .  .  .  (  .  .  .  .  A  L  P  S  .  .  .  .  .  .  .  .  *  .  .  .  ÿ  .  .  ÿ  .  .  .  .  .  .  .  .
 57 52 4d 32 00 00 00 28 00 01 03 03 41 4c 50 53 00 01 01 04 08 0f 10 17 2a 01 00 01 ff 80 80 ff 00 00 00 00 00 00 00 00

WRM2 block custom destroy bg no

 W  R  M  2  .  .  .  (  .  .  .  .  A  L  P  S  .  .  .  .  .  .  .  .  *  .  .  .  ÿ  .  .  ÿ  .  .  .  .  .  .  .  .
 57 52 4d 32 00 00 00 28 00 00 03 03 41 4c 50 53 00 01 01 04 08 0f 10 17 2a 01 00 01 ff 80 80 ff 00 00 00 00 00 00 00 00

Single layer

00 00 04 05 41 4c 50 53 00 00 01 ff c8 0a 00 c8 | ....ALPS...ÿÈ..È

Dual layer

01 00 04 05 41 4c 50 53 00 00 01 ff c8 0a 00 c8 | ....ALPS...ÿÈ..È

WRM2 chunk length - there's padding within the chunk payload!

mountains "DEFAULT"     : WRM2 length = 44
mountains "DEFAULTA"    : WRM2 length = 44
mountains "DEFAULTAB"   : WRM2 length = 46
mountains "DEFAULTABC"  : WRM2 length = 46
mountains "DEFAULTABCD" : WRM2 length = 48

00 00 03 03 44 45 46 41 55 4c 54 00 01 01 ff 80 | ....DEFAULT...ÿ.
80 ff 80 80 01 00 01 ff 80 80 ff 00 00 00 00 00 | .ÿ.....ÿ..ÿ.....
00 00 00 00 00 00 00 00 00 00 00 00 | ............
	
00 00 03 03 44 45 46 41 55 4c 54 41 00 01 01 ff | ....DEFAULTA...ÿ
80 80 ff 80 80 01 00 01 ff 80 80 ff 00 00 00 00 | ..ÿ.....ÿ..ÿ....
00 00 00 00 00 00 00 00 00 00 00 00 | ............

00 00 03 03 44 45 46 41 55 4c 54 41 42 00 01 01 | ....DEFAULTAB...
ff 80 80 ff 80 80 01 00 01 ff 80 80 ff 00 00 00 | ÿ..ÿ.....ÿ..ÿ...
00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ..............

00 00 03 03 44 45 46 41 55 4c 54 41 42 43 00 01 | ....DEFAULTABC..
01 ff 80 80 ff 80 80 01 00 01 ff 80 80 ff 00 00 | .ÿ..ÿ.....ÿ..ÿ..
00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ..............

QUOT chunk has inner-payload padding, too (chunk length is never odd)

WORM chunk

Weird: not generated by WormPrefs, but old WRM16 levels use it. Occurs twice?

WRM2MNTS sub-image headers

A fixed-size, 32 byte data block. Bitmap data starts immediately after it.

DYI sub-images use the same format; seems to start with w, h, planes, stride, but the rest?

Mountain layer 1 (width 384=0x180, height 28=0x1c, planes 4, stride 48=0x30)

01 80 00 1c 00 04 00 30 07 19 00 00 00 00 78 2f | .......0......x/
fe 28 78 2f dc 78 05 40 05 78 15 00 15 e0 00 00 | þ(x/Üx.@.x...à..

Mountain layer 2 (width 384=0x180, height 110=0x6e, planes 4, stride 48=0x30)

01 80 00 6e 00 04 00 30 1b 99 00 00 00 00 78 31 | ...n...0......x1
61 20 78 30 13 30 14 a0 15 7c 52 80 55 f0 00 00 | a x0.0. .|R.Uð..

Bytes after w/h/pl/str block in existing MNT files (highlighted: constant magic numbers, apparently)

ALPS.decr     : image[0] 384* 28 pl 4 str 48, then: 07 19 00 00 00 00 78 2f fe 28 78 2f dc 78 05 40 05 78 15 00 15 e0 00 00
DEFAULT.MNT   : image[0] 384* 28 pl 4 str 48, then: 07 19 00 00 00 00 78 18 20 90 78 14 f7 20 05 40 05 78 15 00 15 e0 00 00
GLACIER.MNT   : image[0] 384* 28 pl 4 str 48, then: 07 19 00 00 00 00 40 1a a8 d0 40 19 a7 80 05 40 05 78 15 00 15 e0 00 00
HELL.MNT.decr : image[0] 384* 28 pl 4 str 48, then: 07 19 00 00 00 00 78 18 1b b8 78 14 f7 20 05 40 05 78 15 00 15 e0 00 00
MARS.MNT.decr : image[0] 384* 28 pl 4 str 48, then: 07 19 00 00 00 00 78 18 21 00 78 14 f7 20 05 40 05 78 15 00 15 e0 00 00
MONEY.MNT     : image[0] 384* 28 pl 4 str 48, then: 07 19 00 00 00 00 00 2b 4b 48 00 2b 2a 38 05 40 05 78 15 00 15 e0 00 00
TURRICAN.MNT  : image[0] 384* 28 pl 4 str 48, then: 07 19 00 00 00 00 08 73 78 f8 08 6f 97 08 05 40 05 78 15 00 15 e0 00 00

ALPS.decr     : image[1] 384*110 pl 4 str 48, then: 1b 99 00 00 00 00 78 31 61 20 78 30 13 30 14 a0 15 7c 52 80 55 f0 00 00
DEFAULT.MNT   : image[1] 384*110 pl 4 str 48, then: 1b 99 00 00 00 00 78 19 34 88 78 19 87 10 14 a0 15 7c 52 80 55 f0 00 00
GLACIER.MNT   : image[1] 384*110 pl 4 str 48, then: 1b 99 00 00 00 00 40 1d 87 40 40 1a f6 10 14 a0 15 7c 52 80 55 f0 00 00
HELL.MNT.decr : image[1] 384*110 pl 4 str 48, then: 1b 99 00 00 00 00 78 19 30 c8 78 19 83 50 14 a0 15 7c 52 80 55 f0 00 00
MARS.MNT.decr : image[1] 384*110 pl 4 str 48, then: 1b 99 00 00 00 00 78 19 36 b8 78 19 89 40 14 a0 15 7c 52 80 55 f0 00 00
MONEY.MNT     : image[1] 384*110 pl 4 str 48, then: 1b 99 00 00 00 00 00 2d fb 60 00 2b 95 58 14 a0 15 7c 52 80 55 f0 00 00
TURRICAN.MNT  : image[1] 384*110 pl 4 str 48, then: 1b 99 00 00 00 00 08 73 e0 88 08 74 33 10 14 a0 15 7c 52 80 55 f0 00 00

In different order:

ALPS.decr     : image[0] 384* 28 pl 4 str 48, then: 07 19 00 00 00 00 78 2f fe 28 78 2f dc 78 05 40 05 78 15 00 15 e0 00 00
ALPS.decr     : image[1] 384*110 pl 4 str 48, then: 1b 99 00 00 00 00 78 31 61 20 78 30 13 30 14 a0 15 7c 52 80 55 f0 00 00
	
DEFAULT.MNT   : image[0] 384* 28 pl 4 str 48, then: 07 19 00 00 00 00 78 18 20 90 78 14 f7 20 05 40 05 78 15 00 15 e0 00 00
DEFAULT.MNT   : image[1] 384*110 pl 4 str 48, then: 1b 99 00 00 00 00 78 19 34 88 78 19 87 10 14 a0 15 7c 52 80 55 f0 00 00
	
GLACIER.MNT   : image[0] 384* 28 pl 4 str 48, then: 07 19 00 00 00 00 40 1a a8 d0 40 19 a7 80 05 40 05 78 15 00 15 e0 00 00
GLACIER.MNT   : image[1] 384*110 pl 4 str 48, then: 1b 99 00 00 00 00 40 1d 87 40 40 1a f6 10 14 a0 15 7c 52 80 55 f0 00 00
	
HELL.MNT.decr : image[0] 384* 28 pl 4 str 48, then: 07 19 00 00 00 00 78 18 1b b8 78 14 f7 20 05 40 05 78 15 00 15 e0 00 00
HELL.MNT.decr : image[1] 384*110 pl 4 str 48, then: 1b 99 00 00 00 00 78 19 30 c8 78 19 83 50 14 a0 15 7c 52 80 55 f0 00 00
	
MARS.MNT.decr : image[0] 384* 28 pl 4 str 48, then: 07 19 00 00 00 00 78 18 21 00 78 14 f7 20 05 40 05 78 15 00 15 e0 00 00
MARS.MNT.decr : image[1] 384*110 pl 4 str 48, then: 1b 99 00 00 00 00 78 19 36 b8 78 19 89 40 14 a0 15 7c 52 80 55 f0 00 00
	
MONEY.MNT     : image[0] 384* 28 pl 4 str 48, then: 07 19 00 00 00 00 00 2b 4b 48 00 2b 2a 38 05 40 05 78 15 00 15 e0 00 00
MONEY.MNT     : image[1] 384*110 pl 4 str 48, then: 1b 99 00 00 00 00 00 2d fb 60 00 2b 95 58 14 a0 15 7c 52 80 55 f0 00 00

TURRICAN.MNT  : image[0] 384* 28 pl 4 str 48, then: 07 19 00 00 00 00 08 73 78 f8 08 6f 97 08 05 40 05 78 15 00 15 e0 00 00
TURRICAN.MNT  : image[1] 384*110 pl 4 str 48, then: 1b 99 00 00 00 00 08 73 e0 88 08 74 33 10 14 a0 15 7c 52 80 55 f0 00 00

Oh! Those mystery bytes are random! Same name, same bitmaps, same values, different exports by WormPrefs:

00000000: 5752 4d32 4d4e 5453 7f7f 00ff 0000 0100  WRM2MNTS........     00000000: 5752 4d32 4d4e 5453 7f7f 00ff 0000 0100  WRM2MNTS........
00000010: 0000 0000 0000 0000 0000 0000 0000 0000  ................     00000010: 0000 0000 0000 0000 0000 0000 0000 0000  ................
00000020: 0000 0000 0000 0000 4d4e 5431 0000 0030  ........MNT1...0     00000020: 0000 0000 0000 0000 4d4e 5431 0000 0030  ........MNT1...0
00000030: 5413 54d7 4179 a53e 77df 3f9a ec4a c5f6  T.T.Ay.>w.?..J..     00000030: 5413 54d7 4179 a53e 77df 3f9a ec4a c5f6  T.T.Ay.>w.?..J..
00000040: 49ec e373 5c9f 239f 861f 86bf 31bf e73e  I..s\.#.....1..>     00000040: 49ec e373 5c9f 239f 861f 86bf 31bf e73e  I..s\.#.....1..>
00000050: e7ba 34b8 dc57 6cf8 b23a ee93 4b02 0002  ..4..Wl..:..K...     00000050: e7ba 34b8 dc57 6cf8 b23a ee93 4b02 0002  ..4..Wl..:..K...
00000060: 4d4e 5432 0000 0030 1f04 2829 0a37 1104  MNT2...0..().7..     00000060: 4d4e 5432 0000 0030 1f04 2829 0a37 1104  MNT2...0..().7..
00000070: 184b 1e63 7d3d a134 1448 0803 0c71 e8e3  .K.c}=.4.H...q..     00000070: 184b 1e63 7d3d a134 1448 0803 0c71 e8e3  .K.c}=.4.H...q..
00000080: 3627 5646 3a6e 2d4d 6713 2838 3e73 8b46  6'VF:n-Mg.(8>s.F     00000080: 3627 5646 3a6e 2d4d 6713 2838 3e73 8b46  6'VF:n-Mg.(8>s.F
00000090: aab1 ebfe fe02 0002 4441 5441 5342 0002  ........DATASB..     00000090: aab1 ebfe fe02 0002 4441 5441 5342 0002  ........DATASB..
000000a0: 0180 001c 0004 0030 0719 0000 0000 001c  .......0........     000000a0: 0180 001c 0004 0030 0719 0000 0000 001c  .......0........
000000b0: 1088 001a 0048 0540 0578 1500 15e0 0000  .....H.@.x......  |  000000b0: 1088 0019 ffc8 0540 0578 1500 15e0 0000  .......@.x......
                  * ***                                                                   * ***

	
< 000000a0: 0180 001c 0004 0030 0719 0000 0000 001c  .......0........
< 000000b0: 1088 0019 ffc8 0540 0578 1500 15e0 0000  .......@.x......
---
> 000000a0: 0180 001c 0004 0030 0719 0000 0000 001a  .......0........
> 000000b0: 1000 0019 f5b8 0540 0578 1500 15e0 0000  .......@.x......
350c350
< 000015d0: 1780 001d 6a08 14a0 157c 5280 55f0 0000  ....j....|R.U...
---
> 000015d0: 9098 001a 5ef8 14a0 157c 5280 55f0 0000  ....^....|R.U...

Also, they seem to be used as keys in a hash table and can mess up MNT lookup (map1.MNT can replace map2.MNT if they have the same "hash").

So, which bits are always set and which bits are filled with random data?

SB0 magic or-ed:   07 19 00 00 00 00 78 7f ff f8 78 7f ff f8 05 40 05 78 15 00 15 e0 00 00
SB1 magic or-ed:   1b 99 00 00 00 00 78 7f ff f8 78 7f ff f8 14 a0 15 7c 52 80 55 f0 00 00

SB0 magic and-ed:  07 19 00 00 00 00 00 00 00 00 00 00 00 00 05 40 05 78 15 00 15 e0 00 00
SB1 magic and-ed:  1b 99 00 00 00 00 00 00 00 00 00 00 00 00 14 a0 15 7c 52 80 55 f0 00 00