Difference between revisions of "Land Data file"

From Worms Knowledge Base

Jump to: navigation, search
(Layer 2 - Invisible Collision Mapping)
(Object Placement Coordinates example image)
 
(13 intermediate revisions by 6 users not shown)
Line 1: Line 1:
 +
{{ParentArticle|[[File formats]]}}
 +
The Land Data File (located at Data\land.dat) contains an uncompressed version of the map, as generated by the land generator (formerly landgen.exe). Aside the map colour data and collision mask, it contains some parameters such as water height and object placement coordinates. Some 3rd-party software such as [[CutWorm]] allow customizing the game map by creating/editing this file directly.
 +
 
== File Format ==
 
== File Format ==
  
* 4-byte tag signature - "LND\x1A"
+
The format differs slightly between Worms 2, versions of Worms Armaggedon, and Worms World Party.
* complete file length (4 bytes)
+
* width of map - 1920 (4 bytes)
+
* height of map - 696 (4 bytes)
+
* border style: 0 = no border, >0 = top border (4 bytes)
+
* water height - (4 bytes)
+
* number of object placements (4 bytes)
+
* object placement coordinates - horizontal (4 bytes), vertical (4 bytes). Each worm, mine, and oil barrel are randomly placed at one of these coordinates at the beginning of the game. The more excess coordinate points there are, the more possibilities there are for each object placement. Not all mines or oil barrels will be placed if there are fewer object placement coordinates than there are objects. Worms will be placed outside of the map if there are fewer object placement coordinates than there are worms or if object placement coordinates overlap each other. The game can crash if worms are placed outside of the map.
+
 
+
== Layer 1 - Visual Foreground Land ==
+
 
+
* 4-byte tag signature - "IMG\x1A"
+
* complete file length (4 bytes)
+
* the number of bits per pixel in the image - value 8 (1 byte)
+
* image flags - value 128 (1 byte)
+
* the number of colors in the image palette, excluding true black (2 bytes)
+
* image palette, excluding true black - RGB format ((3 * palette colors) bytes)
+
* image width - 1920 (2 bytes)
+
* image height - 696 (2 bytes)
+
* image data (1336320 bytes)
+
 
+
== Layer 2 - Invisible Collision Mapping ==
+
  
* 4-byte tag signature - "IMG\x1A"
+
{| border="1" cellspacing="0" class="wikitable"
* complete file length (4 bytes)
+
!Game
* the number of bits per pixel in the image - value 1 (1 byte)
+
!Type
* the number of colors in the image palette - value 0 (1 byte)
+
!Length
* image width - 1920 (2 bytes)
+
!Description
* image height - 696 (2 bytes)
+
|-
* the number of colors in the image palette, excluding true black (2 bytes)
+
| {{SoftwareEx|W2|WA|WWP|OW}} || int || 4 || Signature reading "LND\x1A".
* image data (167040 bytes)
+
|-
 +
| {{SoftwareEx|WWPA}} || int || 4 || Signature reading "LND\x1B".
 +
|-
 +
| {{SoftwareEx|W2|WA|WWP|OW|WWPA}} || int || 4 || Complete file length in bytes.
 +
|-
 +
| {{SoftwareEx|W2|WA|WWP|OW|WWPA}} || int || 4 || Width of map in pixels.
 +
|-
 +
| {{SoftwareEx|W2|WA|WWP|OW|WWPA}} || int || 4 || Height of map in pixels.
 +
|-
 +
| {{SoftwareEx|W2|WA|WWP|OW|WWPA}} || bool || 4 || Indestructible cavern border
 +
* 0 = no border
 +
* non-zero = top border
 +
|-
 +
| {{SoftwareEx|WA|WWP|WWPA}} || int || 4 || Water height in pixels.
 +
|-
 +
| {{SoftwareEx|WA|WWPA}} || int || 4 || Unknown. For WA, mostly equals the following object placement count, sometimes 255, not present in WA 3.0 and possibly other earlier versions.
 +
|-
 +
| {{SoftwareEx|W2|WA|WWP|OW|WWPA}} || int || 4 || Number of object placement structures following, each:
 +
* X position (int, 4 bytes)
 +
* Y position (int, 4 bytes)
 +
|-
 +
| {{SoftwareEx|W2|OW}} || int || 4 || Unknown number, often (always?) 0.
 +
|-
 +
| {{SoftwareEx|W2|WA|WWP|OW|WWPA}} || [[Image file|IMG]] || - || Uncompressed color (8 bpp) image, being the visual foreground land.
 +
|-
 +
| {{SoftwareEx|W2|WA|WWP|OW|WWPA}} || [[Image file|IMG]] || - || Uncompressed monochrome (1 bpp) image, being the collision mask (black determines collidable pixels).
 +
|-
 +
| {{SoftwareEx|W2|WA|WWP|OW|WWPA}} || [[Image file|IMG]] || - || Uncompressed monochrome (1 bpp) image, being the visual background land.
 +
|-
 +
| {{SoftwareEx|W2|OW}} || [[Image file|IMG]] || - || Uncompressed monochrome (1 bpp) image, small size, often (always?) empty, with unknown meaning.
 +
|-
 +
| {{SoftwareEx|W2|WA|WWP|OW|WWPA}} || string || - || 1 byte length-prefixed string, being the absolute path to the land texture.
 +
|-
 +
| {{SoftwareEx|W2|WA|WWP|OW|WWPA}} || string || - || 1 byte length-prefixed string, being the absolute path to the water.dir file.
 +
|}
  
