The mklevel tool builds a complete (but very generic) level from a standard set of terrain tiles. The tiles are required to be in the models/autotiles directory and they must be named in the exact way that the mktiles tool does it.
The input to the tool is (currently) two image files - provided on the command line:
cd /u/lol /u/games/make_level/src/mklevel images/heights.png images/features.png
The Heights Image
The 'heights' image and the 'features' image must be the exact same resolution - one pixel in the map represents the height or feature content of one corner of a terrain tile (actually, the corner shared between four tiles - unless we are at the edge of the map). So if the image is (say) 100x100 pixels then the resulting terrain map will only be 99x99 terrain tiles. Since each tile is 20m across, that produces almost 2km x 2km of terrain. Fortunately, the terrain representation (both on disk and inside the game) is quite efficient - so there is little penalty in generating very large areas of terrain - other than that your players may get lost inside it!
The 'heights' image should be monochrome. The mapping should be such that bright pixels are high and dark pixels are low and every 16 grey levels equals one terrain "height step" (which is currently set to 2.5m in the mktile tool). Since the terrain tile corner heights are limited to 0, 2.5, 5 and 7.5m, the steepest the terrain can slope is 7.5m across each pixel - so the images you create need to be somewhat fuzzy. If you paint a height map that is beyond the limits of what the system can build, it will do it's best to stay as close to what you ask as possible - but it doesn't guarantee to do exactly what you ask. If (for example) you put a black pixel next to a white pixel, that would demand 16 height steps over a difference of one terrain tile - since that's impossible, you'll find that the generated terrain will start sloping up about four pixels away from where you asked it to change heights.
The Features Image
The 'features' image should be a colour image. It should contain predominantly black pixels (meaning generic terrain). Currently, the only thing you can store here is information about water. Pixels painted in maximum blue (0,0,255) will be made from river tiles. However, since we have no automatically generated waterfall tiles, mklevel assumes that all water must be at zero height - even if the 'heights' map says otherwise. This means that the heights data for pixels adjacent to the blue pixels should never be more than 3 height steps above zero. You can paint them higher than that - but the terrain will be squashed downwards until there is enough slope to reach water level where the rivers are. In other words, water takes precedence over height if there is any argument between the two!
Remember that one pixel represents the corner between four terrain tiles - so a single blue dot on the 'features' map would produce four terrain tiles - each with water in one corner. A straight line of blue pixels produces a narrow 20m channel that straddles two tiles in width. Consequently, if you were to make a 'diagonal' connection between two blue pixels, you'd get a tile with water in two corners and land in the other two. With our current tile generator, there will be a very narrow waterway between the two blue pixels - so diagonal connections imply water flowing between the two blue dots. However, this will be VERY narrow in some versions of the tile - so you maybe want to avoid doing that. For a waterway wide enough to take the seaplane down it, you'll need at least a two pixel wide river painted into the 'features' map.
Other feature types will eventually be supported by different coloured pixels in the feature map.
|Wikiid Pages relating to gameTools (edit)|
|gameTools - Main page|
|gameTools - Support Tools :|
|gameTools - File Formats :|
| gameTools - Source Code :
|Wikiid Pages relating to Lemur of Lima (edit)|
|Lemur of Lima - Main page|
|Lemur of Lima - Controls|
|Lemur of Lima - Levels :|
|Lemur of Lima - Java Plugins :|
|Lemur of Lima - Source Code Documentation :|