LGR technical information and limitations

General discussion about the games and the scene.

Moderator: Moporators

Post Reply
sunl
Kuski
Posts: 346
Joined: 27 Jul 2013, 16:23

LGR technical information and limitations

Post by sunl »

Here you go. Lgr limitations (and file structure).

http://wiki.elmaonline.net/LGR/Technical

On a side note, I discovered that qgrass.pcx is a hidden texture that can be used as any normal texture.

Edit: https://github.com/sigvef/elma/pull/6/files
Last edited by sunl on 11 Feb 2017, 00:41, edited 1 time in total.
User avatar
Lee
37mins club
Posts: 2362
Joined: 22 Apr 2005, 05:12
Location: New Zealand

Re: LGR technical information and limitations

Post by Lee »

Thanks a lot, sunl! :D

A lot of those I was not aware of. I do have some questions though.
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.
Does this mean that there is a way (with the current Defualt.lgr) to set the ground or sky texture of a level to Qgrass.pcx?
I've seen levels like this in the past but always assumed the designer grassed the whole level with grass polygons.
The maximum number of QUP_* and QDOWN_* .pcx files is 99.
Default LGR has the following values for QUP and QDOWN images:

Code: Select all

QUP   = 0 1 5 9 14 18
QDOWN =   1 5 9 14 18
Are these numbers directly related to the angle of the slope that the grass is drawn, and what happens if you add more to the mix? For example, QUP_32.pcx???

I may have to experiment with the grass slope images. I know some mans recently are trying to create flat grass. This new information could help with achieving that.
sunl
Kuski
Posts: 346
Joined: 27 Jul 2013, 16:23

Re: LGR technical information and limitations

Post by sunl »

Lee wrote:Thanks a lot, sunl! :D

A lot of those I was not aware of. I do have some questions though.
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.
Does this mean that there is a way (with the current Defualt.lgr) to set the ground or sky texture of a level to Qgrass.pcx?
I've seen levels like this in the past but always assumed the designer grassed the whole level with grass polygons.
Yes download qgrass.lev from eol. I just made it as an example. You can set the ground or sky texture and use grass as masks (!!!). I think previous levels were grassed manually and that this was not known before. To use grass you need to hex edit texture(mask/ground/sky) to say "qgrass" instead of brick/ground/stone1 etc. Hopefully SLE will support this in the future
The maximum number of QUP_* and QDOWN_* .pcx files is 99.
Default LGR has the following values for QUP and QDOWN images:

Code: Select all

QUP   = 0 1 5 9 14 18
QDOWN =   1 5 9 14 18
Are these numbers directly related to the angle of the slope that the grass is drawn, and what happens if you add more to the mix? For example, QUP_32.pcx???

I may have to experiment with the grass slope images. I know some mans recently are trying to create flat grass. This new information could help with achieving that.
I think that the number after QUP_ is useless. You could rename one of these as QUP_HJKL.pcx and it would be the same (?maybe confirm). The number in the default.lgr maybe refers to the slope or something but elma.exe calculates it based on what I write below.

Balasz has this to say about it (http://wiki.elmaonline.net/Lgrdk)
Grass pictures

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.
Presumably for the smoothest grass you'd want 49 up grass pcxs of different angle, 49 down grasses, and 1 flat grass. That way there is most choice but tbh I don't know much more than what I just said so I'm just speculating
User avatar
Schumi
39mins club
Posts: 866
Joined: 27 Jul 2003, 06:44
Location: Ikrény, Hungary

Re: LGR technical information and limitations

Post by Schumi »

Getatlatszosag = getTransparency :)

Good Hunglish programming :D
Elasto Mania - 34:22.20 | #416 - 12. April 2021
Ancient Internals
sunl
Kuski
Posts: 346
Joined: 27 Jul 2013, 16:23

Re: LGR technical information and limitations

Post by sunl »

Schumi wrote:Getatlatszosag = getTransparency :)

Good Hunglish programming :D
Yeh I wasn't able to understand even with google translate so asked csorfab (he's a new eol player) who is hungarian for translation :D. Many errors in Hungarian. I remember checking internal errors 10 years ago, but back then there were no true hungarian online translators so couldn't understand at all.

Also I guess steeper grass is possible if you add custom grass.

Edit: The grass level I mentioned earlier: http://kopasite.net/up/0/QGRASS.lev. Also http://elmaonline.net/downloads/lev/370120
User avatar
Schumi
39mins club
Posts: 866
Joined: 27 Jul 2003, 06:44
Location: Ikrény, Hungary

Re: LGR technical information and limitations

Post by Schumi »

Yea, because the word is átlátszóság :) Ask if you have questions :)
Elasto Mania - 34:22.20 | #416 - 12. April 2021
Ancient Internals
User avatar
Lee
37mins club
Posts: 2362
Joined: 22 Apr 2005, 05:12
Location: New Zealand

Re: LGR technical information and limitations

Post by Lee »

Image

Hey that's pretty rad! Maybe Smibu can add this feature to SLE. Will it work with the QFRAME texture too, sunl?
User avatar
ville_j
Kuski
Posts: 1506
Joined: 17 Aug 2002, 15:45
Team: IS
Location: on the roof
Contact:

Re: LGR technical information and limitations

Post by ville_j »

Awesome, very helpful if I ever get around to making an lgr editor!
< roopemies> horror and frustrating and can't play, sounds just like you
Beer battle winner 2014 and 2015
User avatar
Chris
Kuski
Posts: 1111
Joined: 5 Dec 2008, 16:19
Team: Ferrari
Location: flat track

Re: LGR technical information and limitations

Post by Chris »

Now you have to make it ville_j:>

Cool stuff sunl :)
Lousku wrote:could you mayke shorter sig please :( mega annoying and also against rules :()
User avatar
ROKKEBOL
Kuski
Posts: 376
Joined: 30 Jan 2011, 08:02
Team: BAP
Location: asdf
Contact:

Re: LGR technical information and limitations

Post by ROKKEBOL »

Pls make Reefer learn this thread
Image

Image
sunl
Kuski
Posts: 346
Joined: 27 Jul 2013, 16:23

Re: LGR technical information and limitations

Post by sunl »

Lee wrote:Hey that's pretty rad! Maybe Smibu can add this feature to SLE. Will it work with the QFRAME texture too, sunl?
No the only textures are the normal textures and qgrass as a special texture. qframe is not a texture (and I just tested it and it didn't work).
sunl
Kuski
Posts: 346
Joined: 27 Jul 2013, 16:23

Re: LGR technical information and limitations

Post by sunl »

Making python library for lgr files

So far:
class is made
Convert any image into appropriate format with palette. Fixes palettes at same time.
Some palette functions

Todo:
Open/save lgr files
Error checking

When this is done you could just have png files and stuff and stick it into the lgr file (with automatic conversion)

Potential uses:
-Stick png files into lgrs for noobs (after conversion)
-Convert old lgr files into default palette
-Other secret sunl stuff ;)
User avatar
Lee
37mins club
Posts: 2362
Joined: 22 Apr 2005, 05:12
Location: New Zealand

Re: LGR technical information and limitations

Post by Lee »

Looking forward to that super secret sunl stuff.
Post Reply