Help needed -compression, xrel, yrel
Moderator: Graphics Moderators
- chrisgrant
- Engineer
- Posts: 6
- Joined: 15 Oct 2004 16:43
- Location: Perth, WA
Help needed -compression, xrel, yrel
Can anyone please explain what the compression, xrel, yrel properties
of a regular (non-pseudo) sprite mean?
I've checked through the Graphics forum and I've read through WIKI
but still have no idea. Other than that I'm getting the hang of NFO files
and everthing seems to work, but when my sprites appear in the game
weird and wonderful things happen!
Any help would be much appreciated.
of a regular (non-pseudo) sprite mean?
I've checked through the Graphics forum and I've read through WIKI
but still have no idea. Other than that I'm getting the hang of NFO files
and everthing seems to work, but when my sprites appear in the game
weird and wonderful things happen!
Any help would be much appreciated.
x/yrel define how far right and down[0] to move the sprite before drawing it. Another way of putting this is that x/yrel define the "center" of the sprite--the point the sprite rotates around. This may or may not actually be at the center of the sprite rectangle.
compression is poorly understood; check about two thirds of the way down the Action 1 page for what we do know about its meaning. Set it to one of 01, 03, 09, or 0B. I almost always use 01.
[0] Hence the negative numbers, usually you want to move the sprites left and up instead.
compression is poorly understood; check about two thirds of the way down the Action 1 page for what we do know about its meaning. Set it to one of 01, 03, 09, or 0B. I almost always use 01.
[0] Hence the negative numbers, usually you want to move the sprites left and up instead.
To get a good answer, ask a Smart Question. Similarly, if you want a bug fixed, write a Useful Bug Report. No TTDPatch crashlog? Then follow directions.
Projects: NFORenum (download) | PlaneSet (Website) | grfcodec (download) | grfdebug.log parser
Projects: NFORenum (download) | PlaneSet (Website) | grfcodec (download) | grfdebug.log parser
See also:
Format of a GRF file
EDIT: Thing is quite easy: for vehicle sprites in views '_' '|' compression is 01 and for views '\' '/' it is 09. yrel and xrel is ysize/-2 and xsize/-2, as WhiteHand wrote, but mostly you must figure out by trying which position is good (look good in game).
and pic by eis_os:
(edit by eis_os)
Look here: http://www.tt-forums.net/viewtopic.php?t=8083 It would be nice if people would look before reattaching the same thing several times, thanks...
Sorry for that...
Format of a GRF file
EDIT: Thing is quite easy: for vehicle sprites in views '_' '|' compression is 01 and for views '\' '/' it is 09. yrel and xrel is ysize/-2 and xsize/-2, as WhiteHand wrote, but mostly you must figure out by trying which position is good (look good in game).
and pic by eis_os:
(edit by eis_os)
Look here: http://www.tt-forums.net/viewtopic.php?t=8083 It would be nice if people would look before reattaching the same thing several times, thanks...
Sorry for that...

Last edited by Siema on 04 Apr 2005 10:27, edited 2 times in total.
as a guideline for compression, I use the same compression as used in the original ttd files for a comparable sprite.
that way you don't have to know how it works
that way you don't have to know how it works

Creator of the Openttd Challenge Spinoff, Town Demand patch
After action reports: The path to riches, A dream of skyscrapers
After action reports: The path to riches, A dream of skyscrapers
Useing undefined compression code can result in breakage of TTD, so use only the ones TTD (trg1) use for the sprite type you are creating
TTDPatch dev in retirement ... Search a grf, try Grf Crawler 0.9 - now with even faster details view and new features...


- chrisgrant
- Engineer
- Posts: 6
- Joined: 15 Oct 2004 16:43
- Location: Perth, WA
Who is online
Users browsing this forum: No registered users and 9 guests