Grf codec problems

Discuss, get help with, or post new graphics for TTDPatch and OpenTTD, using the NewGRF system, here. Graphics for plain TTD also acceptable here.

Moderator: Graphics Moderators

Post Reply
User avatar
WWTBAM
Moderator
Moderator
Posts: 3689
Joined: 02 Apr 2005 07:01
Location: Sydney NSW Antipodea
Contact:

Grf codec problems

Post by WWTBAM »

When grf codec asks for target grf and sprites source parth what do i put.
Formerly known as r0b0t_b0y2003, robotboy, roboboy and beclawat. The best place to get the most recent nightly builds of TTDPatch is: http://roboboy.users.tt-forums.net/TTDPatch/nightlies/
User avatar
Jezulkim
Chairman
Chairman
Posts: 844
Joined: 04 Jan 2004 09:40
Location: Finland/Suomi

Post by Jezulkim »

For target grf write the name of the grf file you want to encode.
And for the sprite source path write the name of the folder where you have the sprites, usually the folder is "sprites".
Image
In order to protect the visitors of this site,
TTO Full Conversion!
This post has been lol 1337 times.
PvvS
Engineer
Engineer
Posts: 3
Joined: 01 Jan 2006 13:46
Contact:

Post by PvvS »

My problem:
Decode its first grf , and like result me will originate defective graphic art . I was trying uz perhaps everything
Attachments
vv60lf.jpg
vv60lf.jpg (3.35 KiB) Viewed 3303 times
User avatar
Wile E. Coyote
Tycoon
Tycoon
Posts: 8515
Joined: 08 Jul 2004 22:14
Skype: wile.e.coyote2
Location: Belgrade, Serbia
Contact:

Post by Wile E. Coyote »

It happens when PCX from which you encode GRF is small AFAIK (but I don't know why). I know only this sollution:
you must have PCX image which you drew and which is not corrupted. Copy sprites from it to this "corrupted" PCX, and then encode GRF. Sprites will be OK.
Serbian rail set with Serbian scenario (ECS, PBI, FIRS and Tourist set compatible) Website | Topic and download | Latest version: 03.06.2015.
Serbian tram set Tracking table | TTD Patch tram set Latest version: 17.06.2015. | Open TTD Remix Latest version: 11.07.2015.
WIN-DOS GRF Converter Topic and download | Version 0.2.1: 09.01.2005.


Runner-up in "Best avatar Forums award" for years 2006 and 2010!
User avatar
Lakie
TTDPatch Developer
TTDPatch Developer
Posts: 1799
Joined: 26 May 2004 16:37
Location: Britain
Contact:

Post by Lakie »

Chances are your Orginal pcx file isn't 800 pixils in width.
I'm not sure what multiple it has to be of, but if it isn't of that multiple then you get that type of distorion.
I tend to avoid making pcx files which are not 800 pixils wide for that reason.

~ Lakie
TTDpatch Developer 2005 - 2010 ~ It all started because of shortened vehicle not loading correctly, now look where I've gone with it!
Grfs coded ~ Finnish Train Set (Teaser) | Bm73 (Release 3) | Emu 680 (Release 3)| Glass Station (Release 1) | UK Roadset (Version 1.1a) | New Water Coasts (Version 7)
Pikka: "Lakie's a good coder, but before he'll add any feature to TTDP you have to convince him that you're not going to use it to destroy the world as we know it."
Flamelord
Chief Executive
Chief Executive
Posts: 731
Joined: 24 Mar 2005 22:29
Location: Oregon

Post by Flamelord »

Strange, because I have made a quicky GRF with a PCX file that only included two paper wagons. It was much less than 800 pixels wide.
DaleStan
TTDPatch Developer
TTDPatch Developer
Posts: 10285
Joined: 18 Feb 2004 03:06
Contact:

Post by DaleStan »

I can state definitively that the GIMP (at least, 2.2.10) does not experience this problem. I just saved a PCX with widths of 275, 271, 269, 263, and 257, and had no problems with any of the encodes. Note that, with the exception of the first one (275), all are prime numbers. I believe that this proves either:
(1) The width must be a multiple of at least one of 275, 271, 269, 263, 257, (and possibly some other numbers)
--OR-- (and far more likely, IMO)
(2) The width must be a multiple of one.

If anyone who uses other graphics programs could do a similar procedure, and post all PCX/NFO pairs that do not work, that will probably cause grfcodec to get fixed faster. The first one for the list of misbehaving PCXen is Flamelord's, here.
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
PvvS
Engineer
Engineer
Posts: 3
Joined: 01 Jan 2006 13:46
Contact:

Post by PvvS »

My original NFO and PCX files
Attachments
vv60lf_t_forums.zip
(1.87 KiB) Downloaded 159 times
User avatar
Lakie
TTDPatch Developer
TTDPatch Developer
Posts: 1799
Joined: 26 May 2004 16:37
Location: Britain
Contact:

Post by Lakie »

I can't get it to compile right, but if I change the width of the pcx file to 280, it compiles fine.
Maybe it's just my computer?

~ Lakie
TTDpatch Developer 2005 - 2010 ~ It all started because of shortened vehicle not loading correctly, now look where I've gone with it!
Grfs coded ~ Finnish Train Set (Teaser) | Bm73 (Release 3) | Emu 680 (Release 3)| Glass Station (Release 1) | UK Roadset (Version 1.1a) | New Water Coasts (Version 7)
Pikka: "Lakie's a good coder, but before he'll add any feature to TTDP you have to convince him that you're not going to use it to destroy the world as we know it."
DaleStan
TTDPatch Developer
TTDPatch Developer
Posts: 10285
Joined: 18 Feb 2004 03:06
Contact:

Post by DaleStan »

Lakie wrote:I can't get it to compile right, but if I change the width of the pcx file to 280, it compiles fine.
And again, opening it in GIMP and saving it (no changes) causes it encode and decode just fine.

From the other thread:
George wrote:The problem is not in PCX, but in grfcodec and this is the way to fix it (I do not know why, but it is)
You seem to be quite fond of these random fixes that just happen to work. I'd much rather make my PCX one pixel narrower/wider (see below) than struggle to figure out which compression byte needs to change to 03.
michael blunck wrote:Apparently, grfcodec has problems with .pcx files with an uneven picture width which have been converted from .bmp files with that odd width.

This is a known bug which has been in existence since the first version of grfcodec.
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
User avatar
Lakie
TTDPatch Developer
TTDPatch Developer
Posts: 1799
Joined: 26 May 2004 16:37
Location: Britain
Contact:

Post by Lakie »

Heh, how strange, must be the way my software causes such an issue for me then. :x
Oh, and I've known about grfcodec being less than perfect for quite a while. :)

~ Lakie
TTDpatch Developer 2005 - 2010 ~ It all started because of shortened vehicle not loading correctly, now look where I've gone with it!
Grfs coded ~ Finnish Train Set (Teaser) | Bm73 (Release 3) | Emu 680 (Release 3)| Glass Station (Release 1) | UK Roadset (Version 1.1a) | New Water Coasts (Version 7)
Pikka: "Lakie's a good coder, but before he'll add any feature to TTDP you have to convince him that you're not going to use it to destroy the world as we know it."
PvvS
Engineer
Engineer
Posts: 3
Joined: 01 Jan 2006 13:46
Contact:

Post by PvvS »

Use to generation graphic designer Paint Shop Pro. Somewhere on forum we're him also saw advise .
Post Reply

Return to “Graphics Development”

Who is online

Users browsing this forum: No registered users and 35 guests