== Layer 3 - Visual Background Land ==
+
== Object Placement Coordinates ==
  
* 4-byte tag signature - "IMG\x1A"
+
[[File:Plac.png|600px|thumb|right|Map with blue dots where object placement coordinates are.]]
* complete file length (4 bytes)
+
* the number of bits per pixel in the image - value 1 (1 byte)
+
* the number of colors in the image palette - value 0 (1 byte)
+
* image width - 1920 (2 bytes)
+
* image height - 696 (2 bytes)
+
* image data (167040 bytes)
+
* the number of colors in the image palette, excluding true black (2 bytes)
+
  
== Additional Data - Pathing ==
+
Each worm, mine, and oil barrel are randomly placed at one of these coordinates at the beginning of the game. The more excess coordinate points there are, the more possibilities there are for each object placement. Not all mines or oil barrels will be placed if there are fewer object placement coordinates than there are objects. Worms will be placed outside of the map if there are fewer object placement coordinates than there are worms or if object placement coordinates overlap each other. The game can crash if worms are placed outside of the map.
  
* length of path string (1 byte)
+
== Embedded Images ==
* path to land texture
+
* length of path string (1 byte)
+
* path to water.dir file
+
  
 +
The images embedded in land.dat files are read like typical [[Image file]] data, with the following exceptions:
  
----
+
* W2 and OW have a fourth blank, monochrome image of smaller sizes than the map.
 +
* WWP and WWPA align the image data following the image size by 4 bytes (but only for the embedded images in land.dat), all other games do not.
  
 +
== Land.dat use for custom color maps in WormNet2 ==
  
Worms player/3rd party programmer, Etho, plans on developing a new map file format for Worms World Party that players will be able to use with the program CutWorm. The format will allow wwp players to play customized color maps with each other on WormNet2. Map makers will have the option to customize all three layers that land.dat uses, the border & water setting, object placement coordinates, and water type/color settings.
+
[[User:Etho|Etho]] planned on developing a new map file format for Worms World Party that players would have been able to use with the program CutWorm. The format allowed WWP players to play customized color maps with each other on WormNet2. Map makers had the option to customize all three layers that land.dat uses, the border & water setting, object placement coordinates, and water type/color settings.
  
 
Online and offline tests where these parameters were properly adjusted have worked successfully with no desync errors. So far, tests to increase the size of a map beyond the size 1920 x 696 have failed.
 
Online and offline tests where these parameters were properly adjusted have worked successfully with no desync errors. So far, tests to increase the size of a map beyond the size 1920 x 696 have failed.

Latest revision as of 15:17, 24 December 2022

(Up to File formats)

The Land Data File (located at Data\land.dat) contains an uncompressed version of the map, as generated by the land generator (formerly landgen.exe). Aside the map colour data and collision mask, it contains some parameters such as water height and object placement coordinates. Some 3rd-party software such as CutWorm allow customizing the game map by creating/editing this file directly.

File Format

The format differs slightly between Worms 2, versions of Worms Armaggedon, and Worms World Party.

Game Type Length Description
[W2][WA][WWP][OW][—] int 4 Signature reading "LND\x1A".
[—][—][—][—][WWPA] int 4 Signature reading "LND\x1B".
[W2][WA][WWP][OW][WWPA] int 4 Complete file length in bytes.
[W2][WA][WWP][OW][WWPA] int 4 Width of map in pixels.
[W2][WA][WWP][OW][WWPA] int 4 Height of map in pixels.
[W2][WA][WWP][OW][WWPA] bool 4 Indestructible cavern border
  • 0 = no border
  • non-zero = top border
[—][WA][WWP][—][WWPA] int 4 Water height in pixels.
[—][WA][—][—][WWPA] int 4 Unknown. For WA, mostly equals the following object placement count, sometimes 255, not present in WA 3.0 and possibly other earlier versions.
[W2][WA][WWP][OW][WWPA] int 4 Number of object placement structures following, each:
  • X position (int, 4 bytes)
  • Y position (int, 4 bytes)
[W2][—][—][OW][—] int 4 Unknown number, often (always?) 0.
[W2][WA][WWP][OW][WWPA] IMG - Uncompressed color (8 bpp) image, being the visual foreground land.
[W2][WA][WWP][OW][WWPA] IMG - Uncompressed monochrome (1 bpp) image, being the collision mask (black determines collidable pixels).
[W2][WA][WWP][OW][WWPA] IMG - Uncompressed monochrome (1 bpp) image, being the visual background land.
[W2][—][—][OW][—] IMG - Uncompressed monochrome (1 bpp) image, small size, often (always?) empty, with unknown meaning.
[W2][WA][WWP][OW][WWPA] string - 1 byte length-prefixed string, being the absolute path to the land texture.
[W2][WA][WWP][OW][WWPA] string - 1 byte length-prefixed string, being the absolute path to the water.dir file.

Object Placement Coordinates

Map with blue dots where object placement coordinates are.

Each worm, mine, and oil barrel are randomly placed at one of these coordinates at the beginning of the game. The more excess coordinate points there are, the more possibilities there are for each object placement. Not all mines or oil barrels will be placed if there are fewer object placement coordinates than there are objects. Worms will be placed outside of the map if there are fewer object placement coordinates than there are worms or if object placement coordinates overlap each other. The game can crash if worms are placed outside of the map.

Embedded Images

The images embedded in land.dat files are read like typical Image file data, with the following exceptions:

  • W2 and OW have a fourth blank, monochrome image of smaller sizes than the map.
  • WWP and WWPA align the image data following the image size by 4 bytes (but only for the embedded images in land.dat), all other games do not.

Land.dat use for custom color maps in WormNet2

Etho planned on developing a new map file format for Worms World Party that players would have been able to use with the program CutWorm. The format allowed WWP players to play customized color maps with each other on WormNet2. Map makers had the option to customize all three layers that land.dat uses, the border & water setting, object placement coordinates, and water type/color settings.

Online and offline tests where these parameters were properly adjusted have worked successfully with no desync errors. So far, tests to increase the size of a map beyond the size 1920 x 696 have failed.

Personal tools