Difference between revisions of "LGR/Technical"

From Elma Wiki
Jump to navigation Jump to search
Line 120: Line 120:
 
* The raw contents of each .pcx file must be between 1-10,000,000 bytes in length
 
* The raw contents of each .pcx file must be between 1-10,000,000 bytes in length
 
* The maximum filename length is 8 characters, excluding ".pcx"
 
* The maximum filename length is 8 characters, excluding ".pcx"
 +
* The filename must end in ".pcx" (or ".spr")
  
 
=== Pictures ===
 
=== Pictures ===

Revision as of 23:49, 7 February 2017

Technical information for Elasto Mania LGR files. Some additional info at Lgrdk.

.LGR File Format

Offset Type Bytes Description
0 char[5] 5 "LGR12" for LGR files. (12 refers to the version of LGR file)
5 int 4 Number of .pcx files contained at the end of the LGR file (x)
9 byte[4] 4 Pictures.lst: identification header: [0xEA, 0x03, 0x00, 0x00] (required to be a valid file)
13 int 4 Pictures.lst: Number of elements in .lst file (l)
17 char[10]*l 10*l Pictures.lst: List of image names, null terminated (e.g. "barrel"+[0,0,0,0]). The maximum name length is 8.
17+10*l int*l 4*l Pictures.lst: Image type (100=picture, 101=texture, 102=mask)
17+14*l int*l 4*l Pictures.lst: Default distance (1-999). (Masks have a distance of 0. QUP_/QDOWN_/qfood have distances of 400 - apparently unused?)
17+18*l int*l 4*l Pictures.lst: Default clipping (0=Unclipped, 1=Ground, 2=Sky)
17+22*l int*l 4*l Pictures.lst: Location of transparent pixel (11=no transperancy, 12=topleft, 13=topright, 14=bottomleft, 15=bottomright)
17+26*l Object ? List of x pcx objects of variable length (see Pcx Object below)
? byte[4] 4 End of file marker: [0xE7, 0x05, 0x2E, 0x0B]

Pcx Object

Offset Type Bytes Description
0 char[12] 12 Filename including .pcx, null terminated (e.g. "barrel.pcx"+[0,0] or "plantain.pcx")
12 byte[8] 8 [0x00, 0x95, 0x4C, 0x00, 0x98, 0x95, 0x4C, 0x00]. Only the first byte is important as 0x00 signifies the end of the filename from the previous row. The other bytes are unused.
20 int 4 Length of the .pcx file in bytes (z)
z byte[z] z Raw contents of original .pcx file

Pictures.lst contents

The format of pictures.lst is described above.

Items excluded from Pictures.lst

All files should be present both as an entry in pictures.lst and as a Pcx Object, except the following, which should only present as Pcx Objects as elastomania handles these files specially:

  • q1body.pcx
  • q1thigh.pcx
  • q1leg.pcx
  • q1bike.pcx
  • q1wheel.pcx
  • q1susp1.pcx
  • q1susp2.pcx
  • q1forarm.pcx
  • q1up_arm.pcx
  • q1head.pcx
  • q2body.pcx
  • q2thigh.pcx
  • q2leg.pcx
  • q2bike.pcx
  • q2wheel.pcx
  • q2susp1.pcx
  • q2susp2.pcx
  • q2forarm.pcx
  • q2up_arm.pcx
  • q2head.pcx
  • q2flag.pcx
  • qkiller.pcx
  • qexit.pcx
  • qframe.pcx
  • qcolors.pcx
  • qgrass.pcx

Special filenames included in Pictures.lst

These items are handled specially in elastomania, but must be included in Pictures.lst

  • qup_*.pcx, where * is any text
  • qdown_*.pcx, where * is any text
  • qfoodX.pcx, where X is 1-9

Palette

Palette must be limited to 256 colors. The palette is taken from q1bike.pcx

Mandatory Pcx files for valid .LGR

  • q1body.pcx
  • q1thigh.pcx
  • q1leg.pcx
  • q1bike.pcx
  • q1wheel.pcx
  • q1susp1.pcx
  • q1susp2.pcx
  • q1forarm.pcx
  • q1up_arm.pcx
  • q1head.pcx
  • q2body.pcx
  • q2thigh.pcx
  • q2leg.pcx
  • q2bike.pcx
  • q2wheel.pcx
  • q2susp1.pcx
  • q2susp2.pcx
  • q2forarm.pcx
  • q2up_arm.pcx
  • q2head.pcx
  • q2flag.pcx
  • qkiller.pcx
  • qexit.pcx
  • qframe.pcx
  • qcolors.pcx
  • qfood1.pcx

LGR limits

These are the hard-coded limits to LGR files:

Pcx Files

  • There must be 10-3500 Pcx Objects
  • The raw contents of each .pcx file must be between 1-10,000,000 bytes in length
  • The maximum filename length is 8 characters, excluding ".pcx"
  • The filename must end in ".pcx" (or ".spr")

Pictures

  • The maximum number of pictures is 999
  • The maximum picture width is 6000 (does not apply to masks/textures)
  • The maximum picture size (width*height) is 600,000 (e.g. 775*775 is too large) (does not apply to masks/textures)
  • There may be no duplicate picture names

Textures

  • The must be 2-99 textures.
  • qgrass.pcx counts as a texture
  • There may be no duplicate texture names

Masks

  • The maximum number of masks is 199
  • There exists a "mask is too complicated" error, but I'm unable to figure out how to trigger it, so it can probably be ignored
  • There may be no duplicate mask names

Grass

  • The maximum number of QUP_* and QDOWN_* .pcx files is 99.

Bike/kuski .pcx files

The following .pcx files are limited to a width of 255 and a height of 255:

  • q1body.pcx
  • q1thigh.pcx
  • q1leg.pcx
  • q1wheel.pcx
  • q1susp1.pcx
  • q1susp2.pcx
  • q1forarm.pcx
  • q1up_arm.pcx
  • q1head.pcx
  • q2body.pcx
  • q2thigh.pcx
  • q2leg.pcx
  • q2wheel.pcx
  • q2susp1.pcx
  • q2susp2.pcx
  • q2forarm.pcx
  • q2up_arm.pcx
  • q2head.pcx
  • qflag.pcx

Q1bike.pcx and q2bike.pcx are handled specially: Big_Book_of_Elma_Facts#LGR_tricks.2C_Part_1

Object .pcx files

This pertains to qkiller.pcx, qexit.pcx and qfood*.pcx:

  • The width of any object file must be a multiple of 40, as each 40 pixels are used as 1 frame of animation
  • The maximum number of frames is 1000 (however, I think the .pcx file format breaks down before reaching a width of 40,000)
  • If the height of the .pcx file is greater than 40, all the rows past the 40th are ignored and not drawn

QGRASS.pcx

Qgrass.pcx is added as a hidden texture. It can be used just like any other texture - with masks, or as a ground/sky background image.

getatlatszosag Internal Error

If you have an empty "message.inf" file in your main Elma directory, if you try to open an lgr and get the error message: "getatlatszosag", then the error is caused from a glitch in EasyLGR.exe. When importing images, sometimes the "Background pixel:" option in newly-added images is not set to anything. To fix the bug, make sure all new images have a background pixel option set, even if it is "None"