Elasto Mania LGR file Development Kit Readme file.
With the DK you can produce lgr files with your own graphics.
You should simply create a directory and uncompress the contents of the lgrdk10.zip file into it.
You can distribute this DK freely as long as you don't modify it.
What file types uses the program for the levels
When you play a level, the topology of the polygons and the placement of the objects and pictures (like the trees) come from a level file (with the extension of '.lev' in the LEV subdirectory). But this file doesn't contain any graphics, like the texture of the background, the pictures of the trees, or the apples you have to gather. The graphics are stored in a separate file with the extension of '.lgr' in the LGR subdirectory. The level file contains only the name of the lgr file. In this way you can have many level files using one .lgr file, thus saving a lot of disk space because the .lgr files are usually much bigger than the level files. Actually all internal levels of the game use one lgr file, default.lgr.
If you load a level file to play or to edit it, and there is no LGR file with the name that is specified in the level file, the default.lgr file will be used instead. Probably the names of the pictures in the level and LGR file won't match, so the non-matching objects won't appear on the screen when you play and will be removed from the level file if you load it into the editor and save it.
The game works only with maximum 8 character long .lev, .rec and .lgr file names (plus extension).
Making your own LGR files
For editing the level files you can use the built-in editor. But you can not change the LGR files with the editor. If you want to add pictures to an LGR file, you have to use a command line program, make_lgr.exe. This program is not part of the game, you have to download the LGR Development Kit separately from our site (www.elastomania.com). It is available for free and the same Development Kit can be used for the shareware and registered versions also.
Since this Development Kit is not part of the game, I did not put as much effort into making it easy to use, and polishing it as I should have. I only made it available for the public so that those who want to include their own graphics into the game can do this, if they are willing to spend time understanding exactly how this program works. They should have prior knowledge about manipulating image files, using color palettes and using DOS command line tools.
I do not promise to provide technical support for the DK even if you are a registered user of the game. However if I have time, I will try to reply every technical support questions.
The make_lgr.exe program
An LGR file is basically a collection of 8 bit color, pcx image files. The make_lgr.exe program is a command line program that gathers many pcx files and builds an LGR file for use in the game. To let the make_lgr.exe file know what pcx files it should store in the LGR file, you need to list the names of the pcx files and some other information in a file called pictures.lst. You should edit the pictures.lst file in a simple text editor (Notepad for example) and save it to disk as a plain text file (doc or rtf files won't work for example). About the exact format of this file you can read later in this document.
There are pcx files that the LGR file must contain and there are pcx files that you can add freely to the LGR file. For example the LGR file must contain the pictures of the bike, the legs and hands of the biker, some pictures of objects you should eat and some more pictures. The objects that were added freely to the LGR file in the default.lgr file are the bushes, trees and other objects. In the pictures.lst file you only need to list the names of the picture files you want to add on your own.
Before you can build an LGR file with the make_lgr.exe program, you have to put all pcx files into one single directory along with the pictures.lst file. The pcx files should be 8 bit palettized format using a common global palette (the LGR DK contains tools also about converting true color images into 8 bit common palette pcx files, read the paltools.txt file for more information about this).
If the make_lgr.exe file successfully builds an LGR file, it saves it as noname.lgr in the same directory where the pcx files are stored. You have to rename it as you wish and copy it to the lgr subdirectory under the directory of the game. If you want to use it with a lev file, go into the level editor, load the lev file and choose 'Properties' in the menu. Choose 'Set LGR file' to select this new LGR file.
The example pictures and the pictures.lst file
To make things easier for you, I included in the DK all the 24 and 8 bit color image files that are necessary to build the default.lgr file that ships with the program (this file is identical in the shareware and registered versions). The pictures.lst file is also included and all you have to do is running the make_lgr.exe file to build a valid LGR file.
If you want to add your own picture to the LGR file, convert it to an 8 bit pcx file using the palette of the original pcx files and add its name to the pictures.lst file. I included the true color images too in order that if you add new pictures that don't look good with the original palette, you should be able to generate a new palette and convert the original true color pictures also to this new palette. There are no 24 bit versions of the mask pictures (their palette doesn't matter), so you should not delete these pcx files before a conversion from tga to pcx (you don't need to delete any of the pcx files, because the new ones will overwrite the old ones).
The pictures.lst file
In the pictures.lst file every line contains description about one pcx file. First comes the name without an extension. Then comes the type of the picture that can be, PICT, TEXT or MASK. If the type is PICT, the image will be a simple picture with the top-left pixel signing the transparent color. If the type is TEXT, it is a texture and if the type is MASK, it is a mask (masks and textures can only be used together). If the type is not MASK you also have to give a default distance and clipping property. The distance must be in the 1..999 range, while the clipping property must be either 'U', 'S', or 'G'. If a picture has less distance than an other, it will hide the other picture. The motorbiker and the food-exit-killer objects have a distance of 500. The clipping property determines whether a picture is seen above the sky, the ground, or both (this is independent of the distances). So the U (Unclipped) means that the picture or texture will be seen above the whole picture (unless other pictures hide it). S (Sky) means the picture will be seen only above the Sky. G (Ground) means the picture will be seen only above the ground.
Those pictures that are required for the LGR file (pictures of the bike for example) must not be listed in the pictures.lst file. The pcx file names that are required and should not be listed (except for the food animations and grass pictures, about these you can read later) in the pictures.lst file are beginning with the letter 'Q' In this way you can find these files easily in an alphabetical list. You need to have all of these pcx files to be able to build an LGR file.
The food, killer and exit objects are animations. In the LGR file they are represented by single pictures that contain all the frames of one animation. The QEXIT.PCX file is for example 50 pieces of 40 pixel by 40 pixel frames put together horizontally making one 2000 pixel by 40 pixel image. It is up to you how many frames you put into an animation picture, but it must be 40 pixel tall and 40*N pixel wide. If you set the 'Animated Objects' off in the options menu, the first frame will be visible all the time instead of the animation.
There is one animation for the exit object and one for the killer objects in one lgr file (QEXIT.PCX and QKILLER.PCX). But there may be multiple food animations. At least one food animation you have to add to the lgr file, so you must add the QFOOD1.PCX picture, but optionally you can add a QFOOD2.PCX, ..., QFOOD9.PCX picture also into your LGR file if you want. The game will stop loading the sequence of these pictures if one is missing (so if you have QFOOD 1,2,3,4 and 6, only the first 4 will be loaded). If you set the 'Food anim number' property of a food object (by right clicking on it in the level editor) to 5 for example, the game will try to play the animation from the QFOOD5.PCX picture for this object. If this picture is not loaded, it will be substituted. You need to list the names of these food objects in pictures.lst (but not the exit and killer objects).
When the program displays grass on a level, it builds it up from a texture that is stored in QGRASS.PCX, and from little grass pictures that makes the lower border of the grass. The names of these little border pictures are in the form of QUP_*.PCX and QDOWN_*.PCX. That means QUP_AA.PCX for example will be a grass picture automatically, but you need to list it in the pictures.lst file along with the QGRASS.PCX picture (it doesn't matter what properties you give to these pictures). If the picture is an 'UP' picture, the grass should be higher on the right side of the picture than on the left (the opposite for the 'DOWN'). The horizontal size of these pictures are arbitrary. But the vertical size determines how much the grass on this picture goes down or up between the left and right sides. The program doesn't analyse a picture, but supposes that the grass level difference between the left and right side is VERTICAL_SIZE - 41 (so the height should be minimum 41 pixels, in which case it is supposed to be horizontal grass). For example if picture QDOWN_AB.PCX has a vertical size of 50 pixels, the program will suppose that the level of the grass on the left side is at vertical pixel position 20 (if I assign the pixels from 0 to 49 from up to down) and 29 (49-20) on the right side. To understand how this works you should examine the grass pictures in the example pictures.
If you do not list the QGRASS.PCX picture and at least two QUP_*.PCX or QDOWN_*.PCX pictures in the pictures.lst file, there will be no grass on the levels you play with this lgr file.
Default Sky and ground textures
If there is a SKY.PCX texture in an lgr file, it will be the default Sky. Similarly if there is a GROUND.PCX texture in an lgr file, it will be the default ground.
The LGRLIST.TXT file
If you create an lgr file that contains pictures with the same names that are the names of the pictures in the original default.lgr file, you can replace the original default.lgr file with your own file. This way when you play on the internal levels, the biker, the trees, the bushes and every picture will be replaced by your objects.
If you do not want to replace the original default lgr file for all levels, you can do it, just create an lgrlist.txt file: Let's say you make your own file, called myfile.lgr, and you copy it to the lgr subdirectory. You create a file also in the lgr subdirectory, called lgrlist.txt, which has the following lines: 5 myfile.lgr 6 myfile.lgr 8 myfile.lgr
In this case if you play on internal level 5, 6 and 8, your lgr file will be loaded.
Elasto Mania LGR file Development Kit is Copyright (C) 2000 Balazs Rozsa. All rights reserved.
This Development Kit is supplied as-is. The author disclaims all warranties, expressed or implied, including, without limitation, the warranties of merchantability and of fitness for any purpose. The author assumes no liability for damages, direct or consequential, which may result from the use of this Development Kit.
You may not sell, modify, decompile, disassemble, otherwise reverse engineer, or transfer any part of this Development Kit.