Terrain Creation Guide
From Worms Knowledge Base
[This page is a work in progress. New tools are in development that will likely replace Sprite Editor]
This guide will explain how to create your own terrain files for use with the in-game land generator, just like the built-in levels like Forest, Cheese etc.
See the wkTerrain page for more info on how to play additional terrains.
Terrains are stored under the DATA\Level folder of your Worms install directory. Each terrain has its own folder containing 2 files: 'Level.dir' and 'TEXT.img'. 'TEXT.img' is a small icon for the terrain displayed in the in-game land generator. 'Level.dir' is an archive file (similar to a zip) that contains all of the terrain images and config files.
The image assets in level.dir are in two formats; .IMG files for images, .SPR files for animated sprites. .SPR files are accompanied by a .SPD text file containing parameters for the .SPR file (frames, width, height etc).
The WA Directory Editor utility (https://worms2d.info/WA_directory_editor) (SpriteEditor.exe) is able to take your image assets (in .BMP [OS/2] format), convert them to .IMG/.SPR and then produce a Level.dir file usable in the game. It is also able to extract assets from existing level.dir files although the program is a bit buggy and some files wont extract.
Download and extract the terrain guide files: https://www.tus-wa.com/files/file-2229 This has an 'EXAMPLE TERRAIN' folder containing examples of the core assets required for all terrains and 4 example custom objects. It also contains the standalone SpriteEditor.exe for convenience or you can download it from the link above.
Contents
Core Files (required)
File Name | Info |
---|---|
text.img | The main texture of your land. Dimensions: 256 x 256 |
soil.img | The soil texture revealed when land is destroyed. Dimensions: 256 x 256 |
back.spr | The background mountains image. Dimensions: 640 x 160. Other dimensions may work. Despite being an .SPR file, this is a single image and the background cannot be animated. |
back.spd | The sprite parameters file for back.spr. |
bridge.img | The flat part of the bridge. Dimensions: 64 x 19 |
bridge-l.img | The left part of the bridge. Dimensions: 64 x 50 |
bridge-r.img | The right part of the bridge. Dimensions: 64 x 49 |
debris.spr | This is the animated falling debris. It's a single image containing all of the animation frames stacked vertically. Dimensions vary depending on content. |
debris.spd | The parameters file for debris.spr. Adjust width, height and number of frames accordingly. 'framerate' should be 0. 'flags' should be 1. |
gradient.img | The sky gradient image. Dimensions: 8 x 916. This is the only image asset to have a separate 17-colour palette. |
grass.img | Contains the top and bottom grass and the fringe colour you see when land is destroyed. Width is 136 pixels. Height can vary so experiment but it's typically 16 pixels. |
Index.txt | A list of the custom objects to be displayed on the terrain (not the above assets), exlcuding the .img file extension. Maximum of 32 objects. See 'Custom Objects' below. |
Level.dir.txt | This is used by SpriteEditor.exe to compile the final Level.dir file. It's a simple list of all files to include. NOTE: .SPD files are not included. The utility uses the .SPD and .BMP to create the .SPR file |
NOTE: For conveniance, there's a '_UPDATE INDEX AND LEVEL.DIR FILES.bat' script in the EXAMPLE TERRAIN folder which will automatically build out the 'index.txt' and 'Level.dir.txt' files including your custom objects as you create them.
Custom Object Files
You need at least 1 object for the terrain to work.
There are 3 types of object placement in the game; floor, roof and side.
Your objects can have any name but the file name must end with '.img.bmp' (including file extension). EG, toaster.img.bmp. It's recommended to avoid spaces in the file name and if making a lot of objects it's a good idea to name based on object type, eg, 'obj-floor-toaster.img.bmp', 'obj-roof-knife.img.bmp', 'obj-side-fork.img.bmp'.
Each custom object you create must be accompanied by an .INF file. EG, the object 'obj-floor-toaster.img.bmp' would have the .INF file 'obj-floor-toaster.inf'
The INF file contains a list of numbers representing internal parameters that describe the properties of your object, EG:
5 0 0 1 1 3
In order, this is what the values represent for each line :
eg_value | Info |
---|---|
5 | Can be 1 to 10. This value affects the chance of an object being placed and is relative to the values of others objects. EG, by setting all objects to 5, you can increase or decrease the values of objects that appear too much or too little (smaller objects or objects with a narrow base will typically have more places to appear in the terrain) |
0 | Specifies whether the object is in front or behind the terrain. 0 = behind, 1 = in front |
0 | Specifies whether the soil texture appears when the object is destroyed. 0 = none, 1 = soil |
1 | Enables or disables collision for the object. 1 = enabled. 0 = disabled |
1 | Specifies whether other objects can be placed onto this one. 1 = no |
3 | Location type of object. 0/1 = side of the terrain, 2 = ceiling, 3 = floor |