Difference between revisions of "Monochrome map (Worms 2)"
From Worms Knowledge Base
Line 5: | Line 5: | ||
The header has been partially reversed. This has not been tested on too many levels, so it should be taken with a pinch of salt: | The header has been partially reversed. This has not been tested on too many levels, so it should be taken with a pinch of salt: | ||
− | 0x00 | + | {| class="wikitable" |
+ | |- | ||
+ | ! Offset | ||
+ | ! Length | ||
+ | ! Description | ||
+ | |- | ||
+ | | 0x00 | ||
+ | | 2 | ||
+ | | 0x01 0x01 if the terrain is open, 0x02 0x02 if the terrain is cavern, 0x00 0x01 if the terrain is <Random>. | ||
+ | |- | ||
+ | | 0x02 | ||
+ | | 4 | ||
+ | | Unknown, but presumably similar to below but with the terrain generation seed, not the object seed. If the seed cannot be represented like this, see the first string slot. | ||
+ | |- | ||
+ | | 0x06 | ||
+ | | 4 | ||
+ | | The object generation seed in hex, little-endian (so if the code in game is 05437645, this will read 45764305). If the seed cannot be represented like this, see the first string slot. | ||
+ | |- | ||
+ | | 0x0A | ||
+ | | 4 | ||
+ | | Unknown, presumably a 32-bit little-endian integer, but more investigation required. | ||
+ | |- | ||
+ | | 0x0E | ||
+ | | 4 | ||
+ | | Unknown, presumably a 32-bit little-endian integer, but more investigation required. | ||
+ | |- | ||
+ | | 0x12 | ||
+ | | 4 | ||
+ | | The object count, from 0x00 (min) to 0x64 (max), represented as a 32-bit little-endian integer (presumably), which is odd since only the first byte is required. | ||
+ | |- | ||
+ | | 0x16 | ||
+ | | Varies | ||
+ | | [http://en.wikipedia.org/wiki/String_(computer_science)#Representations Pascal-style string] with the terrain seed. (I assume the specifics of when and when not this exists is similar to below, but since the game does not generate seeds for its own hex format, it's hard to judge whether or not this is the case) | ||
+ | |- | ||
+ | | Varies | ||
+ | | Varies | ||
+ | | Object generation seed, if it cannot be represented in 4 hex bytes. If it can be represented in 4 hex bytes, this is empty (length byte is 0x00 and it goes straight onto the next string). It is unknown whether this is converted into the hex using some algorithm, or if the hex is completely ignored if this is present, though I suspect it is the former, since the hex changes. | ||
+ | |- | ||
+ | | Varies | ||
+ | | Varies | ||
+ | | Name of level. In most cases, this will be the same as the filename but without the .lev suffix. | ||
+ | |- | ||
+ | | Varies | ||
+ | | 1 | ||
+ | | 0x01 if the terrain is edited, 0x00 if seeded and not edited | ||
+ | |- | ||
+ | | Varies | ||
+ | | Varies | ||
+ | | The name of the level style. Exactly as displayed in the drop-down. | ||
+ | |- | ||
+ | | Varies | ||
+ | | Varies | ||
+ | | The name of the water colour, with an initial captital letter, and the rest lower case. They can be: Red, Blue, Green, Purple, Yellow. | ||
+ | |- | ||
+ | | Varies | ||
+ | | 4 | ||
+ | | 0x80 0x07 0xB8 0x02 (only when edited, magic bytes) | ||
+ | |- | ||
+ | | Varies | ||
+ | | 167040 | ||
+ | | Data | ||
+ | |} | ||
− | + | If the terrain is purely seeded, then other than what was mentioned above, after the last string, there is a lot more data, but not enough to describe the entire map. What the rest of the data is is unknown. | |
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
{{stub}} | {{stub}} |
Revision as of 09:10, 13 April 2009
(Up to File formats)
Worms 2 maps (monochrome maps) are gzipped binary files, in most cases with invalid CRCs (so gzip itself cannot be used to extract them). After a header containing the map parameters, the map data follows as a 1-bit-per-pixel bitmap. This will convert the data into a .bmp: http://dump.thecybershadow.net/6c2fbb5e21fd07834c9ed7dd839fe9e8/draw.dpr
The header has been partially reversed. This has not been tested on too many levels, so it should be taken with a pinch of salt:
Offset | Length | Description |
---|---|---|
0x00 | 2 | 0x01 0x01 if the terrain is open, 0x02 0x02 if the terrain is cavern, 0x00 0x01 if the terrain is <Random>. |
0x02 | 4 | Unknown, but presumably similar to below but with the terrain generation seed, not the object seed. If the seed cannot be represented like this, see the first string slot. |
0x06 | 4 | The object generation seed in hex, little-endian (so if the code in game is 05437645, this will read 45764305). If the seed cannot be represented like this, see the first string slot. |
0x0A | 4 | Unknown, presumably a 32-bit little-endian integer, but more investigation required. |
0x0E | 4 | Unknown, presumably a 32-bit little-endian integer, but more investigation required. |
0x12 | 4 | The object count, from 0x00 (min) to 0x64 (max), represented as a 32-bit little-endian integer (presumably), which is odd since only the first byte is required. |
0x16 | Varies | Pascal-style string with the terrain seed. (I assume the specifics of when and when not this exists is similar to below, but since the game does not generate seeds for its own hex format, it's hard to judge whether or not this is the case) |
Varies | Varies | Object generation seed, if it cannot be represented in 4 hex bytes. If it can be represented in 4 hex bytes, this is empty (length byte is 0x00 and it goes straight onto the next string). It is unknown whether this is converted into the hex using some algorithm, or if the hex is completely ignored if this is present, though I suspect it is the former, since the hex changes. |
Varies | Varies | Name of level. In most cases, this will be the same as the filename but without the .lev suffix. |
Varies | 1 | 0x01 if the terrain is edited, 0x00 if seeded and not edited |
Varies | Varies | The name of the level style. Exactly as displayed in the drop-down. |
Varies | Varies | The name of the water colour, with an initial captital letter, and the rest lower case. They can be: Red, Blue, Green, Purple, Yellow. |
Varies | 4 | 0x80 0x07 0xB8 0x02 (only when edited, magic bytes) |
Varies | 167040 | Data |
If the terrain is purely seeded, then other than what was mentioned above, after the last string, there is a lot more data, but not enough to describe the entire map. What the rest of the data is is unknown